Fix:收礼相关逻辑补充

This commit is contained in:
modendeveloper
2025-02-27 12:39:36 +08:00
parent e56dca5b92
commit e257419351
3 changed files with 21 additions and 11 deletions
+12 -8
View File
@@ -1,5 +1,5 @@
<template>
<view class="dialog-conent" v-if="isLogin">
<view class="dialog-conent" v-show="isLogin">
<view class="gift-card-modal" >
<image class="bg-image" :src="card.cover" mode="aspectFit|aspectFill|widthFix" lazy-load="false"></image>
<view class="image-wrap">
@@ -16,25 +16,25 @@
</view>
<view class="btn-wrap">
<button v-if="!isReceive && card.giftProducts[0].isCurrentUser !== 1" class="share-btn v12-white-text v12-primary" @click="setAddress(0)">
<button v-if="!isReceive && myGift.isCurrentUser !== 1" class="share-btn v12-white-text v12-primary" @click="setAddress(0)">
填写地址并收下
</button>
<button v-if="card.canTransfer !== 0 && !isReceive && card.giftProducts[0].isCurrentUser !== 1" open-type="share" class="share-btn v12-white v12-primary-text v12-d-flex" >
<button v-if="card.canTransfer !== 0 && !isReceive && myGift.isCurrentUser !== 1" open-type="share" class="share-btn v12-white v12-primary-text v12-d-flex" >
点击转赠给好友
<u-icon :name="webUrl + '/icon/share.png'" ></u-icon>
</button>
</view>
<view v-if=" card && card.giftProducts[0] && card.giftProducts[0].isCurrentUser === 1" @click="toOrder" style="z-index: 10">
<view v-if="myGift.isCurrentUser === 1" @click="toOrder" style="z-index: 10">
<view class="address-btn v12-white-text v12-primary">
您已领取礼包
</view>
<view class="v12-text-center v12-font-26 v12-primary-text v12-mt-3">查看礼包详情>></view>
</view>
<view v-if="isReceive && card && card.giftProducts[0] && card.giftProducts[0].isCurrentUser === 0" @click="toHome" style="z-index: 10">
<view v-if="isReceive && myGift.isCurrentUser === 0" @click="toHome" style="z-index: 10">
<view class="address-btn v12-white-text v12-primary">
礼包已被领取
</view>
<view class="v12-text-center v12-font-26 v12-primary-text v12-mt-3">去商城看看>></view>
<view @click="toHome" class="v12-text-center v12-font-26 v12-primary-text v12-mt-3" style="z-index: 10">去商城看看>></view>
</view>
<view class="tips">
<view class="tip-text v12-mr-1" @click="showTips">
@@ -88,6 +88,9 @@ export default {
},
isLogin() {
return !!cookie.get('login_status');
},
myGift() {
return this.card && this.card.giftProducts.filter(item => item.isCurrentUser === 1).length > 0 && this.card.giftProducts.filter(item => item.isCurrentUser === 1)[0] || this.card.giftProducts[0]
}
},
watch: {
@@ -137,14 +140,15 @@ export default {
// 领取礼包
getGiftCardReceive({
code: this.card.code,
recipientsNum : 1,
addressId: e
}).then(res => {
this.$refs.addressDialog.close()
this.$refs.AddressList.close()
this.order = res.data.orderId
this.$emit('receive', this.order)
}).finally(() => {
this.$emit('receive', this.card.code)
uni.hideLoading()
}).finally(() => {
})
},
setAddress(flag) {
+1
View File
@@ -281,6 +281,7 @@ export default {
from: 'routine',
cartId: this.cartId,
couponId: this.couponId,
recipientsNum: this.goodsInfo.cartNum,
templateId: this.templateId,
message : this.message || '礼笺轻启,礼藏心意',
cover: this.selectedCover,
+8 -3
View File
@@ -1,12 +1,12 @@
<template>
<view>
<GiftCard v-if="!giftCard.expireTime" :card="giftCard" :addr="giftChooseAddress" @receive="getGiftCard($event)" />
<GiftCard v-if="!giftCard.isExpire" :card="giftCard" :addr="giftChooseAddress" @receive="getGiftCard($event)" />
<view v-else>
<view class="no-img-wrap">
<view class="wrap-box">
<view class="wrap-box" >
<image :src="webUrl + '/icon/no-gift.png'" mode="widthFix"></image>
<view class="v12-font-28 v12-dark1-text v12-mt-8">礼包超过24小时未领取订单已取消</view>
<view class="v12-font-28 v12-primary-text v12-primary-border go-btn">去商城看看</view>
<view @click="toHome" class="v12-font-28 v12-primary-text v12-primary-border go-btn">去商城看看</view>
</view>
</view>
</view>
@@ -41,6 +41,11 @@ export default {
}
},
methods: {
toHome() {
uni.switchTab({
url: '/pages/home/index'
})
},
getGiftCard(code) {
getGiftCardDetail({
code: code