From 564c4c80a3721e23de659cc045451b8c089c45e6 Mon Sep 17 00:00:00 2001 From: qf Date: Mon, 12 Dec 2022 17:55:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=9F=E7=BA=A7=E5=8E=A8=E6=88=BF=EF=BC=9A?= =?UTF-8?q?=E6=A6=9C=E5=8D=95=E5=A2=9E=E5=8A=A0=E8=B7=B3=E8=BD=AC=E4=B8=BB?= =?UTF-8?q?=E9=A1=B5=EF=BC=8C=E6=88=91=E7=9A=84=E9=92=BB=E7=9F=B3=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E5=8D=81=E4=BD=8D=E6=95=B0=E5=AE=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view/peko/activity/act-ocean/css/index.css | 2 +- view/peko/activity/act-ocean/css/index.scss | 3 +- view/peko/activity/act-ocean/js/index.js | 50 ++++++++++++++------- 3 files changed, 37 insertions(+), 18 deletions(-) diff --git a/view/peko/activity/act-ocean/css/index.css b/view/peko/activity/act-ocean/css/index.css index eb71729..f5d089f 100644 --- a/view/peko/activity/act-ocean/css/index.css +++ b/view/peko/activity/act-ocean/css/index.css @@ -627,7 +627,7 @@ body { } .wrap .info-bottom .info-wrap .diamond-num, .wrap .info-bottom .info-wrap .fragment-num { - width: 3.3333333333rem; + width: 4rem; height: 0.56rem; background-color: #BD7F38; border-radius: 0.2666666667rem; diff --git a/view/peko/activity/act-ocean/css/index.scss b/view/peko/activity/act-ocean/css/index.scss index 2520440..1ac3748 100644 --- a/view/peko/activity/act-ocean/css/index.scss +++ b/view/peko/activity/act-ocean/css/index.scss @@ -777,7 +777,8 @@ body { .diamond-num, .fragment-num { - width: px2rem(250); + // width: px2rem(250); + width: 4rem; height: px2rem(42); background-color: #BD7F38; border-radius: px2rem(20); diff --git a/view/peko/activity/act-ocean/js/index.js b/view/peko/activity/act-ocean/js/index.js index 80b0ae3..6c4587b 100644 --- a/view/peko/activity/act-ocean/js/index.js +++ b/view/peko/activity/act-ocean/js/index.js @@ -32,7 +32,7 @@ const toastMsg = (content = '操作完成', time = 2) => { }) } -if (false) { //!browser.app +if (!browser.app) { //false toastMsg('請在app內打開!'); } else { $('.wrap').removeClass('no-in-app') @@ -784,7 +784,7 @@ const renderRankList = () => { } topThreeStr = ` -
+

@@ -795,6 +795,10 @@ const renderRankList = () => { ` }) $('.topthree-wrap').html(topThreeStr) + $('.topthree-wrap .info-wrap').click(function () { + let uid = $(this).attr('uid') + openPerson(uid) + }) // 渲染非前3 @@ -809,7 +813,7 @@ const renderRankList = () => { num = item.num } others += ` -
  • +
  • ${index + 2}
    @@ -820,6 +824,10 @@ const renderRankList = () => { ` }) $('.other-rank').html(others) + $('.other-rank li').click(function(){ + let uid = $(this).attr('uid') + openPerson(uid) + }) } else { // 歐皇榜單 // 渲染前3 @@ -839,7 +847,7 @@ const renderRankList = () => { num = '猜中' + item.num + '次' } topThreeStr = ` -
    +

    @@ -850,6 +858,10 @@ const renderRankList = () => { ` }) $('.topthree-wrap').html(topThreeStr) + $('.topthree-wrap .info-wrap').click(function () { + let uid = $(this).attr('uid') + openPerson(uid) + }) // 渲染非前3 let othersArr = rankListN.slice(1) @@ -861,7 +873,7 @@ const renderRankList = () => { num = '猜中' + item.num + '次' } others += ` -
  • +
  • ${index + 2}
    @@ -872,10 +884,27 @@ const renderRankList = () => { ` }) $('.other-rank').html(others) + $('.other-rank li').click(function(){ + let uid = $(this).attr('uid') + openPerson(uid) + }) } } +//跳转个人主页 +function openPerson(uid) { + console.log('跳转个人主页方法'); + if (!browser.app) return + if (browser.ios) { + window.webkit.messageHandlers.openPersonPage.postMessage(uid); + } else if (browser.android) { + if (androidJsObj && typeof androidJsObj === 'object') { + window.androidJsObj.openPersonPage(uid); + } + } +} + $(function () { getInfoFromClient() @@ -1077,17 +1106,6 @@ $(function () { console.log('uid', uid); openPerson(uid) }) - //跳转个人主页 - function openPerson(uid) { - if (!browser.app) return - if (browser.ios) { - window.webkit.messageHandlers.openPersonPage.postMessage(uid); - } else if (browser.android) { - if (androidJsObj && typeof androidJsObj === 'object') { - window.androidJsObj.openPersonPage(uid); - } - } - } // 關閉碎片不足提示彈窗 $('.cancel-btn').on('click', function () {