调整倒计时

This commit is contained in:
Dragon
2023-12-27 15:05:05 +08:00
parent 910184977c
commit d2fd4dfdc1
14 changed files with 75 additions and 19 deletions

View File

@@ -590,6 +590,14 @@ body {
font-weight: 400;
}
.page1 .my .myBox .NotUser {
width: 100%;
text-align: center;
line-height: 1.76rem;
color: #fff;
transform: translateX(8%);
}
.page1 .act {
background: url(../images/page1myBg2.png) no-repeat bottom;
background-size: 100% 10.4rem;
@@ -3172,6 +3180,7 @@ body {
box-sizing: border-box;
padding: 0.13333rem 0;
border-radius: 0.26667rem;
display: none;
}
.rule .rule_in .content2 img {

View File

@@ -595,6 +595,14 @@ body {
font-weight: 400;
}
}
.NotUser {
width: 100%;
text-align: center;
line-height: 1.76rem;
color: #fff;
transform: translateX(8%)
}
}
}
@@ -3184,6 +3192,7 @@ body {
box-sizing: border-box;
padding: px2rem(10) 0;
border-radius: px2rem(20);
display: none;
img {
display: block;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

@@ -268,7 +268,7 @@
</div>
</div>
<div class="timeBox">
<p>当前赛季倒计时 <span>0</span><span>0</span><span>0</span><span>0</span></p>
<p>当前赛季倒计时 <span class="sp1">0</span><span class="sp2">0</span><span class="sp3">0</span><span class="sp4">0</span></p>
</div>
</div>
<!-- 标题2 -->
@@ -472,7 +472,7 @@
</div>
<div class="but">领取</div>
<div class="butNot">未满足条件</div>
<i>0/8</i>
<i>1/8</i>
<img src="./images/celebrationTaskLeft.png" alt="" class="left">
<img src="./images/celebrationTaskRight.png" alt="" class="right">
</div>

View File

@@ -373,8 +373,12 @@ function cpRank () {
// 处理自己榜单组合
var myStr = '';
$('.page1 .my .myBox .myBox_in').remove();
res.data.meRankList.forEach((res, i) => {
myStr += `
$('.page1 .my .myBox .NotUser').remove();
if (res.data.meRankList.length == 0) {
myStr += `<div class="NotUser">暂无组合~</div>`
} else {
res.data.meRankList.forEach((res, i) => {
myStr += `
<div class="myBox_in">
<img src="./images/page1notTop3ts.png" alt="" class="ts">
<img src="${res.leftAvatar}" alt="" class="ltx">
@@ -384,7 +388,8 @@ function cpRank () {
<div class="score">${unitProcessing(res.score, 10000, 1, 'w')}友谊值</div>
</div>
`
})
})
}
$('.page1 .my .myBox').append(myStr);
} else {
toastMsg(res.message)
@@ -781,14 +786,19 @@ function popularGetRank () {
success (res) {
if (res.code === 200) {
// 人气倒计时
popularGetRankCountup(res.data.endTime);
if (popularGetRankRound == null || popularGetRankRound == undefined) {
console.log(res.data.roundList[res.data.curRound - 1].endTime - res.timestamp);
popularGetRankCountup(res.data.roundList[res.data.curRound - 1].endTime - res.timestamp);
}
// 渲染赛事时间
roundList = res.data.roundList ? res.data.roundList : roundList;
roundList.forEach((val, i) => {
$(`.page3 .page3tabBox .tabBox .tab`).eq(i).attr('round', val.round);
$(`.page3 .page3tabBox .tabBox .tab`).eq(i).children('span').text(`${dateFormat(val.startTime, 'MM.dd')}-${dateFormat(val.endTime, 'MM.dd')}`);
if (res.data.curRound == val.round) {
$(`.page3 .page3tabBox .tabBox .tab`).eq(i).addClass('act').siblings().removeClass('act');
if (popularGetRankRound == null || popularGetRankRound == undefined) {
if (res.data.curRound == val.round) {
$(`.page3 .page3tabBox .tabBox .tab`).eq(i).addClass('act').siblings().removeClass('act');
}
}
});
// 前三
@@ -890,11 +900,14 @@ function popularGetRankCountup (leftTime) {
$('.page3 .page3tabBox .timeBox p .sp4').text(s);
} else {
popularGetRank();
}
if (leftTime > 0) {
leftTime = leftTime - 1000;
}
popularGetRankTime = setTimeout(popularGetRankCountup(), 1000);
popularGetRankTime = setTimeout(function () {
popularGetRankCountup(leftTime);
}, 1000);
}
// 打开页面3小时榜弹窗
$('.page3 .page3RuleIcon').click(function () {
@@ -924,7 +937,12 @@ function getHourRank () {
if (res.code === 200) {
// 渲染小时榜时间
$('.page3_pop .page3_pop_in .timeBox .div1').text(`${res.data.curHour}点小时榜`);
hourCountup(res.data.curHourRemain);
if (res.data.curHourEndTime) {
hourCountup(res.data.curHourEndTime - res.timestamp);
} else {
toastMsg('小时榜仅在每晚19:00-23:59开启')
hideLoading(layerIndex)
}
// 渲染上期小时榜榜首
if (res.data.nick) {
$('.page3_pop .page3_pop_in .lastTop3 .tx').attr('src', res.data.avatar);
@@ -994,7 +1012,9 @@ function hourCountup (leftTime) {
if (leftTime > 0) {
leftTime = leftTime - 1000;
}
hourCountupTime = setTimeout(hourCountup(), 1000);
hourCountupTime = setTimeout(function () {
hourCountup(leftTime)
}, 1000);
}
// 关闭页面3弹窗
$('.page3_pop').click(function () {
@@ -1023,14 +1043,19 @@ function roomGetRank () {
success (res) {
if (res.code === 200) {
// 人气倒计时
// roomGetRankCountup(res.data.endTime);
if (roomGetRankRound == null || roomGetRankRound == undefined) {
console.log(res.data.roundList[res.data.curRound - 1].endTime - res.timestamp);
roomGetRankCountup(res.data.roundList[res.data.curRound - 1].endTime - res.timestamp);
}
// 渲染赛事时间
roundList = res.data.roundList ? res.data.roundList : roundList;
roundList.forEach((val, i) => {
$(`.page4 .page3tabBox .tabBox .tab`).eq(i).attr('round', val.round);
$(`.page4 .page3tabBox .tabBox .tab`).eq(i).children('span').text(`${dateFormat(val.startTime, 'MM.dd')}-${dateFormat(val.endTime, 'MM.dd')}`);
if (res.data.curRound == val.round) {
$(`.page4 .page3tabBox .tabBox .tab`).eq(i).addClass('act').siblings().removeClass('act');
if (roomGetRankRound == null || roomGetRankRound == undefined) {
if (res.data.curRound == val.round) {
$(`.page4 .page3tabBox .tabBox .tab`).eq(i).addClass('act').siblings().removeClass('act');
}
}
});
// 前三
@@ -1122,17 +1147,19 @@ function roomGetRankCountup (leftTime) {
m = getzf(Math.floor(leftTime / 1000 / 60 % 60));
s = getzf(Math.floor(leftTime / 1000 % 60));
//将倒计时赋值到div中
$('.page3 .page3tabBox .timeBox p .sp1').text(d);
$('.page3 .page3tabBox .timeBox p .sp2').text(h);
$('.page3 .page3tabBox .timeBox p .sp3').text(m);
$('.page3 .page3tabBox .timeBox p .sp4').text(s);
$('.page4 .page3tabBox .timeBox p .sp1').text(d);
$('.page4 .page3tabBox .timeBox p .sp2').text(h);
$('.page4 .page3tabBox .timeBox p .sp3').text(m);
$('.page4 .page3tabBox .timeBox p .sp4').text(s);
} else {
popularGetRank();
}
if (leftTime > 0) {
leftTime = leftTime - 1000;
}
roomGetRankTime = setTimeout(roomGetRankCountup(), 1000);
roomGetRankTime = setTimeout(function () {
roomGetRankCountup(leftTime)
}, 1000);
}
// 打开页面4弹窗
$('.page4 .page4Title2').click(function () {
@@ -1223,6 +1250,8 @@ $('.rule .rule_in .TabBox div').click(function () {
return false;
})
// 规则弹窗小切换
var arr1 = ['01.05-01.08', '01.09-01.11', '01.12-01.14', '01.15-01.17', '1.18-01.19'];
var arr2 = ['01.05-01.07', '01.08-01.10', '01.11-01.13', '01.14-01.16', '1.17-01.19'];
$('.rule .rule_in .tabs div').click(function () {
var i = $(this).index() + 1;
$(this).addClass('act').siblings().removeClass('act');
@@ -1250,6 +1279,15 @@ $('.rule .rule_in .tabs div').click(function () {
$('.rule .rule_in .content2 img').attr('src', `./images/rule2${i}.png`);
}
}
if (i == 3) {
arr1.forEach((res, i) => {
$('.rule .rule_in .content_tabBox .tab span').eq(i).text(res);
})
} else if (i == 4) {
arr2.forEach((res, i) => {
$('.rule .rule_in .content_tabBox .tab span').eq(i).text(res);
})
}
return false;
})
// 规则弹窗晋级赛切换