From b4acb8c469d4254cc3bd264d802dde152cfc5c08 Mon Sep 17 00:00:00 2001 From: lixuan Date: Thu, 24 Nov 2022 15:09:12 +0800 Subject: [PATCH] xiugai --- BagMoney/pages/oilCards/oilCards.vue | 11 +++++++++-- pages/tabbar/user/user.vue | 26 ++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/BagMoney/pages/oilCards/oilCards.vue b/BagMoney/pages/oilCards/oilCards.vue index d9e7df3..9144669 100644 --- a/BagMoney/pages/oilCards/oilCards.vue +++ b/BagMoney/pages/oilCards/oilCards.vue @@ -106,6 +106,7 @@ }, data() { return { + hideCard:[], loadStatus: 'load', userTotal: {}, historyList: [], @@ -234,11 +235,17 @@ } }) }, - getCards() { - accountApi.getUserAccount().then(res => { + async getCards() { + await accountApi.getSyncDeductions().then(res => { + if (res.code == 20000) { + this.hideCard = res.data.companyIds + } + }) + await accountApi.getUserAccount().then(res => { if (res.code == 20000) { if (res.data.length > 0) { this.cardList = res.data + this.cardList = this.cardList.filter(item=>!this.hideCard.includes(item.companyId)) this.cardList.forEach(item => { this.$set(item,'currentPage',1) this.$set(item,'loadStatus','more') diff --git a/pages/tabbar/user/user.vue b/pages/tabbar/user/user.vue index 68509c9..3d08a8d 100644 --- a/pages/tabbar/user/user.vue +++ b/pages/tabbar/user/user.vue @@ -57,7 +57,7 @@ 您一共有 {{userTotal.oilCardNumber}} + class="oil-main-color padding-left-xs padding-right-xs">{{cardSum.length}} 张油卡 @@ -139,6 +139,9 @@ }, data() { return { + showCard:[], + hideCard:[], + cardSum:[], yellowURL: this.global.yellowURL, imgURL: this.global.imgURL, starUrl: this.global.starUrl, @@ -195,15 +198,30 @@ toCards() { if(Number(this.userTotal.oilCardNumber)<=0) return uni.navigateTo({ - url: '/BagMoney/pages/oilCards/oilCards' + url: '/BagMoney/pages/oilCards/oilCards' }) }, - getAmount() { - accountApi.getTotalOilCardInfo().then(res => { + async getAmount() { + + await accountApi.getTotalOilCardInfo().then(res => { + console.log(1) if (res.code == 20000) { this.userTotal = res.data } }) + await accountApi.getUserAccount().then(res => { + console.log(2) + this.showCard = [] + res.data.forEach(item=>{ + this.showCard.push(item.companyId) + }) + }) + await accountApi.getSyncDeductions().then(res => { + console.log(3) + if (res.code == 20000) { + this.cardSum = this.showCard.filter(item=>!res.data.companyIds.includes(item)) + } + }) }, copy() { uni.setClipboardData({ -- 2.36.2