You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shop-app/h5/static/js/pages-account-address-edit....

1 line
7.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-account-address-edit"],{"35cc":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:{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:"$color-yellow3",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=[]},3657: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-eaad05a8]{background:#f8f8f8}.form[data-v-eaad05a8]{background:#fff;margin-bottom:%?20?%}.form--item[data-v-eaad05a8]{padding:0 %?40?%}.form--item__last[data-v-eaad05a8]{border:0}.form--city[data-v-eaad05a8]{padding:0}.form--itemInput[data-v-eaad05a8]{flex:1;font-size:%?28?%;padding-left:%?40?%}.saveBtn[data-v-eaad05a8]{position:fixed;bottom:%?89?%;left:%?30?%}[data-v-eaad05a8] .del-address .uiCell--title{color:#ff875b}[data-v-eaad05a8] .form--city .uiCell{padding:0 %?40?%}body.?%PAGE?%[data-v-eaad05a8]{background:#f8f8f8}',""]),e.exports=t},"457a":function(e,t,a){var r=a("3657");"string"===typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);var n=a("4f06").default;n("78071d0e",r,!0,{sourceMap:!1,shadowMode:!1})},"883d2":function(e,t,a){"use strict";a.r(t);var r=a("35cc"),n=a("a1bf");for(var s in n)"default"!==s&&function(e){a.d(t,e,(function(){return n[e]}))}(s);a("f326");var i,d=a("f0c5"),o=Object(d["a"])(n["default"],r["b"],r["c"],!1,null,"eaad05a8",null,!1,r["a"],i);t["default"]=o.exports},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")),o=r(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(){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,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 r=e.city[2].code,s=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,n.default)((0,n.default)({},e.address),{},{province:l,provinceCode:o,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:uni.showModal({title:"友情提示",content:"您确定要删除该地址吗?",showCancel:!0,success: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},f326:function(e,t,a){"use strict";var r=a("457a"),n=a.n(r);n.a}}]);