diff --git a/src/views/DZP1.vue b/src/views/DZP1.vue index 8246d50..1e519b5 100644 --- a/src/views/DZP1.vue +++ b/src/views/DZP1.vue @@ -7,6 +7,9 @@ const showPopup = ref(false); const popupMessage = ref(''); const totalScore = ref(4000) // 初始分数 const myLucky = ref() +// 新增状态 +const spinCount = ref(0) +const isSpinning = ref(false) // 新增变量记录基础分数 //const baseScore = 4000 const wheelConfig = ref({ @@ -40,6 +43,14 @@ const customOrder = ref([0, 4, 3, 1, 2, 4, 5, 7, 3, 4, 0]) let orderIndex = 0; function startCallback() { + // 检查转动条件和次数 + if (spinCount.value >= 11) { // 从0开始计数,11表示第12次 + alert('已达最大转动次数!') + return + } + + isSpinning.value = true + spinCount.value++ // 重置为初始分数 //totalScore.value = baseScore // 调用抽奖组件的play方法开始游戏 diff --git a/src/views/DZP2.vue b/src/views/DZP2.vue index 9b6e964..fc32657 100644 --- a/src/views/DZP2.vue +++ b/src/views/DZP2.vue @@ -143,7 +143,7 @@ function endCallback(prize) { } .full-background { - background-image: url('/public/bg2.jpg'); + background-image: url('/public/bg2.png'); background-size: cover; background-repeat: no-repeat; background-position: center;