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.
high-mini/unpackage/dist/build/mp-weixin/pages/user/address/edit/edit.js

1 line
3.2 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/user/address/edit/edit"],{"5a4b":function(e,t,i){"use strict";var n;i.d(t,"b",(function(){return a})),i.d(t,"c",(function(){return o})),i.d(t,"a",(function(){return n}));var a=function(){var e=this,t=e.$createElement;e._self._c},o=[]},7019:function(e,t,i){"use strict";i.r(t);var n=i("5a4b"),a=i("f4e9");for(var o in a)"default"!==o&&function(e){i.d(t,e,(function(){return a[e]}))}(o);i("ea32");var s,c=i("f0c5"),d=Object(c["a"])(a["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],s);t["default"]=d.exports},9195:function(e,t,i){"use strict";(function(e){i("e5b1");n(i("66fd"));var t=n(i("7019"));function n(e){return e&&e.__esModule?e:{default:e}}e(t.default)}).call(this,i("543d")["createPage"])},aecd:function(e,t,i){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(){Promise.all([i.e("common/vendor"),i.e("components/mpvue-citypicker/mpvueCityPicker")]).then(function(){return resolve(i("adc6"))}.bind(null,i)).catch(i.oe)},a={components:{mpvueCityPicker:n},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},del:function(){var t=this;e.showModal({title:"删除提示",content:"你将删除这个收货地址",success:function(i){i.confirm?e.setStorage({key:"delAddress",data:{id:t.id},success:function(){e.navigateBack()}}):i.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:"正在提交"}),setTimeout((function(){e.setStorage({key:"saveAddress",data:t,success:function(){e.hideLoading(),e.navigateBack()}})}),300)):e.showToast({title:"请选择收件地址",icon:"none"}):e.showToast({title:"请输入收件人详细地址",icon:"none"}):e.showToast({title:"请输入收件人电话号码",icon:"none"}):e.showToast({title:"请输入收件人姓名",icon:"none"})}},onLoad:function(t){var i=this;this.editType=t.type,"edit"==t.type&&e.getStorage({key:"address",success:function(e){i.id=e.data.id,i.name=e.data.name,i.tel=e.data.tel,i.detailed=e.data.address.detailed,i.isDefault=e.data.isDefault,i.cityPickerValue=e.data.address.region.value,i.region=e.data.address.region}})},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=a}).call(this,i("543d")["default"])},e36d:function(e,t,i){},ea32:function(e,t,i){"use strict";var n=i("e36d"),a=i.n(n);a.a},f4e9:function(e,t,i){"use strict";i.r(t);var n=i("aecd"),a=i.n(n);for(var o in n)"default"!==o&&function(e){i.d(t,e,(function(){return n[e]}))}(o);t["default"]=a.a}},[["9195","common/runtime","common/vendor"]]]);