小游戏:领取状态处理
This commit is contained in:
@@ -54,6 +54,7 @@ body {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 1.1733333333rem;
|
bottom: 1.1733333333rem;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
.header .receive {
|
.header .receive {
|
||||||
width: 2.5333333333rem;
|
width: 2.5333333333rem;
|
||||||
@@ -67,6 +68,7 @@ body {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 0.96rem;
|
bottom: 0.96rem;
|
||||||
right: 0.2rem;
|
right: 0.2rem;
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
.header .done {
|
.header .done {
|
||||||
background: url(../images/done.png) no-repeat center/100% 100%;
|
background: url(../images/done.png) no-repeat center/100% 100%;
|
||||||
|
@@ -60,6 +60,7 @@ body {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: px2rem(88);
|
bottom: px2rem(88);
|
||||||
right: 0;
|
right: 0;
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.receive {
|
.receive {
|
||||||
@@ -74,6 +75,7 @@ body {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: px2rem(72);
|
bottom: px2rem(72);
|
||||||
right: px2rem(15);
|
right: px2rem(15);
|
||||||
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.done {
|
.done {
|
||||||
|
@@ -99,7 +99,7 @@ function translateFun() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var jackpotNum = null // 可领取奖金
|
var jackpotNum = null // 可领取奖金 0不能领取 大于0可领取 小于0已领取
|
||||||
var jackpotPool = 0 //奖池金币数
|
var jackpotPool = 0 //奖池金币数
|
||||||
var countdownSecond = 0 //本周倒计时秒数
|
var countdownSecond = 0 //本周倒计时秒数
|
||||||
function getInit() {
|
function getInit() {
|
||||||
@@ -114,13 +114,17 @@ function getInit() {
|
|||||||
countTime();
|
countTime();
|
||||||
// 处理奖金
|
// 处理奖金
|
||||||
jackpotNum = res.data.jackpot || 0;
|
jackpotNum = res.data.jackpot || 0;
|
||||||
$('.coins_pop .text b').html(jackpotNum.toLocaleString());
|
$('.coins_pop .text b').html(Math.abs(jackpotNum).toLocaleString());
|
||||||
if (jackpotNum == 0) {
|
if (jackpotNum <= 0) {
|
||||||
$('.header .receive').html(langReplace(localLang.demoModule.done));
|
$('.header .receive').html(langReplace(localLang.demoModule.done));
|
||||||
$('.header .receive').addClass('done');
|
$('.header .receive').addClass('done');
|
||||||
$('.coins_pop .btn').html(langReplace(localLang.demoModule.done));
|
$('.coins_pop .btn').html(langReplace(localLang.demoModule.done));
|
||||||
$('.coins_pop .btn').addClass('done');
|
$('.coins_pop .btn').addClass('done');
|
||||||
}
|
}
|
||||||
|
if(jackpotNum !== 0) {
|
||||||
|
$('.header .coin_bg').show()
|
||||||
|
$('.header .receive').show()
|
||||||
|
}
|
||||||
jackpotPool = res.data.jackpotPool.toLocaleString();
|
jackpotPool = res.data.jackpotPool.toLocaleString();
|
||||||
$(window).scroll(function () {
|
$(window).scroll(function () {
|
||||||
if (($("#dataNums").offset().top - $(window).scrollTop()) < $(window).height()) {
|
if (($("#dataNums").offset().top - $(window).scrollTop()) < $(window).height()) {
|
||||||
@@ -170,7 +174,7 @@ function getInit() {
|
|||||||
if (my.vipLevel == 0) {
|
if (my.vipLevel == 0) {
|
||||||
$('.page1 .my .icon').hide();
|
$('.page1 .my .icon').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
toastMsg(res.message)
|
toastMsg(res.message)
|
||||||
}
|
}
|
||||||
@@ -334,44 +338,6 @@ var hisRank = [
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
function render() {
|
|
||||||
hisRank.forEach(function (item) {
|
|
||||||
var historyHtml = `
|
|
||||||
<div class="history_week">
|
|
||||||
<div class="title">
|
|
||||||
<img src="./images/left.png" alt="">
|
|
||||||
<b>${item.startDate} - ${item.endDate}</b>
|
|
||||||
<img src="./images/right.png" alt="">
|
|
||||||
</div>
|
|
||||||
<ul>
|
|
||||||
`;
|
|
||||||
|
|
||||||
item.rankList.forEach(user => {
|
|
||||||
historyHtml += `
|
|
||||||
<li>
|
|
||||||
<img src="${user.avatar}" alt="" class="avatar">
|
|
||||||
<img src="./images/h${user.rank > 3 ? "" : user.rank}.png" alt="" class="tx">
|
|
||||||
<img src="./images/vip/${user.vipLevel}.png" alt="" class="icon" style="display: ${user.vipLevel == 0 ? 'none' : 'block'}">
|
|
||||||
<p class="name">${user.nick}</p>
|
|
||||||
<P class="id">ID: ${user.erbanNo}</P>
|
|
||||||
<div class="score">
|
|
||||||
<b>Win ${user.jackpot}K</b>
|
|
||||||
<img src="./images/m.png" alt="">
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
`;
|
|
||||||
})
|
|
||||||
|
|
||||||
historyHtml += `
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
`;
|
|
||||||
|
|
||||||
// 添加到容器
|
|
||||||
$(".page2 .content .box").append(historyHtml);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 领取金币
|
// 领取金币
|
||||||
function getJackpot() {
|
function getJackpot() {
|
||||||
showLoading()
|
showLoading()
|
||||||
@@ -380,6 +346,8 @@ function getJackpot() {
|
|||||||
url: urlPrefix + '/miniGame/weekJackpotRank/getJackpot',
|
url: urlPrefix + '/miniGame/weekJackpotRank/getJackpot',
|
||||||
success(res) {
|
success(res) {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
|
$('.header .receive').html(langReplace(localLang.demoModule.done));
|
||||||
|
$('.header .receive').addClass('done');
|
||||||
$('.coins_pop .btn').html(langReplace(localLang.demoModule.done));
|
$('.coins_pop .btn').html(langReplace(localLang.demoModule.done));
|
||||||
$('.coins_pop .btn').addClass('done');
|
$('.coins_pop .btn').addClass('done');
|
||||||
$(`.coins_pop .fadein`).show()
|
$(`.coins_pop .fadein`).show()
|
||||||
@@ -387,7 +355,7 @@ function getJackpot() {
|
|||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
svgaFun()
|
svgaFun()
|
||||||
}, 1000);
|
}, 1000);
|
||||||
jackpotNum = 0
|
jackpotNum = -Math.abs(jackpotNum)
|
||||||
} else {
|
} else {
|
||||||
toastMsg(res.message)
|
toastMsg(res.message)
|
||||||
}
|
}
|
||||||
@@ -435,6 +403,7 @@ $(".coins_pop .close").click(function () {
|
|||||||
$(".header .receive").click(function () {
|
$(".header .receive").click(function () {
|
||||||
bodyScroolFun(false);
|
bodyScroolFun(false);
|
||||||
$('.coins_pop').show();
|
$('.coins_pop').show();
|
||||||
|
|
||||||
})
|
})
|
||||||
$(".coins_pop .btn").click(function () {
|
$(".coins_pop .btn").click(function () {
|
||||||
if (jackpotNum != 0) {
|
if (jackpotNum != 0) {
|
||||||
|
Reference in New Issue
Block a user