|
@ -206,14 +206,12 @@ async function fetchActivity() { |
|
|
} else { |
|
|
} else { |
|
|
isCompleted.value = false |
|
|
isCompleted.value = false |
|
|
|
|
|
|
|
|
// 计算进度百分比 (0-100) |
|
|
|
|
|
const progressPercent = Math.min((currentCount / totalPeople) * 100, 100) |
|
|
|
|
|
|
|
|
// 计算剩余时间 - 初始15分钟,每满100人减少1分钟 |
|
|
|
|
|
const initialTime = 15 // 初始时间15分钟 |
|
|
|
|
|
const hundredsCount = Math.floor(currentCount / 100) // 计算满100的次数 |
|
|
|
|
|
const remainingTime = Math.max(0, initialTime - hundredsCount) // 每满100人减少1分钟 |
|
|
|
|
|
|
|
|
// 根据进度计算剩余时间 (15分钟对应100%进度) |
|
|
|
|
|
const usedTime = (progressPercent / 100) * 15 |
|
|
|
|
|
const remainingTime = Math.max(0, 15 - usedTime) |
|
|
|
|
|
|
|
|
|
|
|
usRemainingTime.value = Math.round(remainingTime) |
|
|
|
|
|
|
|
|
usRemainingTime.value = remainingTime |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
console.log(`${marketName.value}助力人数: ${currentCount}/${totalPeople}, 进度: ${currentCount >= totalPeople ? '100' : progressPercent.toFixed(1)}%, 剩余时间: ${usRemainingTime.value}分钟, 完成状态: ${isCompleted.value}`) |
|
|
console.log(`${marketName.value}助力人数: ${currentCount}/${totalPeople}, 进度: ${currentCount >= totalPeople ? '100' : progressPercent.toFixed(1)}%, 剩余时间: ${usRemainingTime.value}分钟, 完成状态: ${isCompleted.value}`) |
|
|