联调鹊桥接口动效以及房间榜接口

This commit is contained in:
Dragon
2023-08-09 18:29:45 +08:00
parent 9c3a66300e
commit f26364ffef
9 changed files with 639 additions and 54 deletions

View File

@@ -34,7 +34,7 @@ body {
height: 10.9066666667rem;
background: url(../images/header.png) no-repeat;
background-size: 100% 100%;
margin: 0 auto -1.4rem;
margin: 0 auto -2.4rem;
position: relative;
}
.header .rule {
@@ -50,6 +50,21 @@ body {
background: url(../images/rule_bg.png) no-repeat;
background-size: 100% 100%;
}
.header .titleHeader {
position: absolute;
width: 9.0266666667rem;
height: 0.88rem;
line-height: 0.88rem;
text-align: center;
top: 7.7333333333rem;
left: 50%;
transform: translateX(-50%);
color: #FFFFFF;
font-size: 0.4rem;
font-weight: bold;
background: url(../images/titleHeader.png) no-repeat;
background-size: 100% 100%;
}
.betrothal {
width: 9.28rem;
@@ -198,6 +213,19 @@ body {
transform: translateX(-50%);
top: 0.2rem;
}
.page1 .magpieBridge .xiques {
width: 8.9066666667rem;
height: 6.5466666667rem;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 0.2rem;
}
.page1 .magpieBridge .xiques .xique {
width: 100%;
height: 100%;
overflow: hidden;
}
.page1 .magpieBridge .birdNum {
height: 0.4533333333rem;
line-height: 0.4533333333rem;
@@ -246,6 +274,56 @@ body {
background-size: 100% 100%;
text-shadow: 0px 0.0533333333rem 0.0266666667rem rgba(193, 64, 253, 0.67);
}
.page1 .magpieBridge .buting {
display: none;
width: 2.9066666667rem;
height: 1.16rem;
line-height: 1.0666666667rem;
text-align: center;
color: #FFFFFF;
font-size: 0.4rem;
font-weight: bold;
position: absolute;
bottom: 0.4533333333rem;
left: 50%;
transform: translateX(-50%);
background: url(../images/10.png) no-repeat;
background-size: 100% 100%;
text-shadow: 0px 0.0533333333rem 0.0266666667rem rgba(193, 64, 253, 0.67);
}
.page1 .magpieBridge .buterr {
display: none;
width: 2.9066666667rem;
height: 1.16rem;
line-height: 1.0666666667rem;
text-align: center;
color: #FFFFFF;
font-size: 0.4rem;
font-weight: bold;
position: absolute;
bottom: 0.4533333333rem;
left: 50%;
transform: translateX(-50%);
background: url(../images/10.png) no-repeat;
background-size: 100% 100%;
text-shadow: 0px 0.0533333333rem 0.0266666667rem rgba(193, 64, 253, 0.67);
}
.page1 .magpieBridge .butout {
display: none;
width: 2.9066666667rem;
height: 1.16rem;
line-height: 1.0666666667rem;
text-align: center;
color: #FFFFFF;
font-size: 0.4rem;
font-weight: bold;
position: absolute;
bottom: 0.4533333333rem;
left: 50%;
transform: translateX(-50%);
background: url(../images/butOut.png) no-repeat;
background-size: 100% 100%;
}
.page1 .magpieBridge .text {
width: 6.8rem;
text-align: center;
@@ -269,7 +347,7 @@ body {
background-size: 100% 100%;
}
.page1 .magpieBridge .line .line_in {
width: 10%;
width: 0%;
height: 100%;
background: linear-gradient(0deg, #F772D1, #A639D1);
border-radius: 0.224rem;
@@ -487,7 +565,7 @@ body {
border-radius: 0.1866666667rem;
}
.page1 .task .box1 .task3 .line .line_in {
width: 10%;
width: 0%;
height: 100%;
position: absolute;
left: 0;
@@ -868,13 +946,14 @@ body {
top: -0.5rem;
}
.page3 .no1 p {
width: 100%;
width: 76%;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
position: absolute;
left: 0;
left: 50%;
transform: translateX(-50%);
top: 1.56rem;
color: #fff;
font-size: 0.32rem;
@@ -929,13 +1008,14 @@ body {
top: -0.55rem;
}
.page3 .no2 p {
width: 100%;
width: 76%;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
position: absolute;
left: 0;
left: 50%;
transform: translateX(-50%);
top: 1.2933333333rem;
color: #fff;
font-size: 0.32rem;
@@ -990,13 +1070,14 @@ body {
top: -0.55rem;
}
.page3 .no3 p {
width: 100%;
width: 76%;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
position: absolute;
left: 0;
left: 50%;
transform: translateX(-50%);
top: 1.2933333333rem;
color: #fff;
font-size: 0.32rem;
@@ -1025,7 +1106,8 @@ body {
}
.page3 ul {
width: 9.9066666667rem;
margin: 5rem auto 0;
margin: 6rem auto 1.4rem;
min-height: 1rem;
}
.page3 ul li {
width: 100%;
@@ -1089,6 +1171,71 @@ body {
height: 0.28rem;
margin-right: 0.1066666667rem;
}
.page3 .my {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 1.96rem;
background: url(../images/myBg.png) no-repeat;
background-size: 100% 100%;
box-sizing: border-box;
padding: 0 0.64rem 0 0.2666666667rem;
overflow: hidden;
z-index: 9;
}
.page3 .my .num {
width: 1.6rem;
text-align: center;
color: #FFFFFF;
font-size: 0.48rem;
font-weight: bold;
float: left;
margin-right: 0.2933333333rem;
height: 100%;
line-height: 1.96rem;
}
.page3 .my .tx {
width: 1.2666666667rem;
height: 1.2666666667rem;
border-radius: 50%;
background: #fff;
margin-right: 0.3333333333rem;
margin-top: 0.3466666667rem;
float: left;
}
.page3 .my .name {
width: 2.3rem;
height: 100%;
line-height: 1.96rem;
color: #FFFFFF;
font-size: 0.32rem;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
float: left;
}
.page3 .my .score {
min-width: 1.6133333333rem;
width: auto;
height: 0.5333333333rem;
line-height: 0.2666666667rem;
box-sizing: border-box;
padding: 0.1333333333rem 0.2133333333rem;
border-radius: 0.5333333333rem;
background: linear-gradient(90deg, #7A1183, #4F279F);
white-space: nowrap;
font-size: 0.32rem;
color: #FFFFFF;
vertical-align: middle;
float: right;
margin-top: 0.7066666667rem;
}
.page3 .my .score .loveIcon {
width: 0.3333333333rem;
height: 0.28rem;
margin-right: 0.1066666667rem;
}
.page4 {
display: none;
@@ -1270,13 +1417,14 @@ body {
top: -0.5rem;
}
.page4 .no1 p {
width: 100%;
width: 76%;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
position: absolute;
left: 0;
left: 50%;
transform: translateX(-50%);
top: 1.56rem;
color: #fff;
font-size: 0.32rem;
@@ -1331,13 +1479,14 @@ body {
top: -0.55rem;
}
.page4 .no2 p {
width: 100%;
width: 76%;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
position: absolute;
left: 0;
left: 50%;
transform: translateX(-50%);
top: 1.2933333333rem;
color: #fff;
font-size: 0.32rem;
@@ -1392,13 +1541,14 @@ body {
top: -0.55rem;
}
.page4 .no3 p {
width: 100%;
width: 76%;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
position: absolute;
left: 0;
left: 50%;
transform: translateX(-50%);
top: 1.2933333333rem;
color: #fff;
font-size: 0.32rem;
@@ -1427,7 +1577,8 @@ body {
}
.page4 ul {
width: 9.9066666667rem;
margin: 5rem auto 2rem;
margin: 6rem auto 2rem;
min-height: 1rem;
}
.page4 ul li {
width: 100%;

View File

@@ -43,7 +43,7 @@ body {
height: px2rem(818, );
background: url(../images/header.png) no-repeat;
background-size: 100% 100%;
margin: 0 auto -1.4rem;
margin: 0 auto -2.4rem;
position: relative;
.rule {
@@ -59,6 +59,22 @@ body {
background: url(../images/rule_bg.png) no-repeat;
background-size: 100% 100%;
}
.titleHeader {
position: absolute;
width: px2rem(677, );
height: px2rem(66, );
line-height: px2rem(66, );
text-align: center;
top: px2rem(580, );
left: 50%;
transform: translateX(-50%);
color: #FFFFFF;
font-size: px2rem(30, );
font-weight: bold;
background: url(../images/titleHeader.png) no-repeat;
background-size: 100% 100%;
}
}
.betrothal {
@@ -229,6 +245,21 @@ body {
top: px2rem(15, );
}
.xiques {
width: px2rem(668, );
height: px2rem(491, );
position: absolute;
left: 50%;
transform: translateX(-50%);
top: px2rem(15, );
.xique {
width: 100%;
height: 100%;
overflow: hidden;
}
}
.birdNum {
height: px2rem(34, );
line-height: px2rem(34, );
@@ -282,6 +313,60 @@ body {
text-shadow: 0px px2rem(4, ) px2rem(2, ) rgba(193, 64, 253, 0.67);
}
.buting {
display: none;
width: px2rem(218, );
height: px2rem(87, );
line-height: px2rem(80, );
text-align: center;
color: #FFFFFF;
font-size: px2rem(30, );
font-weight: bold;
position: absolute;
bottom: px2rem(34, );
left: 50%;
transform: translateX(-50%);
background: url(../images/10.png) no-repeat;
background-size: 100% 100%;
text-shadow: 0px px2rem(4, ) px2rem(2, ) rgba(193, 64, 253, 0.67);
}
.buterr {
display: none;
width: px2rem(218, );
height: px2rem(87, );
line-height: px2rem(80, );
text-align: center;
color: #FFFFFF;
font-size: px2rem(30, );
font-weight: bold;
position: absolute;
bottom: px2rem(34, );
left: 50%;
transform: translateX(-50%);
background: url(../images/10.png) no-repeat;
background-size: 100% 100%;
text-shadow: 0px px2rem(4, ) px2rem(2, ) rgba(193, 64, 253, 0.67);
}
.butout {
display: none;
width: px2rem(218, );
height: px2rem(87, );
line-height: px2rem(80, );
text-align: center;
color: #FFFFFF;
font-size: px2rem(30, );
font-weight: bold;
position: absolute;
bottom: px2rem(34, );
left: 50%;
transform: translateX(-50%);
background: url(../images/butOut.png) no-repeat;
background-size: 100% 100%;
// text-shadow: 0px px2rem(4, ) px2rem(2, ) rgba(193, 64, 253, 0.67);
}
.text {
width: px2rem(510, );
text-align: center;
@@ -306,7 +391,7 @@ body {
background-size: 100% 100%;
.line_in {
width: 10%;
width: 0%;
height: 100%;
background: linear-gradient(0deg, #F772D1, #A639D1);
border-radius: px2rem(16.8, );
@@ -549,7 +634,7 @@ body {
border-radius: px2rem(14, );
.line_in {
width: 10%;
width: 0%;
height: 100%;
position: absolute;
left: 0;
@@ -988,13 +1073,14 @@ body {
}
p {
width: 100%;
width: 76%;
text-align: center;
overflow: hidden; //不换行
white-space: nowrap; //不换行
text-overflow: ellipsis; //不换行
position: absolute;
left: 0;
left: 50%;
transform: translateX(-50%);
top: px2rem(117, );
color: #fff;
font-size: px2rem(24, );
@@ -1055,13 +1141,14 @@ body {
}
p {
width: 100%;
width: 76%;
text-align: center;
overflow: hidden; //不换行
white-space: nowrap; //不换行
text-overflow: ellipsis; //不换行
position: absolute;
left: 0;
left: 50%;
transform: translateX(-50%);
top: px2rem(97, );
color: #fff;
font-size: px2rem(24, );
@@ -1122,13 +1209,14 @@ body {
}
p {
width: 100%;
width: 76%;
text-align: center;
overflow: hidden; //不换行
white-space: nowrap; //不换行
text-overflow: ellipsis; //不换行
position: absolute;
left: 0;
left: 50%;
transform: translateX(-50%);
top: px2rem(97, );
color: #fff;
font-size: px2rem(24, );
@@ -1161,7 +1249,8 @@ body {
ul {
width: px2rem(743, );
margin: 5rem auto 0;
margin: 6rem auto 1.4rem;
min-height: 1rem;
li {
width: 100%;
@@ -1231,6 +1320,77 @@ body {
}
}
}
.my {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: px2rem(147, );
background: url(../images/myBg.png) no-repeat;
background-size: 100% 100%;
box-sizing: border-box;
padding: 0 px2rem(48, ) 0 px2rem(20, );
overflow: hidden;
z-index: 9;
.num {
width: 1.6rem;
text-align: center;
color: #FFFFFF;
font-size: px2rem(36, );
font-weight: bold;
float: left;
margin-right: px2rem(22, );
height: 100%;
line-height: px2rem(147, );
}
.tx {
width: px2rem(95, );
height: px2rem(95, );
border-radius: 50%;
background: #fff;
margin-right: px2rem(25, );
margin-top: px2rem(26, );
float: left;
}
.name {
width: 2.3rem;
height: 100%;
line-height: px2rem(147, );
color: #FFFFFF;
font-size: px2rem(24, );
overflow: hidden; //不换行
white-space: nowrap; //不换行
text-overflow: ellipsis; //不换行
float: left;
}
.score {
min-width: px2rem(121, );
width: auto;
height: px2rem(40, );
line-height: px2rem(20, );
box-sizing: border-box;
padding: px2rem(10, ) px2rem(16, );
border-radius: px2rem(40, );
background: linear-gradient(90deg, #7A1183, #4F279F);
white-space: nowrap;
font-size: px2rem(24, );
color: #FFFFFF;
vertical-align: middle;
float: right;
margin-top: px2rem(53, );
.loveIcon {
width: px2rem(25, );
height: px2rem(21, );
margin-right: px2rem(8, );
}
}
}
}
.page4 {
@@ -1435,13 +1595,14 @@ body {
}
p {
width: 100%;
width: 76%;
text-align: center;
overflow: hidden; //不换行
white-space: nowrap; //不换行
text-overflow: ellipsis; //不换行
position: absolute;
left: 0;
left: 50%;
transform: translateX(-50%);
top: px2rem(117, );
color: #fff;
font-size: px2rem(24, );
@@ -1502,13 +1663,14 @@ body {
}
p {
width: 100%;
width: 76%;
text-align: center;
overflow: hidden; //不换行
white-space: nowrap; //不换行
text-overflow: ellipsis; //不换行
position: absolute;
left: 0;
left: 50%;
transform: translateX(-50%);
top: px2rem(97, );
color: #fff;
font-size: px2rem(24, );
@@ -1569,13 +1731,14 @@ body {
}
p {
width: 100%;
width: 76%;
text-align: center;
overflow: hidden; //不换行
white-space: nowrap; //不换行
text-overflow: ellipsis; //不换行
position: absolute;
left: 0;
left: 50%;
transform: translateX(-50%);
top: px2rem(97, );
color: #fff;
font-size: px2rem(24, );
@@ -1608,7 +1771,8 @@ body {
ul {
width: px2rem(743, );
margin: 5rem auto 2rem;
margin: 6rem auto 2rem;
min-height: 1rem;
li {
width: 100%;

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Binary file not shown.

View File

@@ -19,6 +19,8 @@
<!-- header -->
<div class="header">
<div class="rule">活動規則</div>
<!-- 时间 -->
<div class="titleHeader"></div>
</div>
<!-- 定情信物 -->
<div class="betrothal">
@@ -105,6 +107,8 @@
<div class="magpieBridge">
<!-- 背景鹊桥图 -->
<img src="./images/magpieBridgeBg.png" alt="" class="magpieBridgeBg">
<!-- 喜鹊动效 -->
<div class="xiques"><div class="xique"></div></div>
<!-- 我的喜鹊 -->
<p class="birdNum">
<img src="./images/bird.png" alt="" class="bird">
@@ -114,6 +118,12 @@
<div class="but1">投放喜鹊*1</div>
<!-- 投放喜鹊*10 -->
<div class="but10">投放喜鹊*10</div>
<!-- 领取奖励 -->
<div class="buting">领取奖励</div>
<!-- 领取失败 -->
<div class="buterr">领取奖励</div>
<!-- 已领取 -->
<div class="butout">已领取</div>
<!-- 文案展示 -->
<p class="text">將喜鵲投入鵲橋,拉近牛郎和織女的距離<br>
鵲橋相會後,參與搭建鵲橋的用戶可領取活動獎勵</p>
@@ -303,6 +313,16 @@
</div>
</li>
</ul>
<!-- 自己榜单 -->
<div class="my">
<div class="num">4</div>
<img src="./images/logo.png" alt="" class="tx">
<div class="name">虚位以待</div>
<div class="score">
<img src="./images/loveIcon.png" alt="" class="loveIcon">
<b>情緣值XXX</b>
</div>
</div>
<!-- 规则弹窗 -->
<div class="roomRule">
<img src="./images/roomRule.png" alt="" class="roomRule_in">
@@ -412,7 +432,7 @@
<!-- 活动结束弹窗 -->
<div class="endActivity">
<div class="endActivity_in">
<img src="./images/endActivitybut.png" alt="" class="but">
<img src="./images/endActivitybut.png" alt="" class="but">
</div>
</div>
</body>

View File

@@ -26,6 +26,10 @@ const toastMsg = (content = '操作完成', time = 2) => {
skin: 'msg'
})
}
var xiqueNum = 0;//当前剩余喜鹊数量
var roomUid = 0;//房间uid
var giftId = 0;//默认礼物id
var xiqueBut = true;//投放喜鹊锁
// 初始化函數
$(function () {
setTimeout(function () {
@@ -48,19 +52,67 @@ $(function () {
}
})
swiperFun();
getConfig();
getRecommendRoom();
}, 100)
})
})
// 接口
function get () {
// 初始化接口
function getConfig () {
showLoading()
networkRequest({
type: 'GET',
url: urlPrefix + '/seekElfin/product/list',
url: urlPrefix + '/act/2023Qixi/xique/getConfig',
data: {},
success (res) {
if (res.code === 200) {
// 处理活动时间
$('.header .titleHeader').text(`活動時間:${dateFormat(res.data.startTime, 'yyyy年MM月dd日')}-${dateFormat(res.data.endTime, 'yyyy年MM月dd日')}`)
// 当前用户喜鹊
xiqueNum = res.data.xiqueNum
$('.page1 .magpieBridge .birdNum b').text(`我的喜鵲: ${res.data.xiqueNum}`)
// 处理当前喜鹊进度状态值
console.log(res.data.serverCurXiqueNum);
console.log(res.data.serverMaxXiqueNum);
var curXiqueNums = res.data.serverCurXiqueNum / res.data.serverMaxXiqueNum * 100;
console.log(curXiqueNums);
$('.page1 .magpieBridge .line .line_in').css('width', curXiqueNums >= 100 ? '100%' : `${curXiqueNums}%`);
// 处理领取喜鹊头饰按钮状态
if (res.data.devotedBtnStatus == 0) {//投入按钮状态0=可投入1=可领取2=不能领取,-1=已领取)
$('.page1 .magpieBridge .buting').hide();
$('.page1 .magpieBridge .buterr').hide();
$('.page1 .magpieBridge .butout').hide();
$('.page1 .magpieBridge .but1').show();
$('.page1 .magpieBridge .but10').show();
} else if (res.data.devotedBtnStatus == 1) {//投入按钮状态0=可投入1=可领取2=不能领取,-1=已领取)
$('.page1 .magpieBridge .buting').show();
$('.page1 .magpieBridge .but1').hide();
$('.page1 .magpieBridge .but10').hide();
} else if (res.data.devotedBtnStatus = 2) {
$('.page1 .magpieBridge .buterr').show();
$('.page1 .magpieBridge .but1').hide();
$('.page1 .magpieBridge .but10').hide();
} else if (res.data.devotedBtnStatus < 0) {
$('.page1 .magpieBridge .butout').show();
$('.page1 .magpieBridge .but1').hide();
$('.page1 .magpieBridge .but10').hide();
}
// 处理任务状态
res.data.dailyTaskList.forEach((res, i) => {
$(`.page1 .task .box1 .task${i + 1} .p2`).text(`獎勵:喜鵲*${res.xiqueNum}`)
if (res.btnStatus == 1) {//已完成
$(`.page1 .task .box1 .task${i + 1} .but`).addClass('out');
$(`.page1 .task .box1 .task${i + 1} .but`).text('已完成');
$(`.page1 .task .box1 .task${i + 1} .but`).attr('click', 0);
}
if (i == 1) {
$(`.page1 .task .box1 .task2 .p1`).text(`任意房間發送彈幕(${res.cur}/${res.need})`)
}
if (i == 2) {
var percentage = res.cur / res.need * 100;
$('.page1 .task .box1 .task3 .line .line_in').css('width', percentage >= 100 ? '100%' : `${percentage}%`);
}
});
} else {
toastMsg(res.message)
}
@@ -72,18 +124,26 @@ function get () {
}
})
}
// 播放svg
function svgaFun () {
player1 = new SVGA.Player('.star_in');
parser1 = new SVGA.Parser('.star_in');
parser1.load('./images/star.svga', function (videoItem) {
player1.loops = 1;
player1.clearsAfterStop = false;
player1.setVideoItem(videoItem);
player1.startAnimation();
player1.setContentMode('AspectFill')
player1.onFinished(() => {
})
// 获取房间接口
function getRecommendRoom () {
showLoading()
networkRequest({
type: 'GEt',
url: urlPrefix + '/tab/home/one',
data: { pub_ticket: pubInfo.ticket, pub_uid: pubInfo.uid },
success (res) {
if (res.code === 200) {
roomUid = res.data;
hideLoading(layerIndex)
} else {
hideLoading(layerIndex)
toastMsg(res.message)
}
},
error (err) {
hideLoading(layerIndex)
toastMsg('網絡錯誤,請退出重進')
}
})
}
// 定情信物礼物轮播
@@ -107,7 +167,69 @@ $('.tabs div').click(function () {
$('.page3').hide();
$('.page4').hide();
$(`.page${i}`).show();
if (i == 3) {
getRoomRank();
}
})
// 房间榜单接口
function getRoomRank () {
$('.page3 ul li').remove();
showLoading()
networkRequest({
type: 'GET',
url: urlPrefix + '/act/2023Qixi/roomRank/getRank',
data: {},
success (res) {
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) => {
$(`.page3 .no${index + 1} .tx`).attr('src', res.avatar);
$(`.page3 .no${index + 1} p`).text(res.nick);
$(`.page3 .no${index + 1} b`).text(`情緣值:${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="name">${res.nick}</div>
<div class="score">
<img src="./images/loveIcon.png" alt="" class="loveIcon">
<b>情緣值:${unitProcessing(res.score, 10000, 1, 'w')}</b>
</div>
</li>
`
})
$('.page3 ul').append(str);
// 处理自己榜单
var meRank = res.data.meRank;
$('.page3 .my .num').text(meRank.ranking == 0 ? '未上榜' : meRank.ranking);
$('.page3 .my .tx').attr('src', meRank.avatar);
$('.page3 .my .name').text(meRank.nick);
$('.page3 .my .score b').text(`情緣值:${unitProcessing(meRank.score, 10000, 1, 'w')}`);
} else {
toastMsg(res.message)
}
hideLoading(layerIndex)
},
error (err) {
hideLoading(layerIndex)
toastMsg('網絡錯誤,請退出重進')
}
})
}
// 首页任务切换
$('.page1 .task .tab div').click(function () {
var i = $(this).index() + 1;
@@ -183,4 +305,132 @@ $('.page4 .timeList div').click(function () {
$('.endActivity .endActivity_in .but').click(function () {
$('.endActivity').hide();
bodyScroolFun(false);
})
//领取全服喜鹊奖励
function getXiqueReward () {
showLoading()
networkRequest({
type: 'GET',
url: urlPrefix + '/act/2023Qixi/xique/getXiqueReward',
data: {},
success (res) {
if (res.code === 200) {
getConfig();
toastMsg('领取成功');
} else {
toastMsg(res.message)
}
hideLoading(layerIndex)
},
error (err) {
hideLoading(layerIndex)
toastMsg('網絡錯誤,請退出重進')
}
})
}
// 领取喜鹊奖励按钮
$('.page1 .magpieBridge .buting').click(function () {
getXiqueReward();
})
// 领取喜鹊未参与按钮
$('.page1 .magpieBridge .buterr').click(function () {
toastMsg('您未参加搭建鹊桥活动,无法领取');
})
// 投放喜鹊接口
function devotedXique (num) {
// showLoading()
networkRequest({
type: 'GET',
url: urlPrefix + '/act/2023Qixi/xique/devotedXique',
data: { num },
success (res) {
if (res.code === 200) {
getConfig();
toastMsg('投放成功')
xiqueBut = true;
} else {
toastMsg(res.message)
xiqueBut = true;
}
hideLoading(layerIndex)
xiqueBut = true;
},
error (err) {
xiqueBut = true;
hideLoading(layerIndex)
toastMsg('網絡錯誤,請退出重進')
}
})
}
// 播放喜鹊svg
function svgaFun () {
player1 = new SVGA.Player('.xique');
parser1 = new SVGA.Parser('.xique');
parser1.load('./images/xique.svga', function (videoItem) {
player1.loops = 1
player1.clearsAfterStop = false;
player1.setVideoItem(videoItem);
player1.startAnimation();
player1.setContentMode('AspectFill')
player1.onFinished(() => {
// $('.svga').hide()
})
})
}
// 投放按钮
$('.page1 .magpieBridge .but1,.page1 .magpieBridge .but10').click(function () {
var clas = $(this).attr('class')
if (clas == 'but1') {
if (xiqueNum < 1) {
toastMsg('喜鹊数量不足,参加任务获得吧~')
return
}
if (xiqueBut) {
xiqueBut = false;
svgaFun();
setTimeout(function () {
devotedXique(1);
}, 2000)
}
} else {
if (xiqueNum < 10) {
toastMsg('喜鹊数量不足,参加任务获得吧~')
return
}
if (xiqueBut) {
xiqueBut = false;
svgaFun();
setTimeout(function () {
devotedXique(10);
}, 2000)
}
// devotedXique(10);
}
})
// 去完成任务2按钮
$('.page1 .task .box1 .task2 .but').click(function () {
var click = $(this).attr('click');
if (click != 0) {
if (browser.ios) {
window.webkit.messageHandlers.openRoom.postMessage(roomUid);
} else if (browser.android) {
if (androidJsObj && typeof androidJsObj === 'object') {
window.androidJsObj.openRoom(roomUid);
}
}
}
})
// 去完成任务3按钮
$('.page1 .task .box1 .task3 .but').click(function () {
var click = $(this).attr('click');
if (click != 0) {
if (browser.ios) {
window.webkit.messageHandlers.openRoomForGiftId.postMessage(JSON.stringify({ uid: roomUid, giftId: giftId }))
} else if (browser.android) {
if (androidJsObj && typeof androidJsObj === 'object') {
window.androidJsObj.openRoomForGiftId(roomUid, giftId);
}
}
}
})

View File

@@ -544,8 +544,8 @@ function getInfoFromClient () {
} else {
// 非app环境调试参数
pubInfo.uid = sessionStorage.getItem("uid") ? sessionStorage.getItem("uid") : '';
// pubInfo.ticket = sessionStorage.getItem("ticket") ? sessionStorage.getItem("ticket") : '';
pubInfo.h5_token = sessionStorage.getItem("ticket") ? sessionStorage.getItem("ticket") : '';
pubInfo.ticket = sessionStorage.getItem("ticket") ? sessionStorage.getItem("ticket") : '';
// pubInfo.h5_token = sessionStorage.getItem("ticket") ? sessionStorage.getItem("ticket") : '';
pubInfo.deviceId = "0";
pubInfo.deviceInfo = {
app: 'peko',
@@ -775,7 +775,7 @@ function networkRequest (reqObj = {}, type) {
pubHeader.channel = pubInfo.deviceInfo.channel || ''
pubHeader.client = 'h5'
pubHeader.pub_uid = window.location.pathname.match(/login.html/) ? 0 : pubInfo.uid
if (browser.app) {
if (true) {
pubHeader.pub_ticket = pubInfo.ticket
} else {
pubHeader.h5_token =sessionStorage.getItem("ticket") ? sessionStorage.getItem("ticket") : '';