新增peko新春榜单

This commit is contained in:
Dragon
2024-02-05 21:27:57 +08:00
parent 3632ed33a9
commit 956c3c26f9
30 changed files with 329 additions and 36 deletions

View File

@@ -79,10 +79,6 @@ body {
color: transparent; color: transparent;
} }
.page1 {
display: none;
}
.page1 .pageImg1 { .page1 .pageImg1 {
display: block; display: block;
width: 9.2rem; width: 9.2rem;
@@ -97,6 +93,10 @@ body {
margin: 0 auto 0.46667rem; margin: 0 auto 0.46667rem;
} }
.page2 {
display: none;
}
.page2 .box { .page2 .box {
width: 9.2rem; width: 9.2rem;
height: 17.14667rem; height: 17.14667rem;
@@ -320,6 +320,12 @@ body {
.page2 .box ul { .page2 .box ul {
width: 8.56rem; width: 8.56rem;
margin: 0 auto 1.84rem; margin: 0 auto 1.84rem;
overflow-y: scroll;
height: 6.6rem;
}
.page2 .box ul::-webkit-scrollbar {
display: none;
} }
.page2 .box ul li { .page2 .box ul li {
@@ -442,6 +448,7 @@ body {
} }
.rule { .rule {
display: none;
position: fixed; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
@@ -460,4 +467,98 @@ body {
left: 50%; left: 50%;
top: 50%; top: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
overflow: hidden;
}
.rule .rule_in .tabRule {
width: 6.50667rem;
height: 1.01333rem;
line-height: 1.01333rem;
display: flex;
justify-content: space-between;
border-radius: 0.64rem;
background: #fff;
margin: 0.6rem auto 0.25333rem;
}
.rule .rule_in .tabRule div {
text-align: center;
color: #CA5987;
font-size: 0.37333rem;
font-weight: 500;
width: 3.25333rem;
}
.rule .rule_in .tabRule .act {
background: url(../images/rule_act.png) no-repeat;
background-size: 100% 100%;
color: #fff;
}
.rule .rule_in .box1 {
width: 7.34667rem;
height: 11.4rem;
overflow-y: scroll;
margin: 0 auto;
}
.rule .rule_in .box1::-webkit-scrollbar {
display: none;
}
.rule .rule_in .box1 img {
display: block;
width: 7.25333rem;
}
.rule .rule_in .box2 {
display: none;
}
.rule .rule_in .box2 .box2Tab {
width: 4.74667rem;
height: 0.8rem;
margin: 0 auto 0.26667rem;
display: flex;
justify-content: space-between;
}
.rule .rule_in .box2 .box2Tab div {
width: 2.34667rem;
}
.rule .rule_in .box2 .box2Tab .tab1 {
background: url(../images/box2tab1.png) no-repeat;
background-size: 100% 100%;
}
.rule .rule_in .box2 .box2Tab .tab2 {
background: url(../images/box2tab2.png) no-repeat;
background-size: 100% 100%;
}
.rule .rule_in .box2 .box2Tab .act1 {
background: url(../images/box2tabAct1.png) no-repeat;
background-size: 100% 100%;
}
.rule .rule_in .box2 .box2Tab .act2 {
background: url(../images/box2tabAct2.png) no-repeat;
background-size: 100% 100%;
}
.rule .rule_in .box2 .imgBox {
width: 7.52rem;
height: 10rem;
margin: 0 auto;
overflow-y: scroll;
}
.rule .rule_in .box2 .imgBox::-webkit-scrollbar {
display: none;
}
.rule .rule_in .box2 .imgBox img {
width: 100%;
display: block;
} }

View File

@@ -85,7 +85,7 @@ body {
} }
.page1 { .page1 {
display: none; // display: none;
.pageImg1 { .pageImg1 {
display: block; display: block;
@@ -103,6 +103,8 @@ body {
} }
.page2 { .page2 {
display: none;
.box { .box {
width: px2rem(690); width: px2rem(690);
height: px2rem(1286); height: px2rem(1286);
@@ -329,6 +331,12 @@ body {
ul { ul {
width: px2rem(642); width: px2rem(642);
margin: 0 auto px2rem(138); margin: 0 auto px2rem(138);
overflow-y: scroll;
height: 6.6rem;
&::-webkit-scrollbar {
display: none;
}
li { li {
width: 100%; width: 100%;
@@ -456,6 +464,7 @@ body {
} }
.rule { .rule {
display: none;
position: fixed; position: fixed;
left: 0; left: 0;
top: 0; top: 0;
@@ -473,5 +482,100 @@ body {
left: 50%; left: 50%;
top: 50%; top: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
overflow: hidden;
.tabRule {
width: px2rem(488);
height: px2rem(76);
line-height: px2rem(76);
display: flex;
justify-content: space-between;
border-radius: px2rem(48);
background: #fff;
margin: px2rem(45) auto px2rem(19);
div {
text-align: center;
color: #CA5987;
font-size: px2rem(28);
font-weight: 500;
width: px2rem(244);
}
.act {
background: url(../images/rule_act.png) no-repeat;
background-size: 100% 100%;
color: #fff;
}
}
.box1 {
width: px2rem(551);
height: 11.4rem;
overflow-y: scroll;
margin: 0 auto;
// display: none;
&::-webkit-scrollbar {
display: none;
}
img {
display: block;
width: px2rem(544);
}
}
.box2 {
display: none;
.box2Tab {
width: px2rem(356);
height: px2rem(60);
margin: 0 auto px2rem(20);
display: flex;
justify-content: space-between;
div {
width: px2rem(176);
}
.tab1 {
background: url(../images/box2tab1.png) no-repeat;
background-size: 100% 100%;
}
.tab2 {
background: url(../images/box2tab2.png) no-repeat;
background-size: 100% 100%;
}
.act1 {
background: url(../images/box2tabAct1.png) no-repeat;
background-size: 100% 100%;
}
.act2 {
background: url(../images/box2tabAct2.png) no-repeat;
background-size: 100% 100%;
}
}
.imgBox {
width: px2rem(564);
height: 10rem;
margin: 0 auto;
overflow-y: scroll;
&::-webkit-scrollbar {
display: none;
}
img {
width: 100%;
display: block;
}
}
}
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 447 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 MiB

After

Width:  |  Height:  |  Size: 693 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 347 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 380 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -10,51 +10,51 @@
</head> </head>
<body> <body>
<!-- 部返回 --> <!-- 部返回 -->
<div class="back"> <div class="back">
<img src="./images/travel/back.png" alt=""> <img src="./images/travel/back.png" alt="">
</div> </div>
<!-- --> <!-- -->
<div class="header"> <div class="header">
<img src="./images/rule_icon.png" alt="" class="rule_icon"> <img src="./images/rule_icon.png" alt="" class="rule_icon">
</div> </div>
<!-- tab --> <!-- tab -->
<div class="tab"> <div class="tab">
<div class="tab1">新春福利</div> <div class="tab1">新春福利</div>
<div class="">新春榜</div> <div class="">新春榜</div>
</div> </div>
<!-- 面1 --> <!-- 面1 -->
<div class="page1"> <div class="page1">
<img src="./images/pageImg1.png" alt="" class="pageImg1"> <img src="./images/pageImg1.png" alt="" class="pageImg1">
<img src="./images/pageImg2.png" alt="" class="pageImg2"> <img src="./images/pageImg2.png" alt="" class="pageImg2">
</div> </div>
<!-- 面2 --> <!-- 面2 -->
<div class="page2"> <div class="page2">
<div class="box"> <div class="box">
<!-- --> <!-- -->
<div class="listTab"> <div class="listTab">
<div class="listTab1">财气</div> <div class="listTab1">財氣</div>
<div class=""></div> <div class=""></div>
</div> </div>
<!-- 前三 --> <!-- 前三 -->
<div class="topBox"> <div class="topBox">
<div class="top1"> <div class="top1">
<img src="./images/ts1.png" alt="" class="ts"> <img src="./images/ts1.png" alt="" class="ts">
<img src="./images/logo.png" alt="" class="tx"> <img src="./images/logo.png" alt="" class="tx">
<div class="name">户昵称</div> <div class="name">戶昵稱</div>
<div class="score">财富值: <b>0</b></div> <div class="score">財氣值: <b>0</b></div>
</div> </div>
<div class="top2"> <div class="top2">
<img src="./images/ts2.png" alt="" class="ts"> <img src="./images/ts2.png" alt="" class="ts">
<img src="./images/logo.png" alt="" class="tx"> <img src="./images/logo.png" alt="" class="tx">
<div class="name">户昵称</div> <div class="name">戶昵稱</div>
<div class="score">财富值: <b>0</b></div> <div class="score">財氣值: <b>0</b></div>
</div> </div>
<div class="top3"> <div class="top3">
<img src="./images/ts3.png" alt="" class="ts"> <img src="./images/ts3.png" alt="" class="ts">
<img src="./images/logo.png" alt="" class="tx"> <img src="./images/logo.png" alt="" class="tx">
<div class="name">户昵称</div> <div class="name">戶昵稱</div>
<div class="score">财富值: <b>0</b></div> <div class="score">財氣值: <b>0</b></div>
</div> </div>
</div> </div>
<!-- 非前三 --> <!-- 非前三 -->
@@ -62,26 +62,43 @@
<li> <li>
<div class="num">4</div> <div class="num">4</div>
<img src="./images/logo.png" alt="" class="tx"> <img src="./images/logo.png" alt="" class="tx">
<div class="name">户昵称</div> <div class="name">戶昵稱</div>
<div class="score">財氣值999999999</div> <div class="score">財氣值999999999</div>
</li> </li>
</ul> </ul>
<div class="my"> <div class="my">
<div class="num">未上榜</div> <div class="num">未上榜</div>
<img src="./images/logo.png" alt="" class="tx"> <img src="./images/logo.png" alt="" class="tx">
<div class="name">户昵称</div> <div class="name">戶昵稱</div>
<div class="score">財氣值999999999</div> <div class="score">財氣值999999999</div>
</div> </div>
</div> </div>
</div> </div>
<!--责声明 --> <!--責宣告 -->
<div class="bootom"> <div class="bootom">
<p>本活動最終解釋權歸官方所有</p> <p>本活動最終解釋權歸官方所有</p>
<p>本活動以及獎勵與蘋果/Google公司無關</p> <p>本活動以及獎勵與蘋果/Google公司無關</p>
</div> </div>
<!-- 弹窗规则 --> <!-- 彈窗規則 -->
<div class="rule"> <div class="rule">
<div class="rule_in"></div> <div class="rule_in">
<div class="tabRule">
<div class="act">活動規則</div>
<div>活動獎勵</div>
</div>
<div class="box1">
<img src="./images/rule1.png" alt="">
</div>
<div class="box2">
<div class="box2Tab">
<div class="tab1 act1"></div>
<div class="tab2"></div>
</div>
<div class="imgBox">
<img src="./images/img1.png" alt="" srcset="">
</div>
</div>
</div>
</div> </div>
</body> </body>

View File

@@ -4,9 +4,9 @@ let env = EnvCheck();
if (env == 'test') { if (env == 'test') {
new VConsole(); new VConsole();
} }
// 封layer消息提醒框 // 封layer消息提醒框
let layerIndex let layerIndex
const showLoading = (content = '加中...') => { const showLoading = (content = '加中...') => {
layer.open({ layer.open({
type: 2, type: 2,
shadeClose: false, shadeClose: false,
@@ -26,12 +26,12 @@ const toastMsg = (content = '操作完成', time = 2) => {
skin: 'msg' skin: 'msg'
}) })
} }
var rankType = 2;
// 初始化函 // 初始化函
$(function () { $(function () {
getInfoFromClient() getInfoFromClient()
setTimeout(function () { setTimeout(function () {
// 面全屏 // 面全屏
if (browser.app) { if (browser.app) {
if (browser.android) { if (browser.android) {
window.androidJsObj.initShowNav(false) window.androidJsObj.initShowNav(false)
@@ -39,7 +39,7 @@ $(function () {
window.webkit.messageHandlers.initShowNav.postMessage(0) window.webkit.messageHandlers.initShowNav.postMessage(0)
} }
}; };
// 部返回事件 // 部返回事件
$('.back').click(() => { $('.back').click(() => {
if (browser.android) { if (browser.android) {
window.androidJsObj.closeWebView() window.androidJsObj.closeWebView()
@@ -51,14 +51,49 @@ $(function () {
}, 100) }, 100)
}) })
// 接口 // 接口
function get () { function getRank () {
showLoading() showLoading()
networkRequest({ networkRequest({
type: 'get', type: 'get',
url: urlPrefix + '', url: urlPrefix + '/act/special/gift/getRank',
data: { type: taskType }, data: { rankType: rankType, page: 1, pageSize: 30 },
success (res) { success (res) {
if (res.code === 200) { if (res.code === 200) {
// 處理前三
var top3 = res.data.rankList.slice(0, 3);
var notTop3 = res.data.rankList.slice(3);
if (top3.length < 3) {
let arr = new Array(3 - top3.length).fill({
avatar: './images/logo.png',
nick: '虛位以待',
score: "0"
})
top3.push(...arr)
}
top3.forEach((res, index) => {
$(`.page2 .box .topBox .top${index + 1} .tx`).attr('src', res.avatar);
$(`.page2 .box .topBox .top${index + 1} .name`).text(res.nick);
$(`.page2 .box .topBox .top${index + 1} .score`).text(`${rankType == 2 ? "財氣值:" : "福氣值:"}${unitProcessing(res.score, 10000, 1, 'w')}`);
})
// 處理非前三
var str = '';
$('.page2 .box ul li').remove();
notTop3.forEach((res, i) => {
str += `
<li>
<div class="num">${res.ranking}</div>
<img src="${res.avatar}" alt="" class="tx">
<div class="name">${res.nick}</div>
<div class="score">${rankType == 2 ? "財氣值:" : "福氣值:"}${unitProcessing(res.score, 10000, 1, 'w')}</div>
</li>
`
})
$('.page2 .box ul').append(str);
// 處理自己
$('.page2 .box .my .tx').attr('src', res.data.meRank.avatar);
$('.page2 .box .my .num').text(res.data.meRank.ranking == 0 ? '未上榜' : res.data.meRank.ranking);
$('.page2 .box .my .name').text(res.data.meRank.nick);
$('.page2 .box .my .score').text(`${rankType == 2 ? "財氣值:" : "福氣值:"}${unitProcessing(res.data.meRank.score, 10000, 1, 'w')}`);
} else { } else {
toastMsg(res.message) toastMsg(res.message)
} }
@@ -66,22 +101,58 @@ function get () {
}, },
error (err) { error (err) {
hideLoading(layerIndex) hideLoading(layerIndex)
toastMsg('网络错误,请退出重') toastMsg('網路錯誤,請退出重')
} }
}) })
} }
// tab切 // tab切
$('.tab div').click(function () { $('.tab div').click(function () {
var i = $(this).index() + 1; var i = $(this).index() + 1;
$('.page1,.page2').hide(); $('.page1,.page2').hide();
$(`.page${i}`).show(); $(`.page${i}`).show();
$('.tab div').removeClass('tab1').removeClass('tab2'); $('.tab div').removeClass('tab1').removeClass('tab2');
$(this).addClass(`tab${i}`); $(this).addClass(`tab${i}`);
if (i == 2) {
getRank();
}
}) })
// 榜单切换 // 榜單切換
$('.page2 .box .listTab div').click(function () { $('.page2 .box .listTab div').click(function () {
var i = $(this).index() + 1; var i = $(this).index() + 1;
$('.page2 .box .listTab div').removeClass('listTab1').removeClass('listTab2'); $('.page2 .box .listTab div').removeClass('listTab1').removeClass('listTab2');
$(this).addClass(`listTab${i}`); $(this).addClass(`listTab${i}`);
if (i == 1) {
rankType = 2;
} else {
rankType = 4;
}
getRank()
})
// 規則切換
$('.rule .rule_in .tabRule div').click(function () {
var i = $(this).index() + 1;
$(this).addClass('act').siblings().removeClass('act');
$('.rule .rule_in .box1,.rule .rule_in .box2').hide();
$(`.rule .rule_in .box${i}`).show();
return false;
})
$('.rule .rule_in .box2 .box2Tab div').click(function () {
var i = $(this).index() + 1;
$('.rule .rule_in .box2 .box2Tab div').removeClass('act1').removeClass('act2')
$(this).addClass(`act${i}`);
$('.rule .rule_in .box2 .imgBox img').attr('src', `./images/img${i}.png`)
return false;
})
// 打開規則
$('.header .rule_icon').click(function () {
$('.rule').show();
bodyScroolFun(true);
})
// 關閉規則
$('.rule').click(function () {
$('.rule').hide();
bodyScroolFun(false);
return false;
}) })