细节调整
This commit is contained in:
@@ -107,15 +107,21 @@ function recoverData(battleInfo) {
|
||||
totalRounds.value = battleInfo.maxRound;
|
||||
roundResults.value = battleInfo.roundResults;
|
||||
battleInfo.roundResults.forEach((round) => {
|
||||
if (round.blueTotal && round.redTotal) {
|
||||
if (round.blueTotal === round.redTotal) {
|
||||
bluePoints.value += 1;
|
||||
redPoints.value += 1;
|
||||
} else if (round.blueTotal > round.redTotal) {
|
||||
bluePoints.value += 2;
|
||||
} else {
|
||||
redPoints.value += 2;
|
||||
}
|
||||
const blueTotal = round.blueArrows.reduce(
|
||||
(last, next) => last + next.ring,
|
||||
0
|
||||
);
|
||||
const redTotal = round.redArrows.reduce(
|
||||
(last, next) => last + next.ring,
|
||||
0
|
||||
);
|
||||
if (blueTotal === redTotal) {
|
||||
bluePoints.value += 1;
|
||||
redPoints.value += 1;
|
||||
} else if (blueTotal > redTotal) {
|
||||
bluePoints.value += 2;
|
||||
} else {
|
||||
redPoints.value += 2;
|
||||
}
|
||||
});
|
||||
setTimeout(() => {
|
||||
@@ -428,7 +434,6 @@ async function onReceiveMessage(messages = []) {
|
||||
currentRedPoint.value = result.redScore;
|
||||
bluePoints.value += result.blueScore;
|
||||
redPoints.value += result.redScore;
|
||||
// roundResults.value = result.roundResults;
|
||||
currentRound.value = result.currentRound + 1;
|
||||
uni.$emit("update-ramain", 0);
|
||||
if (result.currentRound < 5) {
|
||||
@@ -464,15 +469,19 @@ async function onReceiveMessage(messages = []) {
|
||||
uni.setStorageSync("last-battle", msg.endStatus);
|
||||
if (msg.endStatus.noSaved) {
|
||||
uni.showToast({
|
||||
title: "游戏结束",
|
||||
title: "本场比赛无人射箭,已取消",
|
||||
icon: "none",
|
||||
});
|
||||
uni.navigateBack();
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
} else {
|
||||
isEnded.value = true;
|
||||
uni.redirectTo({
|
||||
url: `/pages/battle-result?battleId=${msg.id}`,
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url: `/pages/battle-result?battleId=${msg.id}`,
|
||||
});
|
||||
}, 1500);
|
||||
}
|
||||
}
|
||||
if (msg.constructor === MESSAGETYPES.BackToGame) {
|
||||
@@ -636,8 +645,8 @@ onHide(() => {
|
||||
<BowTarget
|
||||
:mode="battleType === 1 ? 'team' : 'solo'"
|
||||
:power="start ? power : 0"
|
||||
:currentRound="currentRound"
|
||||
:totalRound="totalRounds"
|
||||
:currentRound="scores.length"
|
||||
:totalRound="battleType === 1 ? 3 : totalRounds"
|
||||
:scores="scores"
|
||||
:blueScores="blueScores"
|
||||
:stop="!startCount"
|
||||
|
||||
Reference in New Issue
Block a user