徐总多门店
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
8.3 KiB

require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/users/user_address/index"],{"5b96":function(e,t,i){},"6fe9":function(e,t,i){"use strict";i.d(t,"b",(function(){return n})),i.d(t,"c",(function(){return s})),i.d(t,"a",(function(){}));var n=function(){var e=this.$createElement,t=(this._self._c,this.addressInfo.length);this.$mp.data=Object.assign({},{$root:{g0:t}})},s=[]},"87e3":function(e,t,i){"use strict";i.r(t);var n=i("e677"),s=i.n(n);for(var d in n)["default"].indexOf(d)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(d);t["default"]=s.a},a2ed:function(e,t,i){"use strict";(function(e,t){var n=i("47a9");i("7561");n(i("3240"));var s=n(i("d9c5"));e.__webpack_require_UNI_MP_PLUGIN__=i,t(s.default)}).call(this,i("3223")["default"],i("df3c")["createPage"])},d9c5:function(e,t,i){"use strict";i.r(t);var n=i("6fe9"),s=i("87e3");for(var d in s)["default"].indexOf(d)<0&&function(e){i.d(t,e,(function(){return s[e]}))}(d);i("f00f");var o=i("828b"),r=Object(o["a"])(s["default"],n["b"],n["c"],!1,null,"bf3a8dd8",null,!1,n["a"],void 0);t["default"]=r.exports},e677:function(e,t,i){"use strict";(function(e){var n=i("47a9");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=n(i("7ca3")),d=i("77d7"),o=(i("a230"),i("7ba4")),r=i("8f59"),a=n(i("cef6")),c=n(i("1146"));function u(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function l(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?u(Object(i),!0).forEach((function(t){(0,s.default)(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):u(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var f={components:{areaWindow:function(){Promise.all([i.e("common/vendor"),i.e("components/areaWindow/index")]).then(function(){return resolve(i("e740"))}.bind(null,i)).catch(i.oe)},home:function(){Promise.all([i.e("common/vendor"),i.e("components/home/index")]).then(function(){return resolve(i("b7a2"))}.bind(null,i)).catch(i.oe)}},mixins:[a.default],data:function(){return{cartId:"",pinkId:0,couponId:0,id:0,userAddress:{is_default:!1},isAuto:!1,isShowAuth:!1,district:[],news:"",noCoupon:0,display:!1,addressInfo:[],addressVal:"",latitude:"",longitude:"",city_id:0,addressValue:"",deliveryType:1,store_name:"",storeId:0,product_id:0,fromType:0}},computed:l(l({},(0,r.mapGetters)(["isLogin"])),{},{addressText:function(){return this.addressInfo.map((function(e){return e.label})).join("/")}}),watch:{isLogin:{handler:function(e,t){},deep:!0}},onLoad:function(t){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||"",this.deliveryType=t.delivery_type||1,this.store_name=t.store_name,this.storeId=t.store_id,this.product_id=t.product_id,this.fromType=t.fromType,e.setNavigationBarTitle({title:t.id?"修改地址":"添加地址"}),this.isLogin?this.getUserAddress():(0,o.toLogin)()},onShow:function(){e.removeStorageSync("form_type_cart")},methods:{onLoadFun:function(){this.getUserAddress(),this.isShowAuth=!1},authColse:function(e){this.isShowAuth=e},changeRegion:function(){this.display=!0},OnChangeAddress:function(e){this.latitude="",this.longitude="",this.addressInfo=e},changeClose:function(){this.display=!1},getUserAddress:function(){if(!this.id)return!1;var e=this;(0,d.getAddressDetail)(this.id).then((function(t){t.data.province,t.data.city,t.data.district,t.data.street;e.$set(e,"userAddress",t.data),e.addressInfo=t.data.city_list,e.latitude=t.data.latitude,e.longitude=t.data.longitude,e.city_id=t.data.city_id}))},chooseLocation:function(){var t=this,i=this;e.chooseLocation({success:function(e){var n,s;n=e.latitude.toString(),s=e.longitude.toString(),t.latitude=e.latitude,t.longitude=e.longitude,(0,d.getGeocoder)({lat:n,long:s}).then((function(e){var t=e.data;(0,d.getCityList)(t.address_component.province+"/"+t.address_component.city+"/"+t.address_component.district+"/"+(t.address_reference.town?t.address_reference.town.title:"")).then((function(e){i.addressInfo=e.data,i.userAddress.detail=t.formatted_addresses.recommend})).catch((function(e){i.$util.Tips({title:e})}))}))},fail:function(e){}})},selfLocation:function(){var t=this,i=this;e.showLoading({title:"定位中",mask:!0}),e.getLocation({type:"gcj02",success:function(n){var s,o;s=n.latitude.toString(),o=n.longitude.toString(),t.latitude=n.latitude,t.longitude=n.longitude,(0,d.getGeocoder)({lat:s,long:o}).then((function(t){var n=t.data;(0,d.getCityList)(n.address_component.province+"/"+n.address_component.city+"/"+n.address_component.district+"/"+(n.address_reference.town?n.address_reference.town.title:"")).then((function(t){i.addressInfo=t.data,i.userAddress.detail=n.formatted_addresses.recommend,e.hideLoading()}))}))},fail:function(t){e.hideLoading(),e.showToast({title:t,icon:"none",duration:1e3})}})},getWxAddress:function(){var t=this;e.authorize({scope:"scope.address",success:function(i){e.chooseAddress({success:function(e){(0,d.getCityList)(e.provinceName+"/"+e.cityName+"/"+e.countyName+"/"+e.streetName).then((function(e){t.addressInfo=e.data})).catch((function(e){return t.$util.Tips({title:e})})),t.userAddress.real_name=e.userName,t.userAddress.phone=e.telNumber,t.userAddress.detail=e.detailInfo},fail:function(e){if("chooseAddress:cancel"==e.errMsg)return t.$util.Tips({title:"取消选择"})}})},fail:function(i){e.showModal({title:"您已拒绝导入微信地址权限",content:"是否进入权限管理,调整授权?",success:function(i){if(i.confirm)e.openSetting({success:function(e){}});else if(i.cancel)return t.$util.Tips({title:"已取消!"})}})}})},getAddress:function(){var e=this;e.$wechat.openAddress().then((function(t){(0,d.getCityList)(t.provinceName+"/"+t.cityName+"/"+t.countryName+"/"+t.streetName).then((function(t){e.addressInfo=t.data})),e.userAddress.real_name=t.userName,e.userAddress.phone=t.telNumber,e.userAddress.detail=t.detailInfo})).catch((function(t){e.$util.Tips({title:t})}))},formSubmit:function(t){var i=this,n=t.detail.value;if(!n.real_name)return i.$util.Tips({title:"请填写收货人姓名"});if(!n.phone)return i.$util.Tips({title:"请填写联系电话"});if(!/^1(3|4|5|7|8|9|6)\d{9}$/i.test(n.phone))return i.$util.Tips({title:"请输入正确的手机号码"});if(!i.addressInfo.length)return i.$util.Tips({title:"请选择所在地区"});if(i.addressInfo.length<3)return i.$util.Tips({title:"请补全所在地区信息"});if(!n.detail)return i.$util.Tips({title:"请填写详细地址"});n.id=i.id;var s=i.addressInfo;n.address={province:s[0].label,city:s[1].label,district:s[2].label,street:s[3]?s[3].label:"",city_id:s[s.length-1].id?s[s.length-1].id:i.city_id},n.is_default=i.userAddress.is_default?1:0,n.longitude=i.longitude,n.latitude=i.latitude,e.showLoading({title:"保存中",mask:!0}),(0,d.editAddress)(n).then((function(t){i.id?i.$util.Tips({title:"修改成功",icon:"success"}):i.$util.Tips({title:"添加成功",icon:"success"}),setTimeout((function(){if(i.cartId){var n=i.cartId,s=i.pinkId,d=i.couponId;i.cartId="",i.pinkId="",i.couponId="",e.navigateTo({url:"/pages/goods/order_confirm/index?new="+i.news+"&cartId="+n+"&addressId="+(i.id?i.id:t.data.id)+"&pinkId="+s+"&couponId="+d+"&noCoupon="+i.noCoupon+"&delivery_type="+i.deliveryType+"&store_id="+i.storeId+"&store_name="+i.store_name+"&product_id="+i.product_id})}else i.fromType?(e.$emit("activeAddress"),e.navigateBack()):e.navigateTo({url:"/pages/users/user_address_list/index"})}),1e3)})).catch((function(e){return i.$util.Tips({title:e})}))},ChangeIsDefault:function(e){this.$set(this.userAddress,"is_default",!this.userAddress.is_default)},identify:function(){var e=this,t=(0,c.default)(this.addressValue.trim(),{type:0,textFilter:[],nameMaxLength:4});this.addressValue.trim()&&(0,d.getCityList)(t.province+"/"+t.city+"/"+t.area).then((function(i){e.addressInfo=i.data,e.userAddress.phone=t.phone,e.userAddress.real_name=t.name,e.userAddress.detail=t.detail})).catch((function(t){return e.$util.Tips({title:t})}))}}};t.default=f}).call(this,i("df3c")["default"])},f00f:function(e,t,i){"use strict";var n=i("5b96"),s=i.n(n);s.a}},[["a2ed","common/runtime","common/vendor","pages/users/common/vendor"]]]);