diff --git a/src/apis.js b/src/apis.js index 293cf52..ac28c0f 100644 --- a/src/apis.js +++ b/src/apis.js @@ -165,12 +165,15 @@ export const getGameAPI = async (battleId) => { mode: battleStats.mode, gameMode: battleStats.gameMode, }; - if (battleStats.mode === 1) { + if (battleStats && battleStats.mode === 1) { data.winner = battleStats.winner; data.roundsData = {}; data.redPlayers = {}; data.bluePlayers = {}; - data.goldenRound = goldenRoundRecords && goldenRoundRecords.length ? goldenRoundRecords[0] : null; + data.goldenRound = + goldenRoundRecords && goldenRoundRecords.length + ? goldenRoundRecords[0] + : null; playerStats.forEach((item) => { const { playerBattleStats = {}, roundRecords = [] } = item; if (playerBattleStats.team === 0) { @@ -187,7 +190,7 @@ export const getGameAPI = async (battleId) => { }); }); } - if (battleStats.mode === 2) { + if (battleStats && battleStats.mode === 2) { data.players = []; playerStats.forEach((item) => { data.players.push({ diff --git a/src/components/RoundEndTip.vue b/src/components/RoundEndTip.vue index e5ba3ef..c9f832e 100644 --- a/src/components/RoundEndTip.vue +++ b/src/components/RoundEndTip.vue @@ -95,9 +95,9 @@ onUnmounted(() => { 蓝队 - {{ bluePoint }} + 5 分,红队 - {{ redPoint }} + 5 同分僵局!最后一箭定江山 diff --git a/src/pages/battle-room.vue b/src/pages/battle-room.vue index 53ae11b..a59d2ec 100644 --- a/src/pages/battle-room.vue +++ b/src/pages/battle-room.vue @@ -269,6 +269,7 @@ async function onReceiveMessage(messages = []) { if (msg.constructor === MESSAGETYPES.FinalShoot) { isFinalShoot.value = true; showRoundTip.value = true; + tips.value = "准备开始决金箭"; } if (msg.constructor === MESSAGETYPES.HalfTimeOver) { startCount.value = false; @@ -276,6 +277,7 @@ async function onReceiveMessage(messages = []) { tips.value = "准备下半场"; } if (msg.constructor === MESSAGETYPES.MatchOver) { + uni.setStorageSync("battle", msg.endStatus); uni.redirectTo({ url: `/pages/battle-result?battleId=${msg.id}`, }); diff --git a/src/pages/match-detail.vue b/src/pages/match-detail.vue index ecf796d..17392c2 100644 --- a/src/pages/match-detail.vue +++ b/src/pages/match-detail.vue @@ -93,7 +93,9 @@ const checkBowData = () => { /> {{ arrow.ring }}环 @@ -110,7 +112,9 @@ const checkBowData = () => { {{ arrow.ring }}环