新增万圣节活动

This commit is contained in:
Dragon
2023-10-19 19:03:43 +08:00
parent 2add7ad28d
commit 587f734d73
86 changed files with 4416 additions and 0 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 307 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

View File

@@ -0,0 +1,339 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>万圣节嘉年华</title>
<link rel="stylesheet" href="../../common/css/reset.css">
<link rel="stylesheet" href="./css/swiper-bundle.min.css">
<link rel="stylesheet" href="./css/index.css">
</head>
<body>
<!-- 顶部返回 -->
<div class="back">
<img src="./images/travel/back.png" alt="">
</div>
<!-- 主视觉 -->
<div class="header">
<div class="rule_icon">活动规则></div>
</div>
<!-- 万圣节活动礼物 -->
<div class="giftBox">
<div class="swiper">
<div class="swiper-wrapper">
<div class="swiper-slide">
<img src="./images/gift1.png" alt="">
</div>
<div class="swiper-slide">
<img src="./images/gift2.png" alt="">
</div>
</div>
</div>
</div>
<!-- pages1 -->
<div class="page1">
<!-- 蒙层-->
<div class="mc">
<div class="mc_in">
<p>送出/收到万圣福袋</p>
<p class="p2">可解锁玩法</p>
<div class="but">去完成</div>
</div>
</div>
<!-- 页面主切换 -->
<div class="tab">
<div class="tab tab1 active1"></div>
<div class="tab tab2"></div>
</div>
<!-- 任务玩法切换 -->
<div class="switch">
<div class="active">万圣地图</div>
<div>糖果任务</div>
</div>
<!-- 我的糖果 -->
<div class="myCandy">我的糖果券0</div>
<!-- 气泡 -->
<div class="qp">
<p>升级糖果券</p>
<p>赢限定礼物</p>
</div>
<!-- 糖果标题 -->
<img src="./images/candyTitle.png" alt="" class="candytitle">
<!-- 展示宝箱 -->
<img src="./images/box3.png" alt="" class="showBox">
<!-- 宝箱三个 -->
<div class="boxs boxs1"><b>初级宝箱</b></div>
<div class="boxs boxs2"><b>中级宝箱</b></div>
<div class="boxs boxs3"><b>高级宝箱</b></div>
<!-- 宝箱文案 -->
<img src="./images/boxText.png" alt="" class="boxText">
<!-- 两条线 -->
<div class="candyLine1"></div>
<div class="candyLine2"></div>
<!-- 地图路线 -->
<div class="road">
<img src="./images/gui.png" alt="" class="gui">
<img src="./images/box1.png" alt="" class="boxImg boxImg1">
<img src="./images/box1.png" alt="" class="boxImg boxImg2">
<img src="./images/box1.png" alt="" class="boxImg boxImg3">
<img src="./images/box1.png" alt="" class="boxImg boxImg4">
<img src="./images/box1.png" alt="" class="boxImg boxImg5">
<img src="./images/box1.png" alt="" class="boxImg boxImg6">
<img src="./images/box1.png" alt="" class="boxImg boxImg7">
</div>
<!-- 骰子 -->
<div class="diceBox">
<!-- 气泡 -->
<img src="./images/diceQP.png" alt="" class="diceQP">
<!-- 动效骰子 -->
<div class="diceSvga"></div>
<!-- 骰子 -->
<img src="./images/dice1.png" alt="" class="dice">
<div class="diceLeftBut">宝箱开启记录</div>
<div class="diceRightBut">点亮全部宝箱</div>
<p>消耗糖果券*1</p>
</div>
</div>
<!-- pages2 -->
<div class="page2">
<!-- 页面主切换 -->
<div class="tab">
<div class="tab tab1 active1"></div>
<div class="tab tab2"></div>
</div>
<!-- 任务玩法切换 -->
<div class="switch">
<div>万圣地图</div>
<div class="active">糖果任务</div>
</div>
<!-- 文案 -->
<img src="./images/taskText.png" alt="" class="taskText">
<!-- 任务标题 -->
<img src="./images/taskTitle.png" alt="" class="taskTitle">
<!-- 我的糖果 -->
<div class="myCandy">我的糖果券0</div>
<!-- 每日任务 -->
<img src="./images/dayTask.png" alt="" class="dayTask">
<!-- 循环任务 -->
<img src="./images/alltask.png" alt="" class="alltask">
<!-- 任务列表 -->
<div class="task task1">
<p>登录活动页(0/1)</p>
<div class="but">去完成</div>
</div>
<div class="task task2">
<p>在任意直播间停留</p>
<div class="lineBox">
<div class="line">0/90</div>
<span class="sp1"></span>
<span class="sp2"></span>
<span class="sp3"></span>
<b class="b1">+1糖果券</b>
<b class="b2">+1糖果券</b>
<b class="b3">+1糖果券</b>
<b class="b4">30分钟</b>
<b class="b5">60分钟</b>
<b class="b6">90分钟</b>
</div>
<div class="but">去完成</div>
</div>
<div class="task task3">
<p>每送出一个魔法宝箱获得 <i>糖果券*1</i></p>
<b>今日已获得<i>0张</i></b>
<div class="but">去完成</div>
</div>
<div class="task task4">
<p>每送出万圣礼物100钻获得 <i>糖果券*1</i></p>
<b>今日已获得<i>0张</i></b>
<div class="but">去完成</div>
</div>
</div>
<!-- page3 -->
<div class="page3">
<!-- 页面主切换 -->
<div class="tab">
<div class="tab tab1 "></div>
<div class="tab tab2 active2"></div>
</div>
<!-- 任务玩法切换 -->
<div class="listTab">
<div class="active">尖叫榜</div>
<div>惊喜榜</div>
</div>
<!-- 规则icon -->
<div class="rule_icon">榜单奖励></div>
<!-- 日榜总榜切换 -->
<div class="dayTab">
<div class="active">日榜</div>
<div>总榜</div>
</div>
<!-- 榜单标题 -->
<img src="./images/listTitle1.png" alt="" class="listTitle">
<!-- 日期 -->
<div class="time">
<div class="active"></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
<!-- 前三 -->
<div class="topBox">
<div class="no1">
<img src="./images/noBg1.png" alt="" class="noBg">
<img src="./images/no1.png" alt="" class="noImg">
<img src="./images/logo.png" alt="" class="tx">
<p>用户名字</p>
<b>尖叫值xxx</b>
</div>
<div class="no2">
<img src="./images/noBg2.png" alt="" class="noBg">
<img src="./images/no2.png" alt="" class="noImg">
<img src="./images/logo.png" alt="" class="tx">
<p>用户名字</p>
<b>尖叫值xxx</b>
</div>
<div class="no3">
<img src="./images/noBg3.png" alt="" class="noBg">
<img src="./images/no3.png" alt="" class="noImg">
<img src="./images/logo.png" alt="" class="tx">
<p>用户名字</p>
<b>尖叫值xxx</b>
</div>
</div>
<!-- 非前三 -->
<ul class="lists">
<li>
<div class="num">4</div>
<img src="./images/logo.png" alt="" class="tx">
<div class="nick">xxx</div>
<div class="score">尖叫值:0</div>
</li>
</ul>
<!-- 自己榜单 -->
<div class="my">
<div class="li">
<div class="num">4</div>
<img src="./images/logo.png" alt="" class="tx">
<div class="nick">xxx</div>
<div class="score">尖叫值:0</div>
</div>
</div>
</div>
<!-- 活动规则 -->
<div class="rule">
<div class="rule_in">
<div class="cen">
<p>
一、活動時間:<br>
2023年10月28日12:00:00-2023年11月2日23:59:59
</p>
<p>二、禮物上新:<br>
活動期間將限時上架5款萬聖新限定禮物1款萬聖限定福袋</p>
<p>三、活動攻略<br>
萬聖地圖<br>
1.送出≥1的萬聖限定福袋解鎖萬聖地圖<br>
2.收到≥5的萬聖限定福袋解鎖萬聖地圖<br>
3.地圖升級詳情查看升級條件和獎勵內容<br>
4.行走到寶箱位置可獲得獎勵,非寶箱位置無獎勵<br>
糖果任務<br>
1.活動期間完成每日任務和循環任務領取糖果券;<br>
2.每日任務0點刷新完成後進入活動頁領取獎勵<br>
3.任務完成後,任務獎勵自動發放;</p>
<p>四、萬聖榜單<br>
驚喜榜:<br>
1.活動期間內收到普通禮物可增加驚喜值1鑽=1驚喜值收到萬聖限定禮物1鑽=3驚喜值<br>
2.普通禮物包含禮物面板和背包禮物;<br>
3.大頭號不參與榜單活動排名;<br>
4.靚號獎勵A≠B≠C≠0不可轉贈請聯繫客服領取<br>
尖叫榜<br>
1.活動期間內贈送普通禮物可增加尖叫值1鑽=1尖叫值贈送萬聖限定禮物1鑽=3尖叫值<br>
2.普通禮物包含禮物面板和背包禮物;<br>
3.大頭號不參與榜單活動排名;<br>
4.靚號獎勵A≠B≠C≠0不可轉贈請聯繫客服領取<br></p>
<p>五、本活動最終解釋權歸Piko所有
本活動以及獎勵與Google/蘋果公司無關</p>
</div>
</div>
</div>
<!-- 榜单规则 -->
<div class="listRule">
<div class="listRule_in">
<img src="./images/listRuletitle1.png" alt="" class="listRuletitle">
<div class="box">
<img src="./images/listRuleText1.png" alt="listRuleText">
</div>
</div>
</div>
<!-- 初级中级高级宝箱弹窗 -->
<div class="box_pub">
<div class="box_pub_in">
<img src="./images/box_pub_Title1.png" alt="" class="box_pub_Title">
<p class="p1">活动期间送出万圣福袋*1</p>
<p class="p2"></p>
<p class="p3">活动期间收到万圣福袋*5</p>
<ul class="box_pub_ul">
<!-- <li>
<img src="./images/logo.png" alt="" class="gift">
<p>黑猫恋人头饰</p>
<b>(30天)</b>
</li> -->
<li class="li1"></li>
</ul>
</div>
</div>
<!-- 恭喜获得弹窗 -->
<div class="gx">
<div class="gx_in">
<ul class="gxBox">
<li>
<img src="./images/logo.png" alt="" class="gift">
<p>xxx头饰*1天</p>
</li>
</ul>
<div class="but">收下</div>
</div>
</div>
<!-- 活动规则 -->
<div class="endActivity">
<div class="endActivity_in">
<p>该活动已结束</p>
<div class="but">查看榜单</div>
</div>
</div>
<!-- 糟糕未获得奖励 -->
<div class="zg">
<img src="./images/zg.png" alt="" class="zg_in">
</div>
<!-- 宝箱记录 -->
<div class="record_box">
<div class="record_box_in">
<ul>
<li>
<div class="left">
<p>2023/10/23</p>
<b>23:45:05</b>
</div>
<div class="right">xxxx礼物*1</div>
</li>
</ul>
</div>
</div>
</body>
</html>
<script src="../../common/js/flexible.js"></script>
<script src="../../common/js/jquery-3.2.1.min.js"></script>
<script src="../../common/js/common2.js"></script>
<script src="../../common/js/layer.js"></script>
<script src="../../common/js/vconsole.min.js"></script>
<script src="../../common/js/svga.min.js"></script>
<script src="./js/swiper-bundle.min.js"></script>
<script src="../../common/js/route-constant.js"></script>
<script src="./js/wow.js"></script>
<script src="./js/index.js"></script>

