修复bug

This commit is contained in:
Dragon
2024-02-22 16:09:23 +08:00
parent bb0acd6a57
commit 9f468451fe
5 changed files with 94 additions and 76 deletions

View File

@@ -24,12 +24,11 @@ body {
.wrap { .wrap {
width: 100%; width: 100%;
height: 100vh; height: 115vh;
background: url("../images/main/index-bg.png") no-repeat center/cover; background: url("../images/main/index-bg.png") no-repeat center/cover;
position: relative; position: relative;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
margin-bottom: 1.46667rem;
} }
.wrap .header { .wrap .header {
@@ -440,6 +439,10 @@ body {
width: 4rem; width: 4rem;
height: 1.01333rem; height: 1.01333rem;
margin: 0.93333rem auto 0; margin: 0.93333rem auto 0;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 14.3rem;
} }
.wrap .summon-area .confitm-btn.inactive { .wrap .summon-area .confitm-btn.inactive {
@@ -1409,7 +1412,7 @@ body {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
z-index: 999; z-index: 9999;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
background-color: rgba(0, 0, 0, 0.4); background-color: rgba(0, 0, 0, 0.4);

View File

@@ -34,12 +34,12 @@ body{
.wrap{ .wrap{
width: 100%; width: 100%;
height: 100vh; height: 115vh;
background: url('../images/main/index-bg.png') no-repeat center/cover; background: url('../images/main/index-bg.png') no-repeat center/cover;
position: relative; position: relative;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
margin-bottom: px2rem(110); // margin-bottom: px2rem(200);
.header{ .header{
position: absolute; position: absolute;
left: 50%; left: 50%;
@@ -408,6 +408,10 @@ body{
width: px2rem(300); width: px2rem(300);
height: px2rem(76); height: px2rem(76);
margin: px2rem(70) auto 0; margin: px2rem(70) auto 0;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 14.3rem;
&.inactive{ &.inactive{
width: px2rem(333); width: px2rem(333);
height: px2rem(84); height: px2rem(84);
@@ -1270,7 +1274,7 @@ body{
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
z-index: 999; z-index: 9999;
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
background-color: rgba($color: #000000, $alpha: 0.4); background-color: rgba($color: #000000, $alpha: 0.4);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@@ -257,7 +257,7 @@
<script src="../../common/js/vconsole.min.js"></script> <script src="../../common/js/vconsole.min.js"></script>
<script src="../../common/js/svga.min.js"></script> <script src="../../common/js/svga.min.js"></script>
<script src="../../common/js/route-constant.js"></script> <script src="../../common/js/route-constant.js"></script>
<script src="./js/index.js?v=2.1"></script> <script src="./js/index.js?v=2.2"></script>
</body> </body>
</html> </html>

View File

@@ -23,7 +23,7 @@ if (env == 'test') {
console.log($(window).width()); console.log($(window).width());
console.log($(window).height()); console.log($(window).height());
var lock = true;
// 封裝layer消息提醒框 // 封裝layer消息提醒框
let layerIndex let layerIndex
@@ -606,14 +606,16 @@ const sendUserDrawInfo = (itemId, num) => {
if (currentWeaponIndex_top != undefined) { if (currentWeaponIndex_top != undefined) {
restrainArr[currentWeaponIndex_top]['num_top'] = 0 restrainArr[currentWeaponIndex_top]['num_top'] = 0
} }
}else if(res.code === 31005){ } else if (res.code === 31005) {
$('.shade-mask-no-money').show(); $('.shade-mask-no-money').show();
} else { } else {
toastMsg(res.message) toastMsg(res.message)
} }
lock = true;
}, },
error (err) { error (err) {
toastMsg('網絡錯誤,請退出重進') toastMsg('網絡錯誤,請退出重進')
lock = true;
} }
}) })
} }
@@ -1326,22 +1328,25 @@ $(function () {
// return // return
// } // }
// 每個標誌位上的數量
restrainArr[currentWeaponIndex].costPieceNum += parseInt($('.select-num input').val())
$('.sign-wrap div').eq(currentWeaponIndex).find('img') if (lock) {
.stop(true, true) lock = false;
.animate({ scale: 1.2 }, 200) // 每個標誌位上的數量
.animate({ scale: 1 }, 200, function () { restrainArr[currentWeaponIndex].costPieceNum += parseInt($('.select-num input').val())
$('.sign-wrap div').eq(currentWeaponIndex).find('p').html('+' + restrainArr[currentWeaponIndex].costPieceNum).hide().fadeIn(200) $('.sign-wrap div').eq(currentWeaponIndex).find('img')
setTimeout(() => { .stop(true, true)
getUserInfo() .animate({ scale: 1.2 }, 200)
}, 100) .animate({ scale: 1 }, 200, function () {
}) $('.sign-wrap div').eq(currentWeaponIndex).find('p').html('+' + restrainArr[currentWeaponIndex].costPieceNum).hide().fadeIn(200)
setTimeout(() => {
getUserInfo()
}, 100)
})
console.log('costPieceNum---', restrainArr[currentWeaponIndex].costPieceNum); console.log('costPieceNum---', restrainArr[currentWeaponIndex].costPieceNum);
console.log('id----', restrainArr[currentWeaponIndex].id); console.log('id----', restrainArr[currentWeaponIndex].id);
sendUserDrawInfo(restrainArr[currentWeaponIndex].id, $('.select-num input').val()) sendUserDrawInfo(restrainArr[currentWeaponIndex].id, $('.select-num input').val())
}
}) })
// let isSelectTopWeapon // let isSelectTopWeapon
@@ -1451,63 +1456,66 @@ $(function () {
if ($('.popup-select-num input').val() == 0) { if ($('.popup-select-num input').val() == 0) {
return toastMsg('數量不能少於0') return toastMsg('數量不能少於0')
} }
if (parseInt(myFragment) < $('.popup-select-num input').val()) { // if (parseInt(myFragment) < $('.popup-select-num input').val()) {
console.log(1); // console.log(1);
let distance = $('.popup-select-num input').val() - myFragment // let distance = $('.popup-select-num input').val() - myFragment
// let listArr = JSON.parse( window.sessionStorage.getItem('listMap')) // // let listArr = JSON.parse( window.sessionStorage.getItem('listMap'))
// console.log(JSON.parse( window.sessionStorage.getItem('listMap') )); // // console.log(JSON.parse( window.sessionStorage.getItem('listMap') ));
let packItem = {} // let packItem = {}
let giveNum = '' // let giveNum = ''
if (distance == 1) { // if (distance == 1) {
packItem = listMap[0] // packItem = listMap[0]
giveNum = 1 // giveNum = 1
} else if (distance <= 10) { // } else if (distance <= 10) {
console.log(2); // console.log(2);
packItem = listMap[1] // packItem = listMap[1]
giveNum = '7~10' // giveNum = '7~10'
} else if (distance <= 100) { // } else if (distance <= 100) {
packItem = listMap[2] // packItem = listMap[2]
giveNum = '70~100' // giveNum = '70~100'
} else { // } else {
packItem = listMap[3] // packItem = listMap[3]
giveNum = '700~1000' // giveNum = '700~1000'
} // }
console.log(packItem); // console.log(packItem);
$('.popup-not-enough .headwear-pic').attr('src', packItem.imgUrl) // $('.popup-not-enough .headwear-pic').attr('src', packItem.imgUrl)
$('.popup-not-enough .headwear-name').html(packItem.name + '/天') // $('.popup-not-enough .headwear-name').html(packItem.name + '/天')
$('.popup-not-enough .headwear-award').html(`獲贈魔法石${giveNum}`) // $('.popup-not-enough .headwear-award').html(`獲贈魔法石${giveNum}個`)
$('.popup-not-enough .headwear-price span').html(packItem.sellingPrice) // $('.popup-not-enough .headwear-price span').html(packItem.sellingPrice)
$('.popup-not-enough .diamond-num span').html(userDiamonds) // $('.popup-not-enough .diamond-num span').html(userDiamonds)
$('.popup-not-enough .buy-btn').data('id', packItem.id) // $('.popup-not-enough .buy-btn').data('id', packItem.id)
// 召喚神器彈窗關閉 // // 召喚神器彈窗關閉
$('.popup-summon').hide() // $('.popup-summon').hide()
$('.popup-summon input').val(0) // $('.popup-summon input').val(0)
$('.popup-select-num .ipt-wrap main i').html(0) // $('.popup-select-num .ipt-wrap main i').html(0)
$('.popup-select-num .ipt-wrap p i').html(0) // $('.popup-select-num .ipt-wrap p i').html(0)
restrainArr[currentWeaponIndex_top]['num_top'] = 0 // restrainArr[currentWeaponIndex_top]['num_top'] = 0
$('.popup-not-enough').show() // $('.popup-not-enough').show()
return // return
// }
if (lock) {
lock = false;
// 每個標誌位上的數量
restrainArr[currentWeaponIndex_top].costPieceNum += parseInt($('.popup-select-num input').val())
$('.sign-wrap div').eq(currentWeaponIndex_top).find('img')
.stop(true, true)
.animate({ scale: 1.2 }, 200)
.animate({ scale: 1 }, 200, function () {
$('.sign-wrap div').eq(currentWeaponIndex_top).find('p').html('+' + restrainArr[currentWeaponIndex_top].costPieceNum).hide().fadeIn(200)
setTimeout(() => {
getUserInfo()
}, 100)
})
console.log('costPieceNum---', restrainArr[currentWeaponIndex_top].costPieceNum);
console.log('id----', restrainArr[currentWeaponIndex_top].id);
sendUserDrawInfo(restrainArr[currentWeaponIndex_top].id, $('.popup-select-num input').val())
} }
// 每個標誌位上的數量
restrainArr[currentWeaponIndex_top].costPieceNum += parseInt($('.popup-select-num input').val())
$('.sign-wrap div').eq(currentWeaponIndex_top).find('img')
.stop(true, true)
.animate({ scale: 1.2 }, 200)
.animate({ scale: 1 }, 200, function () {
$('.sign-wrap div').eq(currentWeaponIndex_top).find('p').html('+' + restrainArr[currentWeaponIndex_top].costPieceNum).hide().fadeIn(200)
setTimeout(() => {
getUserInfo()
}, 100)
})
console.log('costPieceNum---', restrainArr[currentWeaponIndex_top].costPieceNum);
console.log('id----', restrainArr[currentWeaponIndex_top].id);
sendUserDrawInfo(restrainArr[currentWeaponIndex_top].id, $('.popup-select-num input').val())
}) })
@@ -1571,6 +1579,9 @@ $(function () {
$('.popup-not-enough .close').click(() => { $('.popup-not-enough .close').click(() => {
$('.popup-not-enough').hide() $('.popup-not-enough').hide()
}) })
$('.wrap .popup-result .result-content .close').click(function () {
$('.popup-result').hide()
})
$('body').click(() => { $('body').click(() => {
$('.shade-mask-no-money').hide() $('.shade-mask-no-money').hide()
}) })