areaCheck.js 1.3 KB
"use strict";const o=require("../utils/address-data.js"),t=require("../common/vendor.js"),p={props:{shows:{type:Boolean,default:!1}},data(){return{columns:[],columnData:[]}},mounted(){this.columns[0]=o.localData.map(e=>e.name),this.columns[1]=o.localData[0].cities.map(e=>e.name),this.columns[2]=o.localData[0].cities[0].districts.map(e=>e.name)},methods:{close(){this.$emit("close",!1)},changeHandler(e){const{columnIndex:l,value:c,values:u,index:m,picker:a=this.$refs.uPicker}=e;if(console.log("变化",m),l===0){let n=o.localData.find(s=>s.name==c[0]),i=n.cities.map(s=>s.name);this.columnData=i,console.log("市",i[0],n);let r=n.cities[0].districts.map(s=>s.name);a.setColumnValues(1,i),a.setColumnValues(2,r)}if(l===1){let r=o.localData.find(s=>s.name==c[0]).cities.find(s=>s.name==c[1]).districts.map(s=>s.name);a.setColumnValues(2,r)}},confirm(e){this.$emit("popShow",e.value)}}};Array||t.resolveComponent("u-picker")();const d=()=>"../uni_modules/uview-plus/components/u-picker/u-picker.js";Math||d();function h(e,l,c,u,m,a){return{a:t.sr("uPicker","700f6895-0"),b:t.o(a.close),c:t.o(a.confirm),d:t.o(a.changeHandler),e:t.p({immediateChange:!0,show:c.shows,columns:m.columns})}}const _=t._export_sfc(p,[["render",h],["__file","D:/vue/大健康商城/healthMall/componets/areaCheck.vue"]]);wx.createComponent(_);