添加X环显示,比赛过程完善
This commit is contained in:
@@ -108,12 +108,27 @@ async function onReceiveMessage(msg) {
|
||||
recoverData(msg, { arrowOnly: true });
|
||||
} else if (msg.type === MESSAGETYPESV2.NewRound) {
|
||||
showRoundTip.value = true;
|
||||
isFinalShoot.value = msg.current.goldRound;
|
||||
const latestRound = msg.rounds[currentRound.value - 1];
|
||||
if (latestRound) {
|
||||
currentBluePoint.value = latestRound.scores[1].score;
|
||||
currentRedPoint.value = latestRound.scores[2].score;
|
||||
if (isFinalShoot.value) {
|
||||
currentBluePoint.value = msg.teams[1].score;
|
||||
currentRedPoint.value = msg.teams[2].score;
|
||||
} else {
|
||||
currentBluePoint.value = latestRound.scores[1].score;
|
||||
currentRedPoint.value = latestRound.scores[2].score;
|
||||
}
|
||||
}
|
||||
} else if (msg.type === MESSAGETYPESV2.BattleEnd) {
|
||||
if (msg.status === 4) {
|
||||
showRoundTip.value = true;
|
||||
currentBluePoint.value = 0;
|
||||
currentRedPoint.value = 0;
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 2000);
|
||||
return;
|
||||
}
|
||||
uni.redirectTo({
|
||||
url: "/pages/battle-result?battleId=" + msg.matchId,
|
||||
});
|
||||
@@ -122,12 +137,12 @@ async function onReceiveMessage(msg) {
|
||||
|
||||
onLoad(async (options) => {
|
||||
if (options.battleId) battleId.value = options.battleId;
|
||||
uni.enableAlertBeforeUnload({
|
||||
message: "离开比赛可能导致比赛失败,是否继续?",
|
||||
success: (res) => {
|
||||
console.log("已启用离开提示");
|
||||
},
|
||||
});
|
||||
// uni.enableAlertBeforeUnload({
|
||||
// message: "离开比赛可能导致比赛失败,是否继续?",
|
||||
// success: (res) => {
|
||||
// console.log("已启用离开提示");
|
||||
// },
|
||||
// });
|
||||
});
|
||||
onMounted(async () => {
|
||||
uni.setKeepScreenOn({
|
||||
|
||||
Reference in New Issue
Block a user