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.
 
 
 
 

1 lines
4.2 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/address/edit/edit"],{"03bd":function(e,t,n){"use strict";n.r(t);var i=n("5336"),a=n.n(i);for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);t["default"]=a.a},1187:function(e,t,n){"use strict";var i=n("6697"),a=n.n(i);a.a},4253:function(e,t,n){"use strict";n.r(t);var i=n("a90e"),a=n("03bd");for(var o in a)"default"!==o&&function(e){n.d(t,e,(function(){return a[e]}))}(o);n("1187");var s,r=n("f0c5"),d=Object(r["a"])(a["default"],i["b"],i["c"],!1,null,null,null,!1,i["a"],s);t["default"]=d.exports},5336:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a(n("a34a"));function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,n,i,a,o,s){try{var r=e[o](s),d=r.value}catch(c){return void n(c)}r.done?t(d):Promise.resolve(d).then(i,a)}function s(e){return function(){var t=this,n=arguments;return new Promise((function(i,a){var s=e.apply(t,n);function r(e){o(s,i,a,r,d,"next",e)}function d(e){o(s,i,a,r,d,"throw",e)}r(void 0)}))}}var r=function(){Promise.all([n.e("common/vendor"),n.e("components/mpvue-citypicker/mpvueCityPicker")]).then(function(){return resolve(n("ae08"))}.bind(null,n)).catch(n.oe)},d={components:{mpvueCityPicker:r},data:function(){return{editType:"edit",id:"",name:"",tel:"",detailed:"",isDefault:!1,cityPickerValue:[0,0,1],themeColor:"#007AFF",region:{label:"请点击选择地址",value:[],cityCode:""}}},methods:{onCancel:function(e){console.log(e)},chooseCity:function(){this.$refs.mpvueCityPicker.show()},onConfirm:function(e){this.region=e,this.cityPickerValue=e.value},isDefaultChange:function(e){this.isDefault=e.detail.value},savaeditaddress:function(){var t=this;return s(i.default.mark((function n(){var a,o;return i.default.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return a=e.getStorageSync("userinfo"),n.next=3,t.$api.editaddress({action:"editaddress",uid:a.uid,username:t.name,tel:t.tel,address:t.region.label+"--"+t.detailed,addresscode:t.region.value});case 3:o=n.sent,1==o.code&&(a.name=t.name,a.address=t.region.label,a.detail=t.detailed,a.tel=t.tel,a.addresscode=t.region.value,e.setStorage({key:"userinfo",data:a,success:function(){e.hideLoading(),e.navigateBack()}})),e.hideLoading();case 6:case"end":return n.stop()}}),n)})))()},del:function(){var t=this;e.showModal({title:"删除提示",content:"你将删除这个收货地址",success:function(n){n.confirm?e.setStorage({key:"delAddress",data:{id:t.id},success:function(){e.navigateBack()}}):n.cancel&&console.log("用户点击取消")}})},save:function(){var t={name:this.name,head:this.name.substr(0,1),tel:this.tel,address:{region:this.region,detailed:this.detailed},isDefault:this.isDefault};"edit"==this.editType&&(t.id=this.id),t.name?t.tel?t.address.detailed?0!=t.address.region.value.length?(e.showLoading({title:"正在提交"}),this.savaeditaddress()):e.showToast({title:"请选择收件地址",icon:"none"}):e.showToast({title:"请输入收件人详细地址",icon:"none"}):e.showToast({title:"请输入收件人电话号码",icon:"none"}):e.showToast({title:"请输入收件人姓名",icon:"none"})}},onLoad:function(t){var n=this;this.editType=t.type,"edit"==t.type&&e.getStorage({key:"address",success:function(e){n.id=e.data.id,n.name=e.data.name,n.tel=e.data.tel,n.detailed=e.data.detail,n.cityPickerValue=[e.data.addresscode],n.region={label:e.data.address,value:[e.data.addresscode],cityCode:""}}})},onBackPress:function(){if(this.$refs.mpvueCityPicker.showPicker)return this.$refs.mpvueCityPicker.pickerCancel(),!0},onUnload:function(){this.$refs.mpvueCityPicker.showPicker&&this.$refs.mpvueCityPicker.pickerCancel()}};t.default=d}).call(this,n("543d")["default"])},6697:function(e,t,n){},a90e:function(e,t,n){"use strict";var i;n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return i}));var a=function(){var e=this,t=e.$createElement;e._self._c},o=[]},e42b:function(e,t,n){"use strict";(function(e){n("8d0c");i(n("66fd"));var t=i(n("4253"));function i(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=n,e(t.default)}).call(this,n("543d")["createPage"])}},[["e42b","common/runtime","common/vendor"]]]);