cityArray: [
['全部',"北京市", "天津市", "河北省", "山西省", "内蒙古自治区", "辽宁省", "吉林省", "黑龙江省", "上海市", "江苏省", "浙江省", "安徽省", "福建省", "江西省", "山东省", "河南省", "湖北省", "湖南省", "广东省", "广西壮族自治区", "海南省", "重庆市", "四川省", "贵州省", "云南省", "西藏自治区", "陕西省", "甘肃省", "青海省", "宁夏回族自治区", "新疆维吾尔自治区"],
['全部']
],
cityIndex: [0, 0],
//地区
bindRegionChange(e) {
console.log(e)
this.setData({
"cityIndex[0]": e.detail.value[0],
"cityIndex[1]": e.detail.value[1]
})
},
//地区动态获取
bindcolumnRegionChange: function(e) {
console.log('修改的列为', e.detail.column, ',值为', e.detail.value);
let _this = this
console.log(e)
switch (e.detail.column) {
case 0:
let list = []
for (var i = 0; i < _this.data.objectcityArray.length; i++) {
if (_this.data.objectcityArray[i].id == _this.data.objectcityArray[e.detail.value].id) {
for (let k in _this.data.objectcityArray[i].citys) {
list.push(_this.data.objectcityArray[i].citys[k].name)
}
console.log(list)
}
}
_this.setData({
"cityArray[1]": list,
"cityIndex[0]": e.detail.value,
"cityIndex[1]": 0
})
}
},
都是跟着小程序自带的改的,但是回显怎么搞呢,如果别人选的市还没加载,怎么回显呢