mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-13 12:56:43 +08:00
固定显示我的学习天数排行榜数据(排名、累计数据)
This commit is contained in:
@@ -122,10 +122,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="myselftext">
|
<div class="myselftext">
|
||||||
<div class="myranking">
|
<div class="myranking">
|
||||||
我的排名 : <span> {{learningDuration.data.rankingNo}}</span>
|
我的排名 : <span> {{learningDurationTotalData.rankNo}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="myexperience">
|
<div class="myexperience">
|
||||||
我的学习时长: <span> {{learningDuration.data.total || learningDuration.data.months || learningDuration.data.years || learningDuration.data.weeks}}</span> h
|
我的学习时长: <span> {{learningDurationTotalData.rankValue}}</span> h
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-table" style="margin-top:20px">
|
<div class="exp-table" style="margin-top:20px">
|
||||||
@@ -206,10 +206,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="myselftext">
|
<div class="myselftext">
|
||||||
<div class="myranking">
|
<div class="myranking">
|
||||||
我的排名 : <span> {{learningDays.data.rankingNo}}</span>
|
我的排名 : <span> {{learningDaysTotalData.rankNo}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="myexperience">
|
<div class="myexperience">
|
||||||
我的学习天数 : <span>{{learningDays.data.total || learningDays.data.months || learningDays.data.years || learningDays.data.weeks}}</span>
|
我的学习天数 : <span>{{learningDaysTotalData.rankValue}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="exp-table" style="margin-top:20px">
|
<div class="exp-table" style="margin-top:20px">
|
||||||
@@ -310,6 +310,14 @@ export default {
|
|||||||
},
|
},
|
||||||
list:[],
|
list:[],
|
||||||
},
|
},
|
||||||
|
learningDurationTotalData:{
|
||||||
|
rankNo:0, // 学习时长累计排名
|
||||||
|
rankValue:0 // 累计学习时长
|
||||||
|
},
|
||||||
|
learningDaysTotalData:{
|
||||||
|
rankNo:0, // 学习天数累计排名
|
||||||
|
rankValue:0 // 累计学习天数
|
||||||
|
},
|
||||||
learningDays:{
|
learningDays:{
|
||||||
field:'total',
|
field:'total',
|
||||||
name:'累计',
|
name:'累计',
|
||||||
@@ -390,79 +398,88 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getDuration() {//学习时长
|
getDuration() {//学习时长
|
||||||
let data = {
|
let data = {
|
||||||
aid:this.userInfo.aid,// #用户id
|
aid:this.userInfo.aid,// #用户id
|
||||||
statType:10, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数
|
statType:10, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数
|
||||||
field:this.learningDuration.field,// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计
|
field:this.learningDuration.field,// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计
|
||||||
num:5,// #显示的条数
|
num:5,// #显示的条数
|
||||||
}
|
}
|
||||||
apiStat.getRanking(data).then(res=>{
|
apiStat.getRanking(data).then(res=>{
|
||||||
if(res.status==200){
|
if(res.status==200){
|
||||||
if(res.result.currentUserRankingData) {
|
if(res.result.currentUserRankingData) {
|
||||||
res.result.currentUserRankingData.authorInfo={
|
res.result.currentUserRankingData.authorInfo={
|
||||||
aid: "",
|
aid: "",
|
||||||
name: "",
|
name: "",
|
||||||
orgInfo: "",
|
orgInfo: "",
|
||||||
avatar: "",
|
avatar: "",
|
||||||
sex: null
|
sex: null
|
||||||
}
|
}
|
||||||
this.getUserData([res.result.currentUserRankingData.aid],[res.result.currentUserRankingData])
|
this.getUserData([res.result.currentUserRankingData.aid],[res.result.currentUserRankingData])
|
||||||
this.learningDuration.data = res.result.currentUserRankingData;
|
this.learningDuration.data = res.result.currentUserRankingData;
|
||||||
}
|
if(data.field == 'total'){
|
||||||
|
this.learningDurationTotalData.rankNo = res.result.currentUserRankingData.rankingNo;
|
||||||
|
this.learningDurationTotalData.rankValue = res.result.currentUserRankingData.total;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const ids= [];
|
const ids= [];
|
||||||
res.result.rankingData.forEach(item=>{
|
res.result.rankingData.forEach(item=>{
|
||||||
ids.push(item.aid)
|
ids.push(item.aid)
|
||||||
item.authorInfo = {
|
item.authorInfo = {
|
||||||
aid: "",
|
aid: "",
|
||||||
name: "",
|
name: "",
|
||||||
orgInfo: "",
|
orgInfo: "",
|
||||||
avatar: "",
|
avatar: "",
|
||||||
sex: null
|
sex: null
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.getUserData(ids,res.result.rankingData)
|
this.getUserData(ids,res.result.rankingData)
|
||||||
this.learningDuration.list = res.result.rankingData;
|
this.learningDuration.list = res.result.rankingData;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getDays() {//学习天数
|
//学习天数
|
||||||
let data = {
|
getDays() {
|
||||||
aid:this.userInfo.aid,// #用户id
|
let data = {
|
||||||
statType:11, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数
|
aid:this.userInfo.aid,// #用户id
|
||||||
field:this.learningDays.field,// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计
|
statType:11, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数
|
||||||
num:5,// #显示的条数
|
field:this.learningDays.field,// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计
|
||||||
}
|
num:5,// #显示的条数
|
||||||
apiStat.getRanking(data).then(res=>{
|
}
|
||||||
if(res.status==200){
|
apiStat.getRanking(data).then(res=>{
|
||||||
if(res.result.currentUserRankingData) {
|
if(res.status==200){
|
||||||
res.result.currentUserRankingData.authorInfo={
|
if(res.result.currentUserRankingData) {
|
||||||
aid: "",
|
res.result.currentUserRankingData.authorInfo={
|
||||||
name: "",
|
aid: "",
|
||||||
orgInfo: "",
|
name: "",
|
||||||
avatar: "",
|
orgInfo: "",
|
||||||
sex: null
|
avatar: "",
|
||||||
}
|
sex: null
|
||||||
this.getUserData([res.result.currentUserRankingData.aid],[res.result.currentUserRankingData]);
|
}
|
||||||
this.learningDays.data = res.result.currentUserRankingData;
|
this.getUserData([res.result.currentUserRankingData.aid],[res.result.currentUserRankingData]);
|
||||||
}
|
this.learningDays.data = res.result.currentUserRankingData;
|
||||||
|
if(data.field == 'total'){
|
||||||
|
this.learningDaysTotalData.rankNo = res.result.currentUserRankingData.rankingNo;
|
||||||
|
this.learningDaysTotalData.rankValue = res.result.currentUserRankingData.total;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const ids= [];
|
const ids= [];
|
||||||
res.result.rankingData.forEach(item=>{
|
res.result.rankingData.forEach(item=>{
|
||||||
ids.push(item.aid)
|
ids.push(item.aid)
|
||||||
item.authorInfo = {
|
item.authorInfo = {
|
||||||
aid: "",
|
aid: "",
|
||||||
name: "",
|
name: "",
|
||||||
orgInfo: "",
|
orgInfo: "",
|
||||||
avatar: "",
|
avatar: "",
|
||||||
sex: null
|
sex: null
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.getUserData(ids,res.result.rankingData)
|
this.getUserData(ids,res.result.rankingData)
|
||||||
this.learningDays.list = res.result.rankingData;
|
this.learningDays.list = res.result.rankingData;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getUserData(ids,list) {
|
getUserData(ids,list) {
|
||||||
const noReapetIds = [...new Set(ids)];
|
const noReapetIds = [...new Set(ids)];
|
||||||
|
|||||||
Reference in New Issue
Block a user