View File

@@ -0,0 +1,561 @@
let urlPrefix = getUrlPrefix()
let browser = checkVersion()
let env = EnvCheck();
if (env == 'test') {
new VConsole();
}
// 封装layer消息提醒框
let layerIndex
const showLoading = (content = '加载中...') => {
layer.open({
type: 2,
shadeClose: false,
content,
success (e) {
layerIndex = $(e).attr('index')
}
})
}
const hideLoading = (index) => {
layer.close(index)
}
const toastMsg = (content = '操作完成', time = 2) => {
layer.open({
content,
time,
skin: 'msg'
})
}
var leftArr = ['3.6rem', '2.5rem', '1.4rem', '0.3rem', '0.3rem', '0.3rem', '1.4rem', '2.5rem', '2.5rem', '2.5rem', '1.4rem', '0.3rem', '0.3rem', '0.3rem', '0.3rem', '1.4rem', '2.5rem', '2.5rem', '3.6rem', '4.7rem', '4.7rem', '5.8rem', '6.9rem', '6.9rem', '6.9rem', '5.8rem', '5.8rem', '5.8rem', '6.9rem', '6.9rem', '6.9rem', '5.8rem', '4.7rem', '3.6rem'];
var bottArr = ['0.9rem', '0.9rem', '0.9rem', '0.9rem', '2.0rem', '3.1rem', '3.1rem', '3.1rem', '4.3rem', '5.6rem', '5.6rem', '5.6rem', '6.7rem', '7.8rem', '9.1rem', '9.1rem', '9.1rem', '7.8rem', '7.8rem', '7.8rem', '9.1rem', '9.1rem', '9.1rem', '7.8rem', '6.7rem', '6.7rem', '5.6rem', '4.3rem', '4.3rem', '3.1rem', '2.0rem', '2.0rem', '2.0rem', '2.0rem'];
var curDate; //当天日期;
var rankType = 1; //排行榜类型1=送礼日榜2=送礼总榜3=收礼日榜4=收礼总榜);
var data = null;//默认日榜;
var isEndTime = null;//判断是否活动结束;
var roomUid = null;//房间uid;
var type = 'a';//a:送礼b:收礼;
var type2 = 'a';//a:日榜b:总榜;
var page = 1;//页码
var drawPageSizeLack = true;//记录滑动锁
var pooType = null;//宝箱等级
// 初始化函数
$(function () {
getInfoFromClient()
setTimeout(function () {
// 页面全屏
if (browser.app) {
if (browser.android) {
window.androidJsObj.initShowNav(false)
} else {
window.webkit.messageHandlers.initShowNav.postMessage(0)
}
};
// 顶部返回事件
$('.back').click(() => {
if (browser.android) {
window.androidJsObj.closeWebView()
} else {
window.webkit.messageHandlers.closeWebView.postMessage(null)
}
})
// 礼物轮播
var mySwiper = new Swiper('.swiper', {
// direction: "vertical",
loop: true,
autoplay: {
delay: 3500,//
disableOnInteraction: false
}
})
getRecommendRoom();
getConfig();
}, 100)
})
// 获取房间Uid接口
function getRecommendRoom () {
showLoading()
networkRequest({
type: 'GEt',
url: urlPrefix + '/home/tab/home/one',
success (res) {
if (res.code === 200) {
roomUid = res.data;
} else {
toastMsg(res.message)
}
hideLoading(layerIndex)
},
error (err) {
hideLoading(layerIndex)
toastMsg('网络错误,请退出重进')
}
})
}
// 接口
function getConfig () {
showLoading()
networkRequest({
type: 'GEt',
url: urlPrefix + '/act/2023Halloween/draw/getConfig',
success (res) {
if (res.code === 200) {
// 处理糖果数量
$('.myCandy').text('我的糖果券:' + res.data.candyNum);
// 当前格子下标
$('.page1 .road .gui').css({
left: leftArr[res.data.mapPos],
bottom: bottArr[res.data.mapPos],
})
// 判断活动结束时间
if (res.timestamp > res.data.endTime) {
isEndTime = true;
$('.endActivity').show();
}
// 判断等级处理
pooType = res.data.boxLevel;
if (res.data.boxLevel == 0) {
$('.page1 .mc').show();
} else if (res.data.boxLevel == 1) {
$('.page1 .boxs1').addClass('boxOpen1');
$('.page1 .road .boxImg').attr('src', './images/box1.png');
} else if (res.data.boxLevel == 2) {
$('.page1 .boxs1').addClass('boxOpen1');
$('.page1 .boxs2').addClass('boxOpen2');
$('.page1 .road .boxImg').attr('src', './images/box2.png');
} else if (res.data.boxLevel == 3) {
$('.page1 .boxs1').addClass('boxOpen1');
$('.page1 .boxs2').addClass('boxOpen2');
$('.page1 .boxs3').addClass('boxOpen3');
$('.page1 .road .boxImg').attr('src', './images/box3.png');
}
// 处理每日任务
res.data.dailyTaskList.forEach((res, i) => {
$(`.page2 .task${i + 1} .but`).attr('click', res.status);
$(`.page2 .task${i + 1} .but`).text(res.status == 0 ? '去完成' : '已完成');
res.status == 1 ? $(`.page2 .task${i + 1} .but`).addClass('butActive') : $(`.page2 .task${i + 1} .but`).removeClass('butActive');
if (i == 1) {
$('.page2 .task1 p').text(`登录活动页(${res.cur}/${res.need})`);
}
if (i == 1) {
$('.page2 .task2 .line').css('width', `${(res.cur / res.need * 100) >= 100 ? 100 : (res.cur / res.need * 100)}%`);
$('.page2 .task2 .line').text(`${res.cur}/${res.need}`);
}
});
// 处理循环任务
res.data.loopTaskList.forEach((res, i) => {
$(`.page2 .task${i + 3} b i`).text(`${res.loop}`);
$(`.page2 .task${i + 3} .but`).attr('click', res.status);
$(`.page2 .task${i + 3} .but`).text(res.status == 0 ? '去完成' : '已完成');
res.status == 1 ? $(`.page2 .task${i + 3} .but`).addClass(`butActive`) : $(`.page2 .task${i + 3} .but`).removeClass(`butActive`);
})
} else {
toastMsg(res.message)
}
hideLoading(layerIndex)
},
error (err) {
hideLoading(layerIndex)
toastMsg('网络错误,请退出重进')
}
})
}
// 任务按钮2
$('.page2 .task2 .but').click(function () {
var bool = $(this).attr('click') == 0 ? false : true;
console.log(bool);
if (bool) {
return
}
if (browser.ios) {
window.webkit.messageHandlers.openRoom.postMessage(roomUid);
} else if (browser.android) {
if (androidJsObj && typeof androidJsObj === 'object') {
window.androidJsObj.openRoom(roomUid);
}
}
})
// 任务按钮3
$('.page2 .task3 .but').click(function () {
var bool = $(this).attr('click') == 0 ? false : true;
console.log(bool);
if (bool) {
return
}
if (browser.ios) {
window.webkit.messageHandlers.openRoomForGiftId.postMessage(JSON.stringify({ uid: roomUid, giftId: 0 }))
} else if (browser.android) {
if (androidJsObj && typeof androidJsObj === 'object') {
window.androidJsObj.openRoomForGiftId(roomUid, 0);
}
}
})
// 任务按钮4
$('.page2 .task4 .but').click(function () {
var bool = $(this).attr('click') == 0 ? false : true;
console.log(bool);
if (bool) {
return
}
if (browser.ios) {
window.webkit.messageHandlers.openRoomForGiftId.postMessage(JSON.stringify({ uid: roomUid, giftId: 0 }))
} else if (browser.android) {
if (androidJsObj && typeof androidJsObj === 'object') {
window.androidJsObj.openRoomForGiftId(roomUid, 0);
}
}
})
// 点击宝箱按钮
$('.page1 .boxs').click(function () {
var i = $(this).index() - 6;
if (i == 1) {
$('.box_pub .box_pub_in .p1').text('活动期间送出万圣福袋*1');
$('.box_pub .box_pub_in .p3').text('活动期间收到万圣福袋*5');
} else if (i == 2) {
$('.box_pub .box_pub_in .p1').text('活动期间送出万圣福袋*10');
$('.box_pub .box_pub_in .p3').text('活动期间收到万圣福袋*20');
} else {
$('.box_pub .box_pub_in .p1').text('活动期间送出南瓜棒棒糖/幽灵糖果*1');
$('.box_pub .box_pub_in .p3').text('活动期间收到南瓜棒棒糖/幽灵糖果*2');
}
$('.box_pub .box_pub_in .box_pub_ul li').removeClass('li1').removeClass('li2').removeClass('li3');
$('.box_pub .box_pub_in .box_pub_ul li').addClass(`li${i}`);
$('.box_pub').show();
bodyScroolFun(true);
})
// 去完成宝箱解锁任务按钮
$('.page1 .mc .mc_in .but').click(function () {
if (browser.ios) {
window.webkit.messageHandlers.openRoomForGiftId.postMessage(JSON.stringify({ uid: roomUid, giftId: 0 }))
} else if (browser.android) {
if (androidJsObj && typeof androidJsObj === 'object') {
window.androidJsObj.openRoomForGiftId(roomUid, 0);
}
}
})
// tab切换
$('.tab div').click(function () {
var i = $(this).index() + 1;
$('.page1,.page2,.page3').hide();
if (i == 1) {
$('.page1').show();
getConfig();
} else {
getRank(rankType, data);
$('.page3').show();
}
})
// 地图任务tab切换
$('.switch div').click(function () {
var i = $(this).index() + 1;
$('.page1,.page2,.page3').hide();
if (i == 1) {
$('.page1').show();
} else {
$('.page2').show();
}
getConfig();
})
// 尖叫惊喜榜单切换
$('.page3 .listTab div').click(function () {
var i = $(this).index() + 1;
$('.page3 .listTitle').attr('src', `./images/listTitle${i}.png`);
$('.listRule .listRule_in .listRuletitle').attr('src', `./images/listRuletitle${i}.png`);
$('.listRule .listRule_in .box img').attr('src', `./images/listRuleText${i}.png`);
$(this).addClass('active').siblings().removeClass('active');
if (i == 1) {
type = 'a';
rankType = type2 == "a" ? 1 : 2;
} else {
type = 'b';
rankType = type2 == "a" ? 3 : 4;
}
getRank(rankType, data);
})
// 日榜总榜切换
$('.page3 .dayTab div').click(function () {
var i = $(this).index() + 1;
$(this).addClass('active').siblings().removeClass('active');
if (i == 1) {
type2 = 'a';
rankType = type == "a" ? 1 : 3;
} else {
type2 = 'b';
rankType = type == "a" ? 2 : 4;
}
getRank(rankType, data);
})
// 日榜切换日期
$('.page3 .time div').click(function () {
var datas = $(this).attr('data');
$(this).addClass('active').siblings().removeClass('active');
rankType = type == "a" ? 1 : 3;//排行榜类型1=甜蜜日榜2=甜蜜总榜3=爱意日榜4=爱意总榜)
data = datas;
getRank(rankType, data);
})
// 榜单接口
function getRank (rankType, date) {//排行榜类型rankType1=送礼日榜2=送礼总榜3=收礼日榜4=收礼总榜)
$('.page3 .lists li').remove();
showLoading()
networkRequest({
type: 'GEt',
url: urlPrefix + '/act/2023Halloween/rank/getRank',
data: { rankType, date },
success (res) {
if (res.code === 200) {
// 处理日期
if (res.data.dateList) {
res.data.dateList.forEach((res, i) => {
$('.page3 .time div').eq(i).text(`${res[5]}${res[6]}.${res[8]}${res[9]}`);
$('.page3 .time div').eq(i).attr('data', res);
if (res == curDate && date == null) {
$('.page3 .time div').removeClass('active')
$('.page3 .time div').eq(i).addClass('active');
}
})
}
// 处理自己榜单
$('.page3 .my .li .tx').attr('src', res.data.meRank.avatar);
$('.page3 .my .li .num').text(res.data.meRank.ranking == 0 ? '未上榜' : res.data.meRank.ranking);
$('.page3 .my .li .nick').text(res.data.meRank.nick);
$('.page3 .my .li .score').text(`${rankType == 1 || rankType == 2 ? "尖叫值:" : "惊喜值:"}${unitProcessing(res.data.meRank.score, 10000, 1, 'w')}`);
// 处理前三
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) => {
$(`.page3 .topBox .no${index + 1} .tx`).attr('src', res.avatar);
$(`.page3 .topBox .no${index + 1} p`).text(res.nick);
$(`.page3 .topBox .no${index + 1} b`).text(`${rankType == 1 || rankType == 2 ? "尖叫值:" : "惊喜值:"}${unitProcessing(res.score, 10000, 1, 'w')}`);
})
// 非前三
var str = '';
notTop3.forEach((res, i) => {
str += `
<li>
<div class="num">${res.ranking}</div>
<img src="${res.avatar}" alt="" class="tx">
<div class="nick">${res.nick}</div>
<div class="score">${rankType == 1 || rankType == 2 ? "尖叫值:" : "惊喜值:"}${unitProcessing(res.score, 10000, 1, 'w')}</div>
</li>
`
})
$('.page3 .lists').append(str);
} else {
toastMsg(res.message)
}
hideLoading(layerIndex)
},
error (err) {
hideLoading(layerIndex)
toastMsg('网络错误,请退出重进')
}
})
}
// 打开活动规则
$('.header .rule_icon').click(function () {
$('.rule').show();
bodyScroolFun(true);
})
// 关闭活动规则
$('.rule').click(function () {
$('.rule').hide();
bodyScroolFun(false);
})
// 打开榜单规则
$('.page3 .rule_icon').click(function () {
$('.listRule').show();
bodyScroolFun(true);
})
// 关闭榜单规则
$('.listRule').click(function () {
$('.listRule').hide();
bodyScroolFun(false);
})
// 打开初中高宝箱弹窗
$('').click(function () {
$('.box_pub').show();
bodyScroolFun(true);
})
// 关闭初中高宝箱弹窗
$('.box_pub').click(function () {
$('.box_pub').hide();
bodyScroolFun(false);
})
// 关闭恭喜获得弹窗
$('.gx .gx_in .but').click(function () {
$('.gx').hide();
bodyScroolFun(false);
})
// 关闭糟糕弹窗
$('.zg').click(function () {
$('.zg').hide();
bodyScroolFun(false);
})
// 关闭宝箱记录弹窗
$('.record_box').click(function () {
$('.record_box').hide();
bodyScroolFun(false);
})
// 打开宝箱记录
$('.page1 .diceBox .diceLeftBut').click(function () {
page = 1;
$('.record_box .record_box_in ul li').remove();
pageRecord(page);
})
// 获取房间Uid接口
function pageRecord (page) {
showLoading()
networkRequest({
type: 'GEt',
url: urlPrefix + '/act/2023Halloween/draw/pageRecord',
data: { page, size: 20 },
success (res) {
if (res.code === 200) {
if (res.data.length == 0) {
drawPageSizeLack = false;
hideLoading(layerIndex)
$('.record_box').show();
return;
}
var str = '';
res.data.forEach((res, i) => {
str += `
<li>
<div class="left">
<p>${dateFormat(res.createTime, 'yyyy/MM/dd')}</p>
${dateFormat(res.createTime, 'hh:mm:ss')}
</div>
<div class="right">${res.rewardDesc}</div>
</li>
`
})
$('.record_box .record_box_in ul ').append(str);
drawPageSizeLack = true;
$('.record_box').show();
bodyScroolFun(true);
} else {
drawPageSizeLack = true;
toastMsg(res.message)
}
hideLoading(layerIndex)
},
error (err) {
drawPageSizeLack = true;
hideLoading(layerIndex)
toastMsg('网络错误,请退出重进')
}
})
}
//检测抽奖记录是否到达底部
$(".duihuanBg .dividerecordsBg_in .ul").scroll(function () {
var divHeight = $(this).height();
var nScrollHeight = $(this)[0].scrollHeight;
var nScrollTop = $(this)[0].scrollTop;
if (nScrollTop + divHeight + 50 >= nScrollHeight) {
console.log("到达底部了");
if (drawPageSizeLack) {
drawPageSizeLack = false;
page++;
pageRecord(page);
}
}
});
// 骰子动画定义
let player = new SVGA.Player('.diceSvga');
let parser = new SVGA.Parser('.diceSvga');
parser.load(`./images/sz.svga`, function (videoItem) {
player.loops = 1;
player.clearsAfterStop = false;
player.setVideoItem(videoItem);
player.startAnimation();
player.setContentMode('AspectFill');
})
// 骰子动画函数
function diceSvga () {
$('.page1 .diceBox .diceSvga').show();
$('.page1 .diceBox .dice').hide();
parser.load(`./images/sz.svga`, function (videoItem) {
player.loops = 1;
player.clearsAfterStop = false;
player.setVideoItem(videoItem);
player.startAnimation();
player.setContentMode('AspectFill');
player.onFinished(() => {
$('.page1 .diceBox .dice').show();
$('.page1 .diceBox .diceSvga').hide();
})
})
}
// 摇骰子按钮
$('.page1 .diceBox .dice').click(function () {
// diceSvga();
getRecommendRoom(pooType, 1);
})
// 抽奖接口
function draw (pooType, num) {
showLoading()
networkRequest({
type: 'GEt',
url: urlPrefix + '/act/2023Halloween/draw/draw',
data: { pooType, num },
success (res) {
if (res.code === 200) {
// 特效移动
for (let index = 0; index < res.data.step.length; index++) {
setTimeout(function () {
$('.page1 .road .gui').css({
left: leftArr[index],
bottom: bottArr[index],
})
}, (index + 1) * 300)
}
//判断是否中奖
if (res.hasReward) {
// 渲染中奖列表<p>xxx头饰*1天</p>
var str = '';
$('.gx .gx_in .gxBox li').remove();
res.data.rewardList.forEach((res, i) => {
str += `
<li>
<img src="${res.pic}" alt="" class="gift">
<p>${res.desc}</p>
</li>
`
})
$('.gx .gx_in .gxBox').append(str);
$('.gx').show();
bodyScroolFun(true);
} else {
$('.zg').show();
bodyScroolFun(true);
}
} else {
toastMsg(res.message)
}
hideLoading(layerIndex)
},
error (err) {
hideLoading(layerIndex)
toastMsg('网络错误,请退出重进')
}
})
}
//返回页面 重新请求接口
var hiddenProperty = 'hidden' in document ? 'hidden' :
'webkitHidden' in document ? 'webkitHidden' :
'mozHidden' in document ? 'mozHidden' : null;
var visibilityChangeEvent = hiddenProperty.replace(/hidden/i, 'visibilitychange');
var onVisibilityChange = function () {
if (!document[hiddenProperty]) {
location.reload()
}
}
document.addEventListener(visibilityChangeEvent, onVisibilityChange);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,46 @@
var baba = document.querySelector('body');
baba.addEventListener('click', function (e) {
// $('body,html').css({ "width": "100%", "position": "relative", "overflow": "hidden" });
tianJia(e);
})
var erZi = [];
function tianJia (e) {
var sunZi = document.createElement('div');
sunZi.className = 'rabbit';
// sunZi.innerHTML = '<i class="iconfont icon-tuzi"></i>';
sunZi.innerHTML = '<img src="./images/xx.png" alt="">';
baba.appendChild(sunZi);
erZi.push({
el: sunZi,
top: e.pageY - 30,
left: e.pageX - 20,
opacity: 1,
scale: 1,
color: `rgb(${255 * Math.random()},${255 * Math.random()},${255 * Math.random()})`
});
move();
};
function move () {
for (var i = 0; i < erZi.length; i++) {
if (erZi[i].opacity <= 0) {
baba.removeChild(erZi[i].el);
erZi.splice(i, 1);
return;
}
erZi[i].top--;
erZi[i].opacity = erZi[i].opacity - 0.04;
// erZi[i].scale = erZi[i].scale + 0.0001;
erZi[i].el.style.cssText = `
top: ${erZi[i].top}px;
left: ${erZi[i].left}px;
color: ${erZi[i].color};
opacity: ${erZi[i].opacity};
transform: scale(${erZi[i].scale});
position: absolute;
`
}
window.requestAnimationFrame(move);
// $('body,html').css({ "width": "100%", "position": "relative", "overflow": "auto" });
}