|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<view>
|
|
|
<view class="lottery_box" :style="height">
|
|
|
- <!-- <view class="lottery_time">活动时间:{{lotteryInfo.start_date}} ~ {{lotteryInfo.end_date}}</view> -->
|
|
|
+ <view class="lottery_time" v-if="lotteryInfo.id">活动时间:{{lotteryInfo.start_date}} ~ {{lotteryInfo.end_date}}</view>
|
|
|
<view class="lottery_info">
|
|
|
<image class="lottery_logo" v-if="lotteryInfo.logo" :src="lotteryInfo.logo" mode="widthFix"></image>
|
|
|
<button class="lottery_rule_btn" @click="showRule">活动规则</button>
|
|
@@ -10,9 +10,10 @@
|
|
|
<view class="record_box">
|
|
|
<view class="score_info">
|
|
|
<view class="custom_score">当前积分:{{scoreInfo.score}}</view>
|
|
|
- <view class="need_score">每次抽奖消耗{{lotteryInfo.need_score}}积分</view>
|
|
|
+ <view class="need_score" v-if="lotteryInfo.id" >每次抽奖消耗{{lotteryInfo.need_score}}积分</view>
|
|
|
+ <view class="need_score" v-if="!lotteryInfo.id" >暂无可参与的活动</view>
|
|
|
</view>
|
|
|
- <button class="lottery_record" @click="showRecord">
|
|
|
+ <button class="lottery_record" @click="showRecord" v-if="lotteryInfo.id">
|
|
|
<image class="lottery_record_img" src="https://mall.findit.ltd/uploads/images/default/lottery_record.png" mode=""></image>
|
|
|
<text class="lottery_record_text">中奖记录</text>
|
|
|
</button>
|
|
@@ -87,7 +88,7 @@
|
|
|
id:0,
|
|
|
name:"",
|
|
|
logo:"",
|
|
|
- need_score:"--",
|
|
|
+ need_score:"",
|
|
|
start_date:"",
|
|
|
end_date:"",
|
|
|
start_time:"",
|
|
@@ -205,13 +206,15 @@
|
|
|
return;
|
|
|
}
|
|
|
// 活动是否结束
|
|
|
- if( this.scoreInfo.score < this.lotteryInfo.need_score ){
|
|
|
+ if( this.scoreInfo.score - this.lotteryInfo.need_score < this.lotteryInfo.need_score ){
|
|
|
uni.showToast({
|
|
|
title:"积分不足",
|
|
|
icon:"none",
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
+ // 积分操作
|
|
|
+ this.scoreInfo.score = this.scoreInfo.score - this.lotteryInfo.need_score;
|
|
|
// 请求列表
|
|
|
this.$http.request('/api/lottery_score/get_reward',{lottery_id:this.lotteryInfo.id}).then((re)=>{
|
|
|
// 设置非请求中
|
|
@@ -222,12 +225,14 @@
|
|
|
this.prizeList = re.data.reward_list;
|
|
|
this.newScore = re.data.custom_score;
|
|
|
// 奖品的索引
|
|
|
- return this.$refs.dialer.run(re.data.reward_index);
|
|
|
+ return this.$refs.dialer.run(re.data.reward_index);
|
|
|
}else{
|
|
|
uni.showToast({
|
|
|
title:re.msg,
|
|
|
icon:"none",
|
|
|
})
|
|
|
+ // 积分操作
|
|
|
+ this.scoreInfo.score = this.scoreInfo.score + this.lotteryInfo.need_score;
|
|
|
return ;
|
|
|
}
|
|
|
});
|
|
@@ -310,12 +315,19 @@
|
|
|
position: relative;
|
|
|
background: linear-gradient(to bottom, #FC335F 0%, #FB7224 80%, #FFFFFF 100%);
|
|
|
.lottery_time{
|
|
|
+ top: 0rpx;
|
|
|
+ left: 35rpx;
|
|
|
+ z-index: 1;
|
|
|
+ width: 700rpx;
|
|
|
color: #FFFFFF;
|
|
|
display: block;
|
|
|
height: 40rpx;
|
|
|
font-size: 24rpx;
|
|
|
line-height: 40rpx;
|
|
|
text-align: center;
|
|
|
+ position: absolute;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ background-color: rgba(0, 0, 0,0.3);
|
|
|
}
|
|
|
.lottery_info{
|
|
|
width: 750rpx;
|