细节完善

This commit is contained in:
kron
2025-08-15 11:23:23 +08:00
parent 2a9a373743
commit b46bc7aaa5
9 changed files with 121 additions and 80 deletions

View File

@@ -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 = [];