Fix:收礼相关逻辑补充
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user