From e0d29a0ac043cdf3c3b96ba6a1ddd97ca9fb36d1 Mon Sep 17 00:00:00 2001 From: youmengting <2080639302@qq.com> Date: Tue, 2 Jan 2024 16:33:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=86=E9=A1=B5=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E9=80=BB=E8=BE=91=E4=BB=A5=E5=8F=8A=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E5=86=99=E9=94=99=E8=AF=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/bindScan/bindScan.vue | 63 +++++++++++-------- .../equity-activities-details.vue | 27 ++++---- .../equity-activities/equity-activities.vue | 8 +-- .../index/normal-Merchant/normal-Merchant.vue | 27 ++++---- pages/index/scanList/scanList.vue | 29 +++++---- 5 files changed, 85 insertions(+), 69 deletions(-) diff --git a/pages/index/bindScan/bindScan.vue b/pages/index/bindScan/bindScan.vue index 424be23..a0c66e6 100644 --- a/pages/index/bindScan/bindScan.vue +++ b/pages/index/bindScan/bindScan.vue @@ -34,7 +34,7 @@ return { serviceList: [], pageNum: 1, - pagesize: 15, + pageSize: 15, isLoadMore: false, //是否加载中 userInfo: app.globalData.userInfo, //用户信息 typeId: '', //类型 @@ -43,14 +43,10 @@ } }, onReachBottom() { //上拉触底函数 - if (!this.isLoadMore) { //此处判断,上锁,防止重复请求 - this.isLoadMore = true - this.pageNum += 1 - if (this.typeId == 2) { - this.getStoreQrCodeList(); - } else { - this.getSalesmanQrCodeList(); - } + if (this.typeId == 2) { + this.getStoreQrCodeList(); + } else { + this.getSalesmanQrCodeList(); } }, onLoad(options) { @@ -68,7 +64,6 @@ methods: { toSearch() { this.pageNum = 1; - this.pageSize = 10; this.isLoadMore = false; this.serviceList = []; if (this.typeId == 2) { @@ -79,59 +74,75 @@ }, //门店查询设备列表 getStoreQrCodeList() { + if (this.isLoadMore) { + return false; + } + uni.showLoading({ title: '加载中...' }) let params = { pageNum: this.pageNum, - pageSize: this.pagesize, + pageSize: this.pageSize, serialNumber: this.scanNo, storeId: this.storeId } getStoreQrCodeList(params).then(res => { uni.hideLoading(); if (res.return_code == '000000' && res.return_data.list) { - this.isLoadMore = res.return_data.list.length == this.pageSize ? false : true; this.serviceList = this.serviceList.concat(res.return_data.list); - if (res.return_data.total == (this.pageNum * this.pageSize)) { + if (res.return_data.total == this.serviceList.length) { this.isLoadMore = true; + }else{ + this.isLoadMore = false; } - this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; + this.pageNum = this.pageNum + 1; } else { this.serviceList = []; - this.isLoadMore = true + this.isLoadMore = true; + uni.showToast({ + title: res.return_msg, + icon: 'none', + duration: 2000 + }) } }); }, //业务员查询设备列表 getSalesmanQrCodeList() { - uni.showLoading({ - title: '加载中...' - }) if (this.isLoadMore) { - uni.hideLoading() return false; } - let pagenum = this.pageNum; + uni.showLoading({ + title: '加载中...' + }) + let datas = { salesmanId: this.userInfo.salesman.id, isAssignStore: false, serialNumber: this.scanNo, - pageNum: pagenum, - pageSize: this.pagesize, + pageNum: this.pageNum, + pageSize: this.pageSize, } getSalesmanQrCodeList(datas).then(res => { uni.hideLoading(); if (res.return_code == '000000' && res.return_data.list) { - this.isLoadMore = res.return_data.list.length == this.pageSize ? false : true; this.serviceList = this.serviceList.concat(res.return_data.list); - if (res.return_data.total == (this.pageNum * this.pageSize)) { + if (res.return_data.total == this.serviceList.length) { this.isLoadMore = true; + }else{ + this.isLoadMore = false; } - this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum; + this.pageNum = this.pageNum + 1; + } else { this.serviceList = []; - this.isLoadMore = true + this.isLoadMore = true; + uni.showToast({ + title: res.return_msg, + icon: 'none', + duration: 2000 + }) } }); }, diff --git a/pages/index/equity-activities-details/equity-activities-details.vue b/pages/index/equity-activities-details/equity-activities-details.vue index 2ef26b2..2b7eb30 100644 --- a/pages/index/equity-activities-details/equity-activities-details.vue +++ b/pages/index/equity-activities-details/equity-activities-details.vue @@ -22,19 +22,20 @@ 商户信息 - - - 商户名称 - {{merDetailInfo.mer.merName}} - - - 支行名称 - {{merDetailInfo.mer.merSettleAcct.openningBankName}} - - - 支行行号 - {{merDetailInfo.mer.merSettleAcct.openningBankCode}} - +