Skip to content

Commit

Permalink
feat: 抽奖等待界面增加随机更换人员卡片的功能
Browse files Browse the repository at this point in the history
  • Loading branch information
LOG1997 committed Jan 11, 2025
1 parent 6be0e76 commit 70369fd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/views/Home/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ async function stopLottery() {
if (!canOperate.value) {
return
}
clearInterval(intervalTimer.value)
intervalTimer.value = null
// clearInterval(intervalTimer.value)
// intervalTimer.value = null
canOperate.value = false
rollBall(0, 1)
Expand Down Expand Up @@ -570,8 +570,13 @@ function randomBallData(mod: 'default' | 'lucky' | 'sphere' = 'default') {
const cardRandomIndexArr: number[] = []
const personRandomIndexArr: number[] = []
for (let i = 0; i < indexLength; i++) {
cardRandomIndexArr.push(Math.round(Math.random() * (tableData.value.length - 1)))
personRandomIndexArr.push(Math.round(Math.random() * (allPersonList.value.length - 1)))
const randomCardIndex = Math.round(Math.random() * (tableData.value.length - 1))
const randomPersonIndex = Math.round(Math.random() * (allPersonList.value.length - 1))
if (luckyCardList.value.includes(randomCardIndex)) {
continue
}
cardRandomIndexArr.push(randomCardIndex)
personRandomIndexArr.push(randomPersonIndex)
}
for (let i = 0; i < cardRandomIndexArr.length; i++) {
if (!objects.value[cardRandomIndexArr[i]]) {
Expand Down

0 comments on commit 70369fd

Please sign in to comment.