为什么console可以打印出数据库数据,但是页面却显示不正常,能打印出数据却没数据
<view class="weekCalendar" wx:if="{{Role == '超级管理员'}}">
<weekCalendar timeBean="{{timeBean}}" bind:lastWeek="lastWeek" bind:nextWeek="nextWeek" bind:dayClick="dayClick"></weekCalendar>
<view class="checkBody">
<view class="view1">
<view class="address" wx:for="{{addressList}}">{{item}}</view>
</view>
<view class="c9dateArrNull" wx:if="{{c9dateArr == ''}}">
暂无数据
</view>
<view class="states" wx:if="{{c9dateArr != ''}}">
<view>
<view wx:for="{{c9dateArr}}" wx:for-item="check" class="check">
<view class="icos">
<view wx:for="{{check}}" class="ico">
<view wx:if="{{(day > index || day == index) && item.state == '正常'}}" bindtap="toDetail" data-id="{{item._id}}" data-address="{{item.address}}">
<icon type="success"></icon>
</view>
<view wx:elif="{{(day > index || day == index) && item.state == '异常'}}" bindtap="toDetail" data-id="{{item._id}}" data-address="{{item.address}}">
<icon type="warn"></icon>
</view>
<view wx:elif="{{day > index}}" bindtap="warn">
<icon type="cancel" color="#DC143C"></icon>
</view>
<view wx:elif="{{(day < index || day == index)}}" bindtap="waiting">
<icon type="waiting" color="#C9C9C9"></icon>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="checkBody2" wx:for="{{otherArr}}" wx:for-index="idx">
<view class="otheraddress">{{item.address}}</view>
<view class="otherState" wx:if="{{otherArr[idx].state == '正常'}}" bindtap="toDetail" data-id="{{item.id}}" data-address="{{item.address}}">
<icon type="success"></icon>
</view>
<view class="otherState" wx:elif="{{otherArr[idx].state == '异常'}}" bindtap="toDetail" data-id="{{item.id}}" data-address="{{item.address}}">
<icon type="warn"></icon>
</view>
<view class="otherState" wx:elif="{{otherArr[idx].state == null}}" bindtap="waiting2">
<icon type="waiting" color="#C9C9C9"></icon>
</view>
<view class="otherState" wx:elif="{{otherArr[idx].state == '无记录'}}" bindtap="warn">
<icon type="cancel" color="#DC143C"></icon>
</view>
</view>
</view>
```javascript
data: {
selectWeek:0,
timeBean:{},
c9dateArr:[], //检查项列表
day:'',
bool:0,
addressList:[],
Role:'',
CGlist:'',
array:'1',
allCheck:'',
addressList2:[],
otherArr:[],
},
bl: function (e) {
var CGlist = []
var CGb1 = []
var CGb2 = []
var CGb3 = []
var CGb4 = []
var CGb5 = []
var CGb6 = []
var CGb7 = []
var CGb8 = []
var CGb1Zao = []
var CGb1Zhong = []
var CGb1Wan = []
var CGb2Zao = []
var CGb2Zhong = []
var CGb2Wan = []
var CGb3Zao = []
var CGb3Zhong = []
var CGb3Wan = []
var CGb4Zao = []
var CGb4Zhong = []
var CGb4Wan = []
var CGb5Zao = []
var CGb5Zhong = []
var CGb5Wan = []
var CGb6Zao = []
var CGb6Zhong = []
var CGb6Wan = []
var CGb7Zao = []
var CGb7Zhong = []
var CGb7Wan = []
var CGb8Zao = []
var CGb8Zhong = []
var CGb8Wan = []
var Role = wx.getStorageSync('Role')
//全局变量no判断显示哪一周的记录
var no = app.globalData.no
//获取每日检查记录
for (let i = 0; i < addressList1.length; i++) {
const address = addressList1[i];
const db = wx.cloud.database()
const _ = db.command
db.collection('CheckRecord').orderBy('date','desc').where({
address:address,
date: _.gte(startDate).and(_.lte(endDate))
}).get().then(res=>{
var array = res.data
array = array.reverse() //reverse() 方法用于颠倒数组中元素的顺序
this.setData({
array:array,
})
console.log(array)
for (let j = 0; j < array.length; j++) {
const element = array[j];
// console.log(addressList3[0].length)
// 将对应地点和记录进行分组
for (let index = 0; index < addressList3[0].length; index++) {
for(let i = 0; i < addressList4.length; i++){
if(element.address == addressList4[i] && addressList3[i][index] == element.dates){
addressList[i][index] = element;
}
}
}
c9dateArr = addressList3
this.setData({
c9dateArr:c9dateArr,
})
// console.log("c9dateArr:"+c9dateArr)
}
})
}
```