From 8dd3c0150d296a787be05c0e14357d7fb6ae391c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BD=90=E5=A4=A9=E5=A4=A7=E5=9C=A3?= <17615834396@163.com> Date: Fri, 5 Jan 2024 18:21:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gasStation-uni/pagesMy/Coupons/Coupons.vue | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/gasStation-uni/pagesMy/Coupons/Coupons.vue b/gasStation-uni/pagesMy/Coupons/Coupons.vue index 0323402b3..ce675fab5 100644 --- a/gasStation-uni/pagesMy/Coupons/Coupons.vue +++ b/gasStation-uni/pagesMy/Coupons/Coupons.vue @@ -102,9 +102,15 @@ components: { }, - onShow() { + onLoad() { this.query.storeId = uni.getStorageSync("storeId") - this.isDrawDown(); + this.getGiftRecords() + this.isDrawDown() + this.getAllCardFavorables() + }, + onShow() { + + console.log(this.query); }, @@ -117,10 +123,14 @@ }).then(res => { if (res.code == 200) { this.cardFavorableList = res.data.records; + if (this.cardFavorableList.length == 0) { + this.shows = false + } // console.log("555" + this.cardFavorableList) for (var i = 0; i < res.data.records.length; i++) { this.idList.push(res.data.records[i].id) } + /* this.cardFavorableList.forEach(item => this.idList.push(item.id)); console.log("333" + idList) */ } @@ -137,6 +147,7 @@ console.log("222" + res) if (res.code == 200 && res.data == true) { this.shows = false + this.getGiftRecords() uni.showToast({ title: '领取成功!' }) @@ -154,19 +165,20 @@ method: 'get', params: this.query }).then(res => { + if (res.code == 200 && res.data == true) { this.shows = true } else { this.shows = false } - this.getGiftRecords(); - this.getAllCardFavorables(); + }) }, goRecharge(id, cardRecordId) { uni.navigateTo({ - url: '/pagesHome/oilRecharge/oilRecharge?id=0&cardFavorableId=' + id + '&cardRecordId=' + + url: '/pagesHome/oilRecharge/oilRecharge?id=0&cardFavorableId=' + id + + '&cardRecordId=' + cardRecordId }) },