From cd8814189f1542c54603fd2fab5d333f4e8daea2 Mon Sep 17 00:00:00 2001 From: kron Date: Mon, 10 Nov 2025 14:49:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E5=90=8D=E6=98=BE=E7=A4=BA=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BowTarget.vue | 8 ++++++-- src/pages/battle-result.vue | 6 ++++-- src/pages/rank-list.vue | 4 +--- src/pages/ranking.vue | 4 ++-- src/store.js | 19 ++++++++++--------- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/src/components/BowTarget.vue b/src/components/BowTarget.vue index d7d7e73..80d7884 100644 --- a/src/components/BowTarget.vue +++ b/src/components/BowTarget.vue @@ -124,7 +124,7 @@ onBeforeUnmount(() => { 中场休息 - {{ index + 1 }} + {{ + player.rank + }} { /> {{ player.name }} - {{ getLvlName(player.totalScore) }} + {{ getLvlName(player.rank_lvl) }} {{ player.totalRings }} diff --git a/src/pages/rank-list.vue b/src/pages/rank-list.vue index e34029b..7d4d097 100644 --- a/src/pages/rank-list.vue +++ b/src/pages/rank-list.vue @@ -158,9 +158,7 @@ const subTitles = ["排位赛积分", "MVP次数", "十环次数"]; {{ item.name }} - {{ getLvlName(item.totalScore) }},{{ item.TotalGames }}场 + {{ getLvlName(item.rankLvl) }},{{ item.TotalGames }}场 { 段位 {{ - getLvlName(rankData.user.scores) || "-" + getLvlName(rankData.user.rankLvl) || "-" }} @@ -359,7 +359,7 @@ onShow(async () => { {{ item.name }} - {{ getLvlName(item.totalScore) }},{{ item.TotalGames }}场 + {{ getLvlName(item.rankLvl) }},{{ item.TotalGames }}场 diff --git a/src/store.js b/src/store.js index e346aff..6e3adaf 100644 --- a/src/store.js +++ b/src/store.js @@ -8,15 +8,13 @@ const defaultUser = { lvlName: "", }; -const getLvlName = (score, rankList = []) => { +const getLvlName = (rankLvl, rankList = []) => { if (!rankList) return; let lvlName = ""; rankList.some((r, index) => { lvlName = rankList[index].name; - if (r.upgrade_scores > score) { - if (rankList[index - 1]) { - lvlName = rankList[index - 1].name; - } + if (r.rank_id === rankLvl) { + lvlName = rankList[index].name; return true; } return false; @@ -62,8 +60,8 @@ export default defineStore("store", { // 方法 actions: { - getLvlName(score) { - return getLvlName(score, this.config.randInfos); + getLvlName(rankLvl) { + return getLvlName(rankLvl, this.config.randInfos); }, getLvlImage(rankLvl) { return getLvlImage(rankLvl, this.config.randInfos); @@ -78,8 +76,11 @@ export default defineStore("store", { const imageInfo = await uni.getImageInfo({ src: user.avatar }); this.user.avatar = imageInfo.path; } - if (this.user.scores !== undefined) { - this.user.lvlName = getLvlName(this.user.scores, this.config.randInfos); + if (this.user.rankLvl !== undefined) { + this.user.lvlName = getLvlName( + this.user.rankLvl, + this.config.randInfos + ); } const lvlImage = getLvlImage(this.user.rankLvl, this.config.randInfos); if (lvlImage) {