You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
14 KiB
1 line
14 KiB
10 months ago
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-points_mall-user_address"],{"03ff":function(t,e,i){"use strict";i.r(e);var n=i("344e"),s=i("1565");for(var a in s)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(a);i("15bc");var o=i("f0c5"),d=Object(o["a"])(s["default"],n["b"],n["c"],!1,null,"5c721f6d",null,!1,n["a"],void 0);e["default"]=d.exports},1565:function(t,e,i){"use strict";i.r(e);var n=i("539e"),s=i.n(n);for(var a in n)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(a);e["default"]=s.a},"15bc":function(t,e,i){"use strict";var n=i("c257"),s=i.n(n);s.a},"20f0":function(t,e,i){"use strict";i("7a82");var n=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("e25e"),i("a434");var s=i("8ba8"),a=i("666f"),o=i("26cb"),d=n(i("03ff")),r=n(i("66ca")),c=i("989b"),u={components:{home:d.default},mixins:[r.default],data:function(){return{imgHost:c.HTTP_REQUEST_URL,addressList:[],loading:!1,loadend:!1,loadTitle:this.$t("加载更多"),page:1,limit:20,isAuto:!1,isShowAuth:!1,news:"",unique:"",num:""}},computed:(0,o.mapGetters)(["isLogin"]),onLoad:function(t){this.unique=t.unique,this.num=t.num,this.isLogin?(this.cartId=t.cartId||"",this.pinkId=t.pinkId||0,this.couponId=t.couponId||0,this.news=t.news||0,this.getAddressList(!0)):(0,a.toLogin)()},onShow:function(){this.getAddressList(!0)},methods:{onLoadFun:function(){this.getAddressList()},authColse:function(t){this.isShowAuth=t},getWxAddress:function(){var t=this;uni.authorize({scope:"scope.address",success:function(e){uni.chooseAddress({success:function(e){var i={};i.province=e.provinceName,i.city=e.cityName,i.district=e.countyName,(0,s.editAddress)({address:i,is_default:1,real_name:e.userName,post_code:e.postalCode,phone:e.telNumber,detail:e.detailInfo,id:0,type:1}).then((function(e){t.$util.Tips({title:t.$t("添加成功"),icon:"success"},(function(){t.getAddressList(!0)}))})).catch((function(e){return t.$util.Tips({title:e})}))},fail:function(e){if("chooseAddress:cancel"==e.errMsg)return t.$util.Tips({title:t.$t("取消选择")})}})},fail:function(e){uni.showModal({title:this.$t("您已拒绝导入微信地址权限"),content:this.$t("是否进入权限管理,调整授权?"),success:function(e){if(e.confirm)uni.openSetting({success:function(t){}});else if(e.cancel)return t.$util.Tips({title:t.$t("已取消")})}})}})},getAddress:function(){var t=this;t.$wechat.openAddress().then((function(e){(0,s.editAddress)({real_name:e.userName,phone:e.telNumber,address:{province:e.provinceName,city:e.cityName,district:e.countryName},detail:e.detailInfo,post_code:e.postalCode,is_default:1,type:1}).then((function(){t.$util.Tips({title:t.$t("添加成功"),icon:"success"},(function(){t.getAddressList(!0)}))})).catch((function(e){return t.$util.Tips({title:e||t.$t("添加失败")})}))}))},getAddressList:function(t){var e=this;t&&(e.loadend=!1,e.page=1,e.$set(e,"addressList",[])),e.loading||e.loadend||(e.loading=!0,e.loadTitle="",(0,s.getAddressList)({page:e.page,limit:e.limit}).then((function(t){var i=t.data,n=i.length<e.limit;e.addressList=e.$util.SplitArray(i,e.addressList),e.$set(e,"addressList",e.addressList),e.loadend=n,e.loadTitle=n?e.$t("我也是有底线的"):e.$t("加载更多"),e.page=e.page+1,e.loading=!1})).catch((function(t){e.loading=!1,e.loadTitle=e.$t("加载更多")})))},radioChange:function(t){var e=parseInt(t.detail.value),i=this,n=this.addressList[e];if(void 0==n)return i.$util.Tips({title:i.$t("您设置的默认地址不存在!")});(0,s.setAddressDefault)(n.id).then((function(t){for(var n=0,s=i.addressList.length;n<s;n++)i.addressList[n].is_default=n==e;i.$util.Tips({title:i.$t("设置成功"),icon:"success"},(function(){i.$set(i,"addressList",i.addressList)}))})).catch((function(t){return i.$util.Tips({title:t})}))},editAddress:function(t){this.cartId;var e=this.pinkId,i=this.couponId;this.cartId="",this.pinkId="",this.couponId="",uni.navigateTo({url:"/pages/users/user_address/index?id="+t+"&pinkId="+e+"&couponId="+i+"&new="+this.news})},delAddress:function(t){var
|