glhcp/server/public/business/static/js/pages-address_edit-address_...

1 line
201 KiB
JavaScript
Raw Normal View History

2023-08-10 06:59:52 +00:00
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-address_edit-address_edit"],{"064d":function(l,e,a){"use strict";a.r(e);var i=a("d494"),d=a("069e");for(var u in d)"default"!==u&&function(l){a.d(e,l,(function(){return d[l]}))}(u);a("852c");var p,v=a("f0c5"),b=Object(v["a"])(d["default"],i["b"],i["c"],!1,null,"6bc46635",null,!1,i["a"],p);e["default"]=b.exports},"069e":function(l,e,a){"use strict";a.r(e);var i=a("2518"),d=a.n(i);for(var u in i)"default"!==u&&function(l){a.d(e,l,(function(){return i[l]}))}(u);e["default"]=d.a},2518:function(l,e,a){"use strict";var i=a("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var d=i(a("5530"));a("96cf");var u=i(a("1da1")),p=a("bc50"),v=a("cbd2"),b=i(a("85b8")),n={data:function(){return{id:0,type:1,refund_address:{nickname:"",mobile:"",province_id:"",city_id:"",district_id:"",address:""},region:"请选择",defaultRegion:["广东省","广州市","番禺区"],showRegion:!1,lists:[]}},onLoad:function(l){this.lists=b.default;try{var e=this.$Route.query.type,a=this.$Route.query.id;if(e){this.type=e;var i=this.shopInfo;if(1==e){for(var d in this.region=i.province_name+" "+i.province_name+" "+i.district_name,i)this.$set(this.refund_address,d,i[d]);uni.setNavigationBarTitle({title:"编辑商家地址"})}else if(2==e){for(var u in this.region=i.refund_address.province_name+" "+i.refund_address.province_name+" "+i.refund_address.district_name,i.refund_address)this.$set(this.refund_address,u,i.refund_address[u]);uni.setNavigationBarTitle({title:"编辑退货地址"})}}a&&(this.type=3,this.id=a,this.getAddressFunc(a))}catch(p){console.log(p)}},methods:{onSubmit:function(){var l=this;return(0,u.default)(regeneratorRuntime.mark((function e(){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(console.log(3==l.type),a={nickname:2==l.type?l.refund_address.nickname:"",id:3==l.type?l.id:"",mobile:1!=l.type?l.refund_address.mobile:"",consignee:3==l.type?l.refund_address.nickname:"",province:3==l.type?l.refund_address.province_id:"",city:3==l.type?l.refund_address.city_id:"",district:3==l.type?l.refund_address.district_id:"",province_id:3!=l.type?l.refund_address.province_id:"",city_id:3!=l.type?l.refund_address.city_id:"",district_id:3!=l.type?l.refund_address.district_id:"",address:l.refund_address.address},2!=l.type&&3!=l.type){e.next=9;break}if(l.refund_address.nickname){e.next=5;break}return e.abrupt("return",l.$toast({title:"请填写收货人姓名"}));case 5:if(!(!l.refund_address.nickname.length>=20)){e.next=7;break}return e.abrupt("return",l.$toast({title:"输入的收货人长度不得大于20位"}));case 7:if(l.refund_address.mobile){e.next=9;break}return e.abrupt("return",l.$toast({title:"请填写手机号码"}));case 9:if(l.region){e.next=11;break}return e.abrupt("return",l.$toast({title:"请选择地区"}));case 11:if(l.refund_address.address){e.next=13;break}return e.abrupt("return",l.$toast({title:"请填写小区、街道、门牌号等信息"}));case 13:if(2!=l.type){e.next=18;break}return e.next=16,(0,p.apiSetShopInfo)({refund_address:a});case 16:e.next=26;break;case 18:if(1!=l.type){e.next=23;break}return e.next=21,(0,p.apiSetShopInfo)((0,d.default)({},a));case 21:e.next=26;break;case 23:if(3!=l.type){e.next=26;break}return e.next=26,(0,v.apiOrderEditAddress)((0,d.default)({},a));case 26:l.$refs.uToast.show({title:"设置成功",type:"success"}),setTimeout((function(){l.$Router.back()}),1e3);case 28:case"end":return e.stop()}}),e)})))()},getAddressFunc:function(l){var e=this;return(0,u.default)(regeneratorRuntime.mark((function a(){var i;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,(0,v.apiOrderGetAddress)({id:l});case 2:i=a.sent,e.refund_address.nickname=i.consignee,e.refund_address.mobile=i.mobile,e.refund_address.province_id=i.province,e.refund_address.city_id=i.city,e.refund_address.district_id=i.district,e.refund_address.address=i.address,e.region=i.region[0]+" "+i.region[1]+" "+i.region[2];case 10:case"end":return a.stop()}}),a)})))()},regionCha