getForum() {
db.collection('karticle').aggregate()
.group({
_id: '$type',
num: $.sum(1)
})
.sort({
_id: 1
})
.end()
.then(res => {
console.log('分类数据', res)
this.setData({
tabs: res.list
})
this.getList()
})
},
getList() {
let type = this.data.tabs[this.data.tabCur]._id
wx.cloud.callFunction({
name: "karticle",
data: {
action: 'getList',
type: type
}
})
.then(res => {
console.log('列表成功', res)
this.setData({
list: res.result.data
})
})
},
this.data.tabs[this.data.tabCur] 这个有问题,打印this.data.tabs,再打印this.data.tabCur