BUG修复

This commit is contained in:
kron
2025-08-18 16:09:11 +08:00
parent b31689b19f
commit 1ce2ea9eb7
13 changed files with 302 additions and 166 deletions

View File

@@ -25,6 +25,7 @@ const start = ref(false);
const tips = ref("");
const battleId = ref("");
const currentRound = ref(1);
const goldenRound = ref(0);
const currentRedPoint = ref(0);
const currentBluePoint = ref(0);
const totalRounds = ref(0);
@@ -105,6 +106,7 @@ function recoverData(battleInfo) {
const { ShotCount, RedRecords, BlueRecords } = battleInfo.goldenRound;
const roundCount = Math.max(RedRecords.length, BlueRecords.length);
currentRound.value += roundCount;
goldenRound.value += roundCount;
isFinalShoot.value = true;
for (let i = 0; i < roundCount; i++) {
const roundData = {
@@ -112,6 +114,7 @@ function recoverData(battleInfo) {
RedRecords && RedRecords[i] ? RedRecords[i].Arrows || [] : [],
blueArrows:
BlueRecords && BlueRecords[i] ? BlueRecords[i].Arrows || [] : [],
gold: true,
};
if (roundResults.value[5 + i]) {
roundResults.value[5 + i] = roundData;
@@ -185,6 +188,7 @@ async function onReceiveMessage(messages = []) {
roundResults.value.push({
redArrows: [],
blueArrows: [],
gold: goldenRound.value > 0,
});
}
roundResults.value[currentRound.value - 1][
@@ -211,11 +215,13 @@ async function onReceiveMessage(messages = []) {
}
if (msg.constructor === MESSAGETYPES.FinalShoot) {
currentShooterId.value = 0;
currentRound.value += 1;
goldenRound.value += 1;
roundResults.value.push({
redArrows: [],
blueArrows: [],
});
currentBluePoint.value = bluePoints.value;
currentRedPoint.value = redPoints.value;
if (!isFinalShoot.value) {
isFinalShoot.value = true;
showRoundTip.value = true;
@@ -307,7 +313,12 @@ onHide(() => {
:isRed="false"
:currentShooterId="currentShooterId"
/>
<ShootProgress2 :tips="tips" :currentRound="'round' + currentRound" />
<ShootProgress2
:tips="tips"
:currentRound="
goldenRound > 0 ? 'gold' + goldenRound : 'round' + currentRound
"
/>
<TeamAvatars :team="redTeam" :currentShooterId="currentShooterId" />
</view>
<BowTarget
@@ -322,6 +333,7 @@ onHide(() => {
:roundResults="roundResults"
:redPoints="redPoints"
:bluePoints="bluePoints"
:goldenRound="goldenRound"
:power="power"
/>
<Timer v-if="!start" />