(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/address/user_address_list/index"],{"1a5d":function(t,e,i){"use strict";var s=i("2c9e"),n=i.n(s);n.a},"1f19":function(t,e,i){"use strict";i.r(e);var s=i("cf70"),n=i("251d");for(var d in n)["default"].indexOf(d)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(d);i("1a5d");var o=i("828b"),r=Object(o["a"])(n["default"],s["b"],s["c"],!1,null,"6e83f612",null,!1,s["a"],void 0);e["default"]=r.exports},"251d":function(t,e,i){"use strict";i.r(e);var s=i("36c7"),n=i.n(s);for(var d in s)["default"].indexOf(d)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(d);e["default"]=n.a},"2c9e":function(t,e,i){},"36c7":function(t,e,i){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=i("51a2"),n=i("cef1"),d=i("8f59"),o=getApp(),r={components:{emptyPage:function(){i.e("components/emptyPage").then(function(){return resolve(i("a342"))}.bind(null,i)).catch(i.oe)},atModel:function(){Promise.all([i.e("common/vendor"),i.e("components/accredit/index")]).then(function(){return resolve(i("b780"))}.bind(null,i)).catch(i.oe)}},data:function(){return{urlDomain:this.$Cache.get("imgHost"),addressList:[],cartId:"",pinkId:0,couponId:0,loading:!1,loadend:!1,loadTitle:"加载更多",page:1,limit:20,bargain:!1,combination:!1,secKill:!1,theme:o.globalData.theme,locationContent:"授权位置信息，提供完整服务",locationStatus:!1,productId:0}},computed:(0,d.mapGetters)(["isLogin"]),watch:{isLogin:{handler:function(t,e){t&&this.getUserAddress(!0)},deep:!0}},onLoad:function(t){this.isLogin?(this.orderNo=t.orderNo||0,this.productId=Number(t.id)||0,this.getAddressList(!0)):(0,n.toLogin)()},onShow:function(){this.getAddressList(!0)},methods:{modelCancel:function(){this.locationStatus=!1},confirmModel:function(){t.getLocation({type:"gcj02",altitude:!0,geocode:!0,success:function(e){try{t.setStorageSync("user_latitude",e.latitude),t.setStorageSync("user_longitude",e.longitude)}catch(i){}}}),this.locationStatus=!1},getAddressList:function(t){var e=this;e.loading||(e.loading=!0,(0,s.getAddressList)().then((function(t){e.addressList=t.data,e.loading=!1})).catch((function(t){e.loading=!1})))},radioChange:function(t){var e=parseInt(t.detail.value),i=this,n=this.addressList[e];if(void 0==n)return i.$util.Tips({title:"您设置的默认地址不存在!"});(0,s.setAddressDefault)(n.id).then((function(t){for(var s=0,n=i.addressList.length;s<n;s++)i.addressList[s].isDefault=s==e;i.$util.Tips({title:"设置成功",icon:"success"},(function(){i.$set(i,"addressList",i.addressList)}))})).catch((function(t){return i.$util.Tips({title:t})}))},editAddress:function(e){t.navigateTo({url:"/pages/address/user_address/index?id=".concat(e,"&orderNo=").concat(this.orderNo)})},delAddress:function(e){var i=this,n=this.addressList[e];if(void 0==n)return i.$util.Tips({title:"您删除的地址不存在!"});t.showModal({content:"确定删除该地址",cancelText:"取消",confirmText:"确定",showCancel:!0,cancelColor:"#f55850",success:function(t){t.confirm&&(0,s.delAddress)(n.id).then((function(t){i.addressList.splice(e,1),i.$set(i,"addressList",i.addressList),i.$util.Tips({title:"删除成功",icon:"success"})})).catch((function(t){return i.$util.Tips({title:t})}))}})},addAddress:function(){t.navigateTo({url:"/pages/address/user_address/index?orderNo="+this.orderNo})},goOrder:function(e){this.orderNo&&t.redirectTo({url:"/pages/goods/order_confirm/index?is_address=1&orderNo="+this.orderNo+"&addressId="+e}),this.productId&&t.redirectTo({url:"/pages/activity/reservation/reservation/index?id=".concat(this.productId,"&addressId=").concat(e)})}},onReachBottom:function(){this.getAddressList()}};e.default=r}).call(this,i("df3c")["default"])},c88a:function(t,e,i){"use strict";(function(t,e){var s=i("47a9");i("1d3c");s(i("3240"));var n=s(i("1f19"));t.__webpack_require_UNI_MP_PLUGIN__=i,e(n.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},cf70:function(t,e,i){"use strict";i.d(e,"b",(function(){return s})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){}));var s=function(){var t=this.$createElement,e=(this._self._c,this.addressList.length),i=this.addressList.length<1&&this.page>1,s=this.addressList.length,n=0==this.addressList.length&&!this.loading;this.$mp.data=Object.assign({},{$root:{g0:e,g1:i,g2:s,g3:n}})},n=[]}},[["c88a","common/runtime","common/vendor"]]]);