fix:修改比赛进度条展示效果

This commit is contained in:
2026-05-13 17:16:09 +08:00
parent 9d45abd693
commit c168a909db
2 changed files with 29 additions and 32 deletions

View File

@@ -29,6 +29,33 @@ const updateRemain = (value) => {
if (timer.value) clearInterval(timer.value);
return
}
// zeroThenResetToSomeoneShoot 到达时,若进度条仍在倒计时则先瞬间清零(约 150ms 停留)再显示下一玩家满值
// 若进度条已到 0loading 状态),直接切换满值
if (value.zeroThenReset) {
if (timer.value) clearInterval(timer.value);
const wasNonZero = remain.value > 0;
// 更新下一玩家颜色和方向(在清零和满值时均生效)
currentTeam.value = value.team;
if (value.team === 'red') barColor.value = "linear-gradient( 180deg, #FFA0A0 0%, #FF6060 100%)";
if (value.team === 'blue') barColor.value = "linear-gradient( 180deg, #9AB3FF 0%, #4288FF 100%)";
transitionStyle.value = "none";
if (wasNonZero) {
// 瞬间清零,停留约 150ms 后切换为满值
remain.value = 0;
loading.value = true;
setTimeout(() => {
remain.value = value.value;
loading.value = false;
setTimeout(() => { transitionStyle.value = "all 1s linear"; }, 50);
}, 150);
} else {
// 已在底部,直接切换满值
remain.value = value.value;
loading.value = false;
setTimeout(() => { transitionStyle.value = "all 1s linear"; }, 50);
}
return;
}
loading.value = false;
currentTeam.value = value.team
if (value.team === 'red')