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
+22 -7
View File
@@ -52,12 +52,14 @@
</view>
<view class="gift-bottom">
<view class="gift-txt">
赠言{{ item.message }}
赠言{{ item.message || '礼笺轻启,礼藏心意' }}
</view>
<!-- 状态 0-待领取 1-已全部领取 2-已失效 -->
<view
<button
v-if="item.status === 0"
open-type="share"
class="btn"
@click="shareGift(item)"
>
送给朋友
<image
@@ -65,7 +67,7 @@
class="icon"
mode="widthFix"
/>
</view>
</button>
<view
v-if="item.status === 1"
class="btn"
@@ -95,7 +97,7 @@
class="gift-item"
>
<view
v-for="(cart, cartIndex) in item.giftInfo"
v-for="(cart, cartIndex) in item.giftInfos"
:key="cartIndex"
class="gift-body"
@click="giftItemClickHanlde(item)"
@@ -116,14 +118,14 @@
</view>
<view class="price-wrap">
<view class="price">
<text class="prefix"></text>{{ item.payPrice }}
<text class="prefix"></text>{{ cart.productInfo.price }}
</view>
</view>
</view>
</view>
<view class="gift-bottom">
<view class="gift-txt">
赠言{{ item.message }}
赠言{{ item.message || '礼笺轻启,礼藏心意' }}
</view>
<view
:class="{
@@ -192,7 +194,8 @@ export default {
],
isLoad: false,
sendList: [],
receiveList: []
receiveList: [],
giftItem: {}
}
},
created() {
@@ -201,7 +204,19 @@ export default {
})
this.getGiftCardSendList()
},
onShareAppMessage() {
return {
title: '送朋友',
path: `/pkg_user/views/gift/receive?code=${this.giftItem.code}`,
imageUrl: this.giftItem.giftInfo[0].productInfo.image
}
},
methods: {
shareGift(item) {
console.log(item);
this.giftItem = item
},
cateItemClickHanlde(item, index) {
if (this.cateIndex === index || !this.isLoad) return
this.cateIndex = index