(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/app_admin/change-add/change-add"],{"38b8":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=n("2f62");function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function o(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){a(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var c=function(){n.e("components/page-component/app-area-picker/app-area-picker").then(function(){return resolve(n("ffd4"))}.bind(null,n)).catch(n.oe)},d={data:function(){return{ids:[0],id:"",list:[],name:"",mobile:"",province_id:0,city_id:0,district_id:0,detail:"",order_no:"",province:"",city:"",district:"",order:{}}},components:{"app-area-picker":c},computed:o({},(0,i.mapState)({theme:function(t){return t.mallConfig.theme},userInfo:function(t){return t.user.info},adminImg:function(t){return t.mallConfig.__wxapp_img.app_admin}})),methods:{areaEvent:function(t){t&&(this.province=t.province.name,this.city=t.city.name,this.district=t.district.name)},getDistrict:function(){var e=this;e.$showLoading({text:"加载中..."}),e.$request({url:e.$api.default.district}).then((function(n){0==n.code?(e.list=n.data.list,e.getList()):(e.$hideLoading(),t.showToast({title:n.msg,icon:"none",duration:1e3}))})).catch((function(t){e.$hideLoading()}))},getList:function(){var e=this;e.$request({url:e.$api.app_admin.order,data:{status:"-1",keyword:e.order_no},method:"post"}).then((function(n){if(e.$hideLoading(),0==n.code){if(e.order=n.data.list[0],e.name=n.data.list[0].name,e.mobile=n.data.list[0].mobile,!n.data.list[0].address)return t.setNavigationBarTitle({title:"添加收货地址"}),!1;var i=n.data.list[0].address.trim().split(" ");e.detail=i[i.length-1];var r=e.list;e.ids=[],r.forEach((function(t){if(t.name==i[0]){e.ids[0]=t.id;var n=t;n.list.forEach((function(t){if(t.name==i[1]){e.ids[1]=t.id;var n=t;n.list.forEach((function(t){t.name==i[2]&&(e.ids[2]=t.id)}))}}))}}))}else t.showToast({title:n.msg,icon:"none",duration:1e3})})).catch((function(t){e.$hideLoading()}))},saveAddress:function(e){var n=this;n.province?(t.showLoading({title:"提交中..."}),n.$request({url:n.$api.app_admin.update_address,method:"POST",data:{order_id:n.order.id,name:n.name,mobile:n.mobile,province:n.province,city:n.city,district:n.district,address:n.detail}}).then((function(e){t.hideLoading(),0==e.code?(t.showToast({title:e.msg,duration:1e3,icon:"success",mask:!1}),setTimeout((function(){t.navigateBack()}),500)):t.showToast({title:e.msg,icon:"none",duration:1e3})})).catch((function(e){t.hideLoading(),t.showToast({title:e,icon:"none",duration:1e3})}))):t.showToast({title:"地区不能为空",icon:"none",duration:1e3})}},onLoad:function(t){var e=this;t.order_no&&(e.order_no=t.order_no,e.getDistrict())}};e.default=d}).call(this,n("543d")["default"])},3900:function(t,e,n){"use strict";(function(t){n("b8bc");i(n("66fd"));var e=i(n("3e7a"));function i(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},"3e7a":function(t,e,n){"use strict";n.r(e);var i=n("7aac"),r=n("f90b");for(var o in r)"default"!==o&&function(t){n.d(e,t,(function(){return r[t]}))}(o);n("8fe7");var a,c=n("f0c5"),d=Object(c["a"])(r["default"],i["b"],i["c"],!1,null,"015f0f8c",null,!1,i["a"],a);e["default"]=d.exports},"7aac":function(t,e,n){"use strict";var i;n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return o})),n.d(e,"a",(function(){return i}));var r=function(){var t=this,e=t.$createElement;t._self._c},o=[]},"8fe7":function(t,e,n){"use strict";var i=n("e0d1"),r=n.n(i);r.a},e0d1:function(t,e,n){},f90b:function(t,e,n){"use strict";n.r(e);var i=n("38b8"),r=n.n(i);for(var o in i)"default"!==o&&function(t){n.d(e,t,(function(){return i[t]}))}(o);e["default"]=r.a}},[["3900","common/runtime","common/vendor"]]]);