设置屏幕常亮

This commit is contained in:
kron
2025-07-13 11:21:19 +08:00
parent cae46224a3
commit 0eb148ef96
6 changed files with 37 additions and 0 deletions

View File

@@ -196,9 +196,15 @@ const onBack = () => {
}
};
onMounted(() => {
uni.setKeepScreenOn({
keepScreenOn: true,
});
uni.$on("socket-inbox", onReceiveMessage);
});
onUnmounted(() => {
uni.setKeepScreenOn({
keepScreenOn: false,
});
uni.$off("socket-inbox", onReceiveMessage);
if (gameType.value && teamSize.value && !battleId.value) {
matchGameAPI(false, gameType.value, teamSize.value);