| @@ -32,7 +32,7 @@ Component({ | |||||
| data: { | data: { | ||||
| showGroupIf: wx.getStorageSync('tenantData')&&JSON.parse(wx.getStorageSync('tenantData')).length>0?true:false, | showGroupIf: wx.getStorageSync('tenantData')&&JSON.parse(wx.getStorageSync('tenantData')).length>0?true:false, | ||||
| tenantData: wx.getStorageSync('tenantData')&&JSON.parse(wx.getStorageSync('tenantData')), | |||||
| tenantData: wx.getStorageSync('tenantData')?JSON.parse(wx.getStorageSync('tenantData')):[], | |||||
| tenantId: wx.getStorageSync('tenantId'), | tenantId: wx.getStorageSync('tenantId'), | ||||
| array: [], | array: [], | ||||
| index: 1, | index: 1, | ||||
| @@ -47,7 +47,7 @@ Component({ | |||||
| }) | }) | ||||
| }, | }, | ||||
| bindPickerChange: function (e) { | bindPickerChange: function (e) { | ||||
| console.log('picker发送选择改变,携带值为', e.detail.value) | |||||
| console.log('picker发送选择改变,携带值为', this.data.tenantData, e.detail.value) | |||||
| this.setData({ | this.setData({ | ||||
| index: e.detail.value | index: e.detail.value | ||||
| }) | }) | ||||
| @@ -108,14 +108,18 @@ Component({ | |||||
| console.log(JSON.parse(wx.getStorageSync('tenantData')), wx.getStorageSync('tenantId'),11111) | console.log(JSON.parse(wx.getStorageSync('tenantData')), wx.getStorageSync('tenantId'),11111) | ||||
| let list = []; | let list = []; | ||||
| let tindex = 0; | let tindex = 0; | ||||
| this.data.tenantData.map((item,index)=>{ | |||||
| list.push(item.name) | |||||
| if (item.tenantId == wx.getStorageSync('tenantId')){ | |||||
| tindex = index | |||||
| } | |||||
| }) | |||||
| console.log(list,tindex,9999) | |||||
| if (wx.getStorageSync('tenantData') && JSON.parse(wx.getStorageSync('tenantData')).length > 0){ | |||||
| JSON.parse(wx.getStorageSync('tenantData')).map((item, index) => { | |||||
| list.push(item.name) | |||||
| if (item.tenantId == wx.getStorageSync('tenantId')) { | |||||
| tindex = index | |||||
| } | |||||
| }) | |||||
| } | |||||
| this.setData({ | this.setData({ | ||||
| showGroupIf: wx.getStorageSync('tenantData') && JSON.parse(wx.getStorageSync('tenantData')).length > 0 ? true : false, | |||||
| tenantData: wx.getStorageSync('tenantData') ? JSON.parse(wx.getStorageSync('tenantData')) : [], | |||||
| tenantId: wx.getStorageSync('tenantId'), | |||||
| array:list, | array:list, | ||||
| index: tindex | index: tindex | ||||
| }) | }) | ||||