完成决金箭调试

This commit is contained in:
kron
2025-07-06 00:42:10 +08:00
parent a2223d2b10
commit 0d21675013
7 changed files with 67 additions and 29 deletions

View File

@@ -51,6 +51,7 @@ const showRoundTip = ref(false);
const playersScores = ref({});
const showModal = ref(false);
const halfTimeTip = ref(false);
const isFinalShoot = ref(false);
const total = ref(90);
onLoad(async (options) => {
@@ -225,9 +226,14 @@ async function onReceiveMessage(messages = []) {
seq.value += 1;
currentShooterId.value = msg.userId;
if (redTeam.value[0].id === currentShooterId.value) {
tips.value = `请红队射箭-${roundsName[currentRound.value]}`;
tips.value = "请红队射箭-";
} else {
tips.value = `请蓝队射箭-${roundsName[currentRound.value]}`;
tips.value = "请蓝队射箭-";
}
if (isFinalShoot.value) {
tips.value += "决金箭";
} else {
tips.value += `${roundsName[currentRound.value]}`;
}
}
}
@@ -258,17 +264,15 @@ async function onReceiveMessage(messages = []) {
currentRedPoint.value = result.redScore;
bluePoints.value += result.blueScore;
redPoints.value += result.redScore;
showRoundTip.value = true;
if (
result.currentRound > 0 &&
result.currentRound < totalRounds.value
) {
// 开始下一轮;
roundResults.value = result.roundResults;
currentRound.value = result.currentRound + 1;
}
roundResults.value = result.roundResults;
currentRound.value = result.currentRound + 1;
if (result.currentRound < 5) showRoundTip.value = true;
}
}
if (msg.constructor === MESSAGETYPES.FinalShoot) {
isFinalShoot.value = true;
showRoundTip.value = true;
}
if (msg.constructor === MESSAGETYPES.HalfTimeOver) {
startCount.value = false;
halfTimeTip.value = true;
@@ -304,7 +308,11 @@ onUnmounted(() => {
</script>
<template>
<Container title="对战" :onBack="() => (showModal = true)">
<Container
title="对战"
:onBack="() => (showModal = true)"
:bgType="battleId ? 1 : 0"
>
<view class="standby-phase" v-if="step === 1">
<Guide>
<view :style="{ display: 'flex', flexDirection: 'column' }">
@@ -406,10 +414,12 @@ onUnmounted(() => {
<Timer :seq="timerSeq" />
<ScreenHint :show="showRoundTip" :onClose="() => (showRoundTip = false)">
<RoundEndTip
:isFinal="isFinalShoot"
:round="currentRound - 1"
:bluePoint="currentBluePoint"
:redPoint="currentRedPoint"
:roundData="roundResults[roundResults.length - 1]"
:onAutoClose="() => (showRoundTip = false)"
/>
</ScreenHint>
<ScreenHint