From eca11715d51d527c69c7b67248a850ecc01ea025 Mon Sep 17 00:00:00 2001 From: kron Date: Wed, 10 Sep 2025 15:56:57 +0800 Subject: [PATCH] fix bug --- src/apis.js | 13 ++++++------- src/components/BowTarget.vue | 6 +++++- src/pages/team-bow-data.vue | 3 ++- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/apis.js b/src/apis.js index fab8724..4376505 100644 --- a/src/apis.js +++ b/src/apis.js @@ -295,17 +295,16 @@ export const getGameAPI = async (battleId) => { }; }); }); + const totalRounds = Object.keys(data.roundsData).length; (goldenRoundRecords || []).forEach((item, index) => { item.arrowHistory.forEach((arrow) => { - if (!data.roundsData[playerStats.length + index + 1]) { - data.roundsData[playerStats.length + index + 1] = {}; + if (!data.roundsData[totalRounds + index + 1]) { + data.roundsData[totalRounds + index + 1] = {}; } - if (!data.roundsData[playerStats.length + index + 1][arrow.playerId]) { - data.roundsData[playerStats.length + index + 1][arrow.playerId] = []; + if (!data.roundsData[totalRounds + index + 1][arrow.playerId]) { + data.roundsData[totalRounds + index + 1][arrow.playerId] = []; } - data.roundsData[playerStats.length + index + 1][arrow.playerId].push( - arrow - ); + data.roundsData[totalRounds + index + 1][arrow.playerId].push(arrow); }); }); diff --git a/src/components/BowTarget.vue b/src/components/BowTarget.vue index 288cd4c..e470f6b 100644 --- a/src/components/BowTarget.vue +++ b/src/components/BowTarget.vue @@ -212,7 +212,9 @@ onMounted(() => { } .target { position: relative; - padding: 10px; + margin: 10px; + width: calc(100% - 20px); + height: calc(100% - 20px); } .e-value { position: absolute; @@ -244,6 +246,7 @@ onMounted(() => { } .target > image:last-child { width: 100%; + height: 100%; } .hit { position: absolute; @@ -261,6 +264,7 @@ onMounted(() => { display: flex; justify-content: center; align-items: center; + /* transform: translate(-50%, -50%); */ } .hit > text { transform: scaleX(0.7) translateY(-0.5px); diff --git a/src/pages/team-bow-data.vue b/src/pages/team-bow-data.vue index 12ea76c..220479a 100644 --- a/src/pages/team-bow-data.vue +++ b/src/pages/team-bow-data.vue @@ -18,7 +18,7 @@ const data = ref({ onLoad(async (options) => { if (options.battleId) { const result = await getGameAPI( - options.battleId || "BATTLE-1755484626207409508-955" + options.battleId || "BATTLE-1756453741433684760-512" ); data.value = result; Object.values(result.bluePlayers).forEach((p, index) => { @@ -150,6 +150,7 @@ const onClickTab = (index) => {