getId: function(i,tmpItems){
if(i == 2) return;
var that = this;
if(i == 0){
var tmpArr = [];
db.collection('video').skip(i*20).get({
success:function(res) {
for (let j = 0; j < res.data.length; j++) {
tmpArr.push(res.data[j])
}
that.getId(i+1,tmpArr)
}
})
}else {
var screenHeight = wx.getSystemInfoSync().windowHeight;
db.collection('video').skip(i*20).get({
success:function(res) {
var tempItems1 = [];
for (let j = 0; j < res.data.length; j++) {
tempItems1.push(res.data[j])
}
that.setData({
scrollHeight: screenHeight,
items: tempItems1.length == 20 ? tmpItems.concat(tempItems1) : tempItems1.concat(tmpItems),
videoUrl:totalItems[0].video,
})
}
})
}
原来只要data里数据赋值失败或者说是undefined都会不执行啊
调试?打断点?