添加还在游戏中提示

This commit is contained in:
kron
2025-07-02 17:16:56 +08:00
parent 997e2ee756
commit 5c5b72d556
4 changed files with 28 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
<script setup>
import { ref } from "vue";
import SButton from "@/components/SButton.vue";
import { joinRoomAPI, createRoomAPI } from "@/apis";
import { joinRoomAPI, createRoomAPI, isGamingAPI } from "@/apis";
const props = defineProps({
onConfirm: {
@@ -16,6 +16,11 @@ const loading = ref(false);
const roomNumber = ref("");
const createRoom = async () => {
const isGaming = await isGamingAPI();
if (isGaming) {
uni.$showHint("当前正在对战中");
return;
}
if (loading.value === true) return;
loading.value = true;
const result = await createRoomAPI(