From b79857f8cffc0fdb3fccaaebb5c7f186f52ed8a1 Mon Sep 17 00:00:00 2001 From: liugongyu <290219706@qq.com> Date: Tue, 17 May 2022 14:00:22 +0800 Subject: [PATCH] 商户券明细 --- pages/rechargeDetail/rechargeDetail.vue | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/pages/rechargeDetail/rechargeDetail.vue b/pages/rechargeDetail/rechargeDetail.vue index ae81be7..c915e3d 100644 --- a/pages/rechargeDetail/rechargeDetail.vue +++ b/pages/rechargeDetail/rechargeDetail.vue @@ -107,7 +107,7 @@ isLoadAll: false, totalPages: 1, // 总页数 page: 1, - pageSize: 5, + pageSize: 10, loadingTxt: '加载中...', } @@ -117,29 +117,24 @@ withShareTicket: true }); this.getKindType(); - this.page = 1 - this.pageSize = 5 - this.totalPages = 1 - this.orderList = [] + }, onShow() { - this.page = 1 - this.pageSize = 5 - this.totalPages = 1 - this.orderList = [] + }, // 下拉刷新触发 onPullDownRefresh(val) { this.page = 1 - this.pageSize = 5 + this.pageSize = this.pageSize this.totalPages = 1 console.log('下拉刷新', val) this.fetchData() }, // 上拉加载触发 onReachBottom() { + console.log('11') // 判断当前页是否大于等于总页数 - if (this.totalPages <= this.page) { + if (this.totalPages === this.orderList.length) { this.isLoadAll = true; this.loadingTxt = '没有更多数据啦~'; } else { @@ -176,9 +171,7 @@ console.log(data) console.log(that.kind, that.type) that.getDetailSummary(); - that.page = 1 - that.pageSize = 5 - that.orderList = [] + that.fetchData() }) }, @@ -268,8 +261,8 @@ data: that.$common.requestSign(paramsData) }).then(res => { - const resDataArray = res.data.dataList; - if (that.totalPages === res.data.pageTotals) { + const resDataArray = that.orderList.concat(res.data.dataList); + if (that.orderList.length === res.data.pageTotals) { that.isLoadAll = true; that.loadingTxt = '没有更多数据啦~'; that.orderList = resDataArray; -- libgit2 0.21.4