From fe010cd89562375546a7f0d636452ba6c78ec180 Mon Sep 17 00:00:00 2001 From: Dragon <13925835632@139.com> Date: Wed, 15 Nov 2023 14:31:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B4=BB=E5=8A=A8=E7=BB=93?= =?UTF-8?q?=E6=9D=9F=E6=97=B6=E9=97=B4=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E8=B7=B3=E8=BD=AC=E6=88=BF=E9=97=B4=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../activity/2023-anchorBattle/css/index.css | 8 +++--- .../activity/2023-anchorBattle/css/index.scss | 8 +++--- .../activity/2023-anchorBattle/js/index.js | 26 ++++++++++++------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/view/yinmeng/activity/2023-anchorBattle/css/index.css b/view/yinmeng/activity/2023-anchorBattle/css/index.css index 8e3df2f..fa74ded 100644 --- a/view/yinmeng/activity/2023-anchorBattle/css/index.css +++ b/view/yinmeng/activity/2023-anchorBattle/css/index.css @@ -273,13 +273,13 @@ body { } .top3 .no2 p { - width: 100%; + width: 90%; text-align: center; color: #fff; font-size: 0.42667rem; font-weight: 500; position: absolute; - left: 0; + left: 0.13333rem; top: 3.73333rem; white-space: nowrap; overflow: hidden; @@ -340,13 +340,13 @@ body { } .top3 .no3 p { - width: 100%; + width: 90%; text-align: center; color: #fff; font-size: 0.42667rem; font-weight: 500; position: absolute; - left: 0; + left: 0.26667rem; top: 3.73333rem; white-space: nowrap; overflow: hidden; diff --git a/view/yinmeng/activity/2023-anchorBattle/css/index.scss b/view/yinmeng/activity/2023-anchorBattle/css/index.scss index 17503d1..9b84bc6 100644 --- a/view/yinmeng/activity/2023-anchorBattle/css/index.scss +++ b/view/yinmeng/activity/2023-anchorBattle/css/index.scss @@ -275,13 +275,13 @@ body { } p { - width: 100%; + width: 90%; text-align: center; color: #fff; font-size: px2rem(32); font-weight: 500; position: absolute; - left: 0; + left: px2rem(10); top: px2rem(280); white-space: nowrap; overflow: hidden; @@ -342,13 +342,13 @@ body { } p { - width: 100%; + width: 90%; text-align: center; color: #fff; font-size: px2rem(32); font-weight: 500; position: absolute; - left: 0; + left: px2rem(20); top: px2rem(280); white-space: nowrap; overflow: hidden; diff --git a/view/yinmeng/activity/2023-anchorBattle/js/index.js b/view/yinmeng/activity/2023-anchorBattle/js/index.js index f7e6df0..0b1ada4 100644 --- a/view/yinmeng/activity/2023-anchorBattle/js/index.js +++ b/view/yinmeng/activity/2023-anchorBattle/js/index.js @@ -67,7 +67,12 @@ function getRank (rankType, date) { // 处理倒计时 if (rankType == 1) { const curTime = res.timestamp - const endTime = (new Date(`${res.data.dateList[res.data.dateList.length - 1]} 23:59:59`).getTime()) + var endTime = null; + if (browser.ios) { + endTime = (new Date(`${res.data.dateList[res.data.dateList.length - 1]} 11:59:59`.replace(/-/g, "/")).getTime()) + } else { + endTime = (new Date(`${res.data.dateList[res.data.dateList.length - 1]} 11:59:59`).getTime()) + } leftTime = endTime - res.timestamp; const hadEnd = (endTime - curTime) <= 0 if (hadEnd) { @@ -106,7 +111,7 @@ function getRank (rankType, date) { str += `
  • ${res.ranking}
    - +

    ${res.nick}

    ID: ${res.erbanNo} @@ -175,7 +180,12 @@ function countup () { var s = 0; //定义变量 d,h,m,s保存倒计时的时间 var d, h, m, s; - if (leftTime > 0) { + //递归每秒调⽤countTime⽅法,显⽰动态时间效果 + if (leftTime >= 0 && leftTime < 1000) { + rankType = 2; + date = null; + getRank(rankType, date); + } else if (leftTime > 1000) { d = getzf(Math.floor(leftTime / 1000 / 60 / 60 / 24)); h = getzf(Math.floor(leftTime / 1000 / 60 / 60 % 24)); m = getzf(Math.floor(leftTime / 1000 / 60 % 60)); @@ -185,11 +195,6 @@ function countup () { $('.time .sp2').text(h); $('.time .sp3').text(m); $('.time .sp4').text(s); - leftTime = leftTime - 1000; - //递归每秒调⽤countTime⽅法,显⽰动态时间效果 - } else if (leftTime == 0) { - getRank(rankType, date); - return } else { //todo 展示活动已结束 $('.timeOutTab').show(); @@ -197,6 +202,9 @@ function countup () { $('.tab').hide(); $('.time').hide(); } + if (leftTime > 0){ + leftTime = leftTime - 1000; + } timeOut2 = setTimeout(countup, 1000); } //补0操作 @@ -220,6 +228,7 @@ $('.top3 .no .ts').on('click', function () { // 点击非前三按钮 $('.list').on('click', 'li .tx', function () { var uid = $(this).attr('uid'); + console.log(uid); if (browser.ios) { window.webkit.messageHandlers.openRoom.postMessage(uid); } else if (browser.android) { @@ -227,5 +236,4 @@ $('.list').on('click', 'li .tx', function () { window.androidJsObj.openRoom(uid); } } - }) \ No newline at end of file