diff --git a/src/pages/rank-list.vue b/src/pages/rank-list.vue index 953e917..4ce4912 100644 --- a/src/pages/rank-list.vue +++ b/src/pages/rank-list.vue @@ -10,15 +10,20 @@ const { getLvlName } = store; const isIos = ref(true); const selectedIndex = ref(0); const currentList = ref([]); +const myData = ref(null); onMounted(async () => { const deviceInfo = uni.getDeviceInfo(); isIos.value = deviceInfo.osName === "ios"; currentList.value = rankData.value.rank; + myData.value = rankData.value.rank.find( + (item) => item.userId === user.value.id + ); }); const handleSelect = (index) => { selectedIndex.value = index; + myData.value = null; if (index === 0) { currentList.value = rankData.value.rank; } else if (index === 2) { @@ -26,6 +31,9 @@ const handleSelect = (index) => { } else { currentList.value = []; } + myData.value = rankData.value.rank.find( + (item) => item.userId === user.value.id + ); }; const subTitles = ["排位赛积分", "本周MVP次数", "本周十环次数"]; @@ -121,18 +129,18 @@ const subTitles = ["排位赛积分", "本周MVP次数", "本周十环次数"]; > - + - {{ user.ranking }} + {{ myData.rank }} {{ user.nickName }} - {{ user.lvlName }},20场 + {{ user.lvlName }},{{ myData.TotalGames }}场 {{ user.scores }}{{ myData.totalScore }}