diff --git a/src/apis.js b/src/apis.js
index d3ae0af..de33e27 100644
--- a/src/apis.js
+++ b/src/apis.js
@@ -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 = [];
diff --git a/src/components/BattleFooter.vue b/src/components/BattleFooter.vue
index 8058aa3..2185c3f 100644
--- a/src/components/BattleFooter.vue
+++ b/src/components/BattleFooter.vue
@@ -1,3 +1,4 @@
+=
@@ -21,8 +26,13 @@ defineProps({
-
-
+
+
@@ -47,9 +57,12 @@ defineProps({
-
+
- {{ i }}
+
环
@@ -71,7 +84,10 @@ defineProps({
-
+
环
diff --git a/src/components/BowTarget.vue b/src/components/BowTarget.vue
index c193dd8..a396e85 100644
--- a/src/components/BowTarget.vue
+++ b/src/components/BowTarget.vue
@@ -295,7 +295,7 @@ onMounted(() => {
}
.simul {
position: absolute;
- bottom: 20px;
+ bottom: 40px;
right: 20px;
margin-left: 20px;
}
diff --git a/src/components/HeaderProgress.vue b/src/components/HeaderProgress.vue
index 9173f2d..609cae5 100644
--- a/src/components/HeaderProgress.vue
+++ b/src/components/HeaderProgress.vue
@@ -27,7 +27,6 @@ watch(
if (newVal.includes("蓝队")) key = "请蓝方射击";
if (key && sound.value) {
if (currentRoundEnded.value) {
- currentRound.value += 1;
currentRoundEnded.value = false;
if (currentRound.value === 1) audioManager.play("第一轮");
if (currentRound.value === 2) audioManager.play("第二轮");
@@ -63,14 +62,17 @@ async function onReceiveMessage(messages = []) {
} else if (msg.constructor === MESSAGETYPES.WaitForAllReady) {
battleId.value = msg.id;
} else if (msg.constructor === MESSAGETYPES.AllReady) {
+ currentRoundEnded.value = true;
audioManager.play("比赛开始");
} else if (msg.constructor === MESSAGETYPES.MeleeAllReady) {
melee.value = true;
halfTime.value = false;
audioManager.play("比赛开始");
} else if (msg.constructor === MESSAGETYPES.CurrentRoundEnded) {
- currentRound.value += 1;
- currentRoundEnded.value = true;
+ if (msg.preRoundResult && msg.preRoundResult.currentRound) {
+ currentRound.value = msg.preRoundResult.currentRound + 1;
+ currentRoundEnded.value = true;
+ }
} else if (msg.constructor === MESSAGETYPES.HalfTimeOver) {
halfTime.value = true;
audioManager.play("中场休息");
@@ -113,7 +115,7 @@ onUnmounted(() => {
{{ tips }}
-
diff --git a/src/pages/battle-result.vue b/src/pages/battle-result.vue
index f1f076e..9f1ceb2 100644
--- a/src/pages/battle-result.vue
+++ b/src/pages/battle-result.vue
@@ -21,12 +21,10 @@ function exit() {
}
onLoad(async (options) => {
- // const myId = user.value.id;
- const myId = 39;
+ const myId = user.value.id;
if (options.battleId) {
const result = await getGameAPI(
- options.battleId || "BATTLE-1754302650041171466-546"
- // options.battleId || "BATTLE-1754017978280570919-571"
+ options.battleId || "BATTLE-1755156795334880000-865"
);
data.value = {
...result,
@@ -58,12 +56,17 @@ onLoad(async (options) => {
} else {
const battleInfo = uni.getStorageSync("last-battle");
if (!battleInfo) return;
- data.value = battleInfo;
+ data.value = {
+ mvps: [],
+ ...battleInfo,
+ };
if (battleInfo.mode === 1) {
battleInfo.playerStats.forEach((p) => {
if (p.team === 1) data.value.bluePlayers = [p];
if (p.team === 0) data.value.redPlayers = [p];
+ if (p.mvp) data.value.mvps.push(p);
});
+ data.value.mvps.sort((a, b) => b.totalRings - a.totalRings);
}
rank.value = 0;
const mine = battleInfo.playerStats.find((p, index) => {
@@ -90,7 +93,7 @@ const checkBowData = () => {
-