细节完善

This commit is contained in:
kron
2026-02-10 17:03:25 +08:00
parent 88f1ef5d95
commit 608de34dd3
10 changed files with 67 additions and 62 deletions

View File

@@ -16,7 +16,7 @@ const players = ref([]);
onLoad(async (options) => {
if (!options.battleId) return;
battleId.value = options.battleId || "60143330377469952";
battleId.value = options.battleId || "60510101693403136";
const result = await getBattleAPI(battleId.value);
data.value = result;
if (result.mode > 3) {
@@ -128,7 +128,7 @@ const checkBowData = (selected) => {
<text :style="{ color: team == 1 ? '#64BAFF' : '#FF6767' }">
{{ round.shoots[team].reduce((acc, cur) => acc + cur.ring, 0) }}
</text>
<text>得分 {{ round.scores[team].totalRing }}</text>
<text>得分 {{ round.scores[team].score }}</text>
</view>
</view>
</view>

View File

@@ -12,7 +12,6 @@ import ScreenHint from "@/components/ScreenHint.vue";
import TestDistance from "@/components/TestDistance.vue";
import audioManager from "@/audioManager";
import { getBattleAPI, laserCloseAPI } from "@/apis";
import { isGameEnded } from "@/util";
import { MESSAGETYPESV2 } from "@/constants";
import useStore from "@/store";
import { storeToRefs } from "pinia";
@@ -103,9 +102,11 @@ async function onReceiveMessage(msg) {
halfRest.value = true;
tips.value = "准备下半场";
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
uni.redirectTo({
url: "/pages/battle-result?battleId=" + msg.matchId,
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/battle-result?battleId=" + msg.matchId,
});
}, 1000);
}
}
onMounted(async () => {

View File

@@ -21,7 +21,7 @@ import {
} from "@/apis";
import { sharePractiseData } from "@/canvas";
import { wxShare, debounce } from "@/util";
import { MESSAGETYPESV2, MESSAGETYPES, roundsName } from "@/constants";
import { MESSAGETYPESV2, roundsName } from "@/constants";
import useStore from "@/store";
import { storeToRefs } from "pinia";
@@ -31,7 +31,6 @@ const { user } = storeToRefs(store);
const start = ref(false);
const scores = ref([]);
const total = 12;
const currentRound = ref(0);
const practiseResult = ref({});
const practiseId = ref("");
const showGuide = ref(false);
@@ -39,7 +38,6 @@ const tips = ref("");
const onReady = async () => {
await startPractiseAPI();
currentRound.value = 0;
scores.value = [];
start.value = true;
audioManager.play("练习开始");
@@ -69,7 +67,6 @@ async function onComplete() {
practiseResult.value = {};
start.value = false;
scores.value = [];
currentRound.value = 0;
const result = await createPractiseAPI(total, 120);
if (result) practiseId.value = result.id;
}
@@ -132,7 +129,7 @@ onBeforeUnmount(() => {
</view>
<BowTarget
:totalRound="start ? total / 4 : 0"
:currentRound="currentRound"
:currentRound="scores.length % 3"
:scores="scores"
/>
<ScorePanel2 :arrows="scores" />

View File

@@ -12,8 +12,7 @@ import TestDistance from "@/components/TestDistance.vue";
import TeamAvatars from "@/components/TeamAvatars.vue";
import ShootProgress2 from "@/components/ShootProgress2.vue";
import { laserCloseAPI, getBattleAPI } from "@/apis";
import { isGameEnded, formatTimestamp } from "@/util";
import { MESSAGETYPES, MESSAGETYPESV2, roundsName } from "@/constants";
import { MESSAGETYPESV2 } from "@/constants";
import audioManager from "@/audioManager";
import useStore from "@/store";
import { storeToRefs } from "pinia";
@@ -128,9 +127,11 @@ async function onReceiveMessage(msg) {
}, 2000);
return;
}
uni.redirectTo({
url: "/pages/battle-result?battleId=" + msg.matchId,
});
setTimeout(() => {
uni.redirectTo({
url: "/pages/battle-result?battleId=" + msg.matchId,
});
}, 1000);
}
}