初步完成返回游戏功能,待测试完善

This commit is contained in:
kron
2025-07-05 17:24:52 +08:00
parent c269a4b431
commit 1ea3f19238
8 changed files with 126 additions and 33 deletions

View File

@@ -1,9 +1,11 @@
<script setup>
import { ref, onMounted } from "vue";
import { onShow } from "@dcloudio/uni-app";
import AppBackground from "@/components/AppBackground.vue";
import Header from "@/components/Header.vue";
import ScreenHint from "@/components/ScreenHint.vue";
import { getCurrentGameAPI } from "@/apis";
import { debounce } from "@/util";
defineProps({
title: {
type: String,
@@ -29,20 +31,21 @@ defineProps({
const isIos = ref(true);
const showHint = ref(false);
const hintType = ref(0);
onMounted(() => {
const deviceInfo = uni.getDeviceInfo();
isIos.value = deviceInfo.osName === "ios";
});
const showGlobalHint = (type) => {
hintType.value = type;
showHint.value = true;
};
uni.$showHint = showGlobalHint;
const backToGame = async () => {
onMounted(() => {
const deviceInfo = uni.getDeviceInfo();
isIos.value = deviceInfo.osName === "ios";
});
onShow(() => {
uni.$showHint = showGlobalHint;
showHint.value = false;
});
const backToGame = debounce(async () => {
const result = await getCurrentGameAPI();
console.log(111, result);
};
});
</script>
<template>