逻辑完善

This commit is contained in:
kron
2025-11-13 21:23:45 +08:00
parent bd01b179a6
commit 2fb4740752
3 changed files with 55 additions and 25 deletions

View File

@@ -1,5 +1,6 @@
<script setup>
import { ref, onMounted, onBeforeUnmount } from "vue";
import { onShow } from "@dcloudio/uni-app";
import Container from "@/components/Container.vue";
import ShootProgress from "@/components/ShootProgress.vue";
import BowTarget from "@/components/BowTarget.vue";
@@ -55,9 +56,9 @@ async function onReceiveMessage(messages = []) {
}
}
setTimeout(() => {
if (scores.value.length === 3) audioManager.play("第二轮");
if (scores.value.length === 9) audioManager.play("第四轮");
}, 500);
if (scores.value.length === 3) audioManager.play("第二轮", false);
if (scores.value.length === 9) audioManager.play("第四轮", false);
}, 200);
} else if (msg.constructor === MESSAGETYPES.ShootSyncMePracticeID) {
if (practiseId.value && practiseId.value === msg.practice.id) {
setTimeout(() => {
@@ -70,12 +71,15 @@ async function onReceiveMessage(messages = []) {
}, 1500);
}
} else if (msg.constructor === MESSAGETYPES.HalfTimeOver) {
wait.value = msg.wait;
if (msg.wait === 20) uni.$emit("update-ramain", 0);
if (msg.wait === 20) {
uni.$emit("update-ramain", 0);
wait.value = msg.wait;
}
if (msg.wait === 0) {
let count = 60;
wait.value = msg.wait;
uni.$emit("update-ramain", count);
if (scores.value.length === 6) audioManager.play("第三轮");
if (scores.value.length === 6) audioManager.play("第三轮", false);
setInterval(() => {
count -= 1;
if (count === 30) {