Fix:4221 【商城小程序】已被领取的礼包在24小时后查看领取页面会显示为礼包已失效(应该显示为已领取的效果)

This commit is contained in:
linxi
2025-11-13 11:41:34 +08:00
parent 7cc2be3536
commit 6a526eb41c
+13 -5
View File
@@ -1,13 +1,13 @@
<template>
<view v-if="!loading">
<GiftCard
v-if="!giftCard.isExpire"
v-if="showGift"
:card="giftCard"
:isTravelGroup="isTravelGroup"
:addr="giftChooseAddress"
@receive="onReceive($event)" />
<view v-else>
<view class="no-img-wrap">
<view class="no-img-wrap" v-if="isExpire">
<view class="wrap-box" >
<image :src="webUrl + '/icon/no-gift.png'" mode="widthFix"></image>
<view class="v12-font-28 v12-dark1-text v12-mt-8">礼包超过24小时未领取订单已取消</view>
@@ -31,7 +31,8 @@ export default {
giftCard: {},
giftChooseAddress: {},
loading: false,
isTravelGroup: false
isTravelGroup: false,
isExpire: false
}
},
onLoad(opts) {
@@ -41,7 +42,11 @@ export default {
} else {
this.getGiftCard(opts.code)
}
},
computed: {
showGift() {
return !this.giftCard.isExpire || !!this.giftCard.isUserReceive
}
},
onShow() {
this.giftChooseAddress = uni.getStorageSync('giftChooseAddress') || {}
@@ -78,6 +83,7 @@ export default {
code: code
}).then(res => {
this.giftCard = res.data || {}
this.isExpire = this.giftCard.isExpire === 1
if(this.isTravelGroup && res.data.isUserReceive === 1) {
const obj = {
...res.data,
@@ -86,10 +92,11 @@ export default {
}
}
uni.reLaunch({ url: '/pkg_user/views/gift/receiveDone?obj=' + JSON.stringify(obj) })
} else {
this.loading = false
}
uni.hideLoading()
}).finally(() => {
this.loading = false
})
},
@@ -114,6 +121,7 @@ export default {
}).then(res => {
this.giftCard = res.data || {}
this.loading = false
this.isExpire = this.giftCard.isExpire === 1
if(this.giftCard.canTransfer === 0 ) {
uni.hideShareMenu()
return