fix:重进比赛逻辑优化

This commit is contained in:
2026-05-19 11:39:34 +08:00
parent e3c33da40c
commit c094fc7bef
2 changed files with 18 additions and 2 deletions

View File

@@ -132,8 +132,18 @@ const recoverData = (battleInfo, {force = false, arrowOnly = false} = {}) => {
// ShootProgress2v-if="start"尚未挂载update-remain 事件会被丢弃。
// 同时 HeaderProgress 对含"重回"的 tips 拦截音频,倒计时无法依赖
// onAudioEnded 驱动,需在 nextTick 后直接启动。
// playerId=0 表示后端处于过渡状态(上一位射手已完成、下一位尚未分配)
// 此时 startTime/targetTeam 均不可靠,停止进度条并等待 WS ToSomeoneShoot 驱动
if (!battleInfo.current.playerId) {
nextTick(() => {
uni.$emit("update-tips", nextTips);
uni.$emit("update-remain", {stop: true});
});
return;
}
const elapsed = (Date.now() - battleInfo.current.startTime) / 1000;
console.log(`当前轮已进行${elapsed}`);
if (elapsed > 0 && elapsed < shootTimeTotal.value) {
updateRemainSecond.value = shootTimeTotal.value - elapsed - 0.2;
}