(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesMall/address/index"],{"0879":function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var o=function(){var t=this.$createElement,e=(this._self._c,this.loadEnd?this.addressList.length:null);this.$mp.data=Object.assign({},{$root:{g0:e}})},i=[]},"3f0a":function(t,e,n){"use strict";(function(t){var o=n("47a9");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=o(n("7ca3")),r=n("8f59"),a=o(n("f5e9"));function s(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}var c={data:function(){return{loadEnd:!1,addressList:[]}},computed:function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){(0,i.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({},(0,r.mapState)({themeColor:function(t){return t.app.themeColor},iconEdit:function(t){return a.default.svgToUrl("edit",t.app.themeColor)}})),onLoad:function(){var e=this;t.showLoading({title:"加载中"}),this.getAddress((function(){t.hideLoading(),e.loadEnd=!0}))},onShow:function(){this.loadEnd&&this.getAddress()},onPullDownRefresh:function(){this.getAddress((function(){t.stopPullDownRefresh()}))},methods:{getAddress:function(e){var n=this;this.$util.request("mall.address.list").then((function(o){e&&e(),1==o.code?(n.addressList=o.data,n.$forceUpdate()):t.showToast({title:o.msg,icon:"none"})})).catch((function(t){e&&e(),console.error("获取地址列表 ",t)}))},handleSwitch:function(e){var n=this;this.$util.request("mall.address.setDefault",{id:e}).then((function(e){1==e.code?n.getAddress((function(){t.hideLoading()})):t.showToast({title:e.msg,icon:"none"})})).catch((function(t){console.error("切换默认地址 ",t)}))},handleAdd:function(){this.$util.toPage({mode:1,path:"/pagesMall/address/add"})},handleEdit:function(t){this.$util.toPage({mode:1,path:"/pagesMall/address/add?addressData="+JSON.stringify(t)})},handleDelete:function(e){var n=this;t.showModal({title:"系统提示",content:"是否删除该地址？",confirmColor:"#E50002",confirmText:"删除",success:function(o){o.confirm&&(t.showLoading({mask:!0,title:"加载中"}),n.$util.request("mall.address.delete",{id:e}).then((function(e){1==e.code?n.getAddress((function(){t.hideLoading(),t.showToast({icon:"success",title:"删除成功"})})):(t.hideLoading(),t.showToast({title:e.msg,icon:"none"}))})).catch((function(e){t.hideLoading(),console.error("删除地址 ",e)})))}})}}};e.default=c}).call(this,n("df3c")["default"])},5460:function(t,e,n){"use strict";n.r(e);var o=n("0879"),i=n("9f5e");for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);n("9f0b");var a=n("828b"),s=Object(a["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);e["default"]=s.exports},"6aec":function(t,e,n){},"8e52":function(t,e,n){"use strict";(function(t,e){var o=n("47a9");n("aa6c");o(n("3240"));var i=o(n("5460"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n("3223")["default"],n("df3c")["createPage"])},"9f0b":function(t,e,n){"use strict";var o=n("6aec"),i=n.n(o);i.a},"9f5e":function(t,e,n){"use strict";n.r(e);var o=n("3f0a"),i=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(r);e["default"]=i.a}},[["8e52","common/runtime","common/vendor"]]]);