Commit cfe3dcf5 authored by 陈冲's avatar 陈冲

fix: 修复game3,4大屏倒数5秒排行

parent bd2d4d09
......@@ -127,4 +127,16 @@ onMounted(() => {
.score-content>div:nth-child(5) {
margin-top: 40px;
}
.score-content > div:nth-child(6) {
margin-top: 20px;
color: #A00000;
font-size: 32pt;
font-weight: bold;
}
.score-content > div:nth-child(6) label {
color: #A00000;
font-size: 42pt;
margin: 0 10px;
}
</style>
......@@ -154,7 +154,7 @@ const gotoRank1WithIntro = async () => {
await rank1Ref.value?.startIntro()
isPlayingStartAnimation = false
clearSubmitWaiting()
showSubmitWaiting()
}
function handleRoomState(data: any) {
......
......@@ -397,10 +397,9 @@ const startIntro = async () => {
const stopGame = () => {
isGameRunning.value = false;
showResult.value = true;
showResult.value = false;
stopHorseLoop();
playApplauseMusic();
console.log('[game3 Rank1View] 游戏结束,显示结果页');
console.log('[game3 Rank1View] 游戏结束,等待最终排名');
};
defineExpose({
......@@ -482,7 +481,7 @@ onUnmounted(() => {
<template>
<DesignStage ref="designStage">
<div class="screen-container" :class="{ paused: !gameStarted }">
<div class="screen-container" :class="{ paused: !gameStarted || !isGameRunning || showResult }">
<!-- 背景层:无缝滚动 -->
<div class="bg-track">
<div class="bg-inner"></div>
......
......@@ -160,7 +160,7 @@ const gotoRank1WithIntro = async () => {
await rank1Ref.value?.startIntro()
// 结果页已在 Rank1View 内部渲染(showResult + result-overlay),不需要切到 rank2
isPlayingStartAnimation = false
clearSubmitWaiting()
showSubmitWaiting()
}
const horseBoosts = ref<Record<string, number>>({});
......@@ -240,6 +240,9 @@ const { startGame, createRoom, backRoom, closeRoom } = useAdminGameSocket({
updateRankPlayers(data.list)
}
screen.value = 'rank1'
nextTick(() => {
rank1Ref.value?.showFinalResult?.()
})
break
}
},
......
......@@ -404,12 +404,10 @@ const computeFinalRank = (): RankItem[] => {
const stopGame = () => {
isGameRunning.value = false;
showResult.value = true;
stopGameLoop();
stopMockBoost();
// 播放喝彩音效
playApplauseMusic();
// 计算最终排名
finalRankList.value = computeFinalRank();
......@@ -427,6 +425,12 @@ const stopGame = () => {
console.log("原始排名数据:", JSON.parse(JSON.stringify(finalRankList.value)));
};
const showFinalResult = () => {
showResult.value = true;
playApplauseMusic();
finalRankList.value = computeFinalRank();
};
const startIntro = async () => {
console.log("[Rank1View] startIntro 开始,当前 rankList:", props.rankList?.length, JSON.stringify(props.rankList?.slice(0, 2)));
console.log("[Rank1View] 当前 horses 数量:", horses.value.length);
......@@ -520,12 +524,13 @@ onUnmounted(() => {
defineExpose({
startIntro,
showFinalResult,
});
</script>
<template>
<DesignStage ref="designStage">
<div class="screen-container" :class="{ paused: !gameStarted || showResult }">
<div class="screen-container" :class="{ paused: !gameStarted || !isGameRunning || showResult }">
<div class="img-logo"></div>
<div class="img-title-bg"></div>
<div class="img-big-brum"></div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment