设置屏幕常亮

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

@@ -355,10 +355,16 @@ const onBack = () => {
};
onMounted(() => {
uni.setKeepScreenOn({
keepScreenOn: true,
});
uni.$on("socket-inbox", onReceiveMessage);
});
onUnmounted(() => {
uni.setKeepScreenOn({
keepScreenOn: false,
});
uni.$off("socket-inbox", onReceiveMessage);
if (owner.value.id !== user.value.id && !battleId.value) {
exitRoomAPI(roomNumber.value);