修改bug替换贵族icon
This commit is contained in:
@@ -73,13 +73,14 @@ function getListRank () {
|
||||
}
|
||||
top3.forEach((res, i) => {
|
||||
$(`.header .no${i + 1} .tx`).attr('src', res.avatar);
|
||||
$(`.header .no${i + 1} .txBg`).attr('uid', res.uid);
|
||||
if (res.nick == '虚位以待') {
|
||||
$(`.header .no${i + 1} .icon`).hide();
|
||||
$(`.header .no${i + 1} p`).hide();
|
||||
}
|
||||
$(`.header .no${i + 1} .icon`).attr('src', res.vipIcon);
|
||||
$(`.header .no${i + 1} .icon`).attr('src', `./images/${res.vipLevel}.png`);
|
||||
$(`.header .no${i + 1} span`).text(res.nick.length > 5 ? res.nick.slice(0, 5) + '...' : res.nick);
|
||||
$(`.header .no${i + 1} b`).text(res.score > 10000 ? (Math.floor(res.score / 1000) / 10).toFixed(1) + 'w' : res.score);
|
||||
$(`.header .no${i + 1} b`).text(res.score);
|
||||
});
|
||||
// 非前三
|
||||
var str = '';
|
||||
@@ -87,22 +88,33 @@ function getListRank () {
|
||||
str += `
|
||||
<li>
|
||||
<div class="num">${i + 4}</div>
|
||||
<img src="${res.avatar}" alt="" class="tx">
|
||||
<img src="${res.vipIcon}" alt="" class="icon">
|
||||
<img src="${res.avatar}" alt="" class="tx" uid=${res.uid}>
|
||||
<img src="./images/${res.vipLevel}.png" alt="" class="icon">
|
||||
<div class="name">${res.nick.length > 5 ? res.nick.slice(0, 5) + '...' : res.nick}</div>
|
||||
<div class="right">
|
||||
<p>${res.score > 10000 ? (Math.floor(res.score / 1000) / 10).toFixed(1) + 'w' : res.score}</p>
|
||||
<p>${res.score}</p>
|
||||
<span>权力值</span>
|
||||
</div>
|
||||
</li>
|
||||
`
|
||||
});
|
||||
$('.list').append(str);
|
||||
// 点击前三跳转资料页
|
||||
$('.list li .tx').click(function () {
|
||||
var uid = $(this).attr(uid);
|
||||
if (browser.ios) {
|
||||
window.webkit.messageHandlers.openPersonPage.postMessage(uid);
|
||||
setTimeout(function () { lock = true; }, 200)
|
||||
} else if (browser.android) {
|
||||
if (androidJsObj && typeof androidJsObj === 'object') {
|
||||
window.androidJsObj.openPersonPage(uid);
|
||||
}
|
||||
}
|
||||
})
|
||||
var res = res.data.myRank;
|
||||
console.log(res);
|
||||
//自己
|
||||
$('.myInfo .div .tx').attr('src', res.avatar);
|
||||
$('.myInfo .div .name').text(res.nick.length > 5 ? res.nick.slice(0, 5) + '...' : res.nick);
|
||||
$('.myInfo .div .name').text(res.nick.length > 7 ? res.nick.slice(0, 7) + '...' : res.nick);
|
||||
|
||||
|
||||
if (res.rankNo) {
|
||||
@@ -112,7 +124,7 @@ function getListRank () {
|
||||
}
|
||||
if (res.vipLevel) {
|
||||
$('.myInfo .div .tx').attr('src', res.icon);
|
||||
$('.myInfo .div .right p').text(res.score > 10000 ? (Math.floor(res.score / 1000) / 10).toFixed(1) + 'w' : res.score);
|
||||
$('.myInfo .div .right p').text(res.score);
|
||||
} else {
|
||||
$('.myInfo .div .icon').hide();
|
||||
$('.myInfo .div .right').hide();
|
||||
@@ -140,7 +152,7 @@ function getListUpgrade () {
|
||||
var str = '';
|
||||
res.data.forEach((res, i) => {
|
||||
str += `
|
||||
<li>恭喜贵族<img src="${res.avatar}" alt="" class="sculpture"><b>${res.nick.length > 5 ? res.nick.slice(0, 5) + '...' : res.nick}</b> 升级为<img src="${res.vipIcon}" alt="" class="noble_icon">${res.vipName}</li>
|
||||
<li>恭喜贵族<img src="${res.avatar}" alt="" class="sculpture"><b>${res.nick.length > 5 ? res.nick.slice(0, 5) + '...' : res.nick}</b> 升级为<img src="./images/${res.vipLevel}.png" alt="" class="noble_icon">${res.vipName}</li>
|
||||
`
|
||||
});
|
||||
$('.header .notice ul').append(str);
|
||||
@@ -177,3 +189,15 @@ $('.myInfo .div .acitve').click(function () {
|
||||
window.webkit.messageHandlers.closeWebView.postMessage(null)
|
||||
}
|
||||
})
|
||||
// 点击前三跳转资料页
|
||||
$('.header .no1 .txBg,.header .no2 .txBg,.header .no3 .txBg').click(function () {
|
||||
var uid = $(this).attr(uid);
|
||||
if (browser.ios) {
|
||||
window.webkit.messageHandlers.openPersonPage.postMessage(uid);
|
||||
setTimeout(function () { lock = true; }, 200)
|
||||
} else if (browser.android) {
|
||||
if (androidJsObj && typeof androidJsObj === 'object') {
|
||||
window.androidJsObj.openPersonPage(uid);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user