|
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-account-address-edit"],{3476:function(e,t,a){"use strict";a.d(t,"b",(function(){return n})),a.d(t,"c",(function(){return s})),a.d(t,"a",(function(){return r}));var r={uSwitch:a("538b").default},n=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)},s=[]},"3bd6":function(e,t,a){var r=a("24fb");t=r(!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-5b807dc2]{background:#f8f8f8}.form[data-v-5b807dc2]{background:#fff;margin-bottom:%?20?%}.form--item[data-v-5b807dc2]{padding:0 %?40?%}.form--item__last[data-v-5b807dc2]{border:0}.form--city[data-v-5b807dc2]{padding:0}.form--itemInput[data-v-5b807dc2]{flex:1;font-size:%?28?%;padding-left:%?40?%}.saveBtn[data-v-5b807dc2]{position:fixed;bottom:%?89?%;left:%?30?%;width:%?670?%}[data-v-5b807dc2] .del-address .uiCell--title{color:#ff875b}[data-v-5b807dc2] .form--city .ui-cell{padding:0 %?40?%}body.?%PAGE?%[data-v-5b807dc2]{background:#f8f8f8}',""]),e.exports=t},"6bbc":function(e,t,a){var r=a("3bd6");"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var n=a("4f06").default;n("5da08d9a",r,!0,{sourceMap:!1,shadowMode:!1})},"883d2":function(e,t,a){"use strict";a.r(t);var r=a("3476"),n=a("a1bf");for(var s in n)"default"!==s&&function(e){a.d(t,e,(function(){return n[e]}))}(s);a("9805");var i,d=a("f0c5"),c=Object(d["a"])(n["default"],r["b"],r["c"],!1,null,"5b807dc2",null,!1,r["a"],i);t["default"]=c.exports},9805:function(e,t,a){"use strict";var r=a("6bbc"),n=a.n(r);n.a},a1bf:function(e,t,a){"use strict";a.r(t);var r=a("b37d"),n=a.n(r);for(var s in r)"default"!==s&&function(e){a.d(t,e,(function(){return r[e]}))}(s);t["default"]=n.a},b37d:function(e,t,a){"use strict";var r=a("4ea4");a("7db0"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(a("5530"));a("96cf");var s=r(a("1da1")),i=r(a("d1b7")),d=r(a("359f")),c=r(a("f196")),o=a("5767"),u=a("87c9"),l={components:{UiCell:c.default,UiButton:d.default,BsSelectCity:i.default},data:function(){return{address:{},city:[]}},onShow:function(){var e=this;this.address=this.$store.state.address.find((function(t){return t.id==e.$Route.query.id})),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,s.default)(regeneratorRuntime.mark((function t(){var a,r,s,i,d,c,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&&(0,o.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 r=e.city[2].code,s=e.city[2].name,i=e.city[1].name,d=e.city[1].code,c=e.city[0].code,l=e.city[0].name,t.next=21,(0,u.ApiPutAddress)((0,n.default)((0,n.default)({},e.address),{},{province:l,provinceCode:c,areaCode:r,area:s,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,s.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,s.default)(regeneratorRuntime.mark((function t(){var a,r;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,r=a.error,!r){t.next=7;break}return uni.$u.toast(r.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}}]); |