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
+23 -9
View File
@@ -4,11 +4,15 @@
<view class="v12-justify-between v12-pa-2">
<view>
<view></view>
<view class="v12-font-28 v12-secondary-dark-text">送礼寄语</view>
<view class="v12-font-28 v12-secondary-dark-text v12-d-flex">
<u-icon :name="webUrl + '/icon/gift-primary.png'"></u-icon>
送礼寄语
</view>
</view>
<view class="v12-primary-text v12-font-26">
<view class="v12-primary-text v12-font-26 v12-d-flex v12-align-center">
<view @click="showCoverPicker = true">{{ cover }}封面</view>
<view>
<u-icon name="arrow-right" color="#c52733"></u-icon>
</view>
</view>
</view>
@@ -71,13 +75,13 @@
</view>
<u-divider v-if="isPayOk"></u-divider>
<view class="v12-font-26 v12-secondary-dark-text" v-if="isPayOk">
赠言{{ message }}
赠言{{ message || '礼笺轻启礼藏心意' }}
</view>
</view>
<view class="swich-btn" v-if="!isPayOk">
<view class="v12-font-28 v12-dark-text">是否支持好友转赠</view>
<view>
<u-switch v-model="canTransfe" ></u-switch>
<u-switch v-model="canTransfer" ></u-switch>
</view>
</view>
<button v-if="isPayOk" open-type="share" class="share-btn" >
@@ -102,7 +106,9 @@
<CoverPicker
:show.sync="showCoverPicker"
:list="coverList"
:product="goodsInfo.productInfo"
@confirm="onCoverConfirm"
:message="message"
/>
<passkeyborad
ref='payPwdPop'
@@ -137,7 +143,7 @@ export default {
data() {
return {
webUrl: this.$VUE_APP_RESOURCES_URL,
canTransfe: false,
canTransfer: false,
message: '',
cartId: '',
couponId: '',
@@ -146,6 +152,7 @@ export default {
showCoverPicker: false,
showPayPicker: false,
selectedCover: '',
giftImage: '',
orderKey: '',
goodsInfo: {},
cover: '默认',
@@ -170,7 +177,7 @@ export default {
return {
title: '送朋友',
path: `/pkg_user/views/gift/receive?code=${this.giftKey}`,
imageUrl: this.goodsInfo.productInfo.image
imageUrl: this.giftImage
}
},
methods: {
@@ -185,7 +192,8 @@ export default {
onCoverConfirm(cover) {
this.cover = cover.name
this.templateId = cover.id
this.selectedCover = cover.image
this.selectedCover = cover.cover
this.giftImage = cover.image
},
showTips() {
this.$refs.giftTips.showTips = true
@@ -235,7 +243,7 @@ export default {
templateId: this.templateId,
message : this.message,
cover: this.selectedCover,
canTransfe: this.canTransfe,
canTransfer: this.canTransfer ? 1 : 0,
payType: this.payType,
seckillId: this.orderGroupInfo.seckill_id,
combinationId: this.orderGroupInfo.combination_id,
@@ -287,7 +295,13 @@ export default {
case "WECHAT_PAY":
// 小程序支付
weappPay(data.result.jsConfig).finally(() => {
uni.showToast({
title: res.msg,
icon: "none",
duration: 2000
});
this.isPayOk = true;
this.giftKey = data.giftCard.code;
});
break;