Commit b79857f8cffc0fdb3fccaaebb5c7f186f52ed8a1
1 parent
c1de8bf3
商户券明细
Showing
1 changed file
with
9 additions
and
16 deletions
pages/rechargeDetail/rechargeDetail.vue
| @@ -107,7 +107,7 @@ | @@ -107,7 +107,7 @@ | ||
| 107 | isLoadAll: false, | 107 | isLoadAll: false, |
| 108 | totalPages: 1, // 总页数 | 108 | totalPages: 1, // 总页数 |
| 109 | page: 1, | 109 | page: 1, |
| 110 | - pageSize: 5, | 110 | + pageSize: 10, |
| 111 | loadingTxt: '加载中...', | 111 | loadingTxt: '加载中...', |
| 112 | 112 | ||
| 113 | } | 113 | } |
| @@ -117,29 +117,24 @@ | @@ -117,29 +117,24 @@ | ||
| 117 | withShareTicket: true | 117 | withShareTicket: true |
| 118 | }); | 118 | }); |
| 119 | this.getKindType(); | 119 | this.getKindType(); |
| 120 | - this.page = 1 | ||
| 121 | - this.pageSize = 5 | ||
| 122 | - this.totalPages = 1 | ||
| 123 | - this.orderList = [] | 120 | + |
| 124 | }, | 121 | }, |
| 125 | onShow() { | 122 | onShow() { |
| 126 | - this.page = 1 | ||
| 127 | - this.pageSize = 5 | ||
| 128 | - this.totalPages = 1 | ||
| 129 | - this.orderList = [] | 123 | + |
| 130 | }, | 124 | }, |
| 131 | // 下拉刷新触发 | 125 | // 下拉刷新触发 |
| 132 | onPullDownRefresh(val) { | 126 | onPullDownRefresh(val) { |
| 133 | this.page = 1 | 127 | this.page = 1 |
| 134 | - this.pageSize = 5 | 128 | + this.pageSize = this.pageSize |
| 135 | this.totalPages = 1 | 129 | this.totalPages = 1 |
| 136 | console.log('下拉刷新', val) | 130 | console.log('下拉刷新', val) |
| 137 | this.fetchData() | 131 | this.fetchData() |
| 138 | }, | 132 | }, |
| 139 | // 上拉加载触发 | 133 | // 上拉加载触发 |
| 140 | onReachBottom() { | 134 | onReachBottom() { |
| 135 | + console.log('11') | ||
| 141 | // 判断当前页是否大于等于总页数 | 136 | // 判断当前页是否大于等于总页数 |
| 142 | - if (this.totalPages <= this.page) { | 137 | + if (this.totalPages === this.orderList.length) { |
| 143 | this.isLoadAll = true; | 138 | this.isLoadAll = true; |
| 144 | this.loadingTxt = '没有更多数据啦~'; | 139 | this.loadingTxt = '没有更多数据啦~'; |
| 145 | } else { | 140 | } else { |
| @@ -176,9 +171,7 @@ | @@ -176,9 +171,7 @@ | ||
| 176 | console.log(data) | 171 | console.log(data) |
| 177 | console.log(that.kind, that.type) | 172 | console.log(that.kind, that.type) |
| 178 | that.getDetailSummary(); | 173 | that.getDetailSummary(); |
| 179 | - that.page = 1 | ||
| 180 | - that.pageSize = 5 | ||
| 181 | - that.orderList = [] | 174 | + |
| 182 | that.fetchData() | 175 | that.fetchData() |
| 183 | }) | 176 | }) |
| 184 | }, | 177 | }, |
| @@ -268,8 +261,8 @@ | @@ -268,8 +261,8 @@ | ||
| 268 | data: that.$common.requestSign(paramsData) | 261 | data: that.$common.requestSign(paramsData) |
| 269 | }).then(res => { | 262 | }).then(res => { |
| 270 | 263 | ||
| 271 | - const resDataArray = res.data.dataList; | ||
| 272 | - if (that.totalPages === res.data.pageTotals) { | 264 | + const resDataArray = that.orderList.concat(res.data.dataList); |
| 265 | + if (that.orderList.length === res.data.pageTotals) { | ||
| 273 | that.isLoadAll = true; | 266 | that.isLoadAll = true; |
| 274 | that.loadingTxt = '没有更多数据啦~'; | 267 | that.loadingTxt = '没有更多数据啦~'; |
| 275 | that.orderList = resDataArray; | 268 | that.orderList = resDataArray; |