BUG修复
This commit is contained in:
20
src/apis.js
20
src/apis.js
@@ -268,10 +268,8 @@ export const getGameAPI = async (battleId) => {
|
||||
data.redPlayers = {};
|
||||
data.bluePlayers = {};
|
||||
data.mvps = [];
|
||||
data.goldenRound =
|
||||
goldenRoundRecords && goldenRoundRecords.length
|
||||
? goldenRoundRecords[0]
|
||||
: null;
|
||||
data.goldenRounds =
|
||||
goldenRoundRecords && goldenRoundRecords.length ? goldenRoundRecords : [];
|
||||
playerStats.forEach((item) => {
|
||||
const { playerBattleStats = {}, roundRecords = [] } = item;
|
||||
if (playerBattleStats.team === 0) {
|
||||
@@ -290,6 +288,20 @@ export const getGameAPI = async (battleId) => {
|
||||
};
|
||||
});
|
||||
});
|
||||
(goldenRoundRecords || []).forEach((item, index) => {
|
||||
item.arrowHistory.forEach((arrow) => {
|
||||
if (!data.roundsData[playerStats.length + index + 1]) {
|
||||
data.roundsData[playerStats.length + index + 1] = {};
|
||||
}
|
||||
if (!data.roundsData[playerStats.length + index + 1][arrow.playerId]) {
|
||||
data.roundsData[playerStats.length + index + 1][arrow.playerId] = [];
|
||||
}
|
||||
data.roundsData[playerStats.length + index + 1][arrow.playerId].push(
|
||||
arrow
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
data.mvps.sort((a, b) => b.totalRings - a.totalRings);
|
||||
}
|
||||
if (battleStats && battleStats.mode === 2) {
|
||||
|
||||
Reference in New Issue
Block a user