diff --git a/src/components/BattleHeader.vue b/src/components/BattleHeader.vue
index 691316a..f5a6198 100644
--- a/src/components/BattleHeader.vue
+++ b/src/components/BattleHeader.vue
@@ -1,5 +1,6 @@
@@ -35,7 +35,10 @@ const bgColors = ["#364469", "#692735", "#934B4B", "#A98B69", "#8268A2"];
view {
- width: 20%;
display: flex;
flex-direction: column;
align-items: center;
@@ -126,6 +128,7 @@ const bgColors = ["#364469", "#692735", "#934B4B", "#A98B69", "#8268A2"];
color: #fff9;
font-size: 12px;
padding-top: 5px;
+ flex: 0 0 auto;
}
.player-name {
margin-top: 5px;
diff --git a/src/pages/match-detail.vue b/src/pages/match-detail.vue
index d291110..3575abf 100644
--- a/src/pages/match-detail.vue
+++ b/src/pages/match-detail.vue
@@ -20,8 +20,8 @@ const data = ref({
onLoad(async (options) => {
if (options.id) {
- battleId.value = options.id;
- const result = await getGameAPI(options.id);
+ battleId.value = options.id || "BATTLE-1750946182966867665-941";
+ const result = await getGameAPI(battleId.value);
data.value = result;
if (result.mode === 1) {
blueTeam.value = Object.values(result.bluePlayers || {});
diff --git a/src/pages/melee-bow-data.vue b/src/pages/melee-bow-data.vue
index 8ab4062..a9f6011 100644
--- a/src/pages/melee-bow-data.vue
+++ b/src/pages/melee-bow-data.vue
@@ -4,7 +4,6 @@ import { onLoad } from "@dcloudio/uni-app";
import Container from "@/components/Container.vue";
import BowTarget from "@/components/BowTarget.vue";
import Avatar from "@/components/Avatar.vue";
-import { roundsName } from "@/constants";
import { getGameAPI } from "@/apis";
import useStore from "@/store";
import { storeToRefs } from "pinia";
@@ -13,17 +12,6 @@ const { user } = storeToRefs(store);
const scores = ref([]);
const currentUser = ref({});
const data = ref({});
-onLoad(async (options) => {
- if (options.battleId) {
- const result = await getGameAPI(options.battleId);
- data.value = result;
- const mine = result.players.find((p) => p.playerId === user.value.id);
- currentUser.value = mine;
- if (mine && mine.arrowHistory) {
- scores.value = mine.arrowHistory;
- }
- }
-});
const onSelect = (userId) => {
const user = data.value.players.find((p) => p.playerId === userId);
currentUser.value = user;
@@ -31,54 +19,42 @@ const onSelect = (userId) => {
scores.value = user.arrowHistory;
}
};
+onLoad(async (options) => {
+ if (options.battleId) {
+ const result = await getGameAPI(options.battleId);
+ data.value = result;
+ if (result.players && result.players[0]) {
+ onSelect(result.players[0].playerId);
+ }
+ }
+});
-
+
onSelect(player.playerId)"
>
-
-
-
- {{ index + 1 }}
-
- 积分
- {{
- player.totalScore > 0
- ? "+" + player.totalScore
- : player.totalScore
- }}分
- {{ player.totalRings }}环
-
- {{ arrow.ring }}环
-
+ {{ player.name }}
-
-
+
+
{{ scores.length }} {
justify-content: center;
align-items: center;
}
+.players {
+ display: flex;
+ height: 85px;
+ width: 100%;
+ overflow-x: auto;
+ background-color: #fff3;
+}
+.players > view {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ font-size: 12px;
+ padding-top: 5px;
+ flex: 0 0 auto;
+}
+.players > view > text {
+ margin-top: 5px;
+ width: 80%;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ text-align: center;
+}
.score-text {
width: 100%;
color: #fff;
text-align: center;
font-size: 16px;
- margin-bottom: 6px;
+ margin-bottom: 20px;
}
.score-row {
margin: 10px;
@@ -134,54 +134,4 @@ const onSelect = (userId) => {
font-size: 24px;
margin: 3px;
}
-.rank-rows {
- display: flex;
- flex-direction: column;
- width: 100%;
- border-top: 1px solid #fff3;
-}
-.rank-rows > view {
- width: clac(100% - 20px);
- color: #fff9;
- border-bottom: 1px solid #fff3;
- padding: 7px 10px;
- display: flex;
- align-items: center;
- font-size: 14px;
- overflow-x: auto;
-}
-.rank-rows > view::-webkit-scrollbar {
- width: 0;
- height: 0;
- color: transparent;
-}
-.rank-rows > view > image:first-child,
-.rank-rows > view > view:first-child {
- width: 20px;
- height: 20px;
- line-height: 20px;
- text-align: center;
- font-size: 12px;
- margin-right: 10px;
- flex: 0 0 auto;
-}
-.rank-rows > view > view:first-child {
- background-color: #6d6d6d;
- border-radius: 50%;
-}
-.rank-rows > view > text {
- margin-left: 10px;
- flex: 0 0 auto;
- display: block;
- width: 25px;
-}
-.rank-rows > view > text:nth-child(3) {
- width: 80px;
-}
-.rank-rows > view > text:nth-child(4) {
- color: #fed847;
- padding-right: 10px;
- border-right: 1px solid #fff3;
- width: 32px;
-}