Files
shoot-miniprograms/src/components/BackToGame.vue

65 lines
1.4 KiB
Vue
Raw Normal View History

2025-07-13 14:57:16 +08:00
<script setup>
import { ref, onMounted } from "vue";
import { onShow } from "@dcloudio/uni-app";
import { isGamingAPI, getCurrentGameAPI } from "@/apis";
const props = defineProps({
signin: {
type: Function,
default: () => {},
},
});
const show = ref(false);
onShow(async () => {
const isGaming = await isGamingAPI();
show.value = isGaming;
});
const onClick = async () => {
2025-07-18 15:48:41 +08:00
const isGaming = await isGamingAPI();
show.value = isGaming;
if (isGaming) {
const result = await getCurrentGameAPI();
}
2025-07-13 14:57:16 +08:00
};
</script>
<template>
<view v-if="show" class="back-to-game" @click="onClick">
<image src="../static/back-to-game-bg.png" mode="widthFix" />
<image src="../static/pk-icon.png" mode="widthFix" />
<text>返回进行中的对局</text>
<image src="../static/back.png" mode="widthFix" />
</view>
</template>
<style scoped>
.back-to-game {
position: fixed;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
width: 56vw;
left: calc(50% - 28vw);
top: 12%;
z-index: 999;
}
.back-to-game > image:first-child {
position: absolute;
width: 100%;
}
.back-to-game > image:nth-child(2) {
position: relative;
2025-07-14 13:39:10 +08:00
width: 60px;
2025-07-13 14:57:16 +08:00
}
.back-to-game > text:nth-child(3) {
position: relative;
font-size: 14px;
}
.back-to-game > image:nth-child(4) {
position: relative;
width: 15px;
margin-left: 5px;
transform: rotate(180deg);
}
</style>