(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-account-address-edit"],{"345b":function(e,t,a){"use strict";var n=a("9a9f"),s=a.n(n);s.a},"505b":function(e,t,a){var n=a("24fb");t=n(!1),t.push([e.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/* 文字尺寸 */\n/* 间距 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */uni-page-body[data-v-89252092]{background:#f8f8f8}body.?%PAGE?%[data-v-89252092]{background:#f8f8f8}',""]),e.exports=t},"798a":function(e,t,a){"use strict";a.d(t,"b",(function(){return s})),a.d(t,"c",(function(){return r})),a.d(t,"a",(function(){return n}));var n={uSwitch:a("538b").default},s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("v-uni-view",{staticClass:"container"},[a("v-uni-view",{staticClass:"form"},[a("UiCell",{staticClass:"form--item",attrs:{title:"收货人",rightIcon:!1}},[a("template",{slot:"value"},[a("v-uni-input",{staticClass:"form--itemInput",attrs:{maxlength:10,placeholder:"请输入收货人姓名"},model:{value:e.address.name,callback:function(t){e.$set(e.address,"name",t)},expression:"address.name"}})],1)],2),a("UiCell",{staticClass:"form--item",attrs:{title:"手机号码",rightIcon:!1}},[a("template",{slot:"value"},[a("v-uni-input",{staticClass:"form--itemInput",attrs:{placeholder:"请输入收货手机号码"},model:{value:e.address.phone,callback:function(t){e.$set(e.address,"phone",t)},expression:"address.phone"}})],1)],2),a("BsSelectCity",{staticClass:"form--item form--city",model:{value:e.city,callback:function(t){e.city=t},expression:"city"}}),a("UiCell",{staticClass:"form--item form--item__last",attrs:{title:"详细地址",rightIcon:!1}},[a("template",{slot:"value"},[a("v-uni-input",{staticClass:"form--itemInput",attrs:{placeholder:"请输入详细地址"},model:{value:e.address.detailAddress,callback:function(t){e.$set(e.address,"detailAddress",t)},expression:"address.detailAddress"}})],1)],2)],1),a("UiCell",{staticClass:"form--item form--item__last",attrs:{title:"设为默认地址"}},[a("template",{slot:"right-icon"},[a("u-switch",{attrs:{space:"2",activeColor:"#FF875B",inactiveColor:"#F3F3F3"},model:{value:e.address.isDefault,callback:function(t){e.$set(e.address,"isDefault",t)},expression:"address.isDefault"}})],1)],2),a("UiCell",{staticClass:"form--item form--item__last del-address",attrs:{title:"删除收货地址",rightIcon:!1},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.delAddress.apply(void 0,arguments)}}}),a("UiButton",{staticClass:"saveBtn",attrs:{type:"solid",size:"max"},on:{click:function(t){arguments[0]=t=e.$handleEvent(t),e.save.apply(void 0,arguments)}}},[e._v("保存")])],1)},r=[]},"7c9e":function(e,t,a){var n=a("a2c7");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var s=a("4f06").default;s("11c97138",n,!0,{sourceMap:!1,shadowMode:!1})},"883d2":function(e,t,a){"use strict";a.r(t);var n=a("798a"),s=a("a1bf");for(var r in s)"default"!==r&&function(e){a.d(t,e,(function(){return s[e]}))}(r);a("345b"),a("caf2");var i,d=a("f0c5"),o=Object(d["a"])(s["default"],n["b"],n["c"],!1,null,"89252092",null,!1,n["a"],i);t["default"]=o.exports},"9a9f":function(e,t,a){var n=a("505b");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var s=a("4f06").default;s("bc36d0ce",n,!0,{sourceMap:!1,shadowMode:!1})},a1bf:function(e,t,a){"use strict";a.r(t);var n=a("b37d"),s=a.n(n);for(var r in n)"default"!==r&&function(e){a.d(t,e,(function(){return n[e]}))}(r);t["default"]=s.a},a2c7:function(e,t,a){var n=a("24fb");t=n(!1),t.push([e.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/* 文字尺寸 */\n/* 间距 */\n/* 图片尺寸 */\n/* Border Radius */\n/* 水平间距 */\n/* 垂直间距 */.form[data-v-89252092]{background:#fff;margin:%?20?% 0}.form--item[data-v-89252092]{padding:0 %?40?%}.form--item__last[data-v-89252092]{border:0}.form--city[data-v-89252092]{padding:0}.form--itemInput[data-v-89252092]{flex:1;font-size:%?28?%;padding-left:%?40?%}.saveBtn[data-v-89252092]{position:fixed;bottom:%?89?%;left:%?30?%;width:%?670?%}[data-v-89252092] .del-address .ui-cell--title{color:#ff875b}[data-v-89252092] .form--city .ui-cell{padding:0 %?40?%}',""]),e.exports=t},b37d:function(e,t,a){"use strict";var n=a("4ea4");a("7db0"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=n(a("5530"));a("96cf");var r=n(a("1da1")),i=n(a("d1b7")),d=n(a("359f")),o=n(a("f196")),c=a("5767"),u=a("87c9"),l={components:{UiCell:o.default,UiButton:d.default,BsSelectCity:i.default},data:function(){return{address:{},oldPhone:"",city:[]}},onShow:function(){var e=this;this.address=this.$store.state.address.find((function(t){return t.id==e.$Route.query.id})),this.oldPhone=this.address.phone,this.city=[{code:this.address.provinceCode,name:this.address.province},{code:this.address.cityCode,name:this.address.city},{code:this.address.areaCode,name:this.address.area}]},methods:{save:function(){var e=this;return(0,r.default)(regeneratorRuntime.mark((function t(){var a,n,r,i,d,o,l,f,p;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(a=uni.$u.toast,e.address.name){t.next=4;break}return a("请填写收货人姓名"),t.abrupt("return",!1);case 4:if(e.address.phone==e.oldPhone||(0,c.IsPhone)(e.address.phone)){t.next=7;break}return a("请填写正确的手机号"),t.abrupt("return",!1);case 7:if(e.city.length){t.next=10;break}return a("请选择地区"),t.abrupt("return",!1);case 10:if(e.address.detailAddress){t.next=13;break}return a("请填写详细地址"),t.abrupt("return",!1);case 13:return n=e.city[2].code,r=e.city[2].name,i=e.city[1].name,d=e.city[1].code,o=e.city[0].code,l=e.city[0].name,t.next=21,(0,u.ApiPutAddress)((0,s.default)((0,s.default)({},e.address),{},{province:l,provinceCode:o,areaCode:n,area:r,city:i,cityCode:d}));case 21:if(f=t.sent,p=f.error,!p){t.next=26;break}return a(p.message),t.abrupt("return",!1);case 26:a("保存成功"),e.$Router.back();case 28:case"end":return t.stop()}}),t)})))()},delAddress:function(){var e=this;return(0,r.default)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$msb.confirm({content:"您确定要删除该地址吗?",confirm:function(){var t=(0,r.default)(regeneratorRuntime.mark((function t(){var a,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,(0,u.ApiDeleteAddress)({idList:e.$Route.query.id});case 2:if(a=t.sent,n=a.error,!n){t.next=7;break}return uni.$u.toast(n.message),t.abrupt("return",!1);case 7:e.$Router.back();case 8:case"end":return t.stop()}}),t)})));function a(){return t.apply(this,arguments)}return a}()});case 1:case"end":return t.stop()}}),t)})))()}}};t.default=l},caf2:function(e,t,a){"use strict";var n=a("7c9e"),s=a.n(n);s.a}}]);