Merge branch 'new-race-mode' into test

This commit is contained in:
2026-05-14 14:23:25 +08:00
3 changed files with 11 additions and 8 deletions

View File

@@ -17,12 +17,19 @@ const props = defineProps({
},
});
const battleMode = ref(1);
const targetMode = ref(1);
/** 对战模式0=未选 1=1v1 2=乱斗 3=2v2 4=3v3 */
const battleMode = ref(0);
/** 靶纸尺寸0=未选 1=20cm 2=40cm */
const targetMode = ref(0);
const loading = ref(false);
const roomNumber = ref("");
const createRoom = debounce(async () => {
// 校验必填项:对战模式与靶纸均必须选择
if (!battleMode.value || !targetMode.value) {
uni.showToast({ title: '请完善创建信息', icon: 'none' });
return;
}
if (game.value.inBattle) {
uni.$showHint(1);
return;

View File

@@ -10,7 +10,6 @@ import ScreenHint from "@/components/ScreenHint.vue";
import {
getRoomAPI,
exitRoomAPI,
startRoomAPI,
chooseTeamAPI,
getReadyAPI,
kickPlayerAPI,
@@ -208,10 +207,6 @@ const chooseTeam = async (team) => {
refreshMembers(result.members);
};
const exitRoom = async () => {
uni.navigateBack();
};
/** 待确认踢出的玩家信息 */
const playerToKick = ref(null);
/** 控制踢出确认弹窗的显示状态 */

View File

@@ -162,7 +162,8 @@ onLoad(async (options) => {
<view v-if="warnning" class="warnning">
{{ warnning }}
</view>
<CreateRoom v-if="!warnning" :onConfirm="() => (showModal = false)" />
<!-- showModal 关闭时立即销毁组件重开时重建确保选项重置为 0 -->
<CreateRoom v-if="!warnning && showModal" :onConfirm="() => (showModal = false)" />
</SModal>
<Signin :show="showSignin" :onClose="onSignin" />
</view>