Fix:3296 【礼品功能】未登录状态,点击领取礼包,登录前闪过礼包已被领取的页面,登录后显示的是待领取状态

This commit is contained in:
modendeveloper
2025-02-27 22:06:08 +08:00
parent b85a619027
commit 9a7456bdeb
+11 -4
View File
@@ -1,5 +1,5 @@
<template>
<view>
<view v-if="!loading">
<GiftCard v-if="!giftCard.isExpire" :card="giftCard" :addr="giftChooseAddress" @receive="getGiftCard($event)" />
<view v-else>
<view class="no-img-wrap">
@@ -24,7 +24,8 @@ export default {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
giftCard: {},
giftChooseAddress: {}
giftChooseAddress: {},
loading: false
}
},
onLoad(opts) {
@@ -47,17 +48,23 @@ export default {
})
},
getGiftCard(code) {
this.loading = true
uni.showLoading({
title: '加载中...',
mask: true
})
getGiftCardDetail({
code: code
}).then(res => {
console.log(res.data,'res.data');
this.giftCard = res.data || {}
this.loading = false
}).catch(err => {
this.giftCard = {
canTransfer: 0,
isReceive: true
}
}).finally(() => {
uni.hideLoading()
})
},