|
@ -200,16 +200,29 @@ async function fetchActivity() { |
|
|
const currentCount = item.marketCount || 0 // 当前助力人数 |
|
|
const currentCount = item.marketCount || 0 // 当前助力人数 |
|
|
|
|
|
|
|
|
// 判断是否已达到总人数 |
|
|
// 判断是否已达到总人数 |
|
|
if (currentCount >= totalPeople) { |
|
|
|
|
|
|
|
|
if (currentCount >= 4200) { |
|
|
isCompleted.value = true // 设置完成状态 |
|
|
isCompleted.value = true // 设置完成状态 |
|
|
usRemainingTime.value = 0 // 设置剩余时间为0 |
|
|
usRemainingTime.value = 0 // 设置剩余时间为0 |
|
|
} else { |
|
|
} else { |
|
|
isCompleted.value = false |
|
|
isCompleted.value = false |
|
|
|
|
|
|
|
|
// 计算剩余时间 - 初始15分钟,每满100人减少1分钟 |
|
|
|
|
|
|
|
|
// 计算剩余时间 - 分段计算,前1200人每100人减1分钟,超过1200人后每1000人减1分钟 |
|
|
const initialTime = 15 // 初始时间15分钟 |
|
|
const initialTime = 15 // 初始时间15分钟 |
|
|
const hundredsCount = Math.floor(currentCount / 100) // 计算满100的次数 |
|
|
|
|
|
const remainingTime = Math.max(0, initialTime - hundredsCount) // 每满100人减少1分钟 |
|
|
|
|
|
|
|
|
let timeReduction = 0 |
|
|
|
|
|
|
|
|
|
|
|
if (currentCount <= 1200) { |
|
|
|
|
|
// 前1200人:每100人减1分钟 |
|
|
|
|
|
timeReduction = Math.floor(currentCount / 100) |
|
|
|
|
|
} else { |
|
|
|
|
|
// 前1200人已减少12分钟 |
|
|
|
|
|
timeReduction = 12 |
|
|
|
|
|
// 超过1200人的部分:每1000人减1分钟 |
|
|
|
|
|
const extraCount = currentCount - 1200 |
|
|
|
|
|
const extraReduction = Math.floor(extraCount / 1000) |
|
|
|
|
|
timeReduction += extraReduction |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const remainingTime = Math.max(0, initialTime - timeReduction) |
|
|
|
|
|
|
|
|
usRemainingTime.value = remainingTime |
|
|
usRemainingTime.value = remainingTime |
|
|
} |
|
|
} |
|
|