From 124f50429dd73178731829f4b16a22c5ef8a201e Mon Sep 17 00:00:00 2001 From: kron Date: Thu, 17 Jul 2025 09:35:30 +0800 Subject: [PATCH] =?UTF-8?q?BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TestDistance.vue | 2 +- src/pages/battle-result.vue | 11 ++--------- src/pages/battle-room.vue | 9 +++++---- src/pages/melee-bow-data.vue | 13 +++++++------ src/pages/team-match.vue | 10 ++++++---- 5 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/components/TestDistance.vue b/src/components/TestDistance.vue index cccfcb0..40b32eb 100644 --- a/src/components/TestDistance.vue +++ b/src/components/TestDistance.vue @@ -121,7 +121,7 @@ onUnmounted(() => { justify-content: space-between; align-items: center; padding: 15px; - margin-top: -27vw; + margin-top: -40vw; position: relative; } .debug-text { diff --git a/src/pages/battle-result.vue b/src/pages/battle-result.vue index da1d716..8b5c3a0 100644 --- a/src/pages/battle-result.vue +++ b/src/pages/battle-result.vue @@ -47,15 +47,8 @@ onMounted(async () => { rank.value = battleInfo.playerStats.findIndex((p) => p.id === user.value.id) + 1; if (mine) { - if (battleInfo.mode === 1) { - totalPoints.value = mine.roundStats.reduce( - (last, next) => last + next.arrows.length, - 0 - ); - if (mine.team === battleInfo.winner) ifWin.value = true; - } else if (battleInfo.mode === 2) { - totalPoints.value = mine.totalScore; - } + totalPoints.value = mine.totalScore; + ifWin.value = battleInfo.mode === 1 && mine.team === battleInfo.winner; } // const result = await getHomeData(); // if (result.user) updateUser(result.user); diff --git a/src/pages/battle-room.vue b/src/pages/battle-room.vue index 0d2ba5c..5bb1b53 100644 --- a/src/pages/battle-room.vue +++ b/src/pages/battle-room.vue @@ -320,10 +320,11 @@ async function onReceiveMessage(messages = []) { tips.value = "请在90秒内射完12支箭"; seq.value += 1; } - roundResults.value.push({ - redArrows: [], - blueArrows: [], - }); + if (!roundResults.value.length) + roundResults.value.push({ + redArrows: [], + blueArrows: [], + }); total.value = 15; } if (msg.constructor === MESSAGETYPES.MeleeAllReady) { diff --git a/src/pages/melee-bow-data.vue b/src/pages/melee-bow-data.vue index dbaf810..b88f637 100644 --- a/src/pages/melee-bow-data.vue +++ b/src/pages/melee-bow-data.vue @@ -49,7 +49,7 @@ onLoad(async (options) => { :style="{ width: `${Math.max(100 / data.players.length, 18)}vw`, }" - mode="aspectFill" + mode="widthFix" class="player-bg" /> { } .players { display: flex; - height: 85px; width: 100%; overflow-x: auto; - overflow-y: hidden; - background-color: #fff3; } .players::-webkit-scrollbar { width: 0; @@ -105,21 +102,25 @@ onLoad(async (options) => { color: transparent; } .players > view { + background-color: #fff3; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12px; - padding-top: 5px; flex: 0 0 auto; position: relative; + height: 68px; + margin-bottom: 10px; + padding-top: 7px; } .player-bg { position: absolute; width: 100%; + height: 100%; } .players > view > text { - margin-top: 5px; + margin: 5px 0; width: 80%; white-space: nowrap; overflow: hidden; diff --git a/src/pages/team-match.vue b/src/pages/team-match.vue index be6986c..c411471 100644 --- a/src/pages/team-match.vue +++ b/src/pages/team-match.vue @@ -145,10 +145,12 @@ async function onReceiveMessage(messages = []) { timerSeq.value = 0; scores.value = []; totalRounds.value = msg.groupUserStatus.config.maxRounds; - roundResults.value.push({ - redArrows: [], - blueArrows: [], - }); + // 返回游戏时候会加上,加了就不用再加了 + if (!roundResults.value.length) + roundResults.value.push({ + redArrows: [], + blueArrows: [], + }); } if (msg.constructor === MESSAGETYPES.ToSomeoneShoot) { if (currentShooterId.value !== msg.userId) {