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 lines
16 KiB
1 lines
16 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-users-user_address-index"],{"03ff":function(t,e,i){"use strict";i.r(e);var n=i("344e"),a=i("1565");for(var s in a)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(s);i("15bc");var o=i("f0c5"),r=Object(o["a"])(a["default"],n["b"],n["c"],!1,null,"5c721f6d",null,!1,n["a"],void 0);e["default"]=r.exports},"0e41":function(t,e,i){var n=i("c77d");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("4f06").default;a("4f0473de",n,!0,{sourceMap:!1,shadowMode:!1})},1565:function(t,e,i){"use strict";i.r(e);var n=i("539e"),a=i.n(n);for(var s in n)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(s);e["default"]=a.a},"15bc":function(t,e,i){"use strict";var n=i("c257"),a=i.n(n);a.a},"344e":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return a})),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.colorStyle},[i("v-uni-view",{staticStyle:{"touch-action":"none"}},[i("v-uni-view",{staticClass:"home",staticStyle:{position:"fixed"},style:{top:t.top+"px"},attrs:{id:"right-nav"},on:{touchmove:function(e){e.stopPropagation(),e.preventDefault(),arguments[0]=e=t.$handleEvent(e),t.setTouchMove.apply(void 0,arguments)}}},[t.homeActive?i("v-uni-view",{staticClass:"homeCon bg-color",class:!0===t.homeActive?"on":""},[i("v-uni-navigator",{staticClass:"iconfont icon-shouye-xianxing",attrs:{"hover-class":"none","open-type":"switchTab",url:"/pages/index/index"}}),i("v-uni-navigator",{staticClass:"iconfont icon-caigou-xianxing",attrs:{"hover-class":"none","open-type":"switchTab",url:"/pages/order_addcart/order_addcart"}}),i("v-uni-navigator",{staticClass:"iconfont icon-yonghu1",attrs:{"hover-class":"none","open-type":"switchTab",url:"/pages/user/index"}})],1):t._e(),i("v-uni-view",{staticClass:"pictrueBox",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.open.apply(void 0,arguments)}}},[i("v-uni-view",{staticClass:"pictrue"},[i("v-uni-image",{staticClass:"image",attrs:{src:!0===t.homeActive?t.imgHost+"/statics/images/close.gif":t.imgHost+"/statics/images/open.gif"}})],1)],1)],1)],1)],1)},a=[]},"539e":function(t,e,i){"use strict";i("7a82");var n=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=i("26cb"),s=n(i("66ca")),o=i("989b"),r={name:"Home",props:{},mixins:[s.default],data:function(){return{top:"545",imgHost:o.HTTP_REQUEST_URL}},computed:(0,a.mapGetters)(["homeActive"]),methods:{setTouchMove:function(t){t.touches[0].clientY<545&&t.touches[0].clientY>66&&(this.top=t.touches[0].clientY)},open:function(){this.homeActive?this.$store.commit("CLOSE_HOME"):this.$store.commit("OPEN_HOME")}},created:function(){},beforeDestroy:function(){this.$store.commit("CLOSE_HOME")}};e.default=r},"645a":function(t,e,i){"use strict";i.r(e);var n=i("f045"),a=i("d392");for(var s in a)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(s);i("fa07");var o=i("f0c5"),r=Object(o["a"])(a["default"],n["b"],n["c"],!1,null,"06fe5e5c",null,!1,n["a"],void 0);e["default"]=r.exports},"6af1":function(t,e,i){"use strict";i("7a82");var n=i("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("d3b7"),i("159b"),i("14d9"),i("d81d"),i("498a"),i("ac1f"),i("00b4");var a=i("8ba8"),s=i("d322"),o=i("666f"),r=i("26cb"),d=n(i("03ff")),c=n(i("66ca")),u={components:{home:d.default},mixins:[c.default],data:function(){return{regionDval:[this.$t("浙江省"),this.$t("杭州市"),this.$t("滨江区")],cartId:"",pinkId:0,couponId:0,id:0,userAddress:{is_default:!1},region:[this.$t("省"),this.$t("市"),this.$t("区")],valueRegion:[0,0,0],isAuto:!1,isShowAuth:!1,district:[],multiArray:[],multiIndex:[0,0,0],cityId:0,defaultRegion:[this.$t("广东省"),this.$t("广州市"),this.$t("番禺区")],defaultRegionCode:"110101",news:"",noCoupon:0}},computed:(0,r.mapGetters)(["isLogin"]),watch:{isLogin:{handler:function(t,e){t&&this.getUserAddress()},deep:!0}},onLoad:function(t){this.isLogin?(this.cartId=t.cartId||"",this.pinkId=t.pinkId||0,this.couponId=t.couponId||0,this.id=t.id||0,this.noCoupon=t.noCoupon||0,this.news=t.new||"",uni.setNavigationBarTitle({title:t.id?this.$t("修改地址"):this.$t("添加地址")}),this.getUserAddress(),this.getCityList()):(0,o.toLogin)()},methods:{getCityList:function(){var t=this,e=this;(0,s.getCity)().then((function(i){t.district=i.data,e.initialize()}))},initialize:function(){var t=this,e=[],i=[],n=[],a=this.district[0].c||[];a.length&&a[0].c;this.district.forEach((function(i,n){e.push(i.n),i.n===t.region[0]&&(t.valueRegion[0]=n,t.multiIndex[0]=n)})),this.district[this.valueRegion[0]].c.forEach((function(e,n){t.region[1]==e.c&&(t.valueRegion[1]=n,t.multiIndex[1]=n),i.push(e.n)})),this.district[this.valueRegion[0]].c[this.valueRegion[1]].c.forEach((function(e,i){t.region[2]==e.c&&(t.valueRegion[2]=i,t.multiIndex[2]=i),n.push(e.n)})),this.multiArray=[e,i,n]},bindRegionChange:function(t){var e=this.multiIndex,i=this.district[e[0]]||{c:[]},n=i.c[e[1]]||{v:0},a=this.multiArray,s=t.detail.value;this.region=[a[0][s[0]],a[1][s[1]],a[2][s[2]]],this.cityId=n.v,this.valueRegion=[0,0,0],this.initialize()},bindMultiPickerColumnChange:function(t){var e=t.detail.column,i=t.detail.value,n=this.district[i]||{c:[]},a=this.multiArray,s=this.multiIndex;switch(s[e]=i,e){case 0:var o=n.c[0]||{c:[]};a[1]=n.c.map((function(t){return t.n})),a[2]=o.c.map((function(t){return t.n}));break;case 1:var r=this.district[s[0]].c[s[1]].c||[];a[2]=r.map((function(t){return t.n}));break;case 2:break}this.multiArray=a,this.multiIndex=s},onLoadFun:function(){this.getUserAddress()},authColse:function(t){this.isShowAuth=t},toggleTab:function(t){this.$refs[t].show()},onConfirm:function(t){this.region=t.checkArr[0]+"-"+t.checkArr[1]+"-"+t.checkArr[2]},getUserAddress:function(){if(!this.id)return!1;var t=this;(0,a.getAddressDetail)(this.id).then((function(e){var i=[e.data.province,e.data.city,e.data.district];t.$set(t,"userAddress",e.data),t.$set(t,"region",i),t.cityId=e.data.city_id}))},getWxAddress:function(){var t=this;uni.authorize({scope:"scope.address",success:function(e){uni.chooseAddress({success:function(e){var i=this,n={};n.province=e.provinceName,n.city=e.cityName,n.district=e.countyName,(0,a.editAddress)({address:n,is_default:1,real_name:e.userName,post_code:e.postalCode,phone:e.telNumber,detail:e.detailInfo,id:0,type:1}).then((function(e){return setTimeout((function(){if(t.cartId){var i=t.cartId,n=t.pinkId,a=t.couponId;t.cartId="",t.pinkId="",t.couponId="",uni.navigateTo({url:"/pages/goods/order_confirm/index?cartId="+i+"&addressId="+(t.id?t.id:e.data.id)+"&pinkId="+n+"&couponId="+a+"&new="+t.news+"&noCoupon="+t.noCoupon})}else uni.navigateBack({delta:1})}),1e3),t.$util.Tips({title:i.$t("添加成功"),icon:"success"})})).catch((function(e){return t.$util.Tips({title:e})}))},fail:function(e){if("chooseAddress:cancel"==e.errMsg)return t.$util.Tips({title:this.$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,e=this;e.$wechat.openAddress().then((function(i){(0,a.editAddress)({id:t.id,real_name:i.userName,phone:i.telNumber,address:{province:i.provinceName,city:i.cityName,district:i.countryName},detail:i.detailInfo,is_default:1,post_code:i.postalCode,type:1}).then((function(t){e.$util.Tips({title:e.$t("添加成功"),icon:"success"},(function(){if(e.cartId){var i=e.cartId,n=e.pinkId,a=e.couponId;e.cartId="",e.pinkId="",e.couponId="",uni.navigateTo({url:"/pages/goods/order_confirm/index?cartId="+i+"&addressId="+(e.id?e.id:t.data.id)+"&pinkId="+n+"&couponId="+a+"&new="+e.news})}else uni.navigateTo({url:"/pages/users/user_address_list/index"})}))})).catch((function(t){return e.$util.Tips({title:t||e.$t("添加失败")})}))})).catch((function(t){}))},formSubmit:function(t){var e=this,i=t.detail.value;if(!i.real_name.trim())return e.$util.Tips({title:e.$t("请填写收货人姓名")});if(!i.phone)return e.$util.Tips({title:e.$t("请填写联系电话")});if(!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(i.phone))return e.$util.Tips({title:e.$t("请输入正确的手机号码")});if(e.region[0]==e.$t("省"))return e.$util.Tips({title:e.$t("请选择所在地区")});if(!i.detail.trim())return e.$util.Tips({title:e.$t("请填写详细地址")});i.id=e.id;var n=e.region;i.address={province:n[0],city:n[1],district:n[2],city_id:e.cityId},i.is_default=e.userAddress.is_default?1:0,uni.showLoading({title:e.$t("保存中"),mask:!0}),(0,a.editAddress)(i).then((function(t){e.id?e.$util.Tips({title:e.$t("修改成功"),icon:"success"}):e.$util.Tips({title:e.$t("添加成功"),icon:"success"}),setTimeout((function(){if(!e.cartId)return history.back();var i=e.cartId,n=e.pinkId,a=e.couponId;e.cartId="",e.pinkId="",e.couponId="",uni.navigateTo({url:"/pages/goods/order_confirm/index?new="+e.news+"&cartId="+i+"&addressId="+(e.id?e.id:t.data.id)+"&pinkId="+n+"&couponId="+a+"&noCoupon="+e.noCoupon})}),1e3)})).catch((function(t){return e.$util.Tips({title:t})}))},ChangeIsDefault:function(t){this.$set(this.userAddress,"is_default",!this.userAddress.is_default)}}};e.default=u},a798:function(t,e,i){var n=i("24fb");e=n(!1),e.push([t.i,".pictrueBox[data-v-5c721f6d]{width:%?130?%;height:%?120?%}\n\n/*返回主页按钮*/.home[data-v-5c721f6d]{position:fixed;color:#fff;text-align:center;z-index:999;right:%?15?%;display:flex}.home .homeCon[data-v-5c721f6d]{border-radius:%?50?%;opacity:0;height:0;color:var(--view-theme);width:0}.home .homeCon.on[data-v-5c721f6d]{opacity:1;-webkit-animation:bounceInRight .5s cubic-bezier(.215,.61,.355,1);animation:bounceInRight .5s cubic-bezier(.215,.61,.355,1);width:%?300?%;height:%?86?%;margin-bottom:%?20?%;display:flex;justify-content:center;align-items:center;background:var(--view-theme)!important;opacity:.8;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.home .homeCon .iconfont[data-v-5c721f6d]{font-size:%?48?%;color:#fff;display:inline-block;margin:0 auto}.home .pictrue[data-v-5c721f6d]{width:%?86?%;height:%?86?%;border-radius:50%;margin:0 auto;background-color:var(--view-theme)}.home .pictrue .image[data-v-5c721f6d]{width:100%;height:100%;border-radius:50%;-webkit-transform:rotate(90deg);transform:rotate(90deg);ms-transform:rotate(90deg);moz-transform:rotate(90deg);webkit-transform:rotate(90deg);o-transform:rotate(90deg)}",""]),t.exports=e},c257:function(t,e,i){var n=i("a798");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("4f06").default;a("f61d2c94",n,!0,{sourceMap:!1,shadowMode:!1})},c77d:function(t,e,i){var n=i("24fb");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/* crmeb颜色变量 */\n/* 背景颜色 */\n/* 边框颜色 */\n/* 尺寸变量 */\n/* 文字尺寸 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */\n/* 透明度 */\n/* 文章场景相关 */.fontcolor[data-v-06fe5e5c]{color:var(--view-theme)}.addAddress .list[data-v-06fe5e5c]{background-color:#fff}.addAddress .list .item[data-v-06fe5e5c]{padding:%?30?%;border-top:%?1?% solid #eee}.addAddress .list .item .name[data-v-06fe5e5c]{width:%?195?%;font-size:%?30?%;color:#333}.addAddress .list .item .address[data-v-06fe5e5c]{flex:1;margin-left:%?20?%}.addAddress .list .item uni-input[data-v-06fe5e5c]{width:%?475?%;font-size:%?30?%}.addAddress .list .item .placeholder[data-v-06fe5e5c]{color:#ccc}.addAddress .list .item uni-picker[data-v-06fe5e5c]{width:%?475?%}.addAddress .list .item uni-picker .picker[data-v-06fe5e5c]{width:%?410?%;font-size:%?30?%}.addAddress .list .item uni-picker .iconfont[data-v-06fe5e5c]{font-size:%?43?%}.addAddress .default[data-v-06fe5e5c]{padding:0 %?30?%;height:%?90?%;background-color:#fff;margin-top:%?23?%}.addAddress .default uni-checkbox[data-v-06fe5e5c]{margin-right:%?15?%}.addAddress .keepBnt[data-v-06fe5e5c]{width:%?690?%;height:%?86?%;border-radius:%?50?%;text-align:center;line-height:%?86?%;margin:%?50?% auto;font-size:%?32?%;color:#fff}.addAddress .wechatAddress[data-v-06fe5e5c]{width:%?690?%;height:%?86?%;border-radius:%?50?%;text-align:center;line-height:%?86?%;margin:0 auto;font-size:%?32?%;color:var(--view-theme);border:1px solid var(--view-theme)}',""]),t.exports=e},d392:function(t,e,i){"use strict";i.r(e);var n=i("6af1"),a=i.n(n);for(var s in n)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(s);e["default"]=a.a},f045:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return a})),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.colorStyle},[i("v-uni-form",{on:{submit:function(e){arguments[0]=e=t.$handleEvent(e),t.formSubmit.apply(void 0,arguments)}}},[i("v-uni-view",{staticClass:"addAddress"},[i("v-uni-view",{staticClass:"list"},[i("v-uni-view",{staticClass:"item acea-row row-between-wrapper"},[i("v-uni-view",{staticClass:"name"},[t._v(t._s(t.$t("姓名")))]),i("v-uni-input",{attrs:{type:"text",placeholder:t.$t("请输入姓名"),name:"real_name",value:t.userAddress.real_name,"placeholder-class":"placeholder"}})],1),i("v-uni-view",{staticClass:"item acea-row row-between-wrapper"},[i("v-uni-view",{staticClass:"name"},[t._v(t._s(t.$t("联系电话")))]),i("v-uni-input",{attrs:{type:"number",placeholder:t.$t("请输入联系电话"),name:"phone",value:t.userAddress.phone,"placeholder-class":"placeholder",pattern:"\\d*"}})],1),i("v-uni-view",{staticClass:"item acea-row row-between-wrapper"},[i("v-uni-view",{staticClass:"name"},[t._v(t._s(t.$t("所在地区")))]),i("v-uni-view",{staticClass:"address"},[i("v-uni-picker",{attrs:{mode:"multiSelector",value:t.valueRegion,range:t.multiArray},on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.bindRegionChange.apply(void 0,arguments)},columnchange:function(e){arguments[0]=e=t.$handleEvent(e),t.bindMultiPickerColumnChange.apply(void 0,arguments)}}},[i("v-uni-view",{staticClass:"acea-row"},[i("v-uni-view",{staticClass:"picker"},[t._v(t._s(t.region[0])+","+t._s(t.region[1])+","+t._s(t.region[2]))]),i("v-uni-view",{staticClass:"iconfont icon-dizhi fontcolor"})],1)],1)],1)],1),i("v-uni-view",{staticClass:"item acea-row row-between-wrapper"},[i("v-uni-view",{staticClass:"name"},[t._v(t._s(t.$t("详细地址")))]),i("v-uni-input",{attrs:{type:"text",placeholder:t.$t("请填写具体地址"),name:"detail","placeholder-class":"placeholder",value:t.userAddress.detail}})],1)],1),i("v-uni-view",{staticClass:"default acea-row row-middle",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.ChangeIsDefault.apply(void 0,arguments)}}},[i("v-uni-checkbox-group",[i("v-uni-checkbox",{attrs:{checked:!!t.userAddress.is_default}}),t._v(t._s(t.$t("设置为默认地址")))],1)],1),i("v-uni-button",{staticClass:"keepBnt bg-color",attrs:{"form-type":"submit"}},[t._v(t._s(t.$t("立即保存")))]),this.$wechat.isWeixin()&&!t.id?i("v-uni-view",{staticClass:"wechatAddress",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.getAddress.apply(void 0,arguments)}}},[t._v(t._s(t.$t("导入微信地址")))]):t._e()],1)],1),i("home")],1)},a=[]},fa07:function(t,e,i){"use strict";var n=i("0e41"),a=i.n(n);a.a}}]); |