小游戏活动:jackpotNum

This commit is contained in:
qiaofie
2025-03-06 17:15:22 +08:00
parent 8d2d25c5a6
commit f9248152d5
5 changed files with 39 additions and 41 deletions

View File

@@ -87,7 +87,10 @@ body {
font-size: 0.3466666667rem;
font-weight: 400;
line-height: 0.56rem;
margin: 0.6666666667rem auto;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.poolBox {
@@ -127,7 +130,7 @@ body {
}
.poolBox .coins_pool {
width: 80%;
margin: 2.5333333333rem auto 0.4rem;
margin: 2.3333333333rem auto 0.4rem;
display: flex;
align-items: center;
justify-content: center;
@@ -734,14 +737,13 @@ body {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
overflow: hidden;
}
.rules .rule_in .close {
position: absolute;
width: 0.9066666667rem;
height: 0.9066666667rem;
right: 0.1rem;
top: 0;
right: 0.35rem;
top: -0.55rem;
}
.rules .rule_in .titles {
position: absolute;

View File

@@ -96,7 +96,10 @@ body {
font-size: px2rem(26);
font-weight: 400;
line-height: px2rem(42);
margin: px2rem(50) auto;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
}
}
@@ -140,7 +143,7 @@ body {
.coins_pool {
width: 80%;
margin: px2rem(190) auto px2rem(30);
margin: px2rem(175) auto px2rem(30);
display: flex;
align-items: center;
justify-content: center;
@@ -819,14 +822,13 @@ body {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
overflow: hidden;
.close {
position: absolute;
width: px2rem(68);
height: px2rem(68);
right: 0.1rem;
top: 0;
right: 0.35rem;
top: -0.55rem;
}
.titles {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 KiB

After

Width:  |  Height:  |  Size: 581 KiB

View File

@@ -8,7 +8,7 @@
<link rel="stylesheet" href="../../common/css/reset.css">
<link rel="stylesheet" href="../../common/css/animate.css">
<link rel="stylesheet" href="./css/countNumber.css">
<link rel="stylesheet" href="./css/index.css">
<link rel="stylesheet" href="./css/index.css?v=1.1">
</head>
<body>
@@ -234,7 +234,7 @@
<h1 class="text18">Congratulations on Getting</h1>
<img src="./images/coins.png" alt="" class="coins">
<div class="text">
<b>12,000</b>
<b>0</b>
<img src="./images/m.png" alt="">
</div>
<div class="btn">Done</div>
@@ -258,4 +258,4 @@
<script src="../../common/local/langHandler.js"></script>
<script src="../../common/js/svga.min.js"></script>
<script src="./js/countNumber.js"></script>
<script src="./js/index.js"></script>
<script src="./js/index.js?v=1.1"></script>

View File

@@ -62,14 +62,6 @@ $(function () {
// render()
}, 100)
$(window).scroll(function () {
if (($("#dataNums").offset().top - $(window).scrollTop()) < $(window).height()) {
$("#dataNums").rollNum({
deVal: jackpotPool
});
};
});
})
function translateFun() {
@@ -107,7 +99,7 @@ function translateFun() {
}
}
var jackpotStatus = false // 奖金状态
var jackpotNum = null // 可领取奖金
var jackpotPool = 0 //奖池金币数
var countdownSecond = 0 //本周倒计时秒数
function getInit() {
@@ -121,14 +113,22 @@ function getInit() {
countdownSecond = res.data.countdownSecond;
countTime();
// 处理奖金
jackpotStatus = res.data.jackpotStatus;
if (!jackpotStatus) {
jackpotNum = res.data.jackpot || 0;
$('.coins_pop .text b').html(jackpotNum.toLocaleString());
if (jackpotNum == 0) {
$('.header .receive').html(langReplace(localLang.demoModule.done));
$('.header .receive').addClass('done');
$('.coins_pop .btn').html(langReplace(localLang.demoModule.done));
$('.coins_pop .btn').addClass('done');
}
jackpotPool = res.data.jackpotPool.toFixed(2);
jackpotPool = res.data.jackpotPool.toLocaleString();
$(window).scroll(function () {
if (($("#dataNums").offset().top - $(window).scrollTop()) < $(window).height()) {
$("#dataNums").rollNum({
deVal: jackpotPool
});
};
});
// 处理榜单
var listTo3 = res.data.rankList.slice(0, 3);
notListTo3 = res.data.rankList.slice(3);
@@ -167,6 +167,10 @@ function getInit() {
$('.page1 .my .icon').attr('src', `./images/vip/${my.vipLevel}.png`);
$('.page1 .my .info span').text(`ID:${my.erbanNo}`);
$('.page1 .my .score b').text(unitProcessingAr(my.score, 2));
if (my.vipLevel == 0) {
$('.page1 .my .icon').hide();
}
} else {
toastMsg(res.message)
}
@@ -187,10 +191,10 @@ function loadMore() {
let str = '';
// 拼接 HTML
nextItems.forEach(res => {
nextItems.forEach((res, i) => {
str += `
<li>
<div class="num">${res.rank}</div>
<div class="num">${res.ranking}</div>
<img src="${res.avatar}" alt="" class="tx">
<img src="./images/vip/${res.vipLevel}.png" alt="" class="icon" style="display: ${res.vipLevel == 0 ? 'none' : 'block'}">
<div class="info">
@@ -245,17 +249,7 @@ function getHisRank() {
`;
// 遍历 rankList 生成排名列表
for (var i = 0; i < 10; i++) {
var user = weekData.rankList[i] || {
avatar: "./images/null.png",
erbanNo: "-",
gender: "",
jackpot: 0,
nick: "waiting",
rank: i + 1,
vipLevel: 0
};
weekData.rankList.forEach(user => {
historyHtml += `
<li>
<img src="${user.avatar}" alt="" class="avatar">
@@ -269,7 +263,7 @@ function getHisRank() {
</div>
</li>
`;
}
})
historyHtml += `
</ul>
@@ -393,7 +387,7 @@ function getJackpot() {
setTimeout(() => {
svgaFun()
}, 1000);
jackpotStatus = false
jackpotNum = 0
} else {
toastMsg(res.message)
}
@@ -443,7 +437,7 @@ $(".header .receive").click(function () {
$('.coins_pop').show();
})
$(".coins_pop .btn").click(function () {
if (jackpotStatus) {
if (jackpotNum != 0) {
getJackpot()
}