经验排行榜增加当前

This commit is contained in:
zhangsir
2024-07-09 16:59:50 +08:00
parent 0a35bf6023
commit f193857ec7
2 changed files with 13 additions and 4 deletions

View File

@@ -423,6 +423,7 @@ export function translate(field) {
let name = ''; let name = '';
switch (field) { switch (field) {
case 'total':name = '累计'; break; case 'total':name = '累计'; break;
case 'now':name = '当前'; break;
case 'weeks':name = '本周'; break; case 'weeks':name = '本周'; break;
case 'months':name = '本月'; break; case 'months':name = '本月'; break;
case 'years':name = '本年'; break; case 'years':name = '本年'; break;

View File

@@ -23,6 +23,7 @@
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item command="total">累计</el-dropdown-item> <el-dropdown-item command="total">累计</el-dropdown-item>
<el-dropdown-item command="now">当前</el-dropdown-item>
<!-- <el-dropdown-item command="weeks">本周</el-dropdown-item> <!-- <el-dropdown-item command="weeks">本周</el-dropdown-item>
<el-dropdown-item command="months">本月</el-dropdown-item> <el-dropdown-item command="months">本月</el-dropdown-item>
<el-dropdown-item command="years">本年</el-dropdown-item> --> <el-dropdown-item command="years">本年</el-dropdown-item> -->
@@ -32,10 +33,10 @@
</div> </div>
<div class="myselftext"> <div class="myselftext">
<div class="myranking"> <div class="myranking">
当前排名 : <span> {{currentUserRankingTotalData.rankNo}}</span> {{isNow ? '当前' : '累计'}}排名 : <span> {{currentUserRankingTotalData.rankNo}}</span>
</div> </div>
<div class="myexperience"> <div class="myexperience">
累计经验值 : <span>{{currentUserRankingTotalData.rankValue}}</span> {{isNow ? '当前' : '累计'}}经验值 : <span>{{currentUserRankingTotalData.rankValue}}</span>
</div> </div>
</div> </div>
@@ -340,7 +341,8 @@ export default {
total:0 total:0
}, },
list:[], list:[],
} },
isNow: false,
} }
}, },
mounted() { mounted() {
@@ -352,6 +354,7 @@ export default {
// 经验值排行榜(下拉框事件) // 经验值排行榜(下拉框事件)
experienceCommand(e) { experienceCommand(e) {
this.isNow = false
this.experience.field = e; this.experience.field = e;
this.experience.name = this.translate(e) this.experience.name = this.translate(e)
this.getExperience(); this.getExperience();
@@ -371,10 +374,15 @@ export default {
getExperience() {//经验值 getExperience() {//经验值
let data = { let data = {
aid:this.userInfo.aid,// #用户id aid:this.userInfo.aid,// #用户id
statType:20, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数 statType:21, // #统计类型 10学习时长 11 学习天数 20表经验值 30表u币 40表获取天数
field:this.experience.field,// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计 field:this.experience.field,// #统计周期 todays-当天,weeks-周,months-月,years-年 total-总计
num:5,// #显示的条数 num:5,// #显示的条数
} }
if(data.field == 'now'){
data.statType = 20
data.field = 'total'
this.isNow = true
}
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) {