/**
* @param {Object} isLoad 是否翻页
*/
getHelpList(isLoad) {
if (isLoad){
//如果是翻页
if (this.pageNo * this.pageSize <= this.helpList.length) {
//如果当前列表满足整页,说明可能有下一页存在
this.pageNo += 1
} else {
//如果不满足整页,说明没有下一页,不需要请求接口
return
}
}else{
//如果翻页,页码设置为1
this.pageNo = 1
}
let parmas = {
column: 'id',
order: 'desc',
pageNo: this.pageNo,
pageSize: this.pageSize,
superQueryMatchType: 'and'
}
this.keyword ? parmas.help_center = '*'+this.keyword+'*' : ''
getOnlineList(this.$KEY.SOL_HELP_CENTER, parmas).then(res => {
let {
code,
result: {
records,
total
}
} = res.data
if (this.pageNo == 1){
//如果页码是1,表示刷新
this.helpList = records || []
}else{
// 如果页码不为1,表示翻页,累加数组
this.helpList = this.helpList.concat(records || [])
}
}).catch(() => {
})
},
onReachBottom() {
this.getHelpList(true)
},
|