cyywl_shop_app/dist/static/js/pages-users-user_address-in...

1 line
16 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-users-user_address-index"],{"24ca":function(t,e,i){"use strict";i.r(e);var n=i("5a19"),a=i("3910");for(var s in a)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(s);i("b151");var r=i("f0c5"),o=Object(r["a"])(a["default"],n["b"],n["c"],!1,null,"67f27ab4",null,!1,n["a"],void 0);e["default"]=o.exports},2799:function(t,e,i){var n=i("24fb");e=n(!1),e.push([t.i,".pictrueBox[data-v-47a70398]{width:%?130?%;height:%?120?%}\n\n/*返回主页按钮*/.home[data-v-47a70398]{position:fixed;color:#fff;text-align:center;z-index:9999;right:%?15?%;display:flex}.home .homeCon[data-v-47a70398]{border-radius:%?50?%;opacity:0;height:0;color:$theme-color;width:0}.home .homeCon.on[data-v-47a70398]{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:#f44939!important}.home .homeCon .iconfont[data-v-47a70398]{font-size:%?48?%;color:#fff;display:inline-block;margin:0 auto}.home .pictrue[data-v-47a70398]{width:%?86?%;height:%?86?%;border-radius:50%;margin:0 auto}.home .pictrue .image[data-v-47a70398]{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},3910:function(t,e,i){"use strict";i.r(e);var n=i("d642"),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},"5a19":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",[i("v-uni-form",{attrs:{"report-submit":"true"},on:{submit:function(e){arguments[0]=e=t.$handleEvent(e),t.formSubmit.apply(void 0,arguments)}}},[i("v-uni-view",{staticClass:"addAddress pad30"},[i("v-uni-view",{staticClass:"list borRadius14"},[i("v-uni-view",{staticClass:"item acea-row row-between-wrapper",staticStyle:{border:"none"}},[i("v-uni-view",{staticClass:"name"},[t._v("姓名")]),i("v-uni-input",{attrs:{type:"text",placeholder:"请输入姓名","placeholder-style":"color:#ccc;",name:"realName",value:t.userAddress.realName,"placeholder-class":"placeholder",maxlength:"4"}})],1),i("v-uni-view",{staticClass:"item acea-row row-between-wrapper"},[i("v-uni-view",{staticClass:"name"},[t._v("联系电话")]),i("v-uni-input",{attrs:{type:"number",placeholder:"请输入联系电话","placeholder-style":"color:#ccc;",name:"phone",value:t.userAddress.phone,"placeholder-class":"placeholder",maxlength:"11"}})],1),i("v-uni-view",{staticClass:"item acea-row row-between-wrapper relative"},[i("v-uni-view",{staticClass:"name"},[t._v("所在地区")]),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 line1"},[t._v(t._s(t.region[0])+""+t._s(t.region[1])+""+t._s(t.region[2]))]),i("v-uni-view",{staticClass:"iconfont icon-xiangyou abs_right"})],1)],1)],1)],1),i("v-uni-view",{staticClass:"item acea-row row-between-wrapper relative"},[i("v-uni-view",{staticClass:"name"},[t._v("详细地址")]),i("v-uni-input",{attrs:{type:"text",placeholder:"请填写具体地址","placeholder-style":"color:#ccc;",name:"detail","placeholder-class":"placeholder",maxlength:"18"},model:{value:t.userAddress.detail,callback:function(e){t.$set(t.userAddress,"detail",e)},expression:"userAddress.detail"}}),i("v-uni-view",{staticClass:"iconfont icon-dizhi font-color abs_right",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.chooseLocation.apply(void 0,arguments)}}})],1)],1),i("v-uni-view",{staticClass:"default acea-row row-middle borRadius14"},[i("v-uni-checkbox-group",{on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.ChangeIsDefault.apply(void 0,arguments)}}},[i("v-uni-checkbox",{attrs:{checked:t.userAddress.isDefault}}),t._v("设置为默认地址")],1)],1),i("v-uni-button",{staticClass:"keepBnt bg-color",attrs:{"form-type":"submit"}},[t._v("立即保存")]),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._e()],1)],1)],1)},a=[]},"7b73":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",{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-red",class:!0===t.homeActive?"on":""},[i("v-uni-navigator",{staticClass:"iconfont icon-shouye-xianxing",attrs:{"hover-class":"none",url:"/pages/index/index","open-type":"switchTab"}}),i("v-uni-navigator",{staticClass:"iconfont icon-caigou-xianxing",attrs:{"hover-class":"none",url:"/pages/order_addcart/order_addcart","open-type":"switchTab"}}),i("v-uni-navigator",{staticClass:"iconfont icon-yonghu1",attrs:{"hover-class":"none",url:"/pages/user/index","open-type":"switchTab"}})],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?"/static/images/close.gif":"/static/images/open.gif"}})],1)],1)],1)],1)},a=[]},9801:function(t,e,i){"use strict";i("7a82"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i("26cb"),a={name:"Home",props:{},data:function(){return{top:"500"}},computed:(0,n.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(){}};e.default=a},9919:function(t,e,i){var n=i("c3ac");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("4f06").default;a("1fd9e685",n,!0,{sourceMap:!1,shadowMode:!1})},a3aa:function(t,e,i){"use strict";var n=i("f6b6"),a=i.n(n);a.a},b151:function(t,e,i){"use strict";var n=i("9919"),a=i.n(n);a.a},b7f1:function(t,e,i){"use strict";i.r(e);var n=i("7b73"),a=i("f72c");for(var s in a)["default"].indexOf(s)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(s);i("a3aa");var r=i("f0c5"),o=Object(r["a"])(a["default"],n["b"],n["c"],!1,null,"47a70398",null,!1,n["a"],void 0);e["default"]=o.exports},c3ac: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/* 文章场景相关 */.addAddress[data-v-67f27ab4]{padding-top:%?20?%}.addAddress .list[data-v-67f27ab4]{background-color:#fff;padding:0 %?24?%}.addAddress .list .item[data-v-67f27ab4]{border-top:%?1?% solid #eee;height:%?90?%;line-height:%?90?%}.addAddress .list .item .name[data-v-67f27ab4]{font-size:%?30?%;color:#333}.addAddress .list .item .address[data-v-67f27ab4]{flex:1;margin-left:%?50?%}.addAddress .list .item uni-input[data-v-67f27ab4]{width:%?475?%;font-size:%?30?%;font-weight:400}.addAddress .list .item .placeholder[data-v-67f27ab4]{color:#ccc}.addAddress .list .item uni-picker .picker[data-v-67f27ab4]{width:%?410?%;font-size:%?30?%}.addAddress .default[data-v-67f27ab4]{padding:0 %?30?%;height:%?90?%;background-color:#fff;margin-top:%?23?%}.addAddress .default uni-checkbox[data-v-67f27ab4]{margin-right:%?15?%}.addAddress .keepBnt[data-v-67f27ab4]{width:%?690?%;height:%?86?%;border-radius:%?50?%;text-align:center;line-height:%?86?%;margin:%?80?% auto %?24?% auto;font-size:%?32?%;color:#fff}.addAddress .wechatAddress[data-v-67f27ab4]{width:%?690?%;height:%?86?%;border-radius:%?50?%;text-align:center;line-height:%?86?%;margin:0 auto;font-size:%?32?%;color:#e93323;border:1px solid #e93323}.relative[data-v-67f27ab4]{position:relative}.icon-dizhi[data-v-67f27ab4]{font-size:%?44?%;z-index:100}.abs_right[data-v-67f27ab4]{position:absolute;right:0}',""]),t.exports=e},d642:function(t,e,i){"use strict";(function(t){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("ac1f"),i("5319"),i("00b4");var a=i("2110"),s=i("bed0"),r=i("1939"),o=i("26cb"),d=n(i("b7f1")),c=(getApp(),{components:{home:d.default},data:function(){return{regionDval:["浙江省","杭州市","滨江区"],cartId:"",pinkId:0,couponId:0,id:0,userAddress:{isDefault:!1},region:["省","市","区"],valueRegion:[0,0,0],isAuto:!1,isShowAuth:!1,district:[],multiArray:[],multiIndex:[0,0,0],cityId:0,defaultRegion:["广东省","广州市","番禺区"],defaultRegionCode:"440113",bargain:!1,combination:!1,secKill:!1}},computed:(0,o.mapGetters)(["isLogin"]),watch:{isLogin:{handler:function(t,e){t&&(this.getUserAddress(),this.getCityList())},deep:!0}},onLoad:function(t){this.isLogin?(this.preOrderNo=t.preOrderNo||0,this.id=t.id||0,uni.setNavigationBarTitle({title:t.id?"修改地址":"添加地址"}),this.getUserAddress(),this.$Cache.has("cityList")?(this.district=this.$Cache.getItem("cityList"),this.initialize()):this.getCityList()):(0,r.toLogin)()},methods:{getCityList:function(){var t=this,e=this;(0,s.getCity)().then((function(i){t.district=i.data;t.$Cache.setItem({name:"cityList",value:i.data,expires:6048e5}),e.initialize()}))},initialize:function(){var t=[],e=[],i=[];if(this.district.length){var n=this.district[0].children||[],a=n.length&&n[0].children||[];this.district.forEach((function(e){t.push(e.name)})),n.forEach((function(t){e.push(t.name)})),a.forEach((function(t){i.push(t.name)})),this.multiArray=[t,e,i]}},bindRegionChange:function(t){var e=this.multiIndex,i=this.district[e[0]]||{children:[]},n=i.children[e[1]]||{cityId: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.cityId,this.valueRegion=[0,0,0],this.initialize()},bindMultiPickerColumnChange:function(t){var e=t.detail.column,i=t.detail.value,n=this.district[i]||{children:[]},a=this.multiArray,s=this.multiIndex;switch(s[e]=i,e){case 0:var r=n.children[0]||{children:[]};a[1]=n.children.map((function(t){return t.name})),a[2]=r.children.map((function(t){return t.name}));break;case 1:var o=this.district[s[0]].children[s[1]].children||[];a[2]=o.map((function(t){return t.name}));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.city_id=e.data.cityId}))},chooseLocation:function(){var t=this;uni.chooseLocation({success:function(e){t.$set(t.userAddress,"detail",e.address.replace(/.+?(省|市|自治区|自治州|县|区)/g,""))}})},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,i.cityId=0,(0,a.editAddress)({address:i,isDefault:1,realName:e.userName,postCode:e.postalCode,phone:e.telNumber,detail:e.detailInfo,id:0}).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/users/order_confirm/index?cartId="+i+"&addressId="+(t.id?t.id:e.data.id)+"&pinkId="+n+"&couponId="+a+"&secKill="+t.secKill+"&combination="+t.combination+"&bargain="+t.bargain})}else uni.navigateBack({delta:1})}),1e3),t.$util.Tips({title:"添加成功",icon:"success"})})).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 e=this,i=this;i.$wechat.openAddress().then((function(t){(0,a.editAddress)({id:e.id,realName:t.userName,phone:t.telNumber,address:{province:t.provinceName,city:t.cityName,district:t.countryName,cityId:0},detail:t.detailInfo,isDefault:1,postCode:t.postalCode}).then((function(){setTimeout((function(){if(i.cartId){var t=i.cartId,e=i.pinkId,n=i.couponId;i.cartId="",i.pinkId="",i.couponId="",uni.navigateTo({url:"/pages/users/order_confirm/index?cartId="+t+"&addressId="+(i.id?i.id:res.data.id)+"&pinkId="+e+"&couponId="+n+"&secKill="+i.secKill+"&combination="+i.combination+"&bargain="+i.bargain})}else uni.navigateTo({url:"/pages/users/user_address_list/index"})}),1e3),i.$util.Tips({title:"添加成功",icon:"success"})})).catch((function(t){return i.$util.Tips({title:t||"添加失败"})}))})).catch((function(e){t.log(e)}))},formSubmit:function(t){var e=this,i=t.detail.value;if(!i.realName)return e.$util.Tips({title:"请填写收货人姓名"});if(!i.phone)return e.$util.Tips({title:"请填写联系电话"});if(!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(i.phone))return e.$util.Tips({title:"请输入正确的手机号码"});if("省-市-区"==e.region)return e.$util.Tips({title:"请选择所在地区"});if(!i.detail)return e.$util.Tips({title:"请填写详细地址"});i.id=e.id;var n=e.region;i.address={province:n[0],city:n[1],district:n[2],cityId:e.cityId},i.isDefault=e.userAddress.isDefault,uni.showLoading({title:"保存中",mask:!0}),(0,a.editAddress)(i).then((function(t){e.id?e.$util.Tips({title:"修改成功",icon:"success"}):e.$util.Tips({title:"添加成功",icon:"success"}),setTimeout((function(){if(!(e.preOrderNo>0))return history.back();uni.redirectTo({url:"/pages/users/order_confirm/index?preOrderNo="+e.preOrderNo+"&addressId="+(e.id?e.id:t.data.id)})}),1e3)})).catch((function(t){return e.$util.Tips({title:t})}))},ChangeIsDefault:function(t){this.$set(this.userAddress,"isDefault",!this.userAddress.isDefault)}}});e.default=c}).call(this,i("5a52")["default"])},f6b6:function(t,e,i){var n=i("2799");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var a=i("4f06").default;a("2ff3027d",n,!0,{sourceMap:!1,shadowMode:!1})},f72c:function(t,e,i){"use strict";i.r(e);var n=i("9801"),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}}]);