diff --git a/src/views/user/ranking.vue b/src/views/user/ranking.vue index 38f2070b..a0f66295 100644 --- a/src/views/user/ranking.vue +++ b/src/views/user/ranking.vue @@ -516,7 +516,7 @@ export default { aid:this.userInfo.aid,// #用户id statType:11, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数 field:this.learningDays.field,// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计 - num:5,// #显示的条数 + num:10,// #显示的条数 } if(data.field == 'now'){ data.statType = 13 @@ -553,8 +553,26 @@ export default { sex: null } }) - this.getUserData(ids,res.result.rankingData) - this.learningDays.list = res.result.rankingData; + // this.getUserData(ids,res.result.rankingData) + const noReapetIds = [...new Set(ids)]; + apiUser.getByIds(noReapetIds).then(rs => { + if (rs.status == 200) { + const listData = [] + rs.result.forEach((item, index) => { + res.result.rankingData.forEach(author => { + if (author.aid == item.aid) { + author.authorInfo = item; + listData.push(author) + } + }); + }); + this.learningDays.list = listData.sort((a,b)=>{ + return b.total-a.total + }).slice(0,5); + } else { + this.$message.error(res.message); + } + }); } }) },