This commit is contained in:
kron
2025-07-29 22:15:45 +08:00
parent 29886b4fc9
commit 1e4ce52a93

View File

@@ -23,7 +23,7 @@ function exit() {
onLoad(async (options) => { onLoad(async (options) => {
if (options.battleId) { if (options.battleId) {
const result = await getGameAPI( const result = await getGameAPI(
options.battleId || "BATTLE-1753274533670200664-192" options.battleId || "BATTLE-1753787456813171958-86"
// options.battleId || "BATTLE-1753239612271030113-788" // options.battleId || "BATTLE-1753239612271030113-788"
); );
const battleInfo = uni.getStorageSync("last-battle"); const battleInfo = uni.getStorageSync("last-battle");
@@ -31,7 +31,6 @@ onLoad(async (options) => {
...result, ...result,
id: options.battleId, id: options.battleId,
battleMode: result.gameMode, battleMode: result.gameMode,
playerStats: result.players.map((p) => ({ ...p, id: p.playerId })),
}; };
if (result.mode === 1 && result.redPlayers[user.value.id]) { if (result.mode === 1 && result.redPlayers[user.value.id]) {
totalPoints.value = result.redPlayers[user.value.id].totalScore; totalPoints.value = result.redPlayers[user.value.id].totalScore;
@@ -42,6 +41,10 @@ onLoad(async (options) => {
ifWin.value = result.winner === 1; ifWin.value = result.winner === 1;
} }
if (result.mode === 2) { if (result.mode === 2) {
data.value.playerStats = result.players.map((p) => ({
...p,
id: p.playerId,
}));
const mine = result.players.find((p) => p.playerId === user.value.id); const mine = result.players.find((p) => p.playerId === user.value.id);
if (mine) totalPoints.value = mine.totalScore; if (mine) totalPoints.value = mine.totalScore;
rank.value = rank.value =