From 7f4ac663289fe78b53b271244411eb96de439f20 Mon Sep 17 00:00:00 2001 From: caserKing Date: Sat, 3 Aug 2019 14:07:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=B9=E6=A1=86=E4=BC=98=E5=8C=96=E6=BB=91?= =?UTF-8?q?=E5=8A=A8=E7=82=B9d=E7=82=B9=E9=80=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/passCar/passCar.js | 40 +++++++++++++++++++++++++++----------- pages/passCar/passCar.wxml | 2 +- 2 files changed, 30 insertions(+), 12 deletions(-) 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 @@ 敬请期待 - +