vue 列表页面的分页

	/**
			 * @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)
		},

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值