在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1.WXML <picker mode="multiSelector" bindchange="bindMultiPickerChange" bindcolumnchange="bindMultiPickerColumnChange" value="{{multiIndex}}" range="{{multiArray}}"> <view class="picker"> {{multiArray[0][multiIndex[0]]}}{{multiArray[1][multiIndex[1]]}}{{multiArray[2][multiIndex[2]]}} </view> </picker> 2.JS //res.data.data.arrayList是后台获得的数据, Page({ onShow(){ res.data.data.arrayList.forEach(function (v,i) { v.shopList.forEach(function (j, d) { j.shopList.forEach(function (t, p) { that.data.shopId = ret.data if (t.sysUserId == ret.data) { that.data.multiIndex[0] = i that.data.multiArray[1] = [] that.data.multiArray[2] = [] that.setData({ multiIndex: that.data.multiIndex, multiArray: that.data.multiArray }) res.data.data.arrayList[that.data.multiIndex[0]].shopList.forEach(function (g, t) { that.data.multiArray[1].push(g.cityName) if (d == t) { j.shopList.forEach(function (l) { that.data.multiArray[2].push(l.districtName) }) } }) that.data.multiIndex[2] = p that.data.multiIndex[1] = d that.setData({ multiIndex: that.data.multiIndex, multiArray: that.data.multiArray }) } }) }) })
|
请发表评论