From 83a698185c7e8fe0b61077126345d2baefd7b2b5 Mon Sep 17 00:00:00 2001 From: modendeveloper Date: Thu, 27 Feb 2025 12:50:31 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A=E6=94=B6=E7=A4=BC=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E9=80=BB=E8=BE=91=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg_user/views/gift/components/GiftCard.vue | 11 +++++------ pkg_user/views/gift/receive.vue | 2 ++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pkg_user/views/gift/components/GiftCard.vue b/pkg_user/views/gift/components/GiftCard.vue index a4f8237..3f2e4a2 100644 --- a/pkg_user/views/gift/components/GiftCard.vue +++ b/pkg_user/views/gift/components/GiftCard.vue @@ -34,7 +34,7 @@ 礼包已被领取 - 去商城看看>> + 去商城看看>> @@ -90,7 +90,7 @@ export default { return !!cookie.get('login_status'); }, myGift() { - return this.card && this.card.giftProducts.filter(item => item.isCurrentUser === 1).length > 0 && this.card.giftProducts.filter(item => item.isCurrentUser === 1)[0] || this.card.giftProducts[0] + return this.card.giftProducts && this.card.giftProducts.filter(item => item.isCurrentUser === 1).length > 0 && this.card.giftProducts.filter(item => item.isCurrentUser === 1)[0] || this.card.giftProduct && this.card.giftProducts[0] } }, watch: { @@ -104,11 +104,10 @@ export default { deep: true }, // 修改后的监听器 - 'card': { + 'myGift': { handler(newVal) { - if (newVal.giftProducts && newVal.giftProducts[0] && newVal.giftProducts[0].isCurrentUser === 1) { - this.order = newVal.giftProducts[0].orderId - } + + this.order = newVal.orderId }, deep: true } diff --git a/pkg_user/views/gift/receive.vue b/pkg_user/views/gift/receive.vue index 442367c..6b3fce2 100644 --- a/pkg_user/views/gift/receive.vue +++ b/pkg_user/views/gift/receive.vue @@ -50,6 +50,8 @@ export default { getGiftCardDetail({ code: code }).then(res => { + console.log(res.data,'res.data'); + this.giftCard = res.data || {} }).catch(err => { this.giftCard = {