修复BUG
This commit is contained in:
@@ -44,6 +44,7 @@ onLoad(async (options) => {
|
||||
data.value.myTeam = result.bluePlayers[myId].team;
|
||||
ifWin.value = result.winner === 1;
|
||||
}
|
||||
audioManager.play(ifWin.value ? "胜利" : "失败");
|
||||
}
|
||||
if (result.mode === 2) {
|
||||
data.value.playerStats = result.players.map((p) => ({
|
||||
@@ -53,6 +54,9 @@ onLoad(async (options) => {
|
||||
const mine = result.players.find((p) => p.playerId === myId);
|
||||
if (mine) totalPoints.value = mine.totalScore;
|
||||
rank.value = result.players.findIndex((p) => p.playerId === myId) + 1;
|
||||
if (rank.value > result.players.length * 0.3) {
|
||||
audioManager.play("胜利");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const battleInfo = uni.getStorageSync("last-battle");
|
||||
@@ -77,10 +81,16 @@ onLoad(async (options) => {
|
||||
if (mine) {
|
||||
data.value.myTeam = mine.team;
|
||||
totalPoints.value = mine.totalScore;
|
||||
ifWin.value = battleInfo.mode === 1 && mine.team === battleInfo.winner;
|
||||
if (battleInfo.mode === 1) {
|
||||
ifWin.value = mine.team === battleInfo.winner;
|
||||
audioManager.play(ifWin.value ? "胜利" : "失败");
|
||||
} else {
|
||||
if (rank.value > battleInfo.playerStats.length * 0.3) {
|
||||
audioManager.play("胜利");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
audioManager.play(ifWin.value ? "胜利" : "失败");
|
||||
});
|
||||
|
||||
const checkBowData = () => {
|
||||
|
||||
Reference in New Issue
Block a user