diff --git a/pages/passCar/passCar.js b/pages/passCar/passCar.js index e01935b..88c8e28 100644 --- a/pages/passCar/passCar.js +++ b/pages/passCar/passCar.js @@ -43,7 +43,7 @@ Page({ loadingUrl: imgurl.loading.url, allow_load: true, curPageNum: 1, - curPageSize: 4, + curPageSize: 15, curTotalpageNum: 0, quantitle: '', quanid: '', @@ -93,7 +93,7 @@ Page({ url: config.api.couponOrderCarList, data: { pageNum: pageNum, - pageSize: 20, + pageSize: 15, couponOrderStatus: key } }).then(res => { @@ -121,10 +121,18 @@ Page({ * concat 不会改变原数组值 * push 会改变原数组值,但不会一条一条插入,而是整个数组插入 */ - that.data.ticketList = that.data.ticketList.concat(res.data.list); - that.setData({ - ticketList: that.data.ticketList - }); + if (pageNum == 1) { + that.setData({ + ticketList: res.data.list, + curPageNum: pageNum + }); + } else { + that.setData({ + ticketList: that.data.ticketList.concat(res.data.list) + }); + } + // that.data.ticketList = that.data.ticketList.concat(res.data.list); + this.hideLoading(); }) .catch(err => { @@ -216,6 +224,7 @@ Page({ }) }, onShow: function (options) { + console.log(123) var that = this; that.setData({ etcpAppId: extConfig.attr.etcpAppId, @@ -260,14 +269,23 @@ Page({ addCar: null }); } - this.setData({ - ticketList: [], - curPageNum: 1 - }) + this.getTicketList(0, 1); + }, + cancelMove: function() { + console.log(111) + return false; + }, + onHide: function () { + this.setData({ + allow_load: true, + showTicketModal: false, + curPageNum: 1, + ticketList: [] + }) }, onLoad: function (options) { var that = this; @@ -485,7 +503,7 @@ Page({ url: config.api.couponOrderCarList + "?type=5&couponOrderStatus=0", data: { pageNum: 1, - pageSize: 20, + pageSize: 15, couponOrderStatus: 0 } }).then(res => { diff --git a/pages/passCar/passCar.wxml b/pages/passCar/passCar.wxml index c7090cf..c317396 100644 --- a/pages/passCar/passCar.wxml +++ b/pages/passCar/passCar.wxml @@ -108,7 +108,7 @@ 敬请期待 - +