Commit df5a06e0f95433e924d432f6aa392e4922cee0aa

Authored by 刘淇
1 parent bb75b0a6

商户券明细

pages.json
@@ -14,6 +14,13 @@ @@ -14,6 +14,13 @@
14 "pages": [ 14 "pages": [
15 // pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages 15 // pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
16 { 16 {
  17 + "path": "pages/businessCard/cardDetail",
  18 + "style": {
  19 + "navigationBarTitleText": "商户卡券明细",
  20 + "enablePullDownRefresh": true
  21 + }
  22 + },
  23 + {
17 "path": "pages/index/index", 24 "path": "pages/index/index",
18 "style": { 25 "style": {
19 "navigationBarTitleText": "商户管理" 26 "navigationBarTitleText": "商户管理"
@@ -66,12 +73,7 @@ @@ -66,12 +73,7 @@
66 "navigationBarTitleText": "商户卡券" 73 "navigationBarTitleText": "商户卡券"
67 } 74 }
68 }, 75 },
69 - {  
70 - "path": "pages/businessCard/cardDetail",  
71 - "style": {  
72 - "navigationBarTitleText": "商户卡券明细"  
73 - }  
74 - }, 76 +
75 { 77 {
76 "path": "pages/parkRecordList/recordDetail", 78 "path": "pages/parkRecordList/recordDetail",
77 "style": { 79 "style": {
@@ -136,7 +138,7 @@ @@ -136,7 +138,7 @@
136 "navigationBarTitleText": "充值明细", 138 "navigationBarTitleText": "充值明细",
137 "enablePullDownRefresh": true 139 "enablePullDownRefresh": true
138 } 140 }
139 - 141 +
140 }, 142 },
141 { 143 {
142 "path": "pages/rechargeDetail/outDetail", 144 "path": "pages/rechargeDetail/outDetail",
pages/businessCard/cardDetail.vue
@@ -102,6 +102,7 @@ @@ -102,6 +102,7 @@
102 </uni-list> 102 </uni-list>
103 </uni-section> 103 </uni-section>
104 </view> 104 </view>
  105 + <uni-load-more :status="status" />
105 </view> 106 </view>
106 107
107 108
@@ -247,17 +248,12 @@ export default { @@ -247,17 +248,12 @@ export default {
247 isUesed: '1', //1:已使用/绑定 0:未使用 248 isUesed: '1', //1:已使用/绑定 0:未使用
248 beginTime: currentDate, 249 beginTime: currentDate,
249 endTime: currentDate, 250 endTime: currentDate,
250 - rows: [],  
251 pageNum: '1',//当前页 251 pageNum: '1',//当前页
252 pageSize: '10',//每页条数 252 pageSize: '10',//每页条数
253 - reload: false,  
254 - status: 'more',  
255 - contentText: {  
256 - contentdown: '上拉加载更多~',  
257 - contentrefresh: '正在加载更多~',  
258 - contentmore: '我是有底线的~'  
259 - },  
260 - iconType: 'auto', // 图标样式 253 + totalPages:'1', // 总条数
  254 + // isLoadAll: false,
  255 + // reload: false,
  256 + status: 'no-more',
261 dataList: [], 257 dataList: [],
262 } 258 }
263 }, 259 },
@@ -265,11 +261,27 @@ export default { @@ -265,11 +261,27 @@ export default {
265 wx.showShareMenu({ 261 wx.showShareMenu({
266 withShareTicket: true 262 withShareTicket: true
267 }) 263 })
268 - this.couponIssuedParkPage() 264 + this.fetchData()
269 }, 265 },
270 onShow() { 266 onShow() {
271 var me = this; 267 var me = this;
272 }, 268 },
  269 + // 下拉刷新触发
  270 + onPullDownRefresh(val) {
  271 + console.log('下拉刷新触发')
  272 + this.pageNum = 1
  273 + this.pageSize = this.pageSize
  274 + this.totalPages = 1
  275 + this.dataList = []
  276 + this.fetchData()
  277 + },
  278 + // 上拉加载触发
  279 + onReachBottom() {
  280 + console.log('上拉加载触发')
  281 + this.fetchData(); // 每次滑动请求接口,实现上拉加载更多数据
  282 +
  283 +
  284 + },
273 computed: { 285 computed: {
274 startDate() { 286 startDate() {
275 return this.getDate('start'); 287 return this.getDate('start');
@@ -279,10 +291,18 @@ export default { @@ -279,10 +291,18 @@ export default {
279 } 291 }
280 }, 292 },
281 methods: { 293 methods: {
282 -  
283 - couponIssuedParkPage: function () {  
284 - console.log(this.arrayWay) 294 + fetchData: function () {
  295 + console.log(this.totalPages)
  296 + console.log(this.dataList.length)
  297 + if (this.totalPages == this.dataList.length) {
  298 + this.status = 'no-more'
  299 + console.log('111')
  300 + return
  301 + } else {
  302 + this.pageNum++;
  303 + }
285 let that = this 304 let that = this
  305 + that.status = 'loading'
286 let paramsData = { 306 let paramsData = {
287 pageNum: this.pageNum, 307 pageNum: this.pageNum,
288 pageSize: this.pageSize, 308 pageSize: this.pageSize,
@@ -297,8 +317,15 @@ export default { @@ -297,8 +317,15 @@ export default {
297 method: 'POST', 317 method: 'POST',
298 data: that.$common.requestSign(paramsData) 318 data: that.$common.requestSign(paramsData)
299 }).then(res => { 319 }).then(res => {
300 - this.dataList = res.data.dataList  
301 - console.log(this.dataList) 320 + // const resDataArray = that.dataList.concat(res.data.dataList);
  321 + if(res.data.pageTotals<10){
  322 + this.status = 'no-more'
  323 + }else{
  324 + this.status = 'more'
  325 + }
  326 + that.totalPages = res.data.pageTotals;
  327 + that.dataList = that.dataList.concat(res.data.dataList)
  328 + console.log(that.dataList.length)
302 }) 329 })
303 }, 330 },
304 bindPickerChange: function (e, storage) { 331 bindPickerChange: function (e, storage) {