|
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-account-address-create"],{"15a7":function(t,e,a){"use strict";a.d(e,"b",(function(){return s})),a.d(e,"c",(function(){return r})),a.d(e,"a",(function(){return n}));var n={uSwitch:a("538b").default},s=function(){var t=this,e=t.$createElement,a=t._self._c||e;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:t.address.name,callback:function(e){t.$set(t.address,"name",e)},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:t.address.phone,callback:function(e){t.$set(t.address,"phone",e)},expression:"address.phone"}})],1)],2),a("BsSelectCity",{staticClass:"form--item form--city",model:{value:t.city,callback:function(e){t.city=e},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:t.address.detailAddress,callback:function(e){t.$set(t.address,"detailAddress",e)},expression:"address.detailAddress"}})],1)],2)],1),t._v(t._s(t.address.isDefault)),a("UiCell",{staticClass:"form--item form--item__last",attrs:{title:"设为默认地址"}},[a("template",{slot:"right-icon"},[a("u-switch",{attrs:{activeColor:"#FF875B",inactiveColor:"#F3F3F3"},model:{value:t.isDefault,callback:function(e){t.isDefault=e},expression:"isDefault"}})],1)],2),a("UiButton",{staticClass:"saveBtn",attrs:{type:"solid",size:"max"},on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.save.apply(void 0,arguments)}}},[t._v("保存")])],1)},r=[]},"3fa5":function(t,e,a){"use strict";var n=a("4495"),s=a.n(n);s.a},4495:function(t,e,a){var n=a("c424");"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var s=a("4f06").default;s("5ca4d429",n,!0,{sourceMap:!1,shadowMode:!1})},"4bee":function(t,e,a){"use strict";a.r(e);var n=a("15a7"),s=a("e033");for(var r in s)"default"!==r&&function(t){a.d(e,t,(function(){return s[t]}))}(r);a("3fa5");var i,d=a("f0c5"),o=Object(d["a"])(s["default"],n["b"],n["c"],!1,null,"db0f9114",null,!1,n["a"],i);e["default"]=o.exports},c424:function(t,e,a){var n=a("24fb");e=n(!1),e.push([t.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-db0f9114]{background:#f8f8f8}.form[data-v-db0f9114]{background:#fff;margin:%?20?% 0}.form--item[data-v-db0f9114]{padding:0 %?40?%}.form--item__last[data-v-db0f9114]{border:0}.form--city[data-v-db0f9114]{padding:0}.form--itemInput[data-v-db0f9114]{flex:1;font-size:%?28?%;padding-left:%?40?%}.saveBtn[data-v-db0f9114]{position:fixed;bottom:%?89?%;left:%?30?%;width:%?670?%}[data-v-db0f9114] .form--city .ui-cell{padding:0 %?40?%}body.?%PAGE?%[data-v-db0f9114]{background:#f8f8f8}',""]),t.exports=e},ce75:function(t,e,a){"use strict";var n=a("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.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:{},isDefault:!1,city:[]}},onShow:function(){"true"===this.$Route.query.first&&(this.isDefault=!0)},methods:{save:function(){var t=this;return(0,r.default)(regeneratorRuntime.mark((function e(){var a,n,r,i,d,o,l,f,p;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(a=uni.$u.toast,t.address.name){e.next=4;break}return a("请填写收货人姓名"),e.abrupt("return",!1);case 4:if(t.address.phone&&(0,c.IsPhone)(t.address.phone)){e.next=7;break}return a("请填写正确的手机号"),e.abrupt("return",!1);case 7:if(t.city.length){e.next=10;break}return a("请选择地区"),e.abrupt("return",!1);case 10:if(t.address.detailAddress){e.next=13;break}return a("请填写详细地址"),e.abrupt("return",!1);case 13:return n=t.city[2].code,r=t.city[2].name,i=t.city[1].name,d=t.city[1].code,o=t.city[0].code,l=t.city[0].name,e.next=21,(0,u.ApiPostAddress)((0,s.default)((0,s.default)({},t.address),{},{isDefault:t.isDefault,province:l,provinceCode:o,areaCode:n,area:r,city:i,cityCode:d}));case 21:if(f=e.sent,p=f.error,!p){e.next=26;break}return a(p.message),e.abrupt("return",!1);case 26:a("保存成功"),t.$Router.back();case 28:case"end":return e.stop()}}),e)})))()}}};e.default=l},e033:function(t,e,a){"use strict";a.r(e);var n=a("ce75"),s=a.n(n);for(var r in n)"default"!==r&&function(t){a.d(e,t,(function(){return n[t]}))}(r);e["default"]=s.a}}]); |