From 46ec2ade9aa3ed06300f5aaa7a9d47afc60341ee Mon Sep 17 00:00:00 2001 From: kron Date: Wed, 23 Jul 2025 16:01:16 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=86=E8=8A=82=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BattleFooter.vue | 10 ++++++-- src/components/BubbleTip.vue | 2 +- src/components/ShootProgress.vue | 5 +--- src/components/UserUpgrade.vue | 5 +++- src/pages/battle-room.vue | 43 +++++++++++++++++++------------- src/pages/melee-match.vue | 14 +++++++---- src/pages/team-match.vue | 43 +++++++++++++++++++------------- 7 files changed, 75 insertions(+), 47 deletions(-) diff --git a/src/components/BattleFooter.vue b/src/components/BattleFooter.vue index a3d1d9a..94ab5f8 100644 --- a/src/components/BattleFooter.vue +++ b/src/components/BattleFooter.vue @@ -25,7 +25,10 @@ defineProps({ - Round {{ index + 1 }} + {{ index > 4 ? "决金箭" : "Round" }} + {{ index > 4 ? `R${index - 4}` : index + 1 }} {{ result.blueArrows.length @@ -40,7 +43,10 @@ defineProps({ - Round {{ index + 1 }} + {{ index > 4 ? "决金箭" : "Round" }} + {{ index > 4 ? `R${index - 4}` : index + 1 }} {{ result.redArrows.length diff --git a/src/components/BubbleTip.vue b/src/components/BubbleTip.vue index ab8d4f0..b263ddb 100644 --- a/src/components/BubbleTip.vue +++ b/src/components/BubbleTip.vue @@ -41,7 +41,7 @@ const props = defineProps({ height: 105rpx; padding-top: 10px; padding-left: 20rpx; - top: 25%; + top: 0; left: 15%; } .long { diff --git a/src/components/ShootProgress.vue b/src/components/ShootProgress.vue index 4f5a04a..08d61fb 100644 --- a/src/components/ShootProgress.vue +++ b/src/components/ShootProgress.vue @@ -239,11 +239,8 @@ onUnmounted(() => { transform: translateX(10px) translateY(-10px); } .container > view:last-child { - display: flex; - justify-content: center; - align-items: center; z-index: -1; - width: clac(100% - 30px); + width: calc(100% - 30px); margin: 0 15px; text-align: center; background-color: #ffffff80; diff --git a/src/components/UserUpgrade.vue b/src/components/UserUpgrade.vue index 56d27ad..b61ab82 100644 --- a/src/components/UserUpgrade.vue +++ b/src/components/UserUpgrade.vue @@ -23,6 +23,9 @@ onMounted(() => { if (props.lvl > user.value.lvl) { updateUser({ ...user.value, lvl: props.lvl }); } + setTimeout(() => { + props.onClose(); + }, 1500); }); @@ -51,7 +54,7 @@ onMounted(() => { 射灵{{ lvl }}级 ! - + diff --git a/src/pages/battle-room.vue b/src/pages/battle-room.vue index c1e4bf9..6ffb848 100644 --- a/src/pages/battle-room.vue +++ b/src/pages/battle-room.vue @@ -107,15 +107,21 @@ function recoverData(battleInfo) { totalRounds.value = battleInfo.maxRound; roundResults.value = battleInfo.roundResults; battleInfo.roundResults.forEach((round) => { - if (round.blueTotal && round.redTotal) { - if (round.blueTotal === round.redTotal) { - bluePoints.value += 1; - redPoints.value += 1; - } else if (round.blueTotal > round.redTotal) { - bluePoints.value += 2; - } else { - redPoints.value += 2; - } + const blueTotal = round.blueArrows.reduce( + (last, next) => last + next.ring, + 0 + ); + const redTotal = round.redArrows.reduce( + (last, next) => last + next.ring, + 0 + ); + if (blueTotal === redTotal) { + bluePoints.value += 1; + redPoints.value += 1; + } else if (blueTotal > redTotal) { + bluePoints.value += 2; + } else { + redPoints.value += 2; } }); setTimeout(() => { @@ -428,7 +434,6 @@ async function onReceiveMessage(messages = []) { currentRedPoint.value = result.redScore; bluePoints.value += result.blueScore; redPoints.value += result.redScore; - // roundResults.value = result.roundResults; currentRound.value = result.currentRound + 1; uni.$emit("update-ramain", 0); if (result.currentRound < 5) { @@ -464,15 +469,19 @@ async function onReceiveMessage(messages = []) { uni.setStorageSync("last-battle", msg.endStatus); if (msg.endStatus.noSaved) { uni.showToast({ - title: "游戏结束", + title: "本场比赛无人射箭,已取消", icon: "none", }); - uni.navigateBack(); + setTimeout(() => { + uni.navigateBack(); + }, 1500); } else { isEnded.value = true; - uni.redirectTo({ - url: `/pages/battle-result?battleId=${msg.id}`, - }); + setTimeout(() => { + uni.redirectTo({ + url: `/pages/battle-result?battleId=${msg.id}`, + }); + }, 1500); } } if (msg.constructor === MESSAGETYPES.BackToGame) { @@ -636,8 +645,8 @@ onHide(() => { { + uni.navigateBack(); + }, 1500); } else { isEnded.value = true; - uni.redirectTo({ - url: `/pages/battle-result?battleId=${msg.id}`, - }); + setTimeout(() => { + uni.redirectTo({ + url: `/pages/battle-result?battleId=${msg.id}`, + }); + }, 1500); } } if (msg.constructor === MESSAGETYPES.BackToGame) { diff --git a/src/pages/team-match.vue b/src/pages/team-match.vue index 16b7888..c07d238 100644 --- a/src/pages/team-match.vue +++ b/src/pages/team-match.vue @@ -66,15 +66,21 @@ function recoverData(battleInfo) { totalRounds.value = battleInfo.maxRound; roundResults.value = battleInfo.roundResults; battleInfo.roundResults.forEach((round) => { - if (round.blueTotal && round.redTotal) { - if (round.blueTotal === round.redTotal) { - bluePoints.value += 1; - redPoints.value += 1; - } else if (round.blueTotal > round.redTotal) { - bluePoints.value += 2; - } else { - redPoints.value += 2; - } + const blueTotal = round.blueArrows.reduce( + (last, next) => last + next.ring, + 0 + ); + const redTotal = round.redArrows.reduce( + (last, next) => last + next.ring, + 0 + ); + if (blueTotal === redTotal) { + bluePoints.value += 1; + redPoints.value += 1; + } else if (blueTotal > redTotal) { + bluePoints.value += 2; + } else { + redPoints.value += 2; } }); setTimeout(() => { @@ -217,7 +223,6 @@ async function onReceiveMessage(messages = []) { currentRedPoint.value = result.redScore; bluePoints.value += result.blueScore; redPoints.value += result.redScore; - // roundResults.value = result.roundResults; currentRound.value = result.currentRound + 1; if (result.currentRound < 5) { roundResults.value.push({ @@ -238,15 +243,19 @@ async function onReceiveMessage(messages = []) { uni.setStorageSync("last-battle", msg.endStatus); if (msg.endStatus.noSaved) { uni.showToast({ - title: "游戏结束", + title: "本场比赛无人射箭,已取消", icon: "none", }); - uni.navigateBack(); + setTimeout(() => { + uni.navigateBack(); + }, 1500); } else { isEnded.value = true; - uni.redirectTo({ - url: `/pages/battle-result?battleId=${msg.id}`, - }); + setTimeout(() => { + uni.redirectTo({ + url: `/pages/battle-result?battleId=${msg.id}`, + }); + }, 1500); } } if (msg.constructor === MESSAGETYPES.BackToGame) { @@ -331,8 +340,8 @@ onHide(() => { v-if="start" mode="team" :power="start ? power : 0" - :currentRound="currentRound" - :totalRound="totalRounds" + :currentRound="scores.length" + :totalRound="3" :scores="scores" :blueScores="blueScores" />