加入房间逻辑完善
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import SButton from "@/components/SButton.vue";
|
||||
import { createRoomAPI } from "@/apis";
|
||||
import { joinRoomAPI, createRoomAPI } from "@/apis";
|
||||
|
||||
const props = defineProps({
|
||||
onConfirm: {
|
||||
@@ -26,9 +26,10 @@ const createRoom = async () => {
|
||||
step.value = 2;
|
||||
loading.value = false;
|
||||
};
|
||||
const enterRoom = () => {
|
||||
const enterRoom = async () => {
|
||||
step.value = 1;
|
||||
props.onConfirm();
|
||||
await joinRoomAPI(roomNumber.value);
|
||||
uni.navigateTo({
|
||||
url: `/pages/battle-room?roomNumber=${roomNumber.value}`,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user