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
18 KiB
1 lines
18 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-users-user_address-index"],{"0819":function(t,e,n){var i=n("24fb");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-1968d1ff] uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked,[data-v-1968d1ff] 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-1968d1ff]{background-color:#fff}.addAddress .list .item[data-v-1968d1ff]{padding:%?30?%;border-top:1px solid #eee;position:relative}.addAddress .list .item .location[data-v-1968d1ff]{position:absolute;right:%?30?%;top:%?15?%;text-align:center;font-size:%?20?%}.addAddress .list .item .location .iconfont[data-v-1968d1ff]{color:var(--view-theme)}.addAddress .list .item .name[data-v-1968d1ff]{width:%?195?%;font-size:%?30?%;color:#333}.addAddress .list .item .address[data-v-1968d1ff]{flex:1;margin-left:%?20?%}.addAddress .list .item uni-input[data-v-1968d1ff], .region .region_count[data-v-1968d1ff]{width:%?475?%;font-size:%?30?%;box-sizing:border-box}.region .region_count[data-v-1968d1ff]{height:%?42?%;line-height:%?42?%}.region .region_count .icon-xiangyou[data-v-1968d1ff]{float:right}.addAddress .list .location-input[data-v-1968d1ff]{padding-right:%?70?%}.addAddress .list .item .placeholder[data-v-1968d1ff]{color:#ccc}.addAddress .list .item uni-picker[data-v-1968d1ff]{width:%?475?%}.addAddress .list .item uni-picker .picker[data-v-1968d1ff]{width:%?410?%;font-size:%?30?%}.addAddress .list .item uni-picker .iconfont[data-v-1968d1ff]{font-size:%?43?%}.addAddress .default[data-v-1968d1ff]{padding:0 %?30?%;height:%?90?%;background-color:#fff;margin-top:%?23?%}.addAddress .default uni-checkbox[data-v-1968d1ff]{margin-right:%?15?%}.addAddress .keepBnt[data-v-1968d1ff]{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-1968d1ff]{background:#bbb}.addAddress .wechatAddress[data-v-1968d1ff]{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},"09cb":function(t,e,n){var i=n("0819");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var r=n("4f06").default;r("e2770e20",i,!0,{sourceMap:!1,shadowMode:!1})},"43a5":function(t,e,n){"use strict";n("7a82");var i=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,n("d81d"),n("d401"),n("d3b7"),n("25f0"),n("ac1f"),n("00b4");var r=i(n("5530")),o=n("6859"),d=n("58d4"),a=n("26cb"),s=i(n("b9eb")),u=n("736f"),c=n("ddb3"),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,r.default)((0,r.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,d.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,o.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,d.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,d.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,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(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,o.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,r=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="+r}):uni.navigateTo({url:"/pages/users/order_confirm/index?cartId="+n+"&addressId="+(e.id?e.id:t.data.address_id)+"&pinkId="+i+"&couponId="+r}),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},"6e49":function(t,e,n){"use strict";n.r(e);var i=n("b4da"),r=n("fb6b");for(var o in r)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(o);n("79f6");var d=n("f0c5"),a=Object(d["a"])(r["default"],i["b"],i["c"],!1,null,"1968d1ff",null,!1,i["a"],void 0);e["default"]=a.exports},"736f":function(t,e,n){"use strict";n("7a82");var i=n("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.arrivalNoticeApi=function(t){return o.default.post("store/product/increase_take",t)},e.bagExplain=function(){return o.default.get("store/product/bag/explain")},e.bagRecommend=function(){return o.default.get("product/spu/bag/recommend")},e.collectAdd=function(t){return o.default.post("user/relation/create",t)},e.collectAll=function(t){return o.default.post("user/relation/batch/create",t)},e.collectDel=function(t){return o.default.post("user/relation/delete",t)},e.copyPasswordApi=function(t){return o.default.get("product/spu/copy",t,{noAuth:!0})},e.copyPasswordSearch=function(t){return o.default.get("command/copy",t,{noAuth:!0})},e.create=function(t){return o.default.post("intention/create",t)},e.discountsCartAdd=function(t){return o.default.post("user/cart/batchCreate",t)},e.express=function(t){return o.default.post("ordero/express/"+t,{noAuth:!0})},e.followStore=function(t){return o.default.post("user/relation/create",{type:10,type_id:t})},e.getApplicationRecordList=function(t){return o.default.get("intention/lst",t)},e.getBrandlist=function(t){return o.default.get("store/product/brand/lst",t,{noAuth:!0})},e.getBroadcastListApi=function(t){return o.default.get("broadcast/lst",t,{noAuth:!0})},e.getCaptcha=function(){return o.default.get("captcha")},e.getCategoryList=function(){return o.default.get("store/product/category/lst",{},{noAuth:!0})},e.getCollectUserList=function(t){return o.default.get("user/relation/product/lst",t)},e.getCouponProductlist=function(t){t.brand_id&&Array.isArray(t.brand_id)&&(t=(0,r.default)({},t),t.brand_id=t.brand_id.toString());return o.default.get("product/spu/coupon_product",t,{noAuth:!0})},e.getDiscountsLst=function(t){return o.default.get("discounts/lst",t,{noAuth:!0})},e.getGeocoder=function(t){return o.default.get("lbs/geocoder?location=".concat(t.lat,",").concat(t.long),{},{noAuth:!0})},e.getGoodsDetails=function(t){return o.default.get("intention/detail/"+t,{})},e.getGroomList=function(t,e){return o.default.get("product/spu/hot/"+t,e,{noAuth:!0})},e.getHotBanner=function(t){return o.default.get("common/hot_banner/"+t,{},{noAuth:!0})},e.getHotRanking=function(){return o.default.get("product/spu/hot_top",{},{noAuth:!0})},e.getLiveList=function(t){return o.default.get("broadcast/hot",t,{noAuth:!0})},e.getMerProductHot=function(t,e){return o.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 o.default.get("user/relation/merchant/lst",t,{noAuth:!0})},e.getParmasList=function(t){return o.default.get("product/spu/params",t,{noAuth:!0})},e.getParmasValue=function(t){return o.default.get("product/spu/params_value/".concat(t),{},{noAuth:!0})},e.getPresellProductDetail=function(t){return o.default.get("store/product/presell/detail/"+t,{},{noAuth:!0})},e.getPreviewProDetail=function(t){return o.default.get("store/product/preview",t,{noAuth:!0})},e.getProductCode=function(t,e){return o.default.get("store/product/qrcode/"+t,e)},e.getProductDetail=function(t){return o.default.get("store/product/detail/"+t,{},{noAuth:!0})},e.getProductHot=function(t,e){return o.default.get("product/spu/recommend",{page:void 0===t?1:t,limit:void 0===e?10:e},{noAuth:!0})},e.getProductParmas=function(t){return o.default.get("store/product/show/"+t,{},{noAuth:!0})},e.getProductslist=function(t){t.brand_id&&Array.isArray(t.brand_id)&&(t=(0,r.default)({},t),t.brand_id=t.brand_id.toString());return o.default.get("product/spu/lst",t,{noAuth:!0})},e.getReplyConfig=function(t){return o.default.get("reply/config/"+t)},e.getReplyList=function(t,e){return o.default.get("store/product/reply/lst/"+t,e,{noAuth:!0})},e.getSearchKeyword=function(){return o.default.get("common/hot_keyword",{},{noAuth:!0})},e.getSeckillProductDetail=function(t){return o.default.get("store/product/seckill/detail/"+t,{},{noAuth:!0})},e.getStoreCategory=function(t,e){return o.default.get("store/merchant/category/lst/"+t,e,{noAuth:!0})},e.getStoreCoupon=function(t){return o.default.get("coupon/store/"+t,{noAuth:!0})},e.getStoreDetail=function(t,e){return o.default.get("store/merchant/detail/"+t,e,{noAuth:!0})},e.getStoreGoods=function(t,e){return o.default.get("product/spu/merchant/"+t,e,{noAuth:!0})},e.getStoreRecommend=function(t){return o.default.get("store/product/good_list/"+t,{},{noAuth:!0})},e.getStoreTypeApi=function(t){return o.default.get("intention/type",t,{noAuth:!0})},e.getTodayHotSearch=function(){return o.default.get("product/spu/hot_lst",{},{noAuth:!0})},e.merClassifly=function(){return o.default.get("intention/cate",{},{noAuth:!0})},e.merchantProduct=function(t,e){e.brand_id&&Array.isArray(e.brand_id)&&(e=(0,r.default)({},e),e.brand_id=e.brand_id.toString());return o.default.get("product/spu/merchant/"+t,e,{noAuth:!0})},e.merchantQrcode=function(t,e){return o.default.get("store/merchant/qrcode/"+t,e,{noAuth:!0})},e.postCartAdd=function(t){return o.default.post("user/cart/create",t)},e.priceRuleApi=function(t){return o.default.get("store/product/price_rule/".concat(t),{},{noAuth:!0})},e.productBag=function(t){return o.default.get("product/spu/bag",t,{noAuth:!0})},e.storeCategory=function(t){return o.default.get("store/product/category",t,{noAuth:!0})},e.storeCertificate=function(t){return o.default.post("store/certificate/".concat(t.merId),t)},e.storeMerchantList=function(t){return o.default.get("store/merchant/lst",t,{noAuth:!0})},e.storeServiceList=function(t,e){return o.default.get("product/spu/local/".concat(t),e,{noAuth:!0})},e.unfollowStore=function(t){return o.default.post("user/relation/delete",{type:10,type_id:t})},e.updateGoodsRecord=function(t,e){return o.default.post("intention/update/"+t,e)},e.userCollectDel=function(t){return o.default.post("user/relation/batch/delete",t)},e.verify=function(t){return o.default.post("auth/verify",t)},n("d401"),n("d3b7"),n("25f0"),n("99af");var r=i(n("5530")),o=i(n("3314"))},"79f6":function(t,e,n){"use strict";var i=n("09cb"),r=n.n(i);r.a},b4da:function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return r})),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)},r=[]},fb6b:function(t,e,n){"use strict";n.r(e);var i=n("43a5"),r=n.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=r.a}}]); |