From b46bc7aaa52773cabc09d7fac8564fb750fa9c2f Mon Sep 17 00:00:00 2001 From: kron Date: Fri, 15 Aug 2025 11:23:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis.js | 6 +++ src/components/BattleFooter.vue | 26 ++++++++++--- src/components/BowTarget.vue | 2 +- src/components/HeaderProgress.vue | 10 +++-- src/components/ShootProgress2.vue | 2 +- src/components/TeamAvatars.vue | 47 ++++++++++++++++++------ src/pages/battle-result.vue | 61 ++++++++++++++----------------- src/pages/ranking.vue | 10 +++-- src/pages/team-battle.vue | 37 ++++++++----------- 9 files changed, 121 insertions(+), 80 deletions(-) diff --git a/src/apis.js b/src/apis.js index d3ae0af..de33e27 100644 --- a/src/apis.js +++ b/src/apis.js @@ -259,12 +259,14 @@ export const getGameAPI = async (battleId) => { battleId, mode: battleStats.mode, // 1.几V几 2.大乱斗 gameMode: battleStats.gameMode, // 1.约战 2.排位 + teamSize: battleStats.teamSize, }; if (battleStats && battleStats.mode === 1) { data.winner = battleStats.winner; data.roundsData = {}; data.redPlayers = {}; data.bluePlayers = {}; + data.mvps = []; data.goldenRound = goldenRoundRecords && goldenRoundRecords.length ? goldenRoundRecords[0] @@ -277,6 +279,9 @@ export const getGameAPI = async (battleId) => { if (playerBattleStats.team === 1) { data.bluePlayers[playerBattleStats.playerId] = playerBattleStats; } + if (playerBattleStats.mvp) { + data.mvps.push(playerBattleStats); + } roundRecords.forEach((round) => { data.roundsData[round.roundNumber] = { ...data.roundsData[round.roundNumber], @@ -284,6 +289,7 @@ export const getGameAPI = async (battleId) => { }; }); }); + data.mvps.sort((a, b) => b.totalRings - a.totalRings); } if (battleStats && battleStats.mode === 2) { data.players = []; diff --git a/src/components/BattleFooter.vue b/src/components/BattleFooter.vue index 8058aa3..2185c3f 100644 --- a/src/components/BattleFooter.vue +++ b/src/components/BattleFooter.vue @@ -1,3 +1,4 @@ += @@ -21,8 +26,13 @@ defineProps({ - - + + @@ -47,9 +57,12 @@ defineProps({ - + - {{ i }} + @@ -71,7 +84,10 @@ defineProps({ - + diff --git a/src/components/BowTarget.vue b/src/components/BowTarget.vue index c193dd8..a396e85 100644 --- a/src/components/BowTarget.vue +++ b/src/components/BowTarget.vue @@ -295,7 +295,7 @@ onMounted(() => { } .simul { position: absolute; - bottom: 20px; + bottom: 40px; right: 20px; margin-left: 20px; } diff --git a/src/components/HeaderProgress.vue b/src/components/HeaderProgress.vue index 9173f2d..609cae5 100644 --- a/src/components/HeaderProgress.vue +++ b/src/components/HeaderProgress.vue @@ -27,7 +27,6 @@ watch( if (newVal.includes("蓝队")) key = "请蓝方射击"; if (key && sound.value) { if (currentRoundEnded.value) { - currentRound.value += 1; currentRoundEnded.value = false; if (currentRound.value === 1) audioManager.play("第一轮"); if (currentRound.value === 2) audioManager.play("第二轮"); @@ -63,14 +62,17 @@ async function onReceiveMessage(messages = []) { } else if (msg.constructor === MESSAGETYPES.WaitForAllReady) { battleId.value = msg.id; } else if (msg.constructor === MESSAGETYPES.AllReady) { + currentRoundEnded.value = true; audioManager.play("比赛开始"); } else if (msg.constructor === MESSAGETYPES.MeleeAllReady) { melee.value = true; halfTime.value = false; audioManager.play("比赛开始"); } else if (msg.constructor === MESSAGETYPES.CurrentRoundEnded) { - currentRound.value += 1; - currentRoundEnded.value = true; + if (msg.preRoundResult && msg.preRoundResult.currentRound) { + currentRound.value = msg.preRoundResult.currentRound + 1; + currentRoundEnded.value = true; + } } else if (msg.constructor === MESSAGETYPES.HalfTimeOver) { halfTime.value = true; audioManager.play("中场休息"); @@ -113,7 +115,7 @@ onUnmounted(() => { {{ tips }} -