新增儿童节活动
1017
view/molistar/activity/2024-childrenDay/css/index.css
Normal file
1023
view/molistar/activity/2024-childrenDay/css/index.scss
Normal file
13
view/molistar/activity/2024-childrenDay/css/swiper-bundle.min.css
vendored
Normal file
BIN
view/molistar/activity/2024-childrenDay/images/but_icon.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/close.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/gameBg.png
Normal file
After Width: | Height: | Size: 774 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/gift1.png
Normal file
After Width: | Height: | Size: 115 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/gift2.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/gift3.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/giftBox.png
Normal file
After Width: | Height: | Size: 129 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/giftBoxs.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/header.png
Normal file
After Width: | Height: | Size: 622 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/icon1.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/icon2.png
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/icon3.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/icon4.png
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/icon5.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/icon6.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/liBg.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/lisTabAct.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/listBox.png
Normal file
After Width: | Height: | Size: 501 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/listNo.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/listTab.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/listText1.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/listText2.png
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/listText3.png
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/list_icon.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/logo.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/no1.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/no2.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/no3.png
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/playAgain.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/records.png
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/resultBg.png
Normal file
After Width: | Height: | Size: 69 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/resultBg2.png
Normal file
After Width: | Height: | Size: 60 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/resultOut.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/resultText1.png
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/resultText2.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/rule1.png
Normal file
After Width: | Height: | Size: 572 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/rule2.png
Normal file
After Width: | Height: | Size: 836 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/rule_bg.png
Normal file
After Width: | Height: | Size: 49 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/rule_icon.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/text_icon.png
Normal file
After Width: | Height: | Size: 6.7 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/toastBut.png
Normal file
After Width: | Height: | Size: 1014 B |
BIN
view/molistar/activity/2024-childrenDay/images/toastButAct.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/toastPubBg.png
Normal file
After Width: | Height: | Size: 89 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/toast_icon.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/travel/back.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/view.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
view/molistar/activity/2024-childrenDay/images/woastButAct.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
209
view/molistar/activity/2024-childrenDay/index.html
Normal file
@@ -0,0 +1,209 @@
|
||||
<!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>
|
||||
<!-- header -->
|
||||
<div class="header">
|
||||
<img src="./images/rule_icon.png" alt="" class="rule_icon">
|
||||
</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 class="swiper-slide">
|
||||
<img src="./images/gift3.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 遊戲地圖 -->
|
||||
<div class="game">
|
||||
<!-- 放大鏡數量 -->
|
||||
<div class="magnifyingGlass">放大鏡數量:<b>0</b></div>
|
||||
<!-- 遊戲記錄 -->
|
||||
<div class="records">遊園記錄</div>
|
||||
<!-- 榜單 -->
|
||||
<img src="./images/list_icon.png" alt="" class="list_icon">
|
||||
<!-- 任務 -->
|
||||
<img src="./images/toast_icon.png" alt="" class="toast_icon">
|
||||
<!-- 遊園按鈕 -->
|
||||
<img src="./images/but_icon.png" alt="" class="but">
|
||||
<!-- icon -->
|
||||
<img src="./images/icon1.png" alt="" class="icon icon1">
|
||||
<img src="./images/icon2.png" alt="" class="icon icon2">
|
||||
<img src="./images/icon3.png" alt="" class="icon icon3">
|
||||
<img src="./images/icon4.png" alt="" class="icon icon4">
|
||||
<img src="./images/icon5.png" alt="" class="icon icon5">
|
||||
<img src="./images/icon6.png" alt="" class="icon icon6">
|
||||
<!-- 點擊圖標站位按鈕 -->
|
||||
<div class="buts buts1"></div>
|
||||
<div class="buts buts2"></div>
|
||||
<div class="buts buts3"></div>
|
||||
<div class="buts buts4"></div>
|
||||
<div class="buts buts5"></div>
|
||||
<div class="buts buts6"></div>
|
||||
<!-- 贏結果頁 -->
|
||||
<div class="result">
|
||||
<img src="./images/logo.png" alt="" class="tx_left">
|
||||
<img src="./images/logo.png" alt="" class="tx_right">
|
||||
<div class="name_left">虛位以待</div>
|
||||
<div class="name_right">虛位以待</div>
|
||||
<div class="id_right">ID:0</div>
|
||||
<img src="./images/resultText1.png" alt="" class="resultText">
|
||||
<div class="text1">請收下妳的戰利品</div>
|
||||
<div class="giftName">禮物昵稱</div>
|
||||
<div class="giftBoxs">
|
||||
<img src="./images/logo.png" alt="" class="giftImg">
|
||||
</div>
|
||||
<img src="./images/view.png" alt="" class="view">
|
||||
<img src="./images/playAgain.png" alt="" class="playAgain">
|
||||
</div>
|
||||
<!-- 輸結果頁 -->
|
||||
<div class="result2">
|
||||
<img src="./images/logo.png" alt="" class="tx_left">
|
||||
<div class="name_left">虛位以待</div>
|
||||
<img src="./images/resultText2.png" alt="" class="resultText">
|
||||
<div class="text1">請收下妳的戰利品</div>
|
||||
<div class="giftName">禮物昵稱</div>
|
||||
<div class="giftBoxs">
|
||||
<img src="./images/logo.png" alt="" class="giftImg">
|
||||
</div>
|
||||
<img src="./images/view.png" alt="" class="view">
|
||||
<img src="./images/playAgain.png" alt="" class="playAgain">
|
||||
</div>
|
||||
</div>
|
||||
<!-- 榜單彈窗 -->
|
||||
<div class="list_pub">
|
||||
<div class="list_pub_in">
|
||||
<div class="tab">
|
||||
<div class="act">搜捕榜</div>
|
||||
<div>童趣榜</div>
|
||||
<div>童年榜</div>
|
||||
</div>
|
||||
<!-- 前三 -->
|
||||
<div class="top1">
|
||||
<img src="./images/no1.png" alt="" class="ts">
|
||||
<img src="./images/logo.png" alt="" class="tx">
|
||||
<div class="name">虛位以待</div>
|
||||
<div class="score">童趣值:0</div>
|
||||
</div>
|
||||
<div class="top2">
|
||||
<img src="./images/no2.png" alt="" class="ts">
|
||||
<img src="./images/logo.png" alt="" class="tx">
|
||||
<div class="name">虛位以待</div>
|
||||
<div class="score">童趣值:0</div>
|
||||
</div>
|
||||
<div class="top3">
|
||||
<img src="./images/no3.png" alt="" class="ts">
|
||||
<img src="./images/logo.png" alt="" class="tx">
|
||||
<div class="name">虛位以待</div>
|
||||
<div class="score">童趣值:0</div>
|
||||
</div>
|
||||
<!-- 非前三 -->
|
||||
<ul>
|
||||
<li>
|
||||
<div class="num">4</div>
|
||||
<img src="./images/logo.png" alt="" class="tx">
|
||||
<div class="name">虛位以待</div>
|
||||
<div class="score">童趣值:0</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 任務彈窗 -->
|
||||
<div class="toast_pub">
|
||||
<div class="toast_pub_in">
|
||||
<img src="./images/close.png" alt="" class="close">
|
||||
<div class="toasts toasts1">
|
||||
<p>登錄活動頁</p>
|
||||
<span>獎勵:放大鏡*1</span>
|
||||
<div class="but">未完成</div>
|
||||
</div>
|
||||
<div class="toasts toasts2">
|
||||
<p>關註一位新的好友(0/3)</p>
|
||||
<span>獎勵:放大鏡*1</span>
|
||||
<div class="but">未完成</div>
|
||||
</div>
|
||||
<div class="toasts toasts3">
|
||||
<p>房間停留10mins~(0/3)</p>
|
||||
<span>獎勵:放大鏡*1</span>
|
||||
<div class="but">未完成</div>
|
||||
</div>
|
||||
<div class="toasts toasts4">
|
||||
<p>送出or收到1000金幣的61限定禮物</p>
|
||||
<span>獎勵:放大鏡*1</span>
|
||||
<i>今日已獲得:0</i>
|
||||
<div class="but">未完成</div>
|
||||
</div>
|
||||
<div class="toasts toasts5">
|
||||
<p>參與Greedy纍計獲得1000金幣</p>
|
||||
<span>獎勵:放大鏡*1</span>
|
||||
<i>今日已獲得:0</i>
|
||||
<div class="but">未完成</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 遊戲記錄彈窗 -->
|
||||
<div class="records_pub">
|
||||
<div class="records_pub_in">
|
||||
<div class="title">
|
||||
<div>獲獎時間</div>
|
||||
<div>獎品</div>
|
||||
</div>
|
||||
<ul>
|
||||
<li>
|
||||
<div>
|
||||
<p>2024/01/22</p>
|
||||
<b>23:59:59</b>
|
||||
</div>
|
||||
<div>
|
||||
<p>禮物名稱</p>
|
||||
<i>XX天</i>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 規則 -->
|
||||
<div class="rule">
|
||||
<div class="rule_in">
|
||||
<div class="tab">
|
||||
<div class="act">活動規則</div>
|
||||
<div>活動獎勵</div>
|
||||
</div>
|
||||
<div class="imgBox">
|
||||
<img src="./images/rule1.png" alt="" class="img1">
|
||||
<img src="./images/rule2.png" alt="" class="img2">
|
||||
</div>
|
||||
</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/route-constant.js"></script>
|
||||
<script src="./js/swiper-bundle.min.js"></script>
|
||||
<script src="./js/index.js"></script>
|
441
view/molistar/activity/2024-childrenDay/js/index.js
Normal file
@@ -0,0 +1,441 @@
|
||||
let urlPrefix = getUrlPrefix()
|
||||
let browser = checkVersion()
|
||||
let env = EnvCheck();
|
||||
if (env == 'test') {
|
||||
new VConsole();
|
||||
}
|
||||
var langReplace;
|
||||
var localLang;
|
||||
// 封裝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 page = 1;
|
||||
var isLock = true;
|
||||
var magnifyingGlass = 0;
|
||||
var listType = 1;
|
||||
// 初始化函數
|
||||
$(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)
|
||||
}
|
||||
})
|
||||
swiperFun();
|
||||
getInfo();
|
||||
}, 100)
|
||||
})
|
||||
// 禮物輪播
|
||||
function swiperFun() {
|
||||
var mySwiper = new Swiper('.swiper', {
|
||||
direction: "vertical",
|
||||
loop: true,
|
||||
autoplay: {
|
||||
delay: 3000,//
|
||||
disableOnInteraction: false
|
||||
}
|
||||
})
|
||||
}
|
||||
// 活動信息接口
|
||||
function getInfo() {
|
||||
showLoading()
|
||||
networkRequest({
|
||||
type: 'get',
|
||||
url: urlPrefix + '/activity/info',
|
||||
data: { activityCode: 'ACT_2024_CHILDREN_DAY' },
|
||||
success(res) {
|
||||
if (res.code === 200) {
|
||||
showLoading()
|
||||
networkRequest({
|
||||
type: 'get',
|
||||
url: urlPrefix + '/activity/currency',
|
||||
data: { redisKey: 'act_user_task_extra_data' },
|
||||
success(res) {
|
||||
if (res.code === 200) {
|
||||
magnifyingGlass = res.data
|
||||
$('.game .magnifyingGlass b').text(magnifyingGlass);
|
||||
} else {
|
||||
toastMsg(res.message)
|
||||
}
|
||||
hideLoading(layerIndex)
|
||||
},
|
||||
error(err) {
|
||||
hideLoading(layerIndex)
|
||||
toastMsg('網絡錯誤')
|
||||
}
|
||||
})
|
||||
} else {
|
||||
toastMsg(res.message)
|
||||
}
|
||||
hideLoading(layerIndex)
|
||||
},
|
||||
error(err) {
|
||||
hideLoading(layerIndex)
|
||||
toastMsg('網絡錯誤')
|
||||
}
|
||||
})
|
||||
}
|
||||
// 打開榜單
|
||||
$('.game .list_icon').click(function () {
|
||||
listFun(listType)
|
||||
$('.list_pub').show();
|
||||
bodyScroolFun(true);
|
||||
})
|
||||
// 榜單切換
|
||||
$('.list_pub .list_pub_in .tab div').click(function () {
|
||||
var i = $(this).index() + 1;
|
||||
listType = i;
|
||||
$(this).addClass('act').siblings().removeClass('act');
|
||||
listFun(listType)
|
||||
return false;
|
||||
})
|
||||
// 活動信息接口
|
||||
function listFun(type) {
|
||||
var str = '';
|
||||
$('.list_pub .list_pub_in ul li').remove();
|
||||
showLoading()
|
||||
if (type == 1) {
|
||||
networkRequest({
|
||||
type: 'get',
|
||||
url: urlPrefix + '/allrank/geth5',
|
||||
data: {
|
||||
uid: pubInfo.uid,
|
||||
type: 5,
|
||||
datetype: 3,
|
||||
pageNum: 1,
|
||||
pageSize: 999999999,
|
||||
},
|
||||
success(res) {
|
||||
if (res.code === 200) {
|
||||
var listTo3 = res.data.rankVoList.slice(0, 3);
|
||||
var notListTo3 = res.data.rankVoList.slice(3);
|
||||
if (listTo3.length < 3) {
|
||||
let arr = new Array(3 - listTo3.length).fill({
|
||||
avatar: './images/logo.png',
|
||||
nick: '虛位以待',
|
||||
score: "0"
|
||||
})
|
||||
listTo3.push(...arr)
|
||||
}
|
||||
// 處理前三
|
||||
listTo3.forEach((res, i) => {
|
||||
if (res.score > 10000) {
|
||||
res.score = ((Math.floor(res.score / 1000)) / 10).toFixed(1) + 'W'
|
||||
}
|
||||
$(`.list_pub .list_pub_in .top${i + 1} .tx`).attr("src", res.avatar);
|
||||
$(`.list_pub .list_pub_in .top${i + 1} .name`).text(res.nick);
|
||||
$(`.list_pub .list_pub_in .top${i + 1} .score`).text('搜捕值:' + res.score);
|
||||
});
|
||||
notListTo3.forEach(res => {
|
||||
if (res.score > 10000) {
|
||||
res.score = ((Math.floor(res.score / 1000)) / 10).toFixed(1) + 'W'
|
||||
}
|
||||
str += `
|
||||
<li>
|
||||
<div class="num">${i + 4 > 30 ? '30+' : i + 4}</div>
|
||||
<img src="${res.avatar}" alt="" class="tx">
|
||||
<div class="name">${res.nick}</div>
|
||||
<div class="score">搜捕值:${res.score}</div>
|
||||
</li>
|
||||
`
|
||||
})
|
||||
$('.list_pub .list_pub_in ul').append(str);
|
||||
} else {
|
||||
toastMsg(res.message)
|
||||
}
|
||||
hideLoading(layerIndex)
|
||||
},
|
||||
error(err) {
|
||||
hideLoading(layerIndex)
|
||||
toastMsg('網絡錯誤')
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
networkRequest({
|
||||
type: 'get',
|
||||
url: urlPrefix + '/act/special/gift/getRank',
|
||||
data: {
|
||||
pageSize: 999999999,
|
||||
rankType: type == 2 ? 4 : 2,
|
||||
},
|
||||
success(res) {
|
||||
if (res.code === 200) {
|
||||
var listTo3 = res.data.rankList.slice(0, 3);
|
||||
var notListTo3 = res.data.rankList.slice(3);
|
||||
if (listTo3.length < 3) {
|
||||
let arr = new Array(3 - listTo3.length).fill({
|
||||
avatar: './images/logo.png',
|
||||
nick: '虛位以待',
|
||||
score: "0"
|
||||
})
|
||||
listTo3.push(...arr)
|
||||
}
|
||||
// 處理前三
|
||||
listTo3.forEach((res, i) => {
|
||||
if (res.score > 10000) {
|
||||
res.score = ((Math.floor(res.score / 1000)) / 10).toFixed(1) + 'W'
|
||||
}
|
||||
$(`.list_pub .list_pub_in .top${i + 1} .tx`).attr("src", res.avatar);
|
||||
$(`.list_pub .list_pub_in .top${i + 1} .name`).text(res.nick);
|
||||
$(`.list_pub .list_pub_in .top${i + 1} .score`).text('搜捕值:' + res.score);
|
||||
});
|
||||
notListTo3.forEach(res => {
|
||||
if (res.score > 10000) {
|
||||
res.score = ((Math.floor(res.score / 1000)) / 10).toFixed(1) + 'W'
|
||||
}
|
||||
str += `
|
||||
<li>
|
||||
<div class="num">${i + 4 > 30 ? '30+' : i + 4}</div>
|
||||
<img src="${res.avatar}" alt="" class="tx">
|
||||
<div class="name">${res.nick}</div>
|
||||
<div class="score">搜捕值:${res.score}</div>
|
||||
</li>
|
||||
`
|
||||
})
|
||||
$('.list_pub .list_pub_in ul').append(str);
|
||||
} else {
|
||||
toastMsg(res.message)
|
||||
}
|
||||
hideLoading(layerIndex)
|
||||
},
|
||||
error(err) {
|
||||
hideLoading(layerIndex)
|
||||
toastMsg('網絡錯誤')
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// 關閉榜單
|
||||
$('.list_pub').click(function () {
|
||||
$('.list_pub').hide();
|
||||
bodyScroolFun(false);
|
||||
})
|
||||
// 打開任務
|
||||
$('.game .toast_icon').click(function () {
|
||||
getTask();
|
||||
})
|
||||
// 活動信息接口
|
||||
function getTask() {
|
||||
showLoading()
|
||||
networkRequest({
|
||||
type: 'get',
|
||||
url: urlPrefix + '/act/children/task',
|
||||
success(res) {
|
||||
if (res.code === 200) {
|
||||
res.data.isLoginTask ? $('.toast_pub .toast_pub_in .toasts1 .but').addClass('act') : $('.toast_pub .toast_pub_in .toasts1 .but').removeClass('act');
|
||||
res.data.isLoginTask ? $('.toast_pub .toast_pub_in .toasts1 .but').text('已完成') : $('.toast_pub .toast_pub_in .toasts1 .but').text('未完成');
|
||||
$('.toast_pub .toast_pub_in .toasts2 p').text(`關註一位新的好友(${res.data.userFollowCount}/3)`);
|
||||
res.data.isUserFollowTask ? $('.toast_pub .toast_pub_in .toasts2 .but').addClass('act') : $('.toast_pub .toast_pub_in .toasts2 .but').removeClass('act');
|
||||
res.data.isLoginTask ? $('.toast_pub .toast_pub_in .toasts2 .but').text('已完成') : $('.toast_pub .toast_pub_in .toasts2 .but').text('未完成');
|
||||
$('.toast_pub .toast_pub_in .toasts3 p').text(`房間停留10mins~(${res.data.keepTimeCount}/10)`);
|
||||
res.data.isKeepTimeTask ? $('.toast_pub .toast_pub_in .toasts3 .but').addClass('act') : $('.toast_pub .toast_pub_in .toasts3 .but').removeClass('act');
|
||||
res.data.isLoginTask ? $('.toast_pub .toast_pub_in .toasts3 .but').text('已完成') : $('.toast_pub .toast_pub_in .toasts3 .but').text('未完成');
|
||||
$('.toast_pub .toast_pub_in .toasts4 i').text(`今日已獲得:${res.data.limitGiftCount}`);
|
||||
res.data.isLimitGiftFor61Task ? $('.toast_pub .toast_pub_in .toasts4 .but').addClass('act') : $('.toast_pub .toast_pub_in .toasts4 .but').removeClass('act');
|
||||
res.data.isLoginTask ? $('.toast_pub .toast_pub_in .toasts4 .but').text('已完成') : $('.toast_pub .toast_pub_in .toasts4 .but').text('未完成');
|
||||
$('.toast_pub .toast_pub_in .toasts5 i').text(`今日已獲得:${res.data.joinGreedyFor1000Count}`);
|
||||
res.data.isJoinGreedyFor1000Task ? $('.toast_pub .toast_pub_in .toasts5 .but').addClass('act') : $('.toast_pub .toast_pub_in .toasts5 .but').removeClass('act');
|
||||
res.data.isLoginTask ? $('.toast_pub .toast_pub_in .toasts5 .but').text('已完成') : $('.toast_pub .toast_pub_in .toasts5 .but').text('未完成');
|
||||
$('.toast_pub').show();
|
||||
bodyScroolFun(true);
|
||||
} else {
|
||||
toastMsg(res.message)
|
||||
}
|
||||
hideLoading(layerIndex)
|
||||
},
|
||||
error(err) {
|
||||
hideLoading(layerIndex)
|
||||
toastMsg('網絡錯誤')
|
||||
}
|
||||
})
|
||||
}
|
||||
// 關閉任務
|
||||
$('.toast_pub .toast_pub_in .close').click(function () {
|
||||
$('.toast_pub').hide();
|
||||
bodyScroolFun(false);
|
||||
})
|
||||
// 關閉結果彈窗
|
||||
$('.game .result .view,.game .result2 .view').click(function () {
|
||||
$('.result,.result2').hide();
|
||||
})
|
||||
// 關閉記錄彈窗
|
||||
$('.records_pub').click(function () {
|
||||
$('.records_pub').hide();
|
||||
bodyScroolFun(false);
|
||||
})
|
||||
// 切換規則按鈕
|
||||
$('.rule .rule_in .tab div').click(function () {
|
||||
var i = $(this).index() + 1;
|
||||
$(this).addClass('act').siblings().removeClass('act')
|
||||
$('.rule .rule_in .imgBox img').hide();
|
||||
$(`.rule .rule_in .imgBox .img${i}`).show();
|
||||
return false;
|
||||
})
|
||||
// 打開規則
|
||||
$('.header .rule_icon').click(function () {
|
||||
$('.rule').show();
|
||||
bodyScroolFun(true);
|
||||
})
|
||||
// 關閉規則
|
||||
$('.rule').click(function () {
|
||||
$('.rule').hide();
|
||||
bodyScroolFun(false);
|
||||
})
|
||||
// 記錄接口
|
||||
function record(page) {
|
||||
showLoading()
|
||||
networkRequest({
|
||||
type: 'get',
|
||||
url: urlPrefix + '/activity/task/user/record/page',
|
||||
data: { activityCode: 'ACT_2024_CHILDREN_DAY', componentCode: 'TONG_QU_LE_YUAN', pageNum: page, pageSize: 10 },
|
||||
success(res) {
|
||||
if (res.code === 200) {
|
||||
var str = '';
|
||||
if (res.data.records.length == 0 && page == 1) {
|
||||
str += `<li class="null"><div>暫無</div><div>暫無</div></li>`
|
||||
isLock = false;
|
||||
} else {
|
||||
str += `
|
||||
<li>
|
||||
<div>
|
||||
<p>${dateFormat(res.createTime, 'yyyy/MM/dd')}</p>
|
||||
<b>${dateFormat(res.createTime, 'hh/mm/ss')}</b>
|
||||
</div>
|
||||
<div>
|
||||
<p>${res.rewardName}</p>
|
||||
<i>${res.rewardNum}${rewardTypeFun(res.rewardType).unit}</i>
|
||||
</div>
|
||||
</li>`
|
||||
if (res.data.records.length == 0) {
|
||||
isLock = false;
|
||||
} else {
|
||||
isLock = true;
|
||||
}
|
||||
}
|
||||
$('.records_pub .records_pub_in ul').append(str);
|
||||
$('.records_pub').show();
|
||||
bodyScroolFun(true);
|
||||
} else {
|
||||
isLock = true;
|
||||
toastMsg(res.message)
|
||||
}
|
||||
hideLoading(layerIndex)
|
||||
},
|
||||
error(err) {
|
||||
isLock = true;
|
||||
hideLoading(layerIndex)
|
||||
toastMsg('網絡錯誤')
|
||||
}
|
||||
})
|
||||
}
|
||||
// 兌換記錄滾動
|
||||
$('.records_pub .records_pub_in ul').scroll(function () {
|
||||
let scrollTop = $(this).scrollTop()
|
||||
let scrollHeight = $('.records_pub .records_pub_in ul')[0].scrollHeight
|
||||
let ulHeight = $(this).innerHeight()
|
||||
if (scrollTop + ulHeight + 100 >= scrollHeight) {
|
||||
if (isLock) {
|
||||
// 請求下一頁
|
||||
page = page + 1;
|
||||
record(page)
|
||||
isLock = false;
|
||||
}
|
||||
}
|
||||
})
|
||||
// 打開記錄
|
||||
$('.game .records').click(function () {
|
||||
$('.records_pub .records_pub_in ul li').remove();
|
||||
page = 1;
|
||||
record(page);
|
||||
})
|
||||
// 關閉記錄
|
||||
$('.records_pub').click(function () {
|
||||
$('.records_pub').hide();
|
||||
bodyScroolFun(false);
|
||||
})
|
||||
// 逮捕按鈕
|
||||
$('.game .buts,.game .but,.game .result .playAgain,.game .result2 .playAgain').click(function () {
|
||||
draw();
|
||||
})
|
||||
// 活動信息接口
|
||||
function draw() {
|
||||
showLoading()
|
||||
networkRequest({
|
||||
type: 'get',
|
||||
url: urlPrefix + '/act/children/draw',
|
||||
success(res) {
|
||||
if (res.code === 200) {
|
||||
if (res.data.isWin) {
|
||||
// 中獎
|
||||
$('.game .result .tx_left').attr('src', res.data.avatar);
|
||||
$('.game .result .tx_right').attr('src', res.data.anchorAvatar);
|
||||
$('.game .result .tx_right').attr('uid', res.data.anchorRoomUid);
|
||||
$('.game .result .name_left').text('我');
|
||||
$('.game .result .name_Right').text(res.data.anchorNick);
|
||||
$('.game .result .id_right').text("ID:" + res.data.anchorErBanNo);
|
||||
$('.game .result .giftBoxs img').attr("src", res.data.rewardIcon);
|
||||
$('.game .result .giftName').text(res.data.rewardName);
|
||||
$('.game .result').show();
|
||||
} else {
|
||||
// 非中獎
|
||||
$('.game .result2 .tx_left').attr('src', res.data.avatar);
|
||||
$('.game .result2 .name_left').text('我');
|
||||
$('.game .result2 .giftBoxs img').attr("src", res.data.rewardIcon);
|
||||
$('.game .result2 .giftName').text(res.data.rewardName);
|
||||
$('.game .result2').show();
|
||||
}
|
||||
getInfo();
|
||||
} else {
|
||||
toastMsg(res.message)
|
||||
}
|
||||
hideLoading(layerIndex)
|
||||
},
|
||||
error(err) {
|
||||
hideLoading(layerIndex)
|
||||
toastMsg('網絡錯誤')
|
||||
}
|
||||
})
|
||||
}
|
||||
// 跳轉主播房間
|
||||
$('.game .result .tx_right').click(function () {
|
||||
var roomUid = $(this).attr('uid');
|
||||
if (browser.ios) {
|
||||
window.webkit.messageHandlers.openRoom.postMessage(roomUid);
|
||||
} else if (browser.android) {
|
||||
if (androidJsObj && typeof androidJsObj === 'object') {
|
||||
window.androidJsObj.openRoom(roomUid);
|
||||
}
|
||||
}
|
||||
})
|