Commit cfe3dcf5 authored by 陈冲's avatar 陈冲

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

parent bd2d4d09
...@@ -127,4 +127,16 @@ onMounted(() => { ...@@ -127,4 +127,16 @@ onMounted(() => {
.score-content>div:nth-child(5) { .score-content>div:nth-child(5) {
margin-top: 40px; 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> </style>
...@@ -154,7 +154,7 @@ const gotoRank1WithIntro = async () => { ...@@ -154,7 +154,7 @@ const gotoRank1WithIntro = async () => {
await rank1Ref.value?.startIntro() await rank1Ref.value?.startIntro()
isPlayingStartAnimation = false isPlayingStartAnimation = false
clearSubmitWaiting() showSubmitWaiting()
} }
function handleRoomState(data: any) { function handleRoomState(data: any) {
......
...@@ -397,10 +397,9 @@ const startIntro = async () => { ...@@ -397,10 +397,9 @@ const startIntro = async () => {
const stopGame = () => { const stopGame = () => {
isGameRunning.value = false; isGameRunning.value = false;
showResult.value = true; showResult.value = false;
stopHorseLoop(); stopHorseLoop();
playApplauseMusic(); console.log('[game3 Rank1View] 游戏结束,等待最终排名');
console.log('[game3 Rank1View] 游戏结束,显示结果页');
}; };
defineExpose({ defineExpose({
...@@ -482,7 +481,7 @@ onUnmounted(() => { ...@@ -482,7 +481,7 @@ onUnmounted(() => {
<template> <template>
<DesignStage ref="designStage"> <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-track">
<div class="bg-inner"></div> <div class="bg-inner"></div>
......
...@@ -160,7 +160,7 @@ const gotoRank1WithIntro = async () => { ...@@ -160,7 +160,7 @@ const gotoRank1WithIntro = async () => {
await rank1Ref.value?.startIntro() await rank1Ref.value?.startIntro()
// 结果页已在 Rank1View 内部渲染(showResult + result-overlay),不需要切到 rank2 // 结果页已在 Rank1View 内部渲染(showResult + result-overlay),不需要切到 rank2
isPlayingStartAnimation = false isPlayingStartAnimation = false
clearSubmitWaiting() showSubmitWaiting()
} }
const horseBoosts = ref<Record<string, number>>({}); const horseBoosts = ref<Record<string, number>>({});
...@@ -240,6 +240,9 @@ const { startGame, createRoom, backRoom, closeRoom } = useAdminGameSocket({ ...@@ -240,6 +240,9 @@ const { startGame, createRoom, backRoom, closeRoom } = useAdminGameSocket({
updateRankPlayers(data.list) updateRankPlayers(data.list)
} }
screen.value = 'rank1' screen.value = 'rank1'
nextTick(() => {
rank1Ref.value?.showFinalResult?.()
})
break break
} }
}, },
......
...@@ -404,12 +404,10 @@ const computeFinalRank = (): RankItem[] => { ...@@ -404,12 +404,10 @@ const computeFinalRank = (): RankItem[] => {
const stopGame = () => { const stopGame = () => {
isGameRunning.value = false; isGameRunning.value = false;
showResult.value = true;
stopGameLoop(); stopGameLoop();
stopMockBoost(); stopMockBoost();
// 播放喝彩音效 // 播放喝彩音效
playApplauseMusic();
// 计算最终排名 // 计算最终排名
finalRankList.value = computeFinalRank(); finalRankList.value = computeFinalRank();
...@@ -427,6 +425,12 @@ const stopGame = () => { ...@@ -427,6 +425,12 @@ const stopGame = () => {
console.log("原始排名数据:", JSON.parse(JSON.stringify(finalRankList.value))); console.log("原始排名数据:", JSON.parse(JSON.stringify(finalRankList.value)));
}; };
const showFinalResult = () => {
showResult.value = true;
playApplauseMusic();
finalRankList.value = computeFinalRank();
};
const startIntro = async () => { const startIntro = async () => {
console.log("[Rank1View] startIntro 开始,当前 rankList:", props.rankList?.length, JSON.stringify(props.rankList?.slice(0, 2))); console.log("[Rank1View] startIntro 开始,当前 rankList:", props.rankList?.length, JSON.stringify(props.rankList?.slice(0, 2)));
console.log("[Rank1View] 当前 horses 数量:", horses.value.length); console.log("[Rank1View] 当前 horses 数量:", horses.value.length);
...@@ -520,12 +524,13 @@ onUnmounted(() => { ...@@ -520,12 +524,13 @@ onUnmounted(() => {
defineExpose({ defineExpose({
startIntro, startIntro,
showFinalResult,
}); });
</script> </script>
<template> <template>
<DesignStage ref="designStage"> <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-logo"></div>
<div class="img-title-bg"></div> <div class="img-title-bg"></div>
<div class="img-big-brum"></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