|
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-account-address-create"],{"4bee":function(e,t,a){"use strict";a.r(t);var n=a("93d7"),s=a("e033");for(var r in s)"default"!==r&&function(e){a.d(t,e,(function(){return s[e]}))}(r);a("fe1d");var i,d=a("f0c5"),o=Object(d["a"])(s["default"],n["b"],n["c"],!1,null,"7af5d46e",null,!1,n["a"],i);t["default"]=o.exports},8375:function(e,t,a){var n=a("b05a");"string"===typeof n&&(n=[[e.i,n,""]]),n.locals&&(e.exports=n.locals);var s=a("4f06").default;s("53ee9420",n,!0,{sourceMap:!1,shadowMode:!1})},"93d7":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("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=[]},b05a: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-7af5d46e]{background:#f8f8f8}.form[data-v-7af5d46e]{background:#fff;margin-bottom:%?20?%}.form--item[data-v-7af5d46e]{padding:0 %?40?%}.form--item__last[data-v-7af5d46e]{border:0}.form--city[data-v-7af5d46e]{padding:0}.form--itemInput[data-v-7af5d46e]{flex:1;font-size:%?28?%;padding-left:%?40?%}.saveBtn[data-v-7af5d46e]{position:fixed;bottom:%?89?%;left:%?30?%}[data-v-7af5d46e] .form--city .uiCell{padding:0 %?40?%}body.?%PAGE?%[data-v-7af5d46e]{background:#f8f8f8}',""]),e.exports=t},ce75:function(e,t,a){"use strict";var n=a("4ea4");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:{},city:[]}},onShow:function(){this.address.isDefault="true"===this.$Route.query.first},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&&(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.ApiPostAddress)((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)})))()}}};t.default=l},e033:function(e,t,a){"use strict";a.r(t);var n=a("ce75"),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},fe1d:function(e,t,a){"use strict";var n=a("8375"),s=a.n(n);s.a}}]); |