(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/Buy_soap_tape/address-manage"],{144:function(e,n,t){"use strict";(function(e){t(5);r(t(4));var n=r(t(145));function r(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=t,e(n.default)}).call(this,t(1)["createPage"])},145:function(e,n,t){"use strict";t.r(n);var r=t(146),a=t(148);for(var s in a)"default"!==s&&function(e){t.d(n,e,(function(){return a[e]}))}(s);t(150);var i,c=t(11),o=Object(c["default"])(a["default"],r["render"],r["staticRenderFns"],!1,null,null,null,!1,r["components"],i);o.options.__file="pages/Buy_soap_tape/address-manage.vue",n["default"]=o.exports},146:function(e,n,t){"use strict";t.r(n);var r=t(147);t.d(n,"render",(function(){return r["render"]})),t.d(n,"staticRenderFns",(function(){return r["staticRenderFns"]})),t.d(n,"recyclableRender",(function(){return r["recyclableRender"]})),t.d(n,"components",(function(){return r["components"]}))},147:function(e,n,t){"use strict";var r;t.r(n),t.d(n,"render",(function(){return a})),t.d(n,"staticRenderFns",(function(){return i})),t.d(n,"recyclableRender",(function(){return s})),t.d(n,"components",(function(){return r}));var a=function(){var e=this,n=e.$createElement,t=(e._self._c,e.list.length?e.__map(e.list,(function(n,t){var r=e.__get_orig(n),a=n.con_name.slice(0,4),s=n.nickname?n.nickname.slice(0,6):null,i=e._f("getAddressString")(n),c=n.level?e._f("userLevel")(n.level):null;return{$orig:r,g0:a,g1:s,f0:i,f1:c}})):null);e._isMounted||(e.e0=function(n){e.search_name="",e.toSearchAddress()},e.e1=function(n,t){var r=arguments[arguments.length-1].currentTarget.dataset,a=r.eventParams||r["event-params"];t=a.index;e.address_index=t}),e.$mp.data=Object.assign({},{$root:{l0:t}})},s=!1,i=[];a._withStripped=!0},148:function(e,n,t){"use strict";t.r(n);var r=t(149),a=t.n(r);for(var s in r)"default"!==s&&function(e){t.d(n,e,(function(){return r[e]}))}(s);n["default"]=a.a},149:function(e,n,t){"use strict";(function(e){Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=t(139),a={data:function(){return{title:"地址管理",address_index:-1,search_name:""}},filters:{getAddressString:function(e){return e?"".concat(e.provice,"-").concat(e.city,"-").concat(e.area,"-").concat(e.address):""},userLevel:function(e){if(!e)return"";var n="";switch(+e){case 1:n="销售员";break;case 2:n="经销商";break;case 3:n="批发商";break;default:n=""}return n}},computed:{list:function(){return this.$store.state.list}},onShow:function(){var n=this;setTimeout((function(){e.showLoading({mask:!0}),(0,r._API_AddressGet)().then((function(e){n.$store.commit("GET_ADDRESS",e.data.list)}))}),333)},onLoad:function(e){e.choose&&(this.title="选择地址")},created:function(){e.$on("ADDRESS",(function(n){e.toast(n)}))},methods:{toSearchAddress:function(){var e=this;this.address_index=-1,(0,r._API_AddressSearch)({search_name:this.search_name}).then((function(n){if(200===n.code){var t=n.data.list.map((function(e){return{con_name:e.username,con_mobile:e.mobile,provice:e.province,city:e.city,area:e.town,address:e.address,level:+e.level,id:e.id,nickname:e.nickname}}));console.log(111,t),e.$store.commit("GET_ADDRESS",t)}}))},editAddress:function(n){e.navigateTo({url:"./address?index=".concat(String(n))})},delAddress:function(n){var t=this;e.showModal({title:"提示",content:"确定要删除这个地址？",success:function(e){e.confirm&&(0,r._API_AddressDel)({id:t.list[n].id}).then((function(e){t.$store.commit("DEL",n)}))}})},chooseAddress:function(){this.address_index>-1?(this.$store.commit("CHOOSEADDRESS",this.address_index),e.navigateBack()):e.showModal({content:"你还没有选择地址",showCancel:!1})}}};n.default=a}).call(this,t(1)["default"])},150:function(e,n,t){"use strict";t.r(n);var r=t(151),a=t.n(r);for(var s in r)"default"!==s&&function(e){t.d(n,e,(function(){return r[e]}))}(s);n["default"]=a.a},151:function(e,n,t){}},[[144,"common/runtime","common/vendor"]]]);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/Buy_soap_tape/address-manage.js.map