财富魅力月榜 - 修改独联体隐藏上月榜单

This commit is contained in:
2025-10-16 16:25:11 +08:00
parent 3f7117749c
commit 3b06006160
2 changed files with 70 additions and 49 deletions

View File

@@ -55,7 +55,8 @@ $(function () {
localLang = window.lang; localLang = window.lang;
translateFun(); translateFun();
showLoading() showLoading()
geth5() geth5(1);
geth5(2);
userInfo() userInfo()
}, 100) }, 100)
}) })
@@ -76,10 +77,11 @@ function translateFun() {
$('.newText5').html(langReplace(localLang.demoModule.newText5)); $('.newText5').html(langReplace(localLang.demoModule.newText5));
$('.newText6').html(langReplace(localLang.demoModule.newText6)); $('.newText6').html(langReplace(localLang.demoModule.newText6));
$('.Ranking').html(langReplace(localLang.demoModule.Ranking)); $('.Ranking').html(langReplace(localLang.demoModule.Ranking));
} }
var partitionId;
// 榜单接口 // 榜单接口
function geth5() { function geth5(periodType) {
$('ul li').remove(); $('ul li').remove();
$('.header .sTab').show(); $('.header .sTab').show();
$('.my').show() $('.my').show()
@@ -94,11 +96,12 @@ function geth5() {
data: { data: {
type: listType, type: listType,
datetype: 5, datetype: 5,
periodType: 1, periodType,
uid: pubInfo.uid uid: pubInfo.uid
}, },
success(res) { success(res) {
if (res.code === 200) { if (res.code === 200) {
partitionId = res.data.partitionId;
var my = res.data.me; var my = res.data.me;
var listTo3 = res.data.rankVoList.slice(0, 3); var listTo3 = res.data.rankVoList.slice(0, 3);
var notListTo3 = res.data.rankVoList.slice(3); var notListTo3 = res.data.rankVoList.slice(3);
@@ -112,24 +115,18 @@ function geth5() {
}) })
listTo3.push(...arr) listTo3.push(...arr)
} }
listTo3.forEach((res, i) => { // 本月
$(`.header .top .top${i + 1} .ts`).attr('uid', res.uid); if (periodType == 1) {
$(`.header .top .top${i + 1} .tx`).attr('src', res.avatar); listTo3.forEach((res, i) => {
$(`.header .top .top${i + 1} .nick`).text(res.nick); $(`.rank_top .top${i + 1} .ts`).attr('uid', res.uid);
// if (i > 0) { $(`.rank_top .top${i + 1} .tx`).attr('src', res.avatar);
$(`.rank_top .top${i + 1} .score span`).text(unitProcessingAr(res.diffNum, 1)); $(`.rank_top .top${i + 1} .nick`).text(res.nick);
$(`.rank_top .top${i + 1} .score span`).text(unitProcessingAr(res.diffNum, 1));
$(`.rank_top .top${i + 1} .ts`).attr('uid', res.uid); });
$(`.rank_top .top${i + 1} .tx`).attr('src', res.avatar); // 非前三
$(`.rank_top .top${i + 1} .nick`).text(res.nick); var str = '';
// if (i > 0) { notListTo3.forEach((res, i) => {
$(`.rank_top .top${i + 1} .score span`).text(unitProcessingAr(res.diffNum, 1)); str += `
// }
});
// 非前三
var str = '';
notListTo3.forEach((res, i) => {
str += `
<li> <li>
<div class="seqNo">${res.seqNo}</div> <div class="seqNo">${res.seqNo}</div>
<img src="${res.avatar}" uid="${res.uid}" alt="" class="tx"> <img src="${res.avatar}" uid="${res.uid}" alt="" class="tx">
@@ -141,16 +138,27 @@ function geth5() {
</div> --> </div> -->
</li> </li>
` `
}) })
$('ul').append(str); $('ul').append(str);
// 处理自己 // 处理自己
$('.my .box .tx').attr('src', my.avatar); $('.my .box .tx').attr('src', my.avatar);
$('.my .box .nick').text(my.nick); $('.my .box .nick').text(my.nick);
$('.my .box .seqNo').text(my.seqNo <= 0 ? '-' : my.seqNo); $('.my .box .seqNo').text(my.seqNo <= 0 ? '-' : my.seqNo);
$('.my .box .score span').text(my.diffNum <= 0 ? '-' : unitProcessingAr(my.diffNum, 1)); $('.my .box .score span').text(my.diffNum <= 0 ? '-' : unitProcessingAr(my.diffNum, 1));
if (my.diffNum <= 0) { if (my.diffNum <= 0) {
$('.my .box .score b').hide(); $('.my .box .score b').hide();
}
}else{
if(partitionId == 32) return;
// 上月
listTo3.forEach((res, i) => {
$(`.header .top .top${i + 1} .ts`).attr('uid', res.uid);
$(`.header .top .top${i + 1} .tx`).attr('src', res.avatar);
$(`.header .top .top${i + 1} .nick`).text(res.nick);
$(`.header .top .top${i + 1} .score span`).text(unitProcessingAr(res.diffNum, 1));
});
} }
} else { } else {
toastMsg(res.message) toastMsg(res.message)
} }
@@ -163,7 +171,7 @@ function geth5() {
}) })
} }
// 公会接口 // 公会接口
function listRank(type) { function listRank(periodType) {
$('ul li').remove(); $('ul li').remove();
$('.my').hide() $('.my').hide()
// $('.header .top .top2 .score,.header .top .top3 .score').hide(); // $('.header .top .top2 .score,.header .top .top3 .score').hide();
@@ -174,7 +182,7 @@ function listRank(type) {
type: 'get', type: 'get',
url: urlPrefix + '/clan/listRank', url: urlPrefix + '/clan/listRank',
data: { data: {
periodType: 1, periodType,
}, },
success(res) { success(res) {
if (res.code === 200) { if (res.code === 200) {
@@ -192,13 +200,10 @@ function listRank(type) {
}) })
listTo3.push(...arr) listTo3.push(...arr)
} }
listTo3.forEach((res, i) => { // 这个月榜单
$(`.header .top .top${i + 1} .ts`).attr('uid', res.clanElderUid); if(periodType == 1){
$(`.header .top .top${i + 1} .tx`).attr('src', res.avatar); listTo3.forEach((res, i) => {
$(`.header .top .top${i + 1} .nick`).text(res.name); $(`.rank_top .top${i + 1} .ts`).attr('uid', res.clanElderUid);
$(`.header .top .top${i + 1} .score span`).text(unitProcessingAr(res.diffNum, 1));
$(`.rank_top .top${i + 1} .ts`).attr('uid', res.clanElderUid);
$(`.rank_top .top${i + 1} .tx`).attr('src', res.avatar); $(`.rank_top .top${i + 1} .tx`).attr('src', res.avatar);
$(`.rank_top .top${i + 1} .nick`).text(res.name); $(`.rank_top .top${i + 1} .nick`).text(res.name);
// if (i > 0) { // if (i > 0) {
@@ -221,6 +226,17 @@ function listRank(type) {
` `
}) })
$('ul').append(str); $('ul').append(str);
}else{
if(partitionId == 32) return
// 上月榜单
listTo3.forEach((res, i) => {
$(`.header .top .top${i + 1} .ts`).attr('uid', res.clanElderUid);
$(`.header .top .top${i + 1} .tx`).attr('src', res.avatar);
$(`.header .top .top${i + 1} .nick`).text(res.name);
$(`.header .top .top${i + 1} .score span`).text(unitProcessingAr(res.diffNum, 1));
});
}
} else { } else {
toastMsg(res.message) toastMsg(res.message)
} }
@@ -243,9 +259,9 @@ $('.tabBox div').click(function () {
$('.rank_top').removeClass('top_bg_1').removeClass('top_bg_2').removeClass('top_bg_3') $('.rank_top').removeClass('top_bg_1').removeClass('top_bg_2').removeClass('top_bg_3')
$(`.rank_top`).addClass(`top_bg_${i}`); $(`.rank_top`).addClass(`top_bg_${i}`);
// 奖励图 // 奖励图
$('.reward_img div').removeClass('rewardImg_1').removeClass('rewardImg_2').removeClass('rewardImg_3') $('.reward_img div').removeClass('rewardImg_1').removeClass('rewardImg_2').removeClass('rewardImg_3')
$(`.reward_img div`).addClass(`rewardImg_${i}`); $(`.reward_img div`).addClass(`rewardImg_${i}`);
$('ul li .tx').removeClass('actTx'); $('ul li .tx').removeClass('actTx');
$(`.header .top .top1 .ts`).attr('src', './images/no1.png') $(`.header .top .top1 .ts`).attr('src', './images/no1.png')
$(`.header .top .top2 .ts`).attr('src', './images/no2.png') $(`.header .top .top2 .ts`).attr('src', './images/no2.png')
@@ -257,12 +273,15 @@ $('.tabBox div').click(function () {
$('.my .box .score img').attr('src', `./images/${type}.png`); $('.my .box .score img').attr('src', `./images/${type}.png`);
if (i == 1) { if (i == 1) {
listType = 2; listType = 2;
geth5(); geth5(1);
geth5(2);
} else if (i == 2) { } else if (i == 2) {
listType = 1; listType = 1;
geth5(); geth5(1);
geth5(2);
} else if (i == 3) { } else if (i == 3) {
listRank(4); listRank(1);
listRank(2);
$('ul li .tx').addClass('actTx'); $('ul li .tx').addClass('actTx');
} }
}) })
@@ -270,10 +289,10 @@ $('.tabBox div').click(function () {
$('.sTab div').click(function () { $('.sTab div').click(function () {
$(this).addClass('act').siblings().removeClass('act'); $(this).addClass('act').siblings().removeClass('act');
timeType = $(this).attr('type'); timeType = $(this).attr('type');
if(timeType == 1){ if (timeType == 1) {
$('.rank_list').show(); $('.rank_list').show();
$('.reward_img').hide(); $('.reward_img').hide();
}else{ } else {
$('.reward_img').show(); $('.reward_img').show();
$('.rank_list').hide(); $('.rank_list').hide();
} }

View File

@@ -93,10 +93,11 @@ function geth5() {
}, },
success(res) { success(res) {
if (res.code === 200) { if (res.code === 200) {
partitionId = res.data.partitionId;
if(res.data.partitionId !=32){
var my = res.data.me; var my = res.data.me;
var listTo3 = res.data.rankVoList.slice(0, 3); var listTo3 = res.data.rankVoList.slice(0, 3);
var notListTo3 = res.data.rankVoList.slice(3); var notListTo3 = res.data.rankVoList.slice(3);
partitionId = res.data.partitionId;
var currentTabIndex = $('.header .tabBox div.act').index() + 1; var currentTabIndex = $('.header .tabBox div.act').index() + 1;
// if (partitionId == 16 && currentTabIndex == 1) { // if (partitionId == 16 && currentTabIndex == 1) {
// $('.rewards').removeClass('reward1'); // $('.rewards').removeClass('reward1');
@@ -120,6 +121,7 @@ function geth5() {
$(`.header .top .top${i + 1} .score span`).text(unitProcessingAr(res.diffNum, 1)); $(`.header .top .top${i + 1} .score span`).text(unitProcessingAr(res.diffNum, 1));
// } // }
}); });
}
} else { } else {
toastMsg(res.message) toastMsg(res.message)
} }
@@ -149,7 +151,7 @@ function listRank(type) {
success(res) { success(res) {
if (res.code === 200) { if (res.code === 200) {
var my = res.data.me; var my = res.data.me;
// if(partitionId == 16) return if(partitionId == 32) return
var listTo3 = res.data.slice(0, 3); var listTo3 = res.data.slice(0, 3);
var notListTo3 = res.data.slice(3); var notListTo3 = res.data.slice(3);
notListTo3 = notListTo3.slice(0, 27) notListTo3 = notListTo3.slice(0, 27)