修复落后数值异常问题

This commit is contained in:
dragon
2025-01-22 11:51:57 +08:00
parent fcb65d0cec
commit fe5449823e

View File

@@ -223,7 +223,7 @@ function listRank() {
$('.page1 .my .user p img').attr('src', my.userLevelVo.experUrl);
$('.page1 .my .user p b').text(my.nick);
$('.page1 .my .user span').text('ID:' + my.erbanNo);
$('.page1 .my .score').text(my.rank == 0 ? '-' : `${langReplace(localLang.demoModule.text14)} ${unitProcessingAr(lists[my.rank - 1].score - my.score, 1)}`);
$('.page1 .my .score').text(my.rank == 0 ? '-' : `${langReplace(localLang.demoModule.text14)} ${unitProcessingAr(lists[my.rank - 2].score - my.score, 1)}`);
} else {
toastMsg(res.message)
}
@@ -281,10 +281,11 @@ function listLastWeekRank() {
</p>
<span>ID:${res.erbanNo}</span>
</div>
<div class="score">${langReplace(localLang.demoModule.text14)}${scoreFun(list, i)}</div>
</li>
`
})
// <div class="score">${langReplace(localLang.demoModule.text14)}${scoreFun(list, i)}</div>
$('.lastRank .lastRank_in .box ul').append(str);
} else {
toastMsg(res.message)
@@ -337,9 +338,9 @@ function paginateArray(arr, itemsPerPage) {
function scoreFun(list, i) {
var num;
if (i == 0) {
num = unitProcessingAr(list[0].score - list[1].score, 1);
num = unitProcessingAr(list[1].score - list[2].score, 1);
} else {
num = unitProcessingAr(list[i - 1].score - list[i].score, 1);
num = unitProcessingAr(list[i - 1].score - list[i+1].score, 1);
}
return num;
}