Fix:收礼相关逻辑补充

This commit is contained in:
modendeveloper
2025-02-27 12:50:31 +08:00
parent e257419351
commit 83a698185c
2 changed files with 7 additions and 6 deletions
+5 -6
View File
@@ -34,7 +34,7 @@
<view class="address-btn v12-white-text v12-primary">
礼包已被领取
</view>
<view @click="toHome" class="v12-text-center v12-font-26 v12-primary-text v12-mt-3" style="z-index: 10">去商城看看>></view>
<view class="v12-text-center v12-font-26 v12-primary-text v12-mt-3" style="z-index: 10">去商城看看>></view>
</view>
<view class="tips">
<view class="tip-text v12-mr-1" @click="showTips">
@@ -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
}