diff --git a/pages.json b/pages.json index 526939e..ef0d94a 100644 --- a/pages.json +++ b/pages.json @@ -14,6 +14,13 @@ "pages": [ // pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages { + "path": "pages/businessCard/cardDetail", + "style": { + "navigationBarTitleText": "商户卡券明细", + "enablePullDownRefresh": true + } + }, + { "path": "pages/index/index", "style": { "navigationBarTitleText": "商户管理" @@ -66,12 +73,7 @@ "navigationBarTitleText": "商户卡券" } }, - { - "path": "pages/businessCard/cardDetail", - "style": { - "navigationBarTitleText": "商户卡券明细" - } - }, + { "path": "pages/parkRecordList/recordDetail", "style": { @@ -136,7 +138,7 @@ "navigationBarTitleText": "充值明细", "enablePullDownRefresh": true } - + }, { "path": "pages/rechargeDetail/outDetail", diff --git a/pages/businessCard/cardDetail.vue b/pages/businessCard/cardDetail.vue index ae18a00..4146337 100644 --- a/pages/businessCard/cardDetail.vue +++ b/pages/businessCard/cardDetail.vue @@ -102,6 +102,7 @@ + @@ -247,17 +248,12 @@ export default { isUesed: '1', //1:已使用/绑定 0:未使用 beginTime: currentDate, endTime: currentDate, - rows: [], pageNum: '1',//当前页 pageSize: '10',//每页条数 - reload: false, - status: 'more', - contentText: { - contentdown: '上拉加载更多~', - contentrefresh: '正在加载更多~', - contentmore: '我是有底线的~' - }, - iconType: 'auto', // 图标样式 + totalPages:'1', // 总条数 + // isLoadAll: false, + // reload: false, + status: 'no-more', dataList: [], } }, @@ -265,11 +261,27 @@ export default { wx.showShareMenu({ withShareTicket: true }) - this.couponIssuedParkPage() + this.fetchData() }, onShow() { var me = this; }, + // 下拉刷新触发 + onPullDownRefresh(val) { + console.log('下拉刷新触发') + this.pageNum = 1 + this.pageSize = this.pageSize + this.totalPages = 1 + this.dataList = [] + this.fetchData() + }, + // 上拉加载触发 + onReachBottom() { + console.log('上拉加载触发') + this.fetchData(); // 每次滑动请求接口,实现上拉加载更多数据 + + + }, computed: { startDate() { return this.getDate('start'); @@ -279,10 +291,18 @@ export default { } }, methods: { - - couponIssuedParkPage: function () { - console.log(this.arrayWay) + fetchData: function () { + console.log(this.totalPages) + console.log(this.dataList.length) + if (this.totalPages == this.dataList.length) { + this.status = 'no-more' + console.log('111') + return + } else { + this.pageNum++; + } let that = this + that.status = 'loading' let paramsData = { pageNum: this.pageNum, pageSize: this.pageSize, @@ -297,8 +317,15 @@ export default { method: 'POST', data: that.$common.requestSign(paramsData) }).then(res => { - this.dataList = res.data.dataList - console.log(this.dataList) + // const resDataArray = that.dataList.concat(res.data.dataList); + if(res.data.pageTotals<10){ + this.status = 'no-more' + }else{ + this.status = 'more' + } + that.totalPages = res.data.pageTotals; + that.dataList = that.dataList.concat(res.data.dataList) + console.log(that.dataList.length) }) }, bindPickerChange: function (e, storage) {