修复塔罗交互异常问题

This commit is contained in:
Dragon
2023-11-06 16:54:46 +08:00
parent babea9cc93
commit 1b237c98d7

View File

@@ -32,6 +32,7 @@ var gearPositionActive = 0;//當前選澤的檔位
var prodId = [];//檔位類型
var prodIdActive;
var lock = true;//鎖
var lock2 = true;
var page = 1;//頁碼
var scrollLock = true;
var arrLast = []//記錄上次開獎的數組
@@ -58,7 +59,6 @@ $(function () {
})
getAdvertising();
productList();
getUserInfo();
svgaFun();
svgaFun2();
}, 100)
@@ -161,6 +161,7 @@ function productList () {
prodId.push(res.prodId);
$(`.tarotBox .tabBox .tabBox${i + 1} b`).text(`${res.prodNeedPrice}鉆/張`)
})
getUserInfo();
} else {
toastMsg(res.message)
}
@@ -174,7 +175,7 @@ function productList () {
}
// 獲取用戶信息
const getUserInfo = () => {
showLoading()
// showLoading()
networkRequest({
type: 'POST',
url: urlPrefix + '/seekElfin/user/info',
@@ -356,34 +357,35 @@ function kineticEffect (arr, bool, data) {
$('.cardBoxBut').hide();
$('.tarotBox .butAgain').attr('src', prodIdActive == 1 ? './images/butAgain1.png' : prodIdActive == 2 ? './images/butAgain2.png' : './images/butAgain3.png')
$('.butAgain').show();
lock = true;
}, 1000)
}
// 檔位tab切換按鈕
$('.tarotBox .tabBox div').click(function () {
if(lock){
var i = $(this).index() + 1;
// 切換tab樣式
$('.tarotBox .tabBox div').removeClass('active1').removeClass('active2').removeClass('active3');
$(this).addClass(`active${i}`);
// 切換卡牌樣式
$('.tarotBox .cardBox').hide();
$(`.tarotBox .card${i}`).show();
// 切換按鈕樣式
$('.tarotBox .cardBoxBut').attr('src', `./images/but${i}.png`)
// if (i == 1) {
gearPositionActive = gearPosition[i - 1];
prodIdActive = prodId[i - 1];
$('.tarotBox .gradeText b').text(gearPositionActive * 10);
// } else if (i == 2) {
// gearPosition = 1000;
// $('.tarotBox .gradeText b').text(gearPosition * 10);
// } else {
// gearPosition = 10000;
// $('.tarotBox .gradeText b').text(gearPosition * 10);
// }
// 清空默認樣式
initialStytle();}
if (lock) {
var i = $(this).index() + 1;
// 切換tab樣式
$('.tarotBox .tabBox div').removeClass('active1').removeClass('active2').removeClass('active3');
$(this).addClass(`active${i}`);
// 切換卡牌樣式
$('.tarotBox .cardBox').hide();
$(`.tarotBox .card${i}`).show();
// 切換按鈕樣式
$('.tarotBox .cardBoxBut').attr('src', `./images/but${i}.png`)
// if (i == 1) {
gearPositionActive = gearPosition[i - 1];
prodIdActive = prodId[i - 1];
$('.tarotBox .gradeText b').text(gearPositionActive * 10);
console.log(gearPositionActive);
// } else if (i == 2) {
// gearPosition = 1000;
// $('.tarotBox .gradeText b').text(gearPosition * 10);
// } else {
// gearPosition = 10000;
// $('.tarotBox .gradeText b').text(gearPosition * 10);
// }
// 清空默認樣式
initialStytle();
}
})
// 選擇初級卡片按鈕
$('.tarotBox .card1').click(function () {
@@ -435,6 +437,7 @@ $('.tarotBox .cardBoxBut').click(function () {
// 再翻一次按鈕
$('.butAgain').click(function () {
initialStytle(true);
lock = true;
})
// 跳轉充值頁面
$('.tarotBox .diamond').click(() => {