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.
hezhiying/unpackage/dist/build/h5/static/js/pages-AddressEdit-AddressEd...

1 line
308 KiB

1 year ago
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-AddressEdit-AddressEdit"],{"11ac":function(a,e,r){"use strict";r("7a82");var d=r("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,r("d3b7"),r("6062"),r("3ca3"),r("ddb0"),r("e9c4"),r("159b"),r("b64b"),r("14d9");var p=d(r("2909")),t=r("5af7"),n={data:function(){return{addressType:"2",show:!1,columns:[],defaultIds:[],areaList:[],form:{id:null,consignee:null,mobile:null,province_name:null,city_name:null,district_name:null,address:null,is_default:!0},addressText:"",defaultNames:[]}},methods:{confirmAddress:function(a){this.addressText=(0,p.default)(new Set(a.value)).join("");var e=a.value;this.form.province_name=e[0],this.form.city_name=e[1],this.form.district_name=e[2],this.show=!1},getAreaHandle:function(){var a=this;(0,t.getArea)().then((function(e){a.areaList=e.data}))},submitHandle:function(){var a=JSON.parse(JSON.stringify(this.form));a.is_default?a.is_default=1:a.is_default=0,2==this.addressType&&(0,t.addAddr)(a).then((function(a){1==a.code&&uni.navigateTo({url:"/pages/AddressList/AddressList"})})),1==this.addressType&&(0,t.editAddr)(a).then((function(a){1==a.code&&uni.navigateTo({url:"/pages/AddressList/AddressList"})}))},getAddrDescHandle:function(a){var e=this;(0,t.getAddrDesc)({id:a}).then((function(a){console.log(a),Object.keys(e.form).forEach((function(r){e.form[r]=a.data[r]})),e.defaultNames.push(e.form.province_name,e.form.city_name,e.form.district_name),e.addressText=e.form.province_name+e.form.city_name+e.form.district_name}))}},onLoad:function(a){console.log(a),this.addressType=a.type||"2",uni.setNavigationBarTitle({title:"1"===this.addressType?"编辑收货地址":"新建收货地址"}),a.item&&"null"!=a.item&&this.getAddrDescHandle(JSON.parse(a.item).id),this.getAreaHandle()}};e.default=n},1314:function(a,e,r){"use strict";r("7a82");var d=r("4ea4").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,r("a9e3"),r("d81d"),r("d3b7"),r("14d9"),r("c740");var p=d(r("3c9b")),t=d(r("a888")),n={props:{show:{type:Boolean,default:function(){return!1}},closeOnClickOverlay:{type:Boolean,default:function(){return!0}},title:{type:String,default:function(){return""}},showToolbar:{type:Boolean,default:function(){return!1}},showBottombar:{type:Boolean,default:function(){return!0}},itemHeight:{type:[String,Number],default:function(){return 44}},cancelText:{type:String,default:function(){return"取消"}},cancelColor:{type:String,default:function(){return"#909193"}},confirmText:{type:String,default:function(){return"确认"}},confirmColor:{type:String,default:function(){return"#3c9cff"}},visibleItemCount:{type:[String,Number],default:function(){return 5}},loading:{type:Boolean,default:function(){return!1}},indexs:{type:Array,default:function(){return[]}},defaultIds:{type:Array,default:function(){return[]}},defaultNames:{type:Array,default:function(){return[]}},labelName:{type:String,default:function(){return"name"}},sourceData:{type:Array,default:function(){return p.default}},initBack:{type:Boolean,default:function(){return!0}}},data:function(){return{currSourceData:this.sourceData,columns:[],level:0,currIndexs:this.indexs,currNames:this.defaultNames,currIds:this.defaultIds}},watch:{indexs:function(a,e){this.defaultValChange(a,1)},defaultNames:function(a,e){this.defaultValChange(a,2)},defaultIds:function(a,e){this.defaultValChange(a,3)},sourceData:function(a,e){this.defaultValChange(a,4)}},mounted:function(){this.formatData(),this.initBack&&this.initBackData()},components:{uPickerPlus:t.default},methods:{changeHandler:function(a){var e=this,r=a.columnIndex,d=a.indexs,p=a.picker,t=void 0===p?this.$refs.uPicker:p;0===r&&(2==this.level?t.setColumnValues(1,this.currSourceData[d[0]].children.map((function(a){return a[e.labelName]}))):3==this.level&&(t.setColumnValues(1,this.currSourceData[d[0]].children.map((function(a){return a[e.labelName]}))),t.setColumnValues(2,this.currSourceData[d[0]].children[d[1]].children.map((function(a){return a[e.labelName]}))))),1===r&&this.level>2&&t.setColumnValues(2,this.currSourc