pages-users-user_address_list-index.6f64a106.js 11 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-users-user_address_list-index"],{"023a":function(t,e,i){var n=i("ef05");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var s=i("967d").default;s("58abce5f",n,!0,{sourceMap:!1,shadowMode:!1})},"115e":function(t,e,i){"use strict";var n=i("023a"),s=i.n(n);s.a},"70bc":function(t,e,i){"use strict";i.r(e);var n=i("ad2d"),s=i("9b36");for(var a in s)["default"].indexOf(a)<0&&function(t){i.d(e,t,(function(){return s[t]}))}(a);i("115e");var d=i("828b"),o=Object(d["a"])(s["default"],n["b"],n["c"],!1,null,"5941447f",null,!1,n["a"],void 0);e["default"]=o.exports},"8eaf":function(t,e,i){"use strict";i("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("e966"),i("dd2b");var n=i("672a"),s=i("8f59"),a=i("aa10"),d=i("e44d"),o={components:{},data:function(){return{addressList:[],cartId:"",pinkId:0,couponId:0,loading:!1,loadend:!1,loadTitle:"加载更多",page:1,limit:20,domain:a.HTTP_REQUEST_URL}},computed:(0,s.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(e){uni.chooseAddress({success:function(e){var i={};i.province=e.provinceName,i.city=e.cityName,i.district=e.countyName,(0,n.editAddress)({is_default:1,real_name:e.userName,phone:e.telNumber,detail:e.detailInfo,province:e.provinceName,district:e.countyName,city:e.cityName,city_id:""}).then((function(e){t.$util.Tips({title:"添加成功",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:"取消选择"})}})},fail:function(e){uni.showModal({title:"您已拒绝导入微信地址权限",content:"是否进入权限管理,调整授权?",success:function(e){if(e.confirm)uni.openSetting({success:function(t){}});else if(e.cancel)return t.$util.Tips({title:"已取消!"})}})}})},getAddress:function(){var t=this;t.$wechat.openAddress().then((function(e){(0,n.editAddress)({real_name:e.userName,phone:e.telNumber,province:e.provinceName,city:e.cityName,district:e.countryName,detail:e.detailInfo,post_code:e.postalCode,is_default:1,city_id:""}).then((function(){t.$util.Tips({title:"添加成功",icon:"success"},(function(){t.getAddressList(!0)}))})).catch((function(e){return t.$util.Tips({title:e||"添加失败"})}))}))},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,n.getAddressList)({page:e.page,limit:e.limit}).then((function(t){var i=t.data.list,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.page=e.page+1,e.loading=!1})).catch((function(t){e.loading=!1,e.loadTitle="加载更多"})))},radioChange:function(t){var e=parseInt(t.detail.value),i=this,s=this.addressList[e];if(void 0==s)return i.$util.Tips({title:"您设置的默认地址不存在!"});(0,n.setAddressDefault)(s.address_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:"设置成功",icon:"success"},(function(){i.$set(i,"addressList",i.addressList)}))})).catch((function(t){return i.$util.Tips({title:t})}))},editAddress:function(t){var e=this.cartId,i=this.pinkId,n=this.couponId;this.cartId="",this.pinkId="",this.couponId="",uni.navigateTo({url:"/pages/users/user_address/index?id="+t+"&cartId="+e+"&pinkId="+i+"&couponId="+n})},delAddress:function(t){var e=this,i=this.addressList[t];if(void 0==i)return e.$util.Tips({title:"您删除的地址不存在!"});(0,n.delAddress)(i.address_id).then((function(i){e.$util.Tips({title:"删除成功",icon:"success"},(function(){e.addressList.splice(t,1),e.$set(e,"addressList",e.addressList)}))})).catch((function(t){return e.$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 e="",i="",n="";this.cartId&&t&&(e=this.cartId,i=this.pinkId,n=this.couponId,this.cartId="",this.pinkId="",this.couponId="",uni.redirectTo({url:"/pages/users/order_confirm/index?is_address=1&cartId="+e+"&addressId="+t+"&pinkId="+i+"&couponId="+n}))}},onReachBottom:function(){this.getAddressList()}};e.default=o},"9b36":function(t,e,i){"use strict";i.r(e);var n=i("8eaf"),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},ad2d:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return s})),i.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{style:t.viewColor},[i("v-uni-view",{staticClass:"address-management",class:t.addressList.length<1&&t.page>1?"fff":""},[i("v-uni-view",{staticClass:"line"},[t.addressList.length?i("v-uni-image",{attrs:{src:t.domain+"/static/images/line.jpg"}}):t._e()],1),i("v-uni-view",{staticClass:"address-main"},[t.addressList.length?i("v-uni-radio-group",{staticClass:"radio-group",on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.radioChange.apply(void 0,arguments)}}},t._l(t.addressList,(function(e,n){return i("v-uni-view",{key:n,staticClass:"item bg-f boder-24"},[i("v-uni-view",{staticClass:"address",on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.goOrder(e.address_id)}}},[i("v-uni-view",{staticClass:"consignee font-500"},[t._v("收货人:"+t._s(e.real_name)),i("v-uni-text",{staticClass:"phone"},[t._v(t._s(e.phone))])],1),i("v-uni-view",[t._v("收货地址:"+t._s(e.province||"")+t._s(e.city||"")+t._s(e.district||"")+t._s(e.street||"")+t._s(e.detail||""))])],1),i("v-uni-view",{staticClass:"operation acea-row row-between-wrapper"},[i("v-uni-radio",{staticClass:"radio",attrs:{value:n.toString(),checked:!!e.is_default}},[i("v-uni-text",[t._v("设为默认")])],1),i("v-uni-view",{staticClass:"acea-row row-middle"},[i("v-uni-view",{on:{click:function(i){arguments[0]=i=t.$handleEvent(i),t.editAddress(e.address_id)}}},[i("v-uni-text",{staticClass:"iconfont icon-ic_edit"}),t._v("编辑")],1),i("v-uni-view",{on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.delAddress(n)}}},[i("v-uni-text",{staticClass:"iconfont icon-ic_delete"}),t._v("删除")],1)],1)],1)],1)})),1):t._e(),t.addressList.length?i("v-uni-view",{staticClass:"loadingicon acea-row row-center-wrapper"},[i("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?i("v-uni-view",{staticClass:"noCommodity"},[i("v-uni-view",{staticClass:"pictrue"},[i("v-uni-image",{attrs:{src:t.domain+"/static/images/noAddress.png"}})],1),i("v-uni-view",[t._v("暂无地址")])],1):t._e()],1),i("v-uni-view",{staticClass:"footer acea-row row-between-wrapper"},[i("v-uni-view",{staticClass:"addressBnt on",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.addAddress.apply(void 0,arguments)}}},[i("v-uni-text",{staticClass:"iconfont icon-tianjiadizhi"}),t._v("添加新地址")],1)],1)],1)],1)},s=[]},ef05:function(t,e,i){var n=i("c86c");e=n(!1),e.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-5941447f] uni-radio .wx-radio-input.wx-radio-input-checked,[data-v-5941447f] uni-radio .uni-radio-input.uni-radio-input-checked{border:1px solid var(--view-theme)!important;background-color:var(--view-theme)!important}.address-main[data-v-5941447f]{padding:0 %?20?%}.address-management.fff[data-v-5941447f]{background-color:#fff;height:100vh}.address-management .line[data-v-5941447f]{width:100%;height:%?3?%}.address-management .line uni-image[data-v-5941447f]{width:100%;height:100%;display:block}.address-management .item[data-v-5941447f]{padding:0 %?30?%;margin-top:%?20?%}.address-management .item .address[data-v-5941447f]{padding:%?30?% 0;border-bottom:1px solid #eee;font-size:%?28?%;color:#282828}.address-management .item .address .consignee[data-v-5941447f]{font-size:%?30?%;margin-bottom:%?20?%}.address-management .item .address .consignee .phone[data-v-5941447f]{margin-left:%?25?%}.address-management .item .operation[data-v-5941447f]{height:%?83?%;font-size:%?28?%;color:#282828}.b-color[data-v-5941447f]{background-color:var(--view-theme)}.address-management .item .operation .radio uni-text[data-v-5941447f]{margin-left:%?13?%}.address-management .item .operation .iconfont[data-v-5941447f]{font-size:%?35?%;vertical-align:%?-2?%;margin-right:%?10?%}.address-management .item .operation .iconfont.icon-ic_delete[data-v-5941447f]{margin-left:%?54?%;font-size:%?38?%}.address-management .footer[data-v-5941447f]{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-5941447f]{width:%?330?%;height:%?76?%;border-radius:%?50?%;text-align:center;line-height:%?76?%;font-size:%?30?%;color:#fff;background:linear-gradient(270deg,var(--view-bntColor22),var(--view-bntColor21))}.address-management .footer .addressBnt.on[data-v-5941447f]{width:%?690?%;margin:0 auto}.address-management .footer .addressBnt .iconfont[data-v-5941447f]{font-size:%?35?%;margin-right:%?8?%;vertical-align:%?-1?%}.address-management .footer .addressBnt.wxbnt[data-v-5941447f]{background-color:#fe960f}.noCommodity[data-v-5941447f]{text-align:center;border-top:none;margin-top:15vh}.noCommodity .pictrue[data-v-5941447f]{height:%?305?%}.noCommodity uni-view[data-v-5941447f]{color:#999}',""]),t.exports=e}}]);