地区选择
var city_picker = new mui.PopPicker({
layer: 3
});
city_picker.setData(init_city_picker);
setTimeout(function() {
city_picker.show(function(items) {
$("#city_1").html((items[0] || {}).text);
$("#city_2").html((items[1] || {}).text);
$("#city_3").html((items[0] || {}).text+ “,” + (items[1] || {}).text + “,” +(items[2] || {}).text);
$("#city_3").val((items[2] || {}).value);
Aearid = (items[2] || {}).value;
xccpost(“ChenLinKun_API/UpdateArea”,{
userid:UserID,
aearid:Aearid,
},function(data){
console.log(data.data.length);
var Name =data.data[0].Name;
$("#city_3").html(Name);
弹出地区选择的弹窗,进行选所在地区进行点击选择
value: ‘110000’,
text: ‘北京市’,
children: [{
value: “110101”,
text: “北京市”,
children: [{
value: “110101”,
text: “东城区”
}, {
value: “110102”,
text: “西城区”
}, {
value: “110103”,
text: “崇文区”
}, {
value: “110104”,
text: “宣武区”
}, {
value: “110105”,
text: “朝阳区”
}, {
value: “110106”,
text: “丰台区”
}, {
value: “110107”,
text: “石景山区”
}, {
value: “110108”,
text: “海淀区”
}, {
value: “110109”,
text: “门头沟区”
}, {
value: “110111”,
text: “房山区”
}, {
value: “110112”,
text: “通州区”
}, {
value: “110113”,
text: “顺义区”
}, {
value: “110114”,
text: “昌平区”
}, {
value: “110115”,
text: “大兴区”
}, {
value: “110116”,
text: “怀柔区”
}, {
value: “110117”,
text: “平谷区”
}, {
value: “110228”,
text: “密云县”
}, {
value: “110229”,
text: “延庆县”
}, {
value: “110230”,
text: “其它区”
}]
}]
}
地区选择主要是在调用所编辑好的js封装方法,对应数据的地区编码,然后进行匹配选择地区
地区选择
最新推荐文章于 2021-02-26 00:01:03 发布