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' +};