完成打乱斗数据调试

This commit is contained in:
kron
2026-02-07 10:52:56 +08:00
parent 09d8e7b3da
commit 6101cd80ce
20 changed files with 444 additions and 473 deletions

View File

@@ -7,21 +7,39 @@ import Avatar from "@/components/Avatar.vue";
import PlayerScore2 from "@/components/PlayerScore2.vue";
import { getBattleAPI } from "@/apis";
const blueTeam = ref([]);
const redTeam = ref([]);
const roundsData = ref([]);
const goldenRoundsData = ref([]);
const battleId = ref("");
const data = ref({
teams: [],
rounds: [],
});
const players = ref([]);
onLoad(async (options) => {
if (!options.id) return;
battleId.value = options.id || "57943107462893568";
battleId.value = options.id || "59090720979554304";
const result = await getBattleAPI(battleId.value);
data.value = result;
if (result.mode > 3) {
players.value = result.resultList.map((item, index) => {
const plist = result.teams[0] ? result.teams[0].players : [];
const p = plist.find((p) => p.id === item.userId);
const arrows = new Array(12);
result.rounds.forEach((r, index) => {
if (r.shoots[item.userId]) {
r.shoots[item.userId].forEach((s, index2) => {
arrows[index2 + index * 6] = s;
});
}
});
return {
...item,
rank: index + 1,
name: p.name,
avatar: p.avatar || "",
arrows,
};
});
}
});
const checkBowData = (selected) => {
@@ -44,10 +62,10 @@ const checkBowData = (selected) => {
:winner="data.winTeam"
:blueTeam="data.teams[1] ? data.teams[1].players : []"
:redTeam="data.teams[2] ? data.teams[2].players : []"
:players="data.players"
:players="players"
/>
<view
v-if="data.mode > 3"
v-if="data.mode >= 3"
class="score-header"
:style="{ border: 'none', padding: '5px 15px' }"
>
@@ -58,17 +76,17 @@ const checkBowData = (selected) => {
</view>
</view>
<PlayerScore2
v-if="data.mode > 3"
v-for="(player, index) in data.players"
v-if="data.mode >= 3"
v-for="(player, index) in players"
:key="index"
:name="player.name"
:avatar="player.avatar"
:scores="player.arrowHistory"
:arrows="player.arrows"
:totalScore="player.totalScore"
:totalRing="player.totalRings"
:rank="index + 1"
/>
<view
v-if="data.mode <= 3"
v-for="(round, index) in data.rounds"
:key="index"
:style="{ marginBottom: '5px' }"