Task:礼品赠送/送礼、分享。收礼
This commit is contained in:
@@ -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
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user