Merge branch 'new-race-mode' into test
This commit is contained in:
@@ -17,12 +17,19 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const battleMode = ref(1);
|
/** 对战模式:0=未选 1=1v1 2=乱斗 3=2v2 4=3v3 */
|
||||||
const targetMode = ref(1);
|
const battleMode = ref(0);
|
||||||
|
/** 靶纸尺寸:0=未选 1=20cm 2=40cm */
|
||||||
|
const targetMode = ref(0);
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const roomNumber = ref("");
|
const roomNumber = ref("");
|
||||||
|
|
||||||
const createRoom = debounce(async () => {
|
const createRoom = debounce(async () => {
|
||||||
|
// 校验必填项:对战模式与靶纸均必须选择
|
||||||
|
if (!battleMode.value || !targetMode.value) {
|
||||||
|
uni.showToast({ title: '请完善创建信息', icon: 'none' });
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (game.value.inBattle) {
|
if (game.value.inBattle) {
|
||||||
uni.$showHint(1);
|
uni.$showHint(1);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import ScreenHint from "@/components/ScreenHint.vue";
|
|||||||
import {
|
import {
|
||||||
getRoomAPI,
|
getRoomAPI,
|
||||||
exitRoomAPI,
|
exitRoomAPI,
|
||||||
startRoomAPI,
|
|
||||||
chooseTeamAPI,
|
chooseTeamAPI,
|
||||||
getReadyAPI,
|
getReadyAPI,
|
||||||
kickPlayerAPI,
|
kickPlayerAPI,
|
||||||
@@ -208,10 +207,6 @@ const chooseTeam = async (team) => {
|
|||||||
refreshMembers(result.members);
|
refreshMembers(result.members);
|
||||||
};
|
};
|
||||||
|
|
||||||
const exitRoom = async () => {
|
|
||||||
uni.navigateBack();
|
|
||||||
};
|
|
||||||
|
|
||||||
/** 待确认踢出的玩家信息 */
|
/** 待确认踢出的玩家信息 */
|
||||||
const playerToKick = ref(null);
|
const playerToKick = ref(null);
|
||||||
/** 控制踢出确认弹窗的显示状态 */
|
/** 控制踢出确认弹窗的显示状态 */
|
||||||
|
|||||||
@@ -162,7 +162,8 @@ onLoad(async (options) => {
|
|||||||
<view v-if="warnning" class="warnning">
|
<view v-if="warnning" class="warnning">
|
||||||
{{ warnning }}
|
{{ warnning }}
|
||||||
</view>
|
</view>
|
||||||
<CreateRoom v-if="!warnning" :onConfirm="() => (showModal = false)" />
|
<!-- showModal 关闭时立即销毁组件,重开时重建,确保选项重置为 0 -->
|
||||||
|
<CreateRoom v-if="!warnning && showModal" :onConfirm="() => (showModal = false)" />
|
||||||
</SModal>
|
</SModal>
|
||||||
<Signin :show="showSignin" :onClose="onSignin" />
|
<Signin :show="showSignin" :onClose="onSignin" />
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Reference in New Issue
Block a user