修复bug
This commit is contained in:
@@ -222,8 +222,8 @@ body {
|
||||
z-index: 2;
|
||||
}
|
||||
.page1 .magpieBridge .rightRen {
|
||||
width: 1.2266666667rem;
|
||||
height: 2.04rem;
|
||||
width: 1.7333333333rem;
|
||||
height: 2.0133333333rem;
|
||||
position: absolute;
|
||||
top: 2.0133333333rem;
|
||||
right: 10%;
|
||||
@@ -784,6 +784,22 @@ body {
|
||||
transform: translateX(-48%);
|
||||
top: 0.9866666667rem;
|
||||
}
|
||||
.page2 .blessingTree .openLantern .box .typemp {
|
||||
width: 1.0266666667rem;
|
||||
height: 0.4rem;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-48%);
|
||||
top: 1.33rem;
|
||||
}
|
||||
.page2 .blessingTree .openLantern .box .typeqp {
|
||||
width: 1rem;
|
||||
height: 0.8rem;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-48%);
|
||||
top: 1.0933333333rem;
|
||||
}
|
||||
.page2 .blessingTree .openLantern .box p {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
|
@@ -255,8 +255,8 @@ body {
|
||||
}
|
||||
|
||||
.rightRen {
|
||||
width: px2rem(92, );
|
||||
height: px2rem(153, );
|
||||
width: px2rem(130, );
|
||||
height: px2rem(151, );
|
||||
position: absolute;
|
||||
top: px2rem(151, );
|
||||
right: 10%;
|
||||
@@ -886,6 +886,24 @@ body {
|
||||
top: px2rem(74, );
|
||||
}
|
||||
|
||||
.typemp {
|
||||
width: px2rem(77, );
|
||||
height: px2rem(30, );
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-48%);
|
||||
top: 1.33rem;
|
||||
}
|
||||
|
||||
.typeqp {
|
||||
width: 1rem;
|
||||
height: 0.8rem;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-48%);
|
||||
top: px2rem(82, );
|
||||
}
|
||||
|
||||
p {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
|
@@ -373,7 +373,7 @@
|
||||
<div></div>
|
||||
</div>
|
||||
<!-- 禮物值說明 -->
|
||||
<div class="giftVal">收到普通禮物1鉆石=1甜蜜值,七夕限定禮物1鉆石=3甜蜜值</div>
|
||||
<div class="giftVal">收到普通禮物10鉆石=1甜蜜值,七夕限定禮物10鉆石=3甜蜜值</div>
|
||||
<!-- 日榜時間選擇 -->
|
||||
<div class="timeList">
|
||||
<div class=""></div>
|
||||
|
@@ -41,6 +41,7 @@ var page = 1;//頁碼
|
||||
var pageSizeLack = true;// 下拉更多鎖
|
||||
var lack = true;// 抽獎鎖
|
||||
var timeEndLock = true;
|
||||
var lock = true;
|
||||
// 初始化函數
|
||||
$(function () {
|
||||
setTimeout(function () {
|
||||
@@ -104,13 +105,13 @@ function getConfig () {
|
||||
if (curXiqueNums < 20) {
|
||||
$('.page1 .magpieBridge .rightRen').css('right', '10%');
|
||||
} else if (curXiqueNums >= 20 && curXiqueNums < 40) {
|
||||
$('.page1 .magpieBridge .rightRen').css('right', '16.75%');
|
||||
$('.page1 .magpieBridge .rightRen').css('right', '13.75%');
|
||||
} else if (curXiqueNums >= 40 && curXiqueNums < 60) {
|
||||
$('.page1 .magpieBridge .rightRen').css('right', '23.5%');
|
||||
$('.page1 .magpieBridge .rightRen').css('right', '20.5%');
|
||||
} else if (curXiqueNums >= 60 && curXiqueNums < 80) {
|
||||
$('.page1 .magpieBridge .rightRen').css('right', '30.25%');
|
||||
$('.page1 .magpieBridge .rightRen').css('right', '27.25%');
|
||||
} else if (curXiqueNums >= 100) {
|
||||
$('.page1 .magpieBridge .rightRen').css('right', '37%');
|
||||
$('.page1 .magpieBridge .rightRen').css('right', '34%');
|
||||
}
|
||||
// 處理領取喜鵲頭飾按鈕狀態
|
||||
if (res.data.devotedBtnStatus == 0) {//投入按鈕狀態(0=可投入,1=可領取,2=不能領取,-1=已領取)
|
||||
@@ -123,7 +124,7 @@ function getConfig () {
|
||||
$('.page1 .magpieBridge .buting').show();
|
||||
$('.page1 .magpieBridge .but1').hide();
|
||||
$('.page1 .magpieBridge .but10').hide();
|
||||
} else if (res.data.devotedBtnStatus = 2) {
|
||||
} else if (res.data.devotedBtnStatus == 2) {
|
||||
$('.page1 .magpieBridge .buterr').show();
|
||||
$('.page1 .magpieBridge .but1').hide();
|
||||
$('.page1 .magpieBridge .but10').hide();
|
||||
@@ -199,7 +200,14 @@ function redLineGetConfig () {
|
||||
if (res.able) {
|
||||
$(`.page2 .blessingTree .lantern${i + 1}`).removeClass('openLantern');
|
||||
} else {
|
||||
console.log(res.name);
|
||||
$(`.page2 .blessingTree .lantern${i + 1} img`).removeClass('typemp').removeClass('typeqp');
|
||||
if (res.type == 2) {
|
||||
$(`.page2 .blessingTree .lantern${i + 1} img`).addClass("typemp");
|
||||
} else if (res.type == 3) {
|
||||
$(`.page2 .blessingTree .lantern${i + 1} img`).addClass("typeqp");
|
||||
} else {
|
||||
$(`.page2 .blessingTree .lantern${i + 1} img`).removeClass('typemp').removeClass('typeqp');
|
||||
}
|
||||
$(`.page2 .blessingTree .lantern${i + 1} img`).attr('src', res.pic);
|
||||
$(`.page2 .blessingTree .lantern${i + 1} .box p`).text(res.name);
|
||||
$(`.page2 .blessingTree .lantern${i + 1} .box b`).text(`${res.num}${res.unit}`);
|
||||
@@ -208,6 +216,7 @@ function redLineGetConfig () {
|
||||
})
|
||||
hideLoading(layerIndex)
|
||||
} else {
|
||||
lack = true;
|
||||
hideLoading(layerIndex)
|
||||
toastMsg(res.message)
|
||||
}
|
||||
@@ -228,22 +237,10 @@ function redLineDraw (id) {
|
||||
success (res) {
|
||||
if (res.code === 200) {
|
||||
id = id == null ? res.data : id;
|
||||
if (id == 1) {
|
||||
blessingTreeSvgaFun1();
|
||||
} else if (id == 2) {
|
||||
blessingTreeSvgaFun2();
|
||||
} else if (id == 3) {
|
||||
blessingTreeSvgaFun3();
|
||||
} else if (id == 4) {
|
||||
blessingTreeSvgaFun4();
|
||||
}
|
||||
setTimeout(function () {
|
||||
lock = true;
|
||||
redLineGetConfig();
|
||||
}, 500);
|
||||
svga1Fun(id);
|
||||
hideLoading(layerIndex)
|
||||
} else {
|
||||
lock = true;
|
||||
lack = true;
|
||||
hideLoading(layerIndex)
|
||||
toastMsg(res.message)
|
||||
}
|
||||
@@ -259,7 +256,7 @@ function redLineDraw (id) {
|
||||
$('.page2 .blessingTree .but').click(function () {
|
||||
if (redLineNum > 0) {
|
||||
if (lack) {
|
||||
lock = false;
|
||||
lack = false;
|
||||
redLineDraw(null);
|
||||
}
|
||||
} else {
|
||||
@@ -269,94 +266,59 @@ $('.page2 .blessingTree .but').click(function () {
|
||||
// 指定抽獎
|
||||
$('.page2 .blessingTree .lantern').click(function () {
|
||||
var id = $(this).attr('id');
|
||||
var openLantern = $(this).attr('class');
|
||||
if (redLineNum > 0) {
|
||||
if (openLantern.indexOf('openLantern') == -1) {
|
||||
if (lack) {
|
||||
lock = false;
|
||||
lack = false;
|
||||
redLineDraw(id);
|
||||
}
|
||||
} else {
|
||||
toastMsg('福袋已經完成祈願,換一個福袋再祈願吧');
|
||||
}
|
||||
} else {
|
||||
toastMsg('紅繩數量不足,可參與投放喜鵲活動獲得')
|
||||
}
|
||||
})
|
||||
// 播放喜鵲svg
|
||||
function blessingTreeSvgaFun1 () {
|
||||
$('.page2 .blessingTree .blessingTreeSvga1').show();
|
||||
var player1;
|
||||
var parser1;
|
||||
var player2;
|
||||
var parser2;
|
||||
var player3;
|
||||
var parser3;
|
||||
var player4;
|
||||
var parser4;
|
||||
function svga1Fun (id) {
|
||||
var parser = id == 1 ? parser1 : id == 2 ? parser2 : id == 3 ? parser3 : parser4;
|
||||
var player = id == 1 ? player1 : id == 2 ? player2 : id == 3 ? player3 : player4;
|
||||
$(`.page2 .blessingTree .blessingTreeSvga${id}`).show();
|
||||
setTimeout(function () {
|
||||
$('.page2 .blessingTree .lantern1').hide();
|
||||
}, 100)
|
||||
$(`.page2 .blessingTree .lantern${id}`).hide();
|
||||
}, 200)
|
||||
parser.load('./images/blessingTree.svga', function (videoItem) {
|
||||
player.loops = 1;
|
||||
player.setVideoItem(videoItem);
|
||||
player.startAnimation();
|
||||
player.setContentMode('AspectFill')
|
||||
player.onFinished(() => {
|
||||
$(`.page2 .blessingTree .lantern${id}`).show();
|
||||
$(`.page2 .blessingTree .blessingTreeSvga${id}`).hide();
|
||||
lack = true;
|
||||
redLineGetConfig();
|
||||
})
|
||||
})
|
||||
}
|
||||
// 播放喜鵲svg
|
||||
blessingTreeSvgaFun1();
|
||||
function blessingTreeSvgaFun1 () {
|
||||
player1 = new SVGA.Player('.blessingTreeSvgaActive1');
|
||||
parser1 = new SVGA.Parser('.blessingTreeSvgaActive1');
|
||||
parser1.load('./images/blessingTree.svga', function (videoItem) {
|
||||
player1.loops = 1
|
||||
player1.clearsAfterStop = false;
|
||||
player1.setVideoItem(videoItem);
|
||||
player1.startAnimation();
|
||||
player1.setContentMode('AspectFill')
|
||||
player1.onFinished(() => {
|
||||
$('.page2 .blessingTree .lantern1').show();
|
||||
$('.page2 .blessingTree .blessingTreeSvga1').hide();
|
||||
})
|
||||
})
|
||||
}
|
||||
// 播放喜鵲svg
|
||||
function blessingTreeSvgaFun2 () {
|
||||
$('.page2 .blessingTree .blessingTreeSvga2').show();
|
||||
setTimeout(function () {
|
||||
$('.page2 .blessingTree .lantern2').hide();
|
||||
}, 100)
|
||||
player2 = new SVGA.Player('.blessingTreeSvgaActive2');
|
||||
parser2 = new SVGA.Parser('.blessingTreeSvgaActive2');
|
||||
parser2.load('./images/blessingTree.svga', function (videoItem) {
|
||||
player2.loops = 1
|
||||
player2.clearsAfterStop = false;
|
||||
player2.setVideoItem(videoItem);
|
||||
player2.startAnimation();
|
||||
player2.setContentMode('AspectFill')
|
||||
player2.onFinished(() => {
|
||||
$('.page2 .blessingTree .lantern2').show();
|
||||
$('.page2 .blessingTree .blessingTreeSvga2').hide();
|
||||
})
|
||||
})
|
||||
}
|
||||
// 播放喜鵲svg
|
||||
function blessingTreeSvgaFun3 () {
|
||||
$('.page2 .blessingTree .blessingTreeSvga3').show();
|
||||
setTimeout(function () {
|
||||
$('.page2 .blessingTree .lantern3').hide();
|
||||
}, 100)
|
||||
player3 = new SVGA.Player('.blessingTreeSvgaActive3');
|
||||
parser3 = new SVGA.Parser('.blessingTreeSvgaActive3');
|
||||
parser3.load('./images/blessingTree.svga', function (videoItem) {
|
||||
player3.loops = 1
|
||||
player3.clearsAfterStop = false;
|
||||
player3.setVideoItem(videoItem);
|
||||
player3.startAnimation();
|
||||
player3.setContentMode('AspectFill')
|
||||
player3.onFinished(() => {
|
||||
$('.page2 .blessingTree .lantern3').show();
|
||||
$('.page2 .blessingTree .blessingTreeSvga3').hide();
|
||||
})
|
||||
})
|
||||
}
|
||||
// 播放喜鵲svg
|
||||
function blessingTreeSvgaFun4 () {
|
||||
$('.page2 .blessingTree .blessingTreeSvga4').show();
|
||||
setTimeout(function () {
|
||||
$('.page2 .blessingTree .lantern4').hide();
|
||||
}, 100)
|
||||
player4 = new SVGA.Player('.blessingTreeSvgaActive4');
|
||||
parser4 = new SVGA.Parser('.blessingTreeSvgaActive4');
|
||||
parser4.load('./images/blessingTree.svga', function (videoItem) {
|
||||
player4.loops = 1;
|
||||
player4.clearsAfterStop = false;
|
||||
player4.setVideoItem(videoItem);
|
||||
player4.startAnimation();
|
||||
player4.setContentMode('AspectFill')
|
||||
player4.onFinished(() => {
|
||||
$('.page2 .blessingTree .lantern4').show();
|
||||
$('.page2 .blessingTree .blessingTreeSvga4').hide();
|
||||
})
|
||||
})
|
||||
parser4 = new SVGA.Parser('.blessingTreeSvgaActive5');
|
||||
}
|
||||
// 刷新祈福接口
|
||||
function fresh () {
|
||||
@@ -636,12 +598,15 @@ $('.page2 .blessingTreeBoomt .tab div').click(function () {
|
||||
}
|
||||
})
|
||||
//檢測是否到達底部
|
||||
$(document).ready(function () {
|
||||
$(".page2 .blessingTreeBoomt2 .box2 ul").scroll(function () {
|
||||
$(".page2 .blessingTreeBoomt .box2 ul").scroll(function () {
|
||||
var divHeight = $(this).height();
|
||||
var nScrollHeight = $(this)[0].scrollHeight;
|
||||
var nScrollTop = $(this)[0].scrollTop;
|
||||
if (nScrollTop + divHeight >= nScrollHeight) {
|
||||
console.log(nScrollTop);
|
||||
console.log(divHeight);
|
||||
console.log(nScrollTop + divHeight);
|
||||
console.log(nScrollHeight);
|
||||
if (nScrollTop + divHeight + 50 >= nScrollHeight) {
|
||||
console.log("到達底部了");
|
||||
if (pageSizeLack) {
|
||||
pageSizeLack = false;
|
||||
@@ -650,7 +615,6 @@ $(document).ready(function () {
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
// 祈福記錄
|
||||
function pageRecord (page) {
|
||||
showLoading()
|
||||
@@ -678,6 +642,7 @@ function pageRecord (page) {
|
||||
`
|
||||
})
|
||||
$('.page2 .blessingTreeBoomt2 .box2 ul').append(str);
|
||||
pageSizeLack = true;
|
||||
hideLoading(layerIndex)
|
||||
} else {
|
||||
hideLoading(layerIndex)
|
||||
|
Reference in New Issue
Block a user