Task:抽奖

This commit is contained in:
LinCyJang
2026-05-07 00:10:09 +08:00
parent 91aad660e6
commit 59565871d9
7 changed files with 286 additions and 27 deletions
+117 -3
View File
@@ -180,6 +180,28 @@
:show-tab="false"
/>
</u-popup>
<u-popup
:show="showLotteryGiftPopup"
:round="40"
mode="center"
:close-on-click-overlay="false"
bgColor="transparent"
>
<view class="lottery-gift-popup">
<view class="lottery-gift-close" @click="closeLotteryGiftPopup">
<u-icon name="close-circle" color="#111" size="24"></u-icon>
</view>
<view class="lottery-gift-icon-wrap">
<image class="ticket-icon-check" :src="webUrl + '/home/gongxi.png'" mode="widthFix"></image>
</view>
<view class="lottery-gift-title">支付成功</view>
<view class="lottery-gift-content">好友领取礼包后您才可以获得<br>抽奖码哦~</view>
<view class="lottery-gift-actions">
<button class="lottery-gift-btn home-btn" @click="goHomeFromLotteryPopup">返回首页</button>
<button open-type="share" class="lottery-gift-btn send" @click="closeLotteryGiftPopup">送给朋友</button>
</view>
</view>
</u-popup>
</view>
</template>
@@ -251,7 +273,9 @@ export default {
blindImage: '',
isGroupBuy: false,
popupCover: '',
showInput: true
showInput: true,
isCountyLotteryGift: false,
showLotteryGiftPopup: false
}
},
watch: {
@@ -268,6 +292,7 @@ export default {
onLoad(opts) {
this.cartId = opts.cartId
this.isGroupBuy = opts.isGroupBuy === '1'
this.isCountyLotteryGift = opts.from === 'countyLottery' || opts.isCountyLotteryGift === '1' || !!opts.drawActivityId
// this.couponId = opts.couponId || 0
this.discount = opts.discount
if(this.isGroupBuy) {
@@ -485,6 +510,21 @@ export default {
this.loading = false
})
},
handleGiftPaySuccess() {
this.isPayOk = true
if (this.isCountyLotteryGift) {
this.showLotteryGiftPopup = true
}
},
closeLotteryGiftPopup() {
this.showLotteryGiftPopup = false
},
goHomeFromLotteryPopup() {
this.showLotteryGiftPopup = false
uni.switchTab({
url: '/pages/home/index'
})
},
/**
* 确认赠送
* @param {*}
@@ -575,7 +615,7 @@ export default {
icon: "none",
duration: 2000
});
this.isPayOk = true;
this.handleGiftPaySuccess();
break;
case "WECHAT_H5_PAY":
// H5支付
@@ -592,7 +632,7 @@ export default {
icon: "none",
duration: 2000
});
this.isPayOk = true;
this.handleGiftPaySuccess();
}).catch(err => {
// this.makeAgain()
@@ -798,4 +838,78 @@ export default {
width: 100%;
border-radius: 16rpx;
}
.lottery-gift-popup{
background: #fff;
border-radius: 40rpx;
padding: 60rpx 40rpx 50rpx;
position: relative;
box-sizing: border-box;
width: 550rpx;
height: 560rpx;
}
.lottery-gift-close{
position: absolute;
top: 30rpx;
right: 30rpx;
z-index: 10;
}
.lottery-gift-icon-wrap{
display: flex;
justify-content: center;
margin-bottom: 30rpx;
}
.ticket-icon-check{
width: 100rpx;
height: 100rpx;
margin-top: 10rpx;
}
.lottery-gift-title{
text-align: center;
font-size: 48rpx;
font-weight: bold;
color: #333;
margin-bottom: 30rpx;
}
.lottery-gift-content{
text-align: center;
color: #999;
font-size: 28rpx;
line-height: 1.6;
}
.lottery-gift-actions{
margin-top: 60rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
.lottery-gift-btn{
width: 240rpx;
height: 80rpx;
line-height: 76rpx; /* 微调行高补偿边框 */
border-radius: 40rpx;
text-align: center;
font-size: 32rpx;
font-weight: 500;
box-sizing: border-box;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
}
.lottery-gift-btn.home-btn{
border: 2rpx solid #c52733;
color: #c52733;
background: #fff;
}
.lottery-gift-btn.send{
border: 2rpx solid #c52733;
color: #fff;
background: #c52733;
padding: 0;
margin-left: 20rpx;
}
.lottery-gift-btn.send::after{
border: none;
}
</style>