信息完善

This commit is contained in:
kron
2025-07-17 13:55:04 +08:00
parent 9ab54b6740
commit bb3d251041
7 changed files with 89 additions and 56 deletions

View File

@@ -33,20 +33,31 @@ onLoad(async (options) => {
blueId = Object.keys(item)[1];
redId = Object.keys(item)[0];
}
let bluePoint = 1;
let redPoint = 1;
const blueTotalRings = item[blueId].reduce((a, b) => a + b.ring, 0);
const redTotalRings = item[redId].reduce((a, b) => a + b.ring, 0);
if (blueTotalRings > redTotalRings) {
bluePoint = 2;
redPoint = 0;
} else if (blueTotalRings < redTotalRings) {
bluePoint = 0;
redPoint = 2;
}
roundsData.value.push({
blue: {
name: result.bluePlayers[blueId].name,
avatar: result.bluePlayers[blueId].avatar,
arrows: item[blueId],
totalRing: item[blueId].reduce((a, b) => a + b.ring, 0),
totalScore: item[blueId].reduce((a, b) => a + b.ringScore, 0),
totalRing: blueTotalRings,
totalScore: bluePoint,
},
red: {
name: result.redPlayers[redId].name,
avatar: result.redPlayers[redId].avatar,
arrows: item[redId],
totalRing: item[redId].reduce((a, b) => a + b.ring, 0),
totalScore: item[redId].reduce((a, b) => a + b.ringScore, 0),
totalRing: redTotalRings,
totalScore: redPoint,
},
});
});
@@ -76,6 +87,28 @@ const checkBowData = () => {
:redTeam="redTeam"
:players="data.players"
/>
<view
v-if="data.players && data.players.length"
class="score-header"
:style="{ border: 'none', padding: '5px 15px' }"
>
<text>大乱斗</text>
<view @click="checkBowData">
<text>查看靶纸</text>
<image src="../static/back.png" mode="widthFix" />
</view>
</view>
<PlayerScore2
v-if="data.players && data.players.length"
v-for="(player, index) in data.players"
:key="index"
:name="player.name"
:avatar="player.avatar"
:scores="player.arrowHistory"
:totalScore="player.totalScore"
:totalRing="player.totalRings"
:rank="index + 1"
/>
<block v-if="data.goldenRound">
<view class="score-header">
<text>决金箭轮环数</text>
@@ -127,28 +160,6 @@ const checkBowData = () => {
/>
</view>
</block>
<view
v-if="data.players && data.players.length"
class="score-header"
:style="{ border: 'none', padding: '5px 15px' }"
>
<text>大乱斗</text>
<view @click="checkBowData">
<text>查看靶纸</text>
<image src="../static/back.png" mode="widthFix" />
</view>
</view>
<PlayerScore2
v-if="data.players && data.players.length"
v-for="(player, index) in data.players"
:key="index"
:name="player.name"
:avatar="player.avatar"
:scores="player.arrowHistory"
:totalScore="player.totalScore"
:totalRing="player.totalRings"
:rank="index + 1"
/>
<view
v-for="(round, index) in roundsData"
:key="index"
@@ -184,9 +195,9 @@ const checkBowData = () => {
</view>
<view>
<text :style="{ color: '#FF6767' }">
{{ round.blue.totalRing }}环
{{ round.red.totalRing }}环
</text>
<text>得分 {{ round.blue.totalScore }}</text>
<text>得分 {{ round.red.totalScore }}</text>
</view>
</view>
</view>