星级厨房:榜单增加跳转主页,我的钻石展示十位数宽
This commit is contained in:
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -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 = `
|
||||
<div class="info-wrap">
|
||||
<div class="info-wrap" uid="${item.uid}">
|
||||
<div class="avatar">
|
||||
<p></p>
|
||||
<img src="${item.avatar}" alt="">
|
||||
@@ -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 += `
|
||||
<li>
|
||||
<li uid="${item.uid}">
|
||||
<span class="index">${index + 2}</span>
|
||||
<div class="others-info">
|
||||
<img src="${item.avatar}" alt="">
|
||||
@@ -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 = `
|
||||
<div class="info-wrap">
|
||||
<div class="info-wrap" uid="${item.uid}">
|
||||
<div class="avatar">
|
||||
<p></p>
|
||||
<img src="${item.avatar}" alt="">
|
||||
@@ -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 += `
|
||||
<li>
|
||||
<li uid="${item.uid}">
|
||||
<span class="index">${index + 2}</span>
|
||||
<div class="others-info">
|
||||
<img src="${item.avatar}" alt="">
|
||||
@@ -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 () {
|
||||
|
Reference in New Issue
Block a user