fix:删除冗余代码+创建房间表单默认不选择
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user