zx/public/static/js/pages-users-user_address-in...

1 line
18 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-index"],{"029d":function(t,e,n){var i=n("c86c");e=i(!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-2fe1d6d4] uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked,[data-v-2fe1d6d4] uni-checkbox .wx-checkbox-input.wx-checkbox-input-checked{border:1px solid var(--view-theme)!important;background-color:var(--view-theme)!important;color:#fff!important}.addAddress .list[data-v-2fe1d6d4]{background-color:#fff}.addAddress .list .item[data-v-2fe1d6d4]{padding:%?30?%;border-top:1px solid #eee;position:relative}.addAddress .list .item .location[data-v-2fe1d6d4]{position:absolute;right:%?30?%;top:%?15?%;text-align:center;font-size:%?20?%}.addAddress .list .item .location .iconfont[data-v-2fe1d6d4]{color:var(--view-theme)}.addAddress .list .item .name[data-v-2fe1d6d4]{width:%?195?%;font-size:%?30?%;color:#333}.addAddress .list .item .address[data-v-2fe1d6d4]{flex:1;margin-left:%?20?%}.addAddress .list .item uni-input[data-v-2fe1d6d4], .region .region_count[data-v-2fe1d6d4]{width:%?475?%;font-size:%?30?%;box-sizing:border-box}.region .region_count[data-v-2fe1d6d4]{height:%?42?%;line-height:%?42?%}.region .region_count .icon-xiangyou[data-v-2fe1d6d4]{float:right}.addAddress .list .location-input[data-v-2fe1d6d4]{padding-right:%?70?%}.addAddress .list .item .placeholder[data-v-2fe1d6d4]{color:#ccc}.addAddress .list .item uni-picker[data-v-2fe1d6d4]{width:%?475?%}.addAddress .list .item uni-picker .picker[data-v-2fe1d6d4]{width:%?410?%;font-size:%?30?%}.addAddress .list .item uni-picker .iconfont[data-v-2fe1d6d4]{font-size:%?43?%}.addAddress .default[data-v-2fe1d6d4]{padding:0 %?30?%;height:%?90?%;background-color:#fff;margin-top:%?23?%}.addAddress .default uni-checkbox[data-v-2fe1d6d4]{margin-right:%?15?%}.addAddress .keepBnt[data-v-2fe1d6d4]{width:%?690?%;height:%?86?%;border-radius:%?50?%;text-align:center;line-height:%?86?%;margin:%?50?% auto;font-size:%?32?%;color:#fff;background-color:var(--view-theme)}.addAddress .keepBnt[disabled][data-v-2fe1d6d4]{background:#bbb}.addAddress .wechatAddress[data-v-2fe1d6d4]{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},"295a":function(t,e,n){"use strict";var i=n("a876"),d=n.n(i);d.a},"7e00":function(t,e,n){"use strict";n("6a54");var i=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.arrivalNoticeApi=function(t){return r.default.post("store/product/increase_take",t)},e.bagExplain=function(){return r.default.get("store/product/bag/explain")},e.bagRecommend=function(){return r.default.get("product/spu/bag/recommend")},e.collectAdd=function(t){return r.default.post("user/relation/create",t)},e.collectAll=function(t){return r.default.post("user/relation/batch/create",t)},e.collectDel=function(t){return r.default.post("user/relation/delete",t)},e.copyPasswordApi=function(t){return r.default.get("product/spu/copy",t,{noAuth:!0})},e.copyPasswordSearch=function(t){return r.default.get("command/copy",t,{noAuth:!0})},e.create=function(t){return r.default.post("intention/create",t)},e.discountsCartAdd=function(t){return r.default.post("user/cart/batchCreate",t)},e.express=function(t){return r.default.post("ordero/express/"+t,{noAuth:!0})},e.followStore=function(t){return r.default.post("user/relation/create",{type:10,type_id:t})},e.getApplicationRecordList=function(t){return r.default.get("intention/lst",t)},e.getBrandlist=function(t){return r.default.get("store/product/brand/lst",t,{noAuth:!0})},e.getBroadcastListApi=function(t){return r.default.get("broadcast/lst",t,{noAuth:!0})},e.getCaptcha=function(){return r.default.get("captcha")},e.getCategoryList=function(){return r.default.get("store/product/category/lst",{},{noAuth:!0})},e.getCollectUserList=function(t){return r.default.get("user/relation/product/lst",t)},e.getCouponProductlist=function(t){t.brand_id&&Array.isArray(t.brand_id)&&(t=(0,d.default)({},t),t.brand_id=t.brand_id.toString());return r.default.get("product/spu/coupon_product",t,{noAuth:!0})},e.getDiscountsLst=function(t){return r.default.get("discounts/lst",t,{noAuth:!0})},e.getGeocoder=function(t){return r.default.get("lbs/geocoder?location=".concat(t.lat,",").concat(t.long),{},{noAuth:!0})},e.getGoodsDetails=function(t){return r.default.get("intention/detail/"+t,{})},e.getGroomList=function(t,e){return r.default.get("product/spu/hot/"+t,e,{noAuth:!0})},e.getHotBanner=function(t){return r.default.get("common/hot_banner/"+t,{},{noAuth:!0})},e.getHotRanking=function(){return r.default.get("product/spu/hot_top",{},{noAuth:!0})},e.getLiveList=function(t){return r.default.get("broadcast/hot",t,{noAuth:!0})},e.getMerProductHot=function(t,e){return r.default.get("product/spu/recommend",{page:void 0===e.page?1:e.page,limit:void 0===e.limit?10:e.limit,mer_id:t||""},{noAuth:!0})},e.getMerchantLst=function(t){return r.default.get("user/relation/merchant/lst",t,{noAuth:!0})},e.getParmasList=function(t){return r.default.get("product/spu/params",t,{noAuth:!0})},e.getParmasValue=function(t){return r.default.get("product/spu/params_value/".concat(t),{},{noAuth:!0})},e.getPresellProductDetail=function(t){return r.default.get("store/product/presell/detail/"+t,{},{noAuth:!0})},e.getPreviewProDetail=function(t){return r.default.get("store/product/preview",t,{noAuth:!0})},e.getProductCode=function(t,e){return r.default.get("store/product/qrcode/"+t,e,{noAuth:!0})},e.getProductDetail=function(t){return r.default.get("store/product/detail/"+t,{},{noAuth:!0})},e.getProductHot=function(t,e){return r.default.get("product/spu/recommend",{page:void 0===t?1:t,limit:void 0===e?10:e},{noAuth:!0})},e.getProductParmas=function(t){return r.default.get("store/product/show/"+t,{},{noAuth:!0})},e.getProductslist=function(t){t.brand_id&&Array.isArray(t.brand_id)&&(t=(0,d.default)({},t),t.brand_id=t.brand_id.toString());return r.default.get("product/spu/lst",t,{noAuth:!0})},e.getReplyConfig=function(t){return r.default.get("reply/config/"+t)},e.getReplyList=function(t,e){return r.default.get("store/product/reply/lst/"+t,e,{noAuth:!0})},e.getSearchKeyword=function(){return r.default.get("common/hot_keyword",{},{noAuth:!0})},e.getSeckillProductDetail=function(t,e){return r.default.get("store/product/seckill/detail/"+t,e,{noAuth:!0})},e.getStoreCategory=function(t,e){return r.default.get("store/merchant/category/lst/"+t,e,{noAuth:!0})},e.getStoreCoupon=function(t){return r.default.get("coupon/store/"+t,{noAuth:!0})},e.getStoreDetail=function(t,e){return r.default.get("store/merchant/detail/"+t,e,{noAuth:!0})},e.getStoreGoods=function(t,e){return r.default.get("product/spu/merchant/"+t,e,{noAuth:!0})},e.getStoreRecommend=function(t){return r.default.get("store/product/good_list/"+t,{},{noAuth:!0})},e.getStoreTypeApi=function(t){return r.default.get("intention/type",t,{noAuth:!0})},e.getTodayHotSearch=function(){return r.default.get("product/spu/hot_lst",{},{noAuth:!0})},e.merClassifly=function(){return r.default.get("intention/cate",{},{noAuth:!0})},e.merchantProduct=function(t,e){e.brand_id&&Array.isArray(e.brand_id)&&(e=(0,d.default)({},e),e.brand_id=e.brand_id.toString());return r.default.get("product/spu/merchant/"+t,e,{noAuth:!0})},e.merchantQrcode=function(t,e){return r.default.get("store/merchant/qrcode/"+t,e,{noAuth:!0})},e.postCartAdd=function(t){return r.default.post("user/cart/create",t)},e.priceRuleApi=function(t){return r.default.get("store/product/price_rule/".concat(t),{},{noAuth:!0})},e.productBag=function(t){return r.default.get("product/spu/bag",t,{noAuth:!0})},e.storeCategory=function(t){return r.default.get("store/product/category",t,{noAuth:!0})},e.storeCertificate=function(t){return r.default.post("store/certificate/".concat(t.merId),t)},e.storeMerchantList=function(t){return r.default.get("store/merchant/lst",t,{noAuth:!0})},e.storeServiceList=function(t,e){return r.default.get("product/spu/local/".concat(t),e,{noAuth:!0})},e.unfollowStore=function(t){return r.default.post("user/relation/delete",{type:10,type_id:t})},e.updateGoodsRecord=function(t,e){return r.default.post("intention/update/"+t,e)},e.userCollectDel=function(t){return r.default.post("user/relation/batch/delete",t)},e.verify=function(t){return r.default.post("auth/verify",t)},n("c9b5"),n("bf0f"),n("ab80"),n("c223");var d=i(n("9b1b")),r=i(n("fea3"))},"9d65":function(t,e,n){"use strict";n.r(e);var i=n("d5bf"),d=n("d3fe");for(var r in d)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return d[t]}))}(r);n("295a");var o=n("828b"),a=Object(o["a"])(d["default"],i["b"],i["c"],!1,null,"2fe1d6d4",null,!1,i["a"],void 0);e["default"]=a.exports},a876:function(t,e,n){var i=n("029d");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var d=n("967d").default;d("fb23f83c",i,!0,{sourceMap:!1,shadowMode:!1})},d3fe:function(t,e,n){"use strict";n.r(e);var i=n("ee46"),d=n.n(i);for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);e["default"]=d.a},d5bf:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return d})),n.d(e,"a",(function(){}));var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("v-uni-view",{style:t.viewColor},[n("v-uni-form",{attrs:{"report-submit":"true"},on:{submit:function(e){arguments[0]=e=t.$handleEvent(e),t.formSubmit.apply(void 0,arguments)}}},[n("v-uni-view",{staticClass:"addAddress"},[n("v-uni-view",{staticClass:"list"},[n("v-uni-view",{staticClass:"item acea-row row-between-wrapper"},[n("v-uni-view",{staticClass:"name"},[t._v("姓名")]),n("v-uni-input",{attrs:{type:"text",placeholder:"请输入姓名",name:"real_name",value:t.userAddress.real_name,"placeholder-class":"placeholder"}})],1),n("v-uni-view",{staticClass:"item acea-row row-between-wrapper"},[n("v-uni-view",{staticClass:"name"},[t._v("联系电话")]),n("v-uni-input",{attrs:{type:"text",placeholder:"请输入联系电话",name:"phone",value:t.userAddress.phone,"placeholder-class":"placeholder"}})],1),n("v-uni-view",{staticClass:"item acea-row row-between-wrapper"},[n("v-uni-view",{staticClass:"name"},[t._v("所在地区")]),n("v-uni-view",{staticClass:"region"},[n("v-uni-view",{staticClass:"region_count",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.changeRegion.apply(void 0,arguments)}}},[t.addressInfo.length?n("v-uni-text",[t._v(t._s(t.addressText))]):n("v-uni-text",{staticStyle:{color:"#cdcdcd"}},[t._v("请选择地址")]),n("v-uni-text",{staticClass:"iconfont icon-xiangyou"})],1)],1)],1),n("v-uni-view",{staticClass:"item acea-row row-between-wrapper"},[n("v-uni-view",{staticClass:"name"},[t._v("详细地址")]),n("v-uni-input",{staticClass:"location-input",attrs:{type:"text",placeholder:"请填写具体地址",name:"detail","placeholder-class":"placeholder"},model:{value:t.userAddress.detail,callback:function(e){t.$set(t.userAddress,"detail",e)},expression:"userAddress.detail"}}),n("v-uni-view",{staticClass:"location",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.selfLocation.apply(void 0,arguments)}}},[n("v-uni-text",{staticClass:"iconfont icon-chakanditu"}),n("br"),t._v("定位")],1)],1)],1),n("v-uni-view",{staticClass:"default acea-row row-middle"},[n("v-uni-checkbox-group",{on:{change:function(e){arguments[0]=e=t.$handleEvent(e),t.ChangeIsDefault.apply(void 0,arguments)}}},[n("v-uni-checkbox",{attrs:{checked:!!t.userAddress.is_default}}),t._v("设置为默认地址")],1)],1),n("v-uni-button",{staticClass:"keepBnt",attrs:{"form-type":"submit",disabled:t.loading}},[t._v("立即保存")]),this.$wechat.isWeixin()&&!t.address_id?n("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),n("areaWindow",{ref:"areaWindow",attrs:{display:t.display,address:t.addressInfo},on:{submit:function(e){arguments[0]=e=t.$handleEvent(e),t.OnChangeAddress.apply(void 0,arguments)},changeClose:function(e){arguments[0]=e=t.$handleEvent(e),t.changeClose.apply(void 0,arguments)}}})],1)},d=[]},ee46:function(t,e,n){"use strict";n("6a54");var i=n("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("fd3c"),n("c9b5"),n("bf0f"),n("ab80"),n("5c47"),n("0506");var d=i(n("9b1b")),r=n("672a"),o=n("02aa"),a=n("8f59"),s=i(n("f1d3")),u=n("7e00"),c=n("e44d"),l={components:{areaWindow:s.default},data:function(){return{cartId:"",pinkId:0,couponId:0,address_id:0,productType:0,userAddress:{is_default:!1},region:["省","市","区"],valueRegion:[0,0,0],district:[],multiArray:[],multiIndex:[0,0,0],cityId:0,display:!1,addressInfo:[],latitude:"",longitude:"",loading:!1}},computed:(0,d.default)((0,d.default)({},(0,a.mapGetters)(["isLogin","viewColor"])),{},{addressText:function(){return this.addressInfo.map((function(t){return t.name})).join("/")}}),onLoad:function(t){this.isLogin?(this.cartId=t.cartId||"",this.pinkId=t.pinkId||0,this.couponId=t.couponId||0,this.address_id=t.id||0,this.productType=t.product_type||0,uni.setNavigationBarTitle({title:t.id?"修改地址":"添加地址"}),this.getUserAddress(),this.getCityList()):(0,c.toLogin)()},methods:{OnChangeAddress:function(t){this.addressInfo=t},getCityList:function(){var t=this;(0,o.getCityV2)(0).then((function(e){t.district=e.data}))},changeRegion:function(){this.display=!0},changeClose:function(){this.display=!1},getUserAddress:function(){if(!this.address_id)return!1;var t=this;(0,r.getAddressDetail)(this.address_id).then((function(e){var n=[e.data.province,e.data.city,e.data.district];t.$set(t,"userAddress",e.data),t.$set(t,"region",n),t.city_id=e.data.city_id,t.addressInfo=e.data.area}))},getWxAddress:function(){var t=this;uni.authorize({scope:"scope.address",success:function(e){uni.chooseAddress({success:function(e){(0,o.getCityList)(e.provinceName+"/"+e.cityName+"/"+e.countyName).then((function(e){t.addressInfo=e.data})),t.userAddress.real_name=e.userName,t.userAddress.phone=e.telNumber,t.userAddress.detail=e.detailInfo},fail:function(e){if(uni.showToast({title:e.errMsg,icon:"none",duration:1e3}),"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,o.getCityList)(e.provinceName+"/"+e.cityName+"/"+e.countryName).then((function(e){t.addressInfo=e.data})),t.userAddress.real_name=e.userName,t.userAddress.phone=e.telNumber,t.userAddress.detail=e.detailInfo})).catch((function(t){}))},selfLocation:function(){var t=this;uni.showLoading({title:"定位中",mask:!0}),uni.getLocation({type:"gcj02",success:function(e){var n,i;n=e.latitude.toString(),i=e.longitude.toString(),t.latitude=e.latitude,t.longitude=e.longitude,(0,u.getGeocoder)({lat:n,long:i}).then((function(e){var n=e.data;(0,o.getCityList)(n.address_component.province+"/"+n.address_component.city+"/"+n.address_component.district+"/"+(n.address_reference.town?n.address_reference.town.title:"")).then((function(e){t.addressInfo=e.data,t.$set(t.userAddress,"detail",n.formatted_addresses.recommend),uni.hideLoading()})).catch((function(t){uni.hideLoading(),uni.showToast({title:"定位匹配失败,请手动输入地址",icon:"none",duration:1e3})}))})).catch((function(t){uni.hideLoading(),uni.showToast({title:"定位获取失败,请手动输入地址",icon:"none",duration:1e3})}))},fail:function(t){uni.hideLoading(),uni.showToast({title:t.errMsg,icon:"none",duration:1e3})}})},formSubmit:function(t){var e=this,n=t.detail.value;return n.real_name?n.phone?/^1(3|4|5|7|8|9|6)\d{9}$/i.test(n.phone)?e.addressInfo.length?n.detail?(n.address_id=e.address_id,n.is_default=e.userAddress.is_default?1:0,n.area=e.addressInfo,uni.showLoading({title:"保存中",mask:!0}),e.loading=!0,void(0,r.editAddress)(n).then((function(t){e.address_id?e.$util.Tips({title:"修改成功",icon:"success"}):e.$util.Tips({title:"添加成功",icon:"success"}),setTimeout((function(){if(!e.cartId)return history.back();var n=e.cartId,i=e.pinkId,d=e.couponId;e.cartId="",e.pinkId="",e.couponId="",uni.$emit("updataAddress"),20==e.productType?uni.navigateTo({url:"/pages/points_mall/integral_order?cartId="+n+"&addressId="+(e.id?e.id:t.data.address_id)+"&pinkId="+i+"&couponId="+d}):uni.navigateTo({url:"/pages/users/order_confirm/index?cartId="+n+"&addressId="+(e.id?e.id:t.data.address_id)+"&pinkId="+i+"&couponId="+d}),e.loading=!1}),1e3)})).catch((function(t){return e.loading=!1,e.$util.Tips({title:t})}))):e.$util.Tips({title:"请填写详细地址"}):e.$util.Tips({title:"请选择所在地区"}):e.$util.Tips({title:"请输入正确的手机号码"}):e.$util.Tips({title:"请填写联系电话"}):e.$util.Tips({title:"请填写收货人姓名"})},ChangeIsDefault:function(t){this.$set(this.userAddress,"is_default",!this.userAddress.is_default)}}};e.default=l}}]);