完成决金箭调试
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user