pull/2/head
lixuan 2 years ago
parent ee65c64286
commit b4acb8c469
  1. 11
      BagMoney/pages/oilCards/oilCards.vue
  2. 24
      pages/tabbar/user/user.vue

@ -106,6 +106,7 @@
}, },
data() { data() {
return { return {
hideCard:[],
loadStatus: 'load', loadStatus: 'load',
userTotal: {}, userTotal: {},
historyList: [], historyList: [],
@ -234,11 +235,17 @@
} }
}) })
}, },
getCards() { async getCards() {
accountApi.getUserAccount().then(res => { 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.code == 20000) {
if (res.data.length > 0) { if (res.data.length > 0) {
this.cardList = res.data this.cardList = res.data
this.cardList = this.cardList.filter(item=>!this.hideCard.includes(item.companyId))
this.cardList.forEach(item => { this.cardList.forEach(item => {
this.$set(item,'currentPage',1) this.$set(item,'currentPage',1)
this.$set(item,'loadStatus','more') this.$set(item,'loadStatus','more')

@ -57,7 +57,7 @@
<view class="text-center"> <view class="text-center">
<text class="text-sm">您一共有 <text class="text-sm">您一共有
<text <text
class="oil-main-color padding-left-xs padding-right-xs">{{userTotal.oilCardNumber}}</text> class="oil-main-color padding-left-xs padding-right-xs">{{cardSum.length}}</text>
张油卡</text> 张油卡</text>
</view> </view>
</view> </view>
@ -139,6 +139,9 @@
}, },
data() { data() {
return { return {
showCard:[],
hideCard:[],
cardSum:[],
yellowURL: this.global.yellowURL, yellowURL: this.global.yellowURL,
imgURL: this.global.imgURL, imgURL: this.global.imgURL,
starUrl: this.global.starUrl, starUrl: this.global.starUrl,
@ -198,12 +201,27 @@
url: '/BagMoney/pages/oilCards/oilCards' url: '/BagMoney/pages/oilCards/oilCards'
}) })
}, },
getAmount() { async getAmount() {
accountApi.getTotalOilCardInfo().then(res => {
await accountApi.getTotalOilCardInfo().then(res => {
console.log(1)
if (res.code == 20000) { if (res.code == 20000) {
this.userTotal = res.data 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() { copy() {
uni.setClipboardData({ uni.setClipboardData({

Loading…
Cancel
Save