fixbug: 九宫格bug

This commit is contained in:
2025-08-15 14:13:02 +08:00
parent 7c4ecf0ea3
commit bddbaaaa5f
3 changed files with 38 additions and 43 deletions
@@ -1,5 +1,7 @@
<template>
<!-- 九宫格容器 -->
<view>
</view>
<view class="lottery-grid">
<!-- 高亮选中框 -->
<view class="highlight-box" :style="{
@@ -13,7 +15,7 @@
<!-- 中间格子作为抽奖按钮 (索引4) -->
<template v-if="index === 4">
<image :src="prizesObj.prizes[index]?.iconUrl" class="prize-img-button" mode="widthFix"
@click="handleStartClick"></image>
@click="handleStartClick(1)"></image>
</template>
<!-- 其他8个奖品格子 -->
@@ -23,6 +25,7 @@
</template>
</view>
</view>
<view class="coiled-lottery" v-if="prizesObj.times > 10" @click="handleStartClick(10)"> 连续抽奖10次 </view>
</template>
<script>
@@ -166,7 +169,7 @@ export default {
/**
* 处理开始抽奖点击事件
*/
handleStartClick() {
handleStartClick(num) {
// 如果正在抽奖或被禁用,则不执行
if (this.isDisabled || this.isRotating) {
console.log('抽奖被禁用或正在进行中')
@@ -174,7 +177,7 @@ export default {
}
// 通知父组件开始抽奖
this.$emit('start', 1)
this.$emit('start', num)
// 开始抽奖动画(无论父组件做了什么处理)
this.startLotteryAnimation()
@@ -301,4 +304,19 @@ export default {
/* background: linear-gradient(180deg, #FFF7E7 0%, #FFDAB2 100%); */
box-shadow: inset 0px 0 24px 0px rgba(255, 129, 9, 0.5);
}
.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;
}
</style>
@@ -93,6 +93,12 @@ export default {
justify-content: space-around;
.modal-content-result-item {
margin-left: 15rpx;
&:first-child {
margin-left: 0;
}
.par-value {
font-weight: bold;