From 18ce93b12fadc0ec07a6d94e7792d8da5964f8b1 Mon Sep 17 00:00:00 2001 From: kron Date: Thu, 3 Jul 2025 21:12:59 +0800 Subject: [PATCH] =?UTF-8?q?UI=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Container.vue | 57 ++++++++++++++++++++++++++++++---- src/components/ScreenHint.vue | 20 +++++++++--- src/pages/my-device.vue | 1 - src/pages/ranking.vue | 12 +++---- src/static/screen-hint-bg.png | Bin 0 -> 42681 bytes 5 files changed, 72 insertions(+), 18 deletions(-) create mode 100644 src/static/screen-hint-bg.png diff --git a/src/components/Container.vue b/src/components/Container.vue index 258f895..f5e4bf0 100644 --- a/src/components/Container.vue +++ b/src/components/Container.vue @@ -3,6 +3,7 @@ import { ref, onMounted } from "vue"; import AppBackground from "@/components/AppBackground.vue"; import Header from "@/components/Header.vue"; import ScreenHint from "@/components/ScreenHint.vue"; +import { getCurrentGameAPI } from "@/apis"; defineProps({ title: { type: String, @@ -27,16 +28,21 @@ defineProps({ }); const isIos = ref(true); const showHint = ref(false); -const hintMessage = ref(""); +const hintType = ref(0); onMounted(() => { const deviceInfo = uni.getDeviceInfo(); isIos.value = deviceInfo.osName === "ios"; }); -const showGlobalHint = (message) => { - hintMessage.value = message; +const showGlobalHint = (type) => { + hintType.value = type; showHint.value = true; }; uni.$showHint = showGlobalHint; + +const backToGame = async () => { + const result = await getCurrentGameAPI(); + console.log(111, result); +}; @@ -66,4 +83,32 @@ uni.$showHint = showGlobalHint; justify-content: space-between; overflow-x: hidden; } +.back-to-game { + flex-direction: column; + display: flex; + align-items: center; + justify-content: center; + color: #fff; + width: 100%; + font-size: 14px; +} +.back-to-game > view { + display: flex; + align-items: center; + justify-content: space-around; + margin-top: 50rpx; + width: 100%; +} +.back-to-game > view > button { + padding: 12px; + border-radius: 20px; + background-color: #fff6; + color: #fff; + width: 45%; + font-size: 16px; +} +.back-to-game > view > button:first-child { + background-color: #fed847; + color: #000; +} diff --git a/src/components/ScreenHint.vue b/src/components/ScreenHint.vue index 85b0896..4098c48 100644 --- a/src/components/ScreenHint.vue +++ b/src/components/ScreenHint.vue @@ -8,20 +8,30 @@ const props = defineProps({ }, onClose: { type: Function, - default: () => {}, + default: null, }, mode: { type: String, default: "normal", }, }); +const getContentHeight = () => { + if (props.mode === "tall") return "47vw"; + if (props.mode === "square") return "74vw"; + return '36vw' +};