fixbug: 九宫格bug
This commit is contained in:
@@ -10,13 +10,9 @@
|
||||
<view class="remain-count"> 剩余抽奖次数: {{ prizesObj.times }} </view>
|
||||
|
||||
|
||||
|
||||
<!-- 九宫格抽奖组件 -->
|
||||
<LotteryGrid :prizesObj="prizesObj" :remain-count="prizesObj.times" :is-disabled="isRotating"
|
||||
@start="handleStartLottery" @complete="handleLotteryComplete" :targetIndex="targetIndex" />
|
||||
|
||||
<view class="coiled-lottery" v-if="prizesObj.times > 10" @click="handleStartLottery(10)"> 连续抽奖10次 </view>
|
||||
|
||||
<LotteryGrid :prizesObj="prizesObj" :is-disabled="isRotating" @start="handleStartLottery"
|
||||
@complete="handleLotteryComplete" :targetIndex="targetIndex" />
|
||||
|
||||
<!-- 规则 -->
|
||||
<view class="rule">
|
||||
@@ -24,8 +20,6 @@
|
||||
<view class="rule_content" v-html="prizesObj.ruleDescr"></view>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
<!-- 中奖结果弹窗 -->
|
||||
<ResultModal :visible="showResult" :prize="currentPrize" @close="showResult = false" />
|
||||
</view>
|
||||
@@ -103,28 +97,20 @@ export default {
|
||||
id: this.prizesObj.id,
|
||||
times: num,
|
||||
}
|
||||
const result = await raffleExecute(params);
|
||||
let runCount = null;
|
||||
if (result && result.bizcode === 100) {
|
||||
const { data } = await raffleExecute(params);
|
||||
this.targetIndex = this.prizesObj.prizes.findIndex(ele => ele.id === data.idList[0].id);
|
||||
|
||||
this.targetIndex = this.prizesObj.prizes.findIndex(ele => ele.id === result.data[0].id);
|
||||
this.currentPrize = data.prizeList;
|
||||
console.log("0------", this.currentPrize)
|
||||
|
||||
this.currentPrize = result.data;
|
||||
console.log("0------", this.currentPrize)
|
||||
|
||||
// 减少抽奖次数并标记为正在抽奖
|
||||
|
||||
this.isRotating = true
|
||||
|
||||
const total = this.prizesObj.times;
|
||||
const data = result.data;
|
||||
this.lotteryList = data;// 中奖列表
|
||||
this.prizesObj.times = total - num;// 减去次数
|
||||
|
||||
}
|
||||
// 减少抽奖次数并标记为正在抽奖
|
||||
|
||||
this.isRotating = true
|
||||
|
||||
const total = this.prizesObj.times;
|
||||
this.prizesObj.times = total - num;// 减去次数
|
||||
},
|
||||
|
||||
/**
|
||||
* 处理抽奖完成事件
|
||||
* @param {Object} prize - 中奖奖品
|
||||
@@ -185,21 +171,6 @@ export default {
|
||||
|
||||
}
|
||||
|
||||
.coiled-lottery {
|
||||
width: 670rpx;
|
||||
height: 88rpx;
|
||||
background: linear-gradient(180deg, #FFE361 0%, #FF7B21 70%, #FFB931 91%, #FFB245 100%);
|
||||
box-shadow: inset 0px 0 24rpx 0px rgba(255, 255, 255, 0.5);
|
||||
border-radius: 44rpx;
|
||||
margin: 120rpx auto 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.rule {
|
||||
width: 670rpx;
|
||||
background: linear-gradient(180deg, #FF8876 0%, #FF3D36 17%, #FF4646 85%, #FF8978 100%);
|
||||
|
||||
Reference in New Issue
Block a user