修改升级接收方式

This commit is contained in:
kron
2025-07-22 09:36:38 +08:00
parent cbf83952d7
commit d3029865cf
8 changed files with 36 additions and 42 deletions

View File

@@ -1,6 +1,6 @@
<script setup>
import { ref, watch, onMounted, onUnmounted } from "vue";
import { onLoad } from "@dcloudio/uni-app";
import { onLoad, onShow, onHide } from "@dcloudio/uni-app";
import Container from "@/components/Container.vue";
import BowTarget from "@/components/BowTarget.vue";
import ShootProgress from "@/components/ShootProgress.vue";
@@ -155,7 +155,7 @@ async function onReceiveMessage(messages = []) {
tips.value = "准备下半场";
}
if (msg.constructor === MESSAGETYPES.MatchOver) {
uni.setStorageSync("last-battle", { ...msg.endStatus, lvl: msg.lvl });
uni.setStorageSync("last-battle", msg.endStatus);
if (msg.endStatus.noSaved) {
uni.showToast({
title: "游戏结束",
@@ -177,6 +177,7 @@ const onBack = () => {
uni.$showHint(3);
}
};
onShow(() => {});
onMounted(() => {
uni.setKeepScreenOn({
keepScreenOn: true,