完成决金箭调试

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

@@ -44,6 +44,7 @@ const bluePoints = ref(0);
const showRoundTip = ref(false);
const onComplete = ref(null);
const showModal = ref(false);
const isFinalShoot = ref(false);
onLoad(async (options) => {
if (options.battleId) {
@@ -126,9 +127,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]}`;
}
}
}
@@ -149,10 +155,13 @@ async function onReceiveMessage(messages = []) {
currentRedPoint.value = result.redScore;
bluePoints.value += result.blueScore;
redPoints.value += result.redScore;
showRoundTip.value = true;
// 开始下一轮;
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.MatchOver) {
uni.redirectTo({
@@ -223,12 +232,15 @@ onUnmounted(() => {
<ScreenHint
:show="showRoundTip"
:onClose="() => (showRoundTip = false)"
:mode="isFinalShoot ? 'tall' : 'normal'"
>
<RoundEndTip
:isFinal="isFinalShoot"
:round="currentRound - 1"
:bluePoint="currentBluePoint"
:redPoint="currentRedPoint"
:roundData="roundResults[roundResults.length - 1]"
:onAutoClose="() => (showRoundTip = false)"
/>
</ScreenHint>
</block>