Task:礼品赠送/送礼、分享。收礼

This commit is contained in:
modendeveloper
2025-02-22 19:20:33 +08:00
parent f0a4a0edf9
commit aedc2fd768
9 changed files with 543 additions and 90 deletions
+15 -5
View File
@@ -1,6 +1,6 @@
<template>
<view>
<GiftCard :card="giftCard"/>
<GiftCard :card="giftCard" :addr="giftChooseAddress" />
</view>
</template>
@@ -13,18 +13,28 @@ export default {
},
data() {
return {
giftCard: {}
giftCard: {},
giftChooseAddress: {}
}
},
onLoad(opts) {
this.getGiftCard(opts.code)
},
onShow() {
this.giftChooseAddress = uni.getStorageSync('giftChooseAddress') || {}
},
methods: {
async getGiftCard(code) {
const res = await getGiftCardDetail({
getGiftCard(code) {
getGiftCardDetail({
code: code
}).then(res => {
this.giftCard = res.data || {}
}).catch(err => {
this.giftCard = {
canTransfer: 0,
isReceive: true
}
})
this.giftCard = res.data
},
}