From 1b237c98d7ac30a312a05e4a0c7aeacc04a80814 Mon Sep 17 00:00:00 2001 From: Dragon <13925835632@139.com> Date: Mon, 6 Nov 2023 16:54:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A1=94=E7=BD=97=E4=BA=A4?= =?UTF-8?q?=E4=BA=92=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view/peko/modules/luckyTarot/js/index.js | 55 +++++++++++++----------- 1 file changed, 29 insertions(+), 26 deletions(-) diff --git a/view/peko/modules/luckyTarot/js/index.js b/view/peko/modules/luckyTarot/js/index.js index 0bb7719..baeb3a2 100644 --- a/view/peko/modules/luckyTarot/js/index.js +++ b/view/peko/modules/luckyTarot/js/index.js @@ -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(() => {