|
@ -7,6 +7,9 @@ const showPopup = ref(false); |
|
|
const popupMessage = ref(''); |
|
|
const popupMessage = ref(''); |
|
|
const totalScore = ref(4000) // 初始分数 |
|
|
const totalScore = ref(4000) // 初始分数 |
|
|
const myLucky = ref() |
|
|
const myLucky = ref() |
|
|
|
|
|
// 新增状态 |
|
|
|
|
|
const spinCount = ref(0) |
|
|
|
|
|
const isSpinning = ref(false) |
|
|
// 新增变量记录基础分数 |
|
|
// 新增变量记录基础分数 |
|
|
//const baseScore = 4000 |
|
|
//const baseScore = 4000 |
|
|
const wheelConfig = ref({ |
|
|
const wheelConfig = ref({ |
|
@ -40,6 +43,14 @@ const customOrder = ref([0, 4, 3, 1, 2, 4, 5, 7, 3, 4, 0]) |
|
|
let orderIndex = 0; |
|
|
let orderIndex = 0; |
|
|
|
|
|
|
|
|
function startCallback() { |
|
|
function startCallback() { |
|
|
|
|
|
// 检查转动条件和次数 |
|
|
|
|
|
if (spinCount.value >= 11) { // 从0开始计数,11表示第12次 |
|
|
|
|
|
alert('已达最大转动次数!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
isSpinning.value = true |
|
|
|
|
|
spinCount.value++ |
|
|
// 重置为初始分数 |
|
|
// 重置为初始分数 |
|
|
//totalScore.value = baseScore |
|
|
//totalScore.value = baseScore |
|
|
// 调用抽奖组件的play方法开始游戏 |
|
|
// 调用抽奖组件的play方法开始游戏 |
|
@ -66,7 +77,10 @@ function endCallback(prize) { |
|
|
const result = Number(prize.fonts[0].text) |
|
|
const result = Number(prize.fonts[0].text) |
|
|
console.log(prize.fonts[0].text) |
|
|
console.log(prize.fonts[0].text) |
|
|
// 更新总分 |
|
|
// 更新总分 |
|
|
totalScore.value = totalScore.value + result |
|
|
|
|
|
|
|
|
setTimeout(()=>{ |
|
|
|
|
|
totalScore.value = totalScore.value + result |
|
|
|
|
|
},1000); |
|
|
|
|
|
|
|
|
// 触发动画 |
|
|
// 触发动画 |
|
|
animateScoreChange() |
|
|
animateScoreChange() |
|
|
// 先清空文字 |
|
|
// 先清空文字 |
|
@ -201,8 +215,8 @@ onMounted(() => { |
|
|
/* 添加艺术字样式 */ |
|
|
/* 添加艺术字样式 */ |
|
|
.art-text { |
|
|
.art-text { |
|
|
position: fixed; |
|
|
position: fixed; |
|
|
left: 450px; |
|
|
|
|
|
bottom: 200px; |
|
|
|
|
|
|
|
|
left: 30%; |
|
|
|
|
|
bottom: 20%; |
|
|
transform: translateX(-50%); |
|
|
transform: translateX(-50%); |
|
|
font-family: 'Arial Black', sans-serif; |
|
|
font-family: 'Arial Black', sans-serif; |
|
|
font-size: 150px; |
|
|
font-size: 150px; |
|
@ -260,7 +274,7 @@ onMounted(() => { |
|
|
|
|
|
|
|
|
/* 转盘底的样式 */ |
|
|
/* 转盘底的样式 */ |
|
|
.wheel-base { |
|
|
.wheel-base { |
|
|
background-image: url('wheel-base.png'); |
|
|
|
|
|
|
|
|
background-image: url('/public/wheel-base.png'); |
|
|
position: fixed; |
|
|
position: fixed; |
|
|
left: 1065px; |
|
|
left: 1065px; |
|
|
top: 350px; |
|
|
top: 350px; |
|
|