fix bug
This commit is contained in:
@@ -23,7 +23,7 @@ function exit() {
|
||||
onLoad(async (options) => {
|
||||
if (options.battleId) {
|
||||
const result = await getGameAPI(
|
||||
options.battleId || "BATTLE-1753274533670200664-192"
|
||||
options.battleId || "BATTLE-1753787456813171958-86"
|
||||
// options.battleId || "BATTLE-1753239612271030113-788"
|
||||
);
|
||||
const battleInfo = uni.getStorageSync("last-battle");
|
||||
@@ -31,7 +31,6 @@ onLoad(async (options) => {
|
||||
...result,
|
||||
id: options.battleId,
|
||||
battleMode: result.gameMode,
|
||||
playerStats: result.players.map((p) => ({ ...p, id: p.playerId })),
|
||||
};
|
||||
if (result.mode === 1 && result.redPlayers[user.value.id]) {
|
||||
totalPoints.value = result.redPlayers[user.value.id].totalScore;
|
||||
@@ -42,6 +41,10 @@ onLoad(async (options) => {
|
||||
ifWin.value = result.winner === 1;
|
||||
}
|
||||
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);
|
||||
if (mine) totalPoints.value = mine.totalScore;
|
||||
rank.value =
|
||||
|
||||
Reference in New Issue
Block a user