在比赛开始时关闭激光

This commit is contained in:
kron
2025-10-30 09:09:03 +08:00
parent 84cdbb94db
commit 2c0982bd27
3 changed files with 6 additions and 6 deletions

View File

@@ -13,7 +13,7 @@ import RoundEndTip from "@/components/RoundEndTip.vue";
import TestDistance from "@/components/TestDistance.vue";
import TeamAvatars from "@/components/TeamAvatars.vue";
import ShootProgress2 from "@/components/ShootProgress2.vue";
import { getCurrentGameAPI } from "@/apis";
import { getCurrentGameAPI, laserCloseAPI } from "@/apis";
import { isGameEnded } from "@/util";
import { MESSAGETYPES, roundsName } from "@/constants";
import audioManager from "@/audioManager";
@@ -281,11 +281,12 @@ onLoad(async (options) => {
}
}
});
onMounted(() => {
onMounted(async () => {
uni.setKeepScreenOn({
keepScreenOn: true,
});
uni.$on("socket-inbox", onReceiveMessage);
await laserCloseAPI();
});
onBeforeUnmount(() => {
uni.setKeepScreenOn({