From 00b79cdcc8b2dac543e193c128fc3a3471c899fb Mon Sep 17 00:00:00 2001 From: hzj <1304805162@qq.com> Date: Thu, 23 Oct 2025 17:56:01 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8A=BD=E5=A5=96=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E9=A1=B5):=20=E4=BF=AE=E5=A4=8D=E8=8E=B7=E5=8F=96=E6=88=91?= =?UTF-8?q?=E7=9A=84=E6=8E=92=E5=90=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Activities/Lottery/Lottery.vue | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/views/Activities/Lottery/Lottery.vue b/src/views/Activities/Lottery/Lottery.vue index f11d901..09e6282 100644 --- a/src/views/Activities/Lottery/Lottery.vue +++ b/src/views/Activities/Lottery/Lottery.vue @@ -1178,8 +1178,14 @@ const getUserInfo = async () => { if (Object.keys(userInfo.value).length === 0) { const resUserInfo = await getMemberProfile() if (resUserInfo.status && resUserInfo.body) { - userInfo.value = - userInfo.value == {} ? resUserInfo.body : Object.assign(userInfo.value, resUserInfo.body) + if (ranking.value.length == 0) { + userInfo.value = resUserInfo.body + } else { + // 在排行榜中查我的信息 + const myInfo = ranking.value.find((item) => item.account == resUserInfo.body.account) + console.log('myInfo:', myInfo) + userInfo.value = Object.assign(resUserInfo.body, myInfo) + } } } const resIdentity = await getUserIdentity() @@ -1315,12 +1321,14 @@ const getRanking = async () => { const resRanking = await ranklist() if (resRanking.status && resRanking.body) { ranking.value = resRanking.body - // 在排行榜中查我的信息 - const myInfo = ranking.value.find((item) => item.account == userInfo.value.account) - console.log('myInfo:', myInfo) + if (Object.keys(userInfo.value).length != 0) { + // 在排行榜中查我的信息 + const myInfo = resRanking.body.find((item) => item.account == userInfo.value.account) + console.log('myInfo:', myInfo) - if (myInfo) { - userInfo.value = userInfo.value == {} ? myInfo : Object.assign(userInfo.value, myInfo) + if (myInfo) { + Object.assign(userInfo.value, myInfo) + } } } else { ranking.value = {}