Commit b79857f8cffc0fdb3fccaaebb5c7f186f52ed8a1

Authored by 刘淇
1 parent c1de8bf3

商户券明细

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