zx/public/static/js/pages-users-user_address_li...

1 line
10 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-users-user_address_list-index"],{4385:function(t,i,e){"use strict";var n=e("b6b5"),a=e.n(n);a.a},"70bc":function(t,i,e){"use strict";e.r(i);var n=e("98dc"),a=e("9b36");for(var s in a)["default"].indexOf(s)<0&&function(t){e.d(i,t,(function(){return a[t]}))}(s);e("4385");var d=e("828b"),o=Object(d["a"])(a["default"],n["b"],n["c"],!1,null,"7a758bfc",null,!1,n["a"],void 0);i["default"]=o.exports},"8eaf":function(t,i,e){"use strict";e("6a54"),Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,e("e966"),e("dd2b");var n=e("672a"),a=e("8f59"),s=e("aa10"),d=e("e44d"),o={components:{},data:function(){return{addressList:[],cartId:"",pinkId:0,couponId:0,loading:!1,loadend:!1,loadTitle:"加载更多",page:1,limit:20,domain:s.HTTP_REQUEST_URL}},computed:(0,a.mapGetters)(["isLogin","viewColor"]),onLoad:function(t){this.isLogin?(this.cartId=t.cartId||"",this.pinkId=t.pinkId||0,this.couponId=t.couponId||0,this.getAddressList(!0)):(0,d.toLogin)()},onReady:function(){},onShow:function(){this.getAddressList(!0)},methods:{getWxAddress:function(){var t=this;uni.authorize({scope:"scope.address",success:function(i){uni.chooseAddress({success:function(i){var e={};e.province=i.provinceName,e.city=i.cityName,e.district=i.countyName,(0,n.editAddress)({is_default:1,real_name:i.userName,phone:i.telNumber,detail:i.detailInfo,province:i.provinceName,district:i.countyName,city:i.cityName,city_id:""}).then((function(i){t.$util.Tips({title:"添加成功",icon:"success"},(function(){t.getAddressList(!0)}))})).catch((function(i){return t.$util.Tips({title:i})}))},fail:function(i){if("chooseAddress:cancel"==i.errMsg)return t.$util.Tips({title:"取消选择"})}})},fail:function(i){uni.showModal({title:"您已拒绝导入微信地址权限",content:"是否进入权限管理,调整授权?",success:function(i){if(i.confirm)uni.openSetting({success:function(t){}});else if(i.cancel)return t.$util.Tips({title:"已取消!"})}})}})},getAddress:function(){var t=this;t.$wechat.openAddress().then((function(i){(0,n.editAddress)({real_name:i.userName,phone:i.telNumber,province:i.provinceName,city:i.cityName,district:i.countryName,detail:i.detailInfo,post_code:i.postalCode,is_default:1,city_id:""}).then((function(){t.$util.Tips({title:"添加成功",icon:"success"},(function(){t.getAddressList(!0)}))})).catch((function(i){return t.$util.Tips({title:i||"添加失败"})}))}))},getAddressList:function(t){var i=this;t&&(i.loadend=!1,i.page=1,i.$set(i,"addressList",[])),i.loading||i.loadend||(i.loading=!0,i.loadTitle="",(0,n.getAddressList)({page:i.page,limit:i.limit}).then((function(t){var e=t.data.list,n=e.length<i.limit;i.addressList=i.$util.SplitArray(e,i.addressList),i.$set(i,"addressList",i.addressList),i.loadend=n,i.loadTitle=n?"我也是有底线的":"加载更多",i.page=i.page+1,i.loading=!1})).catch((function(t){i.loading=!1,i.loadTitle="加载更多"})))},radioChange:function(t){var i=parseInt(t.detail.value),e=this,a=this.addressList[i];if(void 0==a)return e.$util.Tips({title:"您设置的默认地址不存在!"});(0,n.setAddressDefault)(a.address_id).then((function(t){for(var n=0,a=e.addressList.length;n<a;n++)e.addressList[n].is_default=n==i;e.$util.Tips({title:"设置成功",icon:"success"},(function(){e.$set(e,"addressList",e.addressList)}))})).catch((function(t){return e.$util.Tips({title:t})}))},editAddress:function(t){var i=this.cartId,e=this.pinkId,n=this.couponId;this.cartId="",this.pinkId="",this.couponId="",uni.navigateTo({url:"/pages/users/user_address/index?id="+t+"&cartId="+i+"&pinkId="+e+"&couponId="+n})},delAddress:function(t){var i=this,e=this.addressList[t];if(void 0==e)return i.$util.Tips({title:"您删除的地址不存在!"});(0,n.delAddress)(e.address_id).then((function(e){i.$util.Tips({title:"删除成功",icon:"success"},(function(){i.addressList.splice(t,1),i.$set(i,"addressList",i.addressList)}))})).catch((function(t){return i.$util.Tips({title:t})}))},addAddress:function(){var t=this.cartId;this.pinkId,this.couponId;this.cartId="",this.pinkId="",this.couponId="",uni.navigateTo({url:"/pages/users/user_address/index?cartId="+t})},goOrder:function(t){var i="",e="",n="";this.cartId&&t&&(i=this.cartId,e=this.pinkId,n=this.couponId,this.cartId="",this.pinkId="",this.couponId="",uni.redirectTo({url:"/pages/users/order_confirm/index?is_address=1&cartId="+i+"&addressId="+t+"&pinkId="+e+"&couponId="+n}))}},onReachBottom:function(){this.getAddressList()}};i.default=o},"98dc":function(t,i,e){"use strict";e.d(i,"b",(function(){return n})),e.d(i,"c",(function(){return a})),e.d(i,"a",(function(){}));var n=function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("v-uni-view",{style:t.viewColor},[e("v-uni-view",{staticClass:"address-management",class:t.addressList.length<1&&t.page>1?"fff":""},[e("v-uni-view",{staticClass:"line"},[t.addressList.length?e("v-uni-image",{attrs:{src:t.domain+"/static/images/line.jpg"}}):t._e()],1),t.addressList.length?e("v-uni-radio-group",{staticClass:"radio-group",on:{change:function(i){arguments[0]=i=t.$handleEvent(i),t.radioChange.apply(void 0,arguments)}}},t._l(t.addressList,(function(i,n){return e("v-uni-view",{key:n,staticClass:"item"},[e("v-uni-view",{staticClass:"address",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.goOrder(i.address_id)}}},[e("v-uni-view",{staticClass:"consignee"},[t._v("收货人:"+t._s(i.real_name)),e("v-uni-text",{staticClass:"phone"},[t._v(t._s(i.phone))])],1),e("v-uni-view",[t._v("收货地址:"+t._s(i.province||"")+t._s(i.city||"")+t._s(i.district||"")+t._s(i.street||"")+t._s(i.detail||""))])],1),e("v-uni-view",{staticClass:"operation acea-row row-between-wrapper"},[e("v-uni-radio",{staticClass:"radio",attrs:{value:n.toString(),checked:!!i.is_default}},[e("v-uni-text",[t._v("设为默认")])],1),e("v-uni-view",{staticClass:"acea-row row-middle"},[e("v-uni-view",{on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.editAddress(i.address_id)}}},[e("v-uni-text",{staticClass:"iconfont icon-bianji"}),t._v("编辑")],1),e("v-uni-view",{on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.delAddress(n)}}},[e("v-uni-text",{staticClass:"iconfont icon-shanchu"}),t._v("删除")],1)],1)],1)],1)})),1):t._e(),t.addressList.length?e("v-uni-view",{staticClass:"loadingicon acea-row row-center-wrapper"},[e("v-uni-text",{staticClass:"loading iconfont icon-jiazai",attrs:{hidden:0==t.loading}}),t._v(t._s(t.loadTitle))],1):t._e(),t.addressList.length<1&&t.page>1?e("v-uni-view",{staticClass:"noCommodity"},[e("v-uni-view",{staticClass:"pictrue"},[e("v-uni-image",{attrs:{src:t.domain+"/static/images/noAddress.png"}})],1),e("v-uni-view",[t._v("暂无地址")])],1):t._e(),e("v-uni-view",{staticClass:"footer acea-row row-between-wrapper"},[e("v-uni-view",{staticClass:"addressBnt b-color on",on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.addAddress.apply(void 0,arguments)}}},[e("v-uni-text",{staticClass:"iconfont icon-tianjiadizhi"}),t._v("添加新地址")],1)],1)],1)],1)},a=[]},"9b36":function(t,i,e){"use strict";e.r(i);var n=e("8eaf"),a=e.n(n);for(var s in n)["default"].indexOf(s)<0&&function(t){e.d(i,t,(function(){return n[t]}))}(s);i["default"]=a.a},b08f:function(t,i,e){var n=e("c86c");i=n(!1),i.push([t.i,'@charset "UTF-8";\n/**\n * 这里是uni-app内置的常用样式变量\n *\n * uni-app 官方扩展插件及插件市场https://ext.dcloud.net.cn上很多三方插件均使用了这些样式变量\n * 如果你是插件开发者建议你使用scss预处理并在插件代码中直接使用这些变量无需 import 这个文件方便用户通过搭积木的方式开发整体风格一致的App\n *\n */\n/**\n * 如果你是App开发者插件使用者你可以通过修改这些变量来定制自己的插件主题实现自定义主题功能\n *\n * 如果你的项目同样使用了scss预处理你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件\n */\n/* 颜色变量 */\n/* 行为相关颜色 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */[data-v-7a758bfc] uni-radio .wx-radio-input.wx-radio-input-checked,[data-v-7a758bfc] uni-radio .uni-radio-input.uni-radio-input-checked{border:1px solid var(--view-theme)!important;background-color:var(--view-theme)!important}.address-management.fff[data-v-7a758bfc]{background-color:#fff;height:100vh}.address-management .line[data-v-7a758bfc]{width:100%;height:%?3?%}.address-management .line uni-image[data-v-7a758bfc]{width:100%;height:100%;display:block}.address-management .item[data-v-7a758bfc]{background-color:#fff;padding:0 %?30?%;margin-bottom:%?12?%}.address-management .item .address[data-v-7a758bfc]{padding:%?30?% 0;border-bottom:1px solid #eee;font-size:%?28?%;color:#282828}.address-management .item .address .consignee[data-v-7a758bfc]{font-size:%?28?%;font-weight:700;margin-bottom:%?8?%}.address-management .item .address .consignee .phone[data-v-7a758bfc]{margin-left:%?25?%}.address-management .item .operation[data-v-7a758bfc]{height:%?83?%;font-size:%?28?%;color:#282828}.b-color[data-v-7a758bfc]{background-color:var(--view-theme)}.address-management .item .operation .radio uni-text[data-v-7a758bfc]{margin-left:%?13?%}.address-management .item .operation .iconfont[data-v-7a758bfc]{color:#2c2c2c;font-size:%?35?%;vertical-align:%?-2?%;margin-right:%?10?%}.address-management .item .operation .iconfont.icon-shanchu[data-v-7a758bfc]{margin-left:%?40?%;font-size:%?38?%}.address-management .footer[data-v-7a758bfc]{position:fixed;width:100%;background-color:#fff;bottom:0;bottom:calc(0rpx+ constant(safe-area-inset-bottom));bottom:calc(%?0?% + env(safe-area-inset-bottom));height:%?106?%;padding:0 %?30?%;box-sizing:border-box}.address-management .footer .addressBnt[data-v-7a758bfc]{width:%?330?%;height:%?76?%;border-radius:%?50?%;text-align:center;line-height:%?76?%;font-size:%?30?%;color:#fff}.address-management .footer .addressBnt.on[data-v-7a758bfc]{width:%?690?%;margin:0 auto}.address-management .footer .addressBnt .iconfont[data-v-7a758bfc]{font-size:%?35?%;margin-right:%?8?%;vertical-align:%?-1?%}.address-management .footer .addressBnt.wxbnt[data-v-7a758bfc]{background-color:#fe960f}.noCommodity[data-v-7a758bfc]{text-align:center;border-top:none;margin-top:15vh}.noCommodity .pictrue[data-v-7a758bfc]{height:%?305?%}.noCommodity uni-view[data-v-7a758bfc]{color:#999}',""]),t.exports=i},b6b5:function(t,i,e){var n=e("b08f");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=e("967d").default;a("79022b3e",n,!0,{sourceMap:!1,shadowMode:!1})}}]);