Files
xdd-uniapp-new/pkg_user/views/gift/receive.vue
T

60 lines
1.1 KiB
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') || {}
},
onShareAppMessage() {
return {
title: this.giftCard.message || '礼笺轻启,礼藏心意',
path: `/pkg_user/views/gift/receive?code=${this.giftCard.code}`,
imageUrl: this.giftCard.image
}
},
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>