修复首页榜单

This commit is contained in:
dragon
2025-01-16 18:28:07 +08:00
parent a10b2f2918
commit 7e76f15a03
4 changed files with 38 additions and 15 deletions

View File

@@ -171,6 +171,7 @@ body {
color: #000;
font-size: 0.34667rem;
font-weight: 500;
display: none;
}
.header .monthlyRewards p {

View File

@@ -179,7 +179,7 @@ body {
color: #000;
font-size: px2rem(26);
font-weight: 500;
// display: none;
display: none;
p {
position: absolute;

View File

@@ -29,6 +29,7 @@ const toastMsg = (content = langReplace(localLang.demoModule.layerIndex2), time
var listType = 2;//2爱意榜 1魅力榜 3房间榜
var timeType = 1;//1日 2周
var type = 1;
var partitionId;
// 初始化函數
$(function () {
getInfoFromClient();
@@ -55,6 +56,7 @@ $(function () {
translateFun();
showLoading()
geth5()
userInfo()
}, 100)
})
function translateFun() {
@@ -75,6 +77,29 @@ function translateFun() {
}
// 榜单接口
function userInfo() {
networkRequest({
type: 'get',
url: urlPrefix + '/web-user',
success(res) {
if (res.code === 200) {
partitionId = res.data.partitionId;
if (partitionId == 4) {
$('.header .sTab .newText2').hide();
$(`.header .monthlyRewards`).hide();
}
} else {
toastMsg(res.message)
}
hideLoading(layerIndex)
},
error(err) {
hideLoading(layerIndex)
toastMsg(langReplace(localLang.demoModule.layerIndex3))
}
})
}
// 榜单接口
function geth5() {
$('ul li').remove();
$('.header .sTab').show();
@@ -231,7 +256,7 @@ $('.header .tabBox div').click(function () {
$('.top').removeClass('tops1').removeClass('tops2').removeClass('tops3').removeClass('tops4');
$(`.top`).addClass(`tops${i}`);
$('ul li .tx').removeClass('actTx');
// $('.header .monthlyRewards').hide();
$('.header .monthlyRewards').hide();
$(`.header .top .top1 .ts`).attr('src', './images/no1.png')
$(`.header .top .top2 .ts`).attr('src', './images/no2.png')
$(`.header .top .top3 .ts`).attr('src', './images/no3.png')
@@ -260,17 +285,22 @@ $('.header .tabBox div').click(function () {
listRank(4);
$('ul li .tx').addClass('actTx');
}
if (partitionId == 4) {
$('.header .sTab .newText2').hide();
$(`.header .monthlyRewards`).hide();
}
})
// 日榜周榜切换tab
$('.header .sTab div').click(function () {
var i = $(this).index() + 1;
$(this).addClass('act').siblings().removeClass('act');
timeType = $(this).attr('type');
// if (timeType == 5) {
// $('.header .monthlyRewards').show();
// } else {
// $('.header .monthlyRewards').hide();
// }
if (timeType == 5) {
$('.header .monthlyRewards').show();
} else {
$('.header .monthlyRewards').hide();
}
geth5();
})
// 前三跳转个人页

View File

@@ -113,14 +113,6 @@ function geth5() {
$(`.header .top .top${i + 1} .score span`).text(unitProcessingAr(res.diffNum, 1));
// }
});
// 处理自己
$('.my .box .tx').attr('src', my.avatar);
$('.my .box .nick').text(my.nick);
$('.my .box .seqNo').text(my.diffNum <= 0 ? '-' : my.seqNo);
$('.my .box .score span').text(my.diffNum <= 0 ? '-' : unitProcessingAr(my.diffNum, 1));
if (my.diffNum <= 0) {
$('.my .box .score b').hide();
}
} else {
toastMsg(res.message)
}