设置屏幕常亮
This commit is contained in:
@@ -355,10 +355,16 @@ const onBack = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
uni.setKeepScreenOn({
|
||||||
|
keepScreenOn: true,
|
||||||
|
});
|
||||||
uni.$on("socket-inbox", onReceiveMessage);
|
uni.$on("socket-inbox", onReceiveMessage);
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
uni.setKeepScreenOn({
|
||||||
|
keepScreenOn: false,
|
||||||
|
});
|
||||||
uni.$off("socket-inbox", onReceiveMessage);
|
uni.$off("socket-inbox", onReceiveMessage);
|
||||||
if (owner.value.id !== user.value.id && !battleId.value) {
|
if (owner.value.id !== user.value.id && !battleId.value) {
|
||||||
exitRoomAPI(roomNumber.value);
|
exitRoomAPI(roomNumber.value);
|
||||||
|
|||||||
@@ -94,10 +94,16 @@ async function onReceiveMessage(messages = []) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
uni.setKeepScreenOn({
|
||||||
|
keepScreenOn: true,
|
||||||
|
});
|
||||||
uni.$on("socket-inbox", onReceiveMessage);
|
uni.$on("socket-inbox", onReceiveMessage);
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
uni.setKeepScreenOn({
|
||||||
|
keepScreenOn: false,
|
||||||
|
});
|
||||||
uni.$off("socket-inbox", onReceiveMessage);
|
uni.$off("socket-inbox", onReceiveMessage);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -163,9 +163,15 @@ const onBack = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
uni.setKeepScreenOn({
|
||||||
|
keepScreenOn: true,
|
||||||
|
});
|
||||||
uni.$on("socket-inbox", onReceiveMessage);
|
uni.$on("socket-inbox", onReceiveMessage);
|
||||||
});
|
});
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
uni.setKeepScreenOn({
|
||||||
|
keepScreenOn: false,
|
||||||
|
});
|
||||||
uni.$off("socket-inbox", onReceiveMessage);
|
uni.$off("socket-inbox", onReceiveMessage);
|
||||||
if (gameType.value && teamSize.value) {
|
if (gameType.value && teamSize.value) {
|
||||||
matchGameAPI(true, gameType.value, teamSize.value);
|
matchGameAPI(true, gameType.value, teamSize.value);
|
||||||
|
|||||||
@@ -81,10 +81,16 @@ async function onComplete() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
uni.setKeepScreenOn({
|
||||||
|
keepScreenOn: true,
|
||||||
|
});
|
||||||
uni.$on("socket-inbox", onReceiveMessage);
|
uni.$on("socket-inbox", onReceiveMessage);
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
uni.setKeepScreenOn({
|
||||||
|
keepScreenOn: false,
|
||||||
|
});
|
||||||
uni.$off("socket-inbox", onReceiveMessage);
|
uni.$off("socket-inbox", onReceiveMessage);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -81,10 +81,16 @@ async function onComplete() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
uni.setKeepScreenOn({
|
||||||
|
keepScreenOn: true,
|
||||||
|
});
|
||||||
uni.$on("socket-inbox", onReceiveMessage);
|
uni.$on("socket-inbox", onReceiveMessage);
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
uni.setKeepScreenOn({
|
||||||
|
keepScreenOn: false,
|
||||||
|
});
|
||||||
uni.$off("socket-inbox", onReceiveMessage);
|
uni.$off("socket-inbox", onReceiveMessage);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -112,6 +118,7 @@ onUnmounted(() => {
|
|||||||
</view>
|
</view>
|
||||||
<BowTarget
|
<BowTarget
|
||||||
:start="start"
|
:start="start"
|
||||||
|
:currentRound="scores.length"
|
||||||
:totalRound="start ? total : 0"
|
:totalRound="start ? total : 0"
|
||||||
:scores="scores"
|
:scores="scores"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -196,9 +196,15 @@ const onBack = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
uni.setKeepScreenOn({
|
||||||
|
keepScreenOn: true,
|
||||||
|
});
|
||||||
uni.$on("socket-inbox", onReceiveMessage);
|
uni.$on("socket-inbox", onReceiveMessage);
|
||||||
});
|
});
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
uni.setKeepScreenOn({
|
||||||
|
keepScreenOn: false,
|
||||||
|
});
|
||||||
uni.$off("socket-inbox", onReceiveMessage);
|
uni.$off("socket-inbox", onReceiveMessage);
|
||||||
if (gameType.value && teamSize.value && !battleId.value) {
|
if (gameType.value && teamSize.value && !battleId.value) {
|
||||||
matchGameAPI(false, gameType.value, teamSize.value);
|
matchGameAPI(false, gameType.value, teamSize.value);
|
||||||
|
|||||||
Reference in New Issue
Block a user