53 lines
914 B
Vue
53 lines
914 B
Vue
<template>
|
|
<view>
|
|
<GiftCard :card="giftCard" :addr="giftChooseAddress" />
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import GiftCard from './components/GiftCard.vue'
|
|
import { getGiftCardDetail } from '@/api/gift'
|
|
export default {
|
|
components: {
|
|
GiftCard
|
|
},
|
|
data() {
|
|
return {
|
|
giftCard: {},
|
|
giftChooseAddress: {}
|
|
}
|
|
},
|
|
onLoad(opts) {
|
|
this.getGiftCard(opts.code)
|
|
},
|
|
onShow() {
|
|
this.giftChooseAddress = uni.getStorageSync('giftChooseAddress') || {}
|
|
},
|
|
methods: {
|
|
getGiftCard(code) {
|
|
getGiftCardDetail({
|
|
code: code
|
|
}).then(res => {
|
|
this.giftCard = res.data || {}
|
|
}).catch(err => {
|
|
this.giftCard = {
|
|
canTransfer: 0,
|
|
isReceive: true
|
|
}
|
|
})
|
|
},
|
|
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
.top-card{
|
|
width: 710rpx;
|
|
height: 280rpx;
|
|
background: #fff;
|
|
border-radius: 16rpx;
|
|
}
|
|
|
|
|
|
</style> |