细节调整
This commit is contained in:
@@ -25,7 +25,10 @@ defineProps({
|
||||
<view class="players">
|
||||
<view>
|
||||
<view v-for="(result, index) in roundResults" :key="index">
|
||||
<text>Round {{ index + 1 }}</text>
|
||||
<text
|
||||
>{{ index > 4 ? "决金箭" : "Round" }}
|
||||
{{ index > 4 ? `R${index - 4}` : index + 1 }}</text
|
||||
>
|
||||
<view>
|
||||
<text>{{
|
||||
result.blueArrows.length
|
||||
@@ -40,7 +43,10 @@ defineProps({
|
||||
</view>
|
||||
<view>
|
||||
<view v-for="(result, index) in roundResults" :key="index">
|
||||
<text>Round {{ index + 1 }}</text>
|
||||
<text
|
||||
>{{ index > 4 ? "决金箭" : "Round" }}
|
||||
{{ index > 4 ? `R${index - 4}` : index + 1 }}</text
|
||||
>
|
||||
<view>
|
||||
<text>{{
|
||||
result.redArrows.length
|
||||
|
||||
@@ -41,7 +41,7 @@ const props = defineProps({
|
||||
height: 105rpx;
|
||||
padding-top: 10px;
|
||||
padding-left: 20rpx;
|
||||
top: 25%;
|
||||
top: 0;
|
||||
left: 15%;
|
||||
}
|
||||
.long {
|
||||
|
||||
@@ -239,11 +239,8 @@ onUnmounted(() => {
|
||||
transform: translateX(10px) translateY(-10px);
|
||||
}
|
||||
.container > view:last-child {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: -1;
|
||||
width: clac(100% - 30px);
|
||||
width: calc(100% - 30px);
|
||||
margin: 0 15px;
|
||||
text-align: center;
|
||||
background-color: #ffffff80;
|
||||
|
||||
@@ -23,6 +23,9 @@ onMounted(() => {
|
||||
if (props.lvl > user.value.lvl) {
|
||||
updateUser({ ...user.value, lvl: props.lvl });
|
||||
}
|
||||
setTimeout(() => {
|
||||
props.onClose();
|
||||
}, 1500);
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -51,7 +54,7 @@ onMounted(() => {
|
||||
<text>射灵{{ lvl }}级</text>
|
||||
<text>!</text>
|
||||
</view>
|
||||
<button @click="onClose" hover-class="none">关闭</button>
|
||||
<!-- <button @click="onClose" hover-class="none">关闭</button> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -165,15 +165,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) {
|
||||
|
||||
@@ -66,15 +66,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(() => {
|
||||
@@ -217,7 +223,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;
|
||||
if (result.currentRound < 5) {
|
||||
roundResults.value.push({
|
||||
@@ -238,15 +243,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) {
|
||||
@@ -331,8 +340,8 @@ onHide(() => {
|
||||
v-if="start"
|
||||
mode="team"
|
||||
:power="start ? power : 0"
|
||||
:currentRound="currentRound"
|
||||
:totalRound="totalRounds"
|
||||
:currentRound="scores.length"
|
||||
:totalRound="3"
|
||||
:scores="scores"
|
||||
:blueScores="blueScores"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user