diff --git a/src/apis.js b/src/apis.js
index 849e1ea..63058f9 100644
--- a/src/apis.js
+++ b/src/apis.js
@@ -236,3 +236,7 @@ export const getBattleListAPI = async (page, battleType) => {
});
return data;
};
+
+export const getRankListAPI = () => {
+ return request("GET", "/index/ranklist");
+};
diff --git a/src/components/PlayerScore2.vue b/src/components/PlayerScore2.vue
index c185b30..2a5ad1c 100644
--- a/src/components/PlayerScore2.vue
+++ b/src/components/PlayerScore2.vue
@@ -1,4 +1,5 @@
diff --git a/src/constants.js b/src/constants.js
index 8e79a5e..36d7199 100644
--- a/src/constants.js
+++ b/src/constants.js
@@ -19,6 +19,8 @@ export const MESSAGETYPES = {
HalfTimeOver: 388606440,
};
+export const topThreeColors = ["#FFD947", "#D2D2D2", "#FFA515"];
+
export const getMessageTypeName = (id) => {
for (let key in MESSAGETYPES) {
if (MESSAGETYPES[key] === id) {
diff --git a/src/pages/battle-result.vue b/src/pages/battle-result.vue
index ae9e79c..e6b6fe9 100644
--- a/src/pages/battle-result.vue
+++ b/src/pages/battle-result.vue
@@ -4,6 +4,7 @@ import { onLoad } from "@dcloudio/uni-app";
import { getGameAPI } from "@/apis";
import Avatar from "@/components/Avatar.vue";
import { getHomeData } from "@/apis";
+import { topThreeColors } from "@/constants";
import useStore from "@/store";
import { storeToRefs } from "pinia";
const store = useStore();
@@ -54,7 +55,6 @@ const checkBowData = () => {
});
}
};
-const topThreeColors = ["#FFD947 ", "#D2D2D2", "#FFA515"];
diff --git a/src/pages/index.vue b/src/pages/index.vue
index 61fd3f0..52dbb5f 100644
--- a/src/pages/index.vue
+++ b/src/pages/index.vue
@@ -5,7 +5,13 @@ import AppBackground from "@/components/AppBackground.vue";
import UserHeader from "@/components/UserHeader.vue";
import SModal from "@/components/SModal.vue";
import Signin from "@/components/Signin.vue";
-import { getAppConfig, getHomeData, getMyDevicesAPI } from "@/apis";
+import {
+ getAppConfig,
+ getHomeData,
+ getMyDevicesAPI,
+ getRankListAPI,
+} from "@/apis";
+import { topThreeColors } from "@/constants";
import useStore from "@/store";
import { storeToRefs } from "pinia";
const store = useStore();
@@ -14,6 +20,7 @@ const { updateConfig, updateUser, updateDevice } = store;
const { user, device, remoteConnect } = storeToRefs(store);
const showModal = ref(false);
const isIos = ref(true);
+const rankData = ref({});
const toPage = (path) => {
if (!user.value.id) {
@@ -47,6 +54,9 @@ onMounted(async () => {
isIos.value = deviceInfo.osName === "ios";
const config = await getAppConfig();
console.log("全局配置:", config);
+ const rankList = await getRankListAPI();
+ if (rankList) rankData.value = rankList;
+ console.log("排位赛数据:", rankList);
updateConfig(config);
const token = uni.getStorageSync("token");
if (token) {
@@ -74,7 +84,6 @@ const comingSoon = () => {
icon: "none",
});
};
-const topThreeColors = ["#FFD947", "#D2D2D2", "#FFA515"];
@@ -121,21 +130,23 @@ const topThreeColors = ["#FFD947", "#D2D2D2", "#FFA515"];
-
-
-
-
- {{ i }}
-
-
+
+
+
+
+
+
+ {{ i }}
+
+
+
+
456{{ remoteConnect ? 1 : 0 }}
@@ -284,7 +295,7 @@ const topThreeColors = ["#FFD947", "#D2D2D2", "#FFA515"];
.ranking-players > image:first-child {
width: 28%;
- transform: translateX(-10px);
+ transform: translateX(-10px) translateY(-8px);
}
.player-avatars {
diff --git a/src/pages/rank-list.vue b/src/pages/rank-list.vue
index 1d0cc38..edc5aea 100644
--- a/src/pages/rank-list.vue
+++ b/src/pages/rank-list.vue
@@ -1,15 +1,19 @@