完成上周数据联调

This commit is contained in:
dragon
2025-01-16 16:13:05 +08:00
parent d6861af5a8
commit a10b2f2918
3 changed files with 31 additions and 56 deletions

View File

@@ -28,7 +28,7 @@
<div class="sTab">
<div class="act text5" type="1"></div>
<div class="text6" type="2"></div>
<!-- <div class="newText2" type="5"></div> -->
<div class="newText2" type="5"></div>
</div>
<!-- 奖励 -->
<div class="monthlyRewards">

View File

@@ -90,6 +90,7 @@ function geth5() {
data: {
type: listType,
datetype: timeType,
periodType: 1,
uid: pubInfo.uid
},
success(res) {
@@ -102,7 +103,7 @@ function geth5() {
let arr = new Array(3 - listTo3.length).fill({
avatar: './images/logo.png',
nick: langReplace(localLang.demoModule.newText7),
totalNum: "",
diffNum: "",
uid: "0",
})
listTo3.push(...arr)
@@ -112,7 +113,7 @@ function geth5() {
$(`.header .top .top${i + 1} .tx`).attr('src', res.avatar);
$(`.header .top .top${i + 1} .nick`).text(res.nick);
// if (i > 0) {
$(`.header .top .top${i + 1} .score span`).text(unitProcessingAr(res.totalNum, 1));
$(`.header .top .top${i + 1} .score span`).text(unitProcessingAr(res.diffNum, 1));
// }
});
// 非前三
@@ -126,7 +127,7 @@ function geth5() {
<div class="score">
<b>${langReplace(localLang.demoModule.newText3)}</b>
<img src="./images/${type}.png" alt="">
<span>${unitProcessingAr(res.totalNum, 1)}</span>
<span>${unitProcessingAr(res.diffNum, 1)}</span>
</div> -->
</li>
`
@@ -135,9 +136,9 @@ function geth5() {
// 处理自己
$('.my .box .tx').attr('src', my.avatar);
$('.my .box .nick').text(my.nick);
$('.my .box .seqNo').text(my.totalNum <= 0 ? '-' : my.seqNo);
$('.my .box .score span').text(my.totalNum <= 0 ? '-' : unitProcessingAr(my.totalNum, 1));
if (my.totalNum <= 0) {
$('.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 {
@@ -163,6 +164,9 @@ function listRank(type) {
networkRequest({
type: 'get',
url: urlPrefix + '/clan/listRank',
data: {
periodType: 1,
},
success(res) {
if (res.code === 200) {
var my = res.data.me;
@@ -174,7 +178,7 @@ function listRank(type) {
let arr = new Array(3 - listTo3.length).fill({
avatar: './images/logo.png',
name: langReplace(localLang.demoModule.newText7),
totalNum: "",
diffNum: "",
uid: "0",
})
listTo3.push(...arr)

View File

@@ -48,8 +48,8 @@ $(function () {
langReplace = window.lang.replace;
localLang = window.lang;
translateFun();
// showLoading()
// geth5()
showLoading()
geth5()
}, 100)
})
function translateFun() {
@@ -87,6 +87,7 @@ function geth5() {
data: {
type: listType,
datetype: timeType,
periodType: 2,
uid: pubInfo.uid
},
success(res) {
@@ -98,8 +99,8 @@ function geth5() {
if (listTo3.length < 3) {
let arr = new Array(3 - listTo3.length).fill({
avatar: './images/logo.png',
nick: '',
totalNum: "",
nick: langReplace(localLang.demoModule.newText7),
diffNum: "",
uid: "0",
})
listTo3.push(...arr)
@@ -109,32 +110,15 @@ function geth5() {
$(`.header .top .top${i + 1} .tx`).attr('src', res.avatar);
$(`.header .top .top${i + 1} .nick`).text(res.nick);
// if (i > 0) {
$(`.header .top .top${i + 1} .score span`).text(unitProcessingAr(res.totalNum, 1));
$(`.header .top .top${i + 1} .score span`).text(unitProcessingAr(res.diffNum, 1));
// }
});
// 非前三
var str = '';
notListTo3.forEach((res, i) => {
str += `
<li>
<div class="seqNo">${res.seqNo}</div>
<img src="${res.avatar}" uid="${res.uid}" alt="" class="tx">
<div class="nick">${res.nick}</div>
<div class="score">
<b>${langReplace(localLang.demoModule.newText3)}</b>
<img src="./images/gold.png" alt="">
<span>${unitProcessingAr(res.totalNum, 1)}</span>
</div>
</li>
`
})
$('ul').append(str);
// 处理自己
$('.my .box .tx').attr('src', my.avatar);
$('.my .box .nick').text(my.nick);
$('.my .box .seqNo').text(my.totalNum <= 0 ? '-' : my.totalNum);
$('.my .box .score span').text(my.totalNum <= 0 ? '-' : unitProcessingAr(my.totalNum, 1));
if (my.totalNum <= 0) {
$('.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 {
@@ -149,7 +133,7 @@ function geth5() {
})
}
// 公会接口
function listRank() {
function listRank(type) {
$('ul li').remove();
$('.header .sTab').hide();
$('.my').hide()
@@ -160,17 +144,21 @@ function listRank() {
networkRequest({
type: 'get',
url: urlPrefix + '/clan/listRank',
data: {
periodType: 2,
},
success(res) {
if (res.code === 200) {
var my = res.data.me;
var listTo3 = res.data.slice(0, 3);
var notListTo3 = res.data.slice(3);
notListTo3 = notListTo3.slice(0, 27)
// 处理前三
if (listTo3.length < 3) {
let arr = new Array(3 - listTo3.length).fill({
avatar: './images/logo.png',
name: '',
totalNum: "",
name: langReplace(localLang.demoModule.newText7),
diffNum: "",
uid: "0",
})
listTo3.push(...arr)
@@ -183,23 +171,6 @@ function listRank() {
$(`.header .top .top${i + 1} .score span`).text(unitProcessingAr(res.income, 1));
// }
});
// 非前三
var str = '';
notListTo3.forEach((res, i) => {
str += `
<li>
<div class="seqNo">${i + 4}</div>
<img src="${res.avatar}" uid="${res.clanElderUid}" alt="" class="tx">
<div class="nick">${res.name}</div>
<div class="score">
<b>${langReplace(localLang.demoModule.newText3)}</b>
<img src="./images/gold.png" alt="">
<span>${unitProcessingAr(res.income, 1)}</span>
</div>
</li>
`
})
$('ul').append(str);
} else {
toastMsg(res.message)
}
@@ -233,13 +204,13 @@ $('.header .tabBox div').click(function () {
$('.rewards').addClass(`reward${i}`);
if (i == 1) {
listType = 2;
// geth5();
geth5();
} else if (i == 2) {
listType = 1;
// geth5();
geth5();
} else if (i == 3) {
listType = 3;
// geth5();
listRank();
$('.header .top .score img').attr('src', `./images/${4}.png`);
$(`.header .top .top1 .ts`).attr('src', './images/no11.png')
$(`.header .top .top2 .ts`).attr('src', './images/no22.png')