更新首页榜单
1263
view/yinmeng/modules/ranks/css/index.css
Normal file
1274
view/yinmeng/modules/ranks/css/index.scss
Normal file
BIN
view/yinmeng/modules/ranks/images/back.png
Normal file
After Width: | Height: | Size: 208 B |
BIN
view/yinmeng/modules/ranks/images/boy.png
Normal file
After Width: | Height: | Size: 368 B |
BIN
view/yinmeng/modules/ranks/images/girl.png
Normal file
After Width: | Height: | Size: 396 B |
BIN
view/yinmeng/modules/ranks/images/header1.png
Normal file
After Width: | Height: | Size: 120 KiB |
BIN
view/yinmeng/modules/ranks/images/header2.png
Normal file
After Width: | Height: | Size: 120 KiB |
BIN
view/yinmeng/modules/ranks/images/header3.png
Normal file
After Width: | Height: | Size: 116 KiB |
BIN
view/yinmeng/modules/ranks/images/header4.png
Normal file
After Width: | Height: | Size: 118 KiB |
BIN
view/yinmeng/modules/ranks/images/icon1.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
view/yinmeng/modules/ranks/images/icon2.png
Normal file
After Width: | Height: | Size: 2.4 KiB |
BIN
view/yinmeng/modules/ranks/images/lastTopThree_in.png
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
view/yinmeng/modules/ranks/images/listLast.png
Normal file
After Width: | Height: | Size: 164 B |
BIN
view/yinmeng/modules/ranks/images/live.svga
Normal file
BIN
view/yinmeng/modules/ranks/images/logo.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
view/yinmeng/modules/ranks/images/my.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
view/yinmeng/modules/ranks/images/no1.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
view/yinmeng/modules/ranks/images/no2.png
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
view/yinmeng/modules/ranks/images/no3.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
view/yinmeng/modules/ranks/images/topList1.png
Normal file
After Width: | Height: | Size: 48 KiB |
BIN
view/yinmeng/modules/ranks/images/topList2.png
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
view/yinmeng/modules/ranks/images/topList3.png
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
view/yinmeng/modules/ranks/images/topList4.png
Normal file
After Width: | Height: | Size: 49 KiB |
177
view/yinmeng/modules/ranks/index.html
Normal file
@@ -0,0 +1,177 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>荣耀榜</title>
|
||||
<link rel="stylesheet" href="../../common/css/reset.css">
|
||||
<link rel="stylesheet" href="./css/index.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- 头部 -->
|
||||
<div class="header">
|
||||
<!-- 标题 -->
|
||||
<div class="title">
|
||||
<img src="./images/back.png" alt="" class="back">
|
||||
<span>荣耀榜</span>
|
||||
</div>
|
||||
<!-- tab榜单切换 -->
|
||||
<div class="tab">
|
||||
<div class="active1">爱意榜<span></span></div>
|
||||
<div>魅力榜<span></span></div>
|
||||
<div>房间榜<span></span></div>
|
||||
<div>公会榜<span></span></div>
|
||||
</div>
|
||||
<!-- 榜单周期切换 timeTab2-->
|
||||
<div class="timeTab ">
|
||||
<div class="active divBg1">小时榜</div>
|
||||
<div class="active1 divBg1">日榜</div>
|
||||
<div class="divBg1">周榜</div>
|
||||
<div class="divBg1">月榜</div>
|
||||
</div>
|
||||
<!-- 上期前三 -->
|
||||
<div class="listLast">
|
||||
<span class="sp1">上期TOP3 ></span>
|
||||
</div>
|
||||
<!-- 前三榜单 -->
|
||||
<div class="topBox topBox1">
|
||||
<div class="no no1">
|
||||
<img src="./images/no1.png" alt="" class="ts">
|
||||
<img src="./images/logo.png" alt="" class="tx">
|
||||
<img src="./images/logo.png" alt="" class="zl">
|
||||
<div src="./images/live.svga" loops="0" clearsAfterStop="true" class="svga"></div>
|
||||
<p>
|
||||
<span class="girl"><img src="./images/girl.png" alt=""></span>
|
||||
</p>
|
||||
<div class="icon">
|
||||
<img class="icon1" src="./images/icon1.png" alt="">
|
||||
<img class="icon2" src="./images/icon2.png" alt="">
|
||||
</div>
|
||||
<!-- <i>距上一名111.5W</i> -->
|
||||
<img src="" alt="" class="icon_gh">
|
||||
</div>
|
||||
<div class="no no2">
|
||||
<img src="./images/no3.png" alt="" class="ts">
|
||||
<img src="./images/logo.png" alt="" class="tx">
|
||||
<img src="./images/logo.png" alt="" class="zl">
|
||||
<div src="./images/live.svga" loops="0" clearsAfterStop="true" class="svga"></div>
|
||||
<p>
|
||||
<span class="girl"><img src="./images/girl.png" alt=""></span>
|
||||
</p>
|
||||
<div class="icon">
|
||||
<img class="icon1" src="./images/icon1.png" alt="">
|
||||
<img class="icon2" src="./images/icon2.png" alt="">
|
||||
</div>
|
||||
<i></i>
|
||||
<img src="" alt="" class="icon_gh">
|
||||
</div>
|
||||
<div class="no no3">
|
||||
<img src="./images/no2.png" alt="" class="ts">
|
||||
<img src="./images/logo.png" alt="" class="tx">
|
||||
<img src="./images/logo.png" alt="" class="zl">
|
||||
<div src="./images/live.svga" loops="0" clearsAfterStop="true" class="svga"></div>
|
||||
<p>
|
||||
<span class="girl"><img src="./images/girl.png" alt=""></span>
|
||||
</p>
|
||||
<div class="icon">
|
||||
<img class="icon1" src="./images/icon1.png" alt="">
|
||||
<img class="icon2" src="./images/icon2.png" alt="">
|
||||
</div>
|
||||
<i></i>
|
||||
<img src="" alt="" class="icon_gh">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 非前三 -->
|
||||
<ul class="list">
|
||||
<li>
|
||||
<div class="num">44.</div>
|
||||
<img src="./images/logo.png" alt="" class="tx">
|
||||
<div src="./images/live.svga" loops="0" clearsAfterStop="true" class="svga" style="display: block;"></div>
|
||||
<div class="nameBox">
|
||||
<p>我的名嗷字啊啊...
|
||||
<span class="girl"><img src="./images/girl.png" alt=""></span>
|
||||
</p>
|
||||
<div class="icon">
|
||||
<img src="./images/icon1.png" alt="">
|
||||
<img src="./images/icon2.png" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="right">
|
||||
<img src="./images/logo.png" alt="">
|
||||
<div class="nick">啊啊啊啊啊啊啊啊啊啊啊</div>
|
||||
<p>最佳助力</p>
|
||||
</div>
|
||||
<div class="score">
|
||||
<b>191.1W</b>
|
||||
<i>距上一名</i>
|
||||
</div>
|
||||
<img src="" alt="" class="icon_gh">
|
||||
</li>
|
||||
</ul>
|
||||
<!-- 自己榜单 -->
|
||||
<div class="my">
|
||||
<div class="num">未上榜</div>
|
||||
<img src="./images/logo.png" alt="" class="tx">
|
||||
<p class="name"></p>
|
||||
<div class="score"><b>0</b> <i>爱意值</i></div>
|
||||
</div>
|
||||
<!-- 上期前弹窗 -->
|
||||
<div class="lastTopThree">
|
||||
<div class="lastTopThree_in">
|
||||
<div class="box">
|
||||
<div class="no no1">
|
||||
<img src="./images/no1.png" alt="" class="ts">
|
||||
<img src="./images/logo.png" alt="" class="tx">
|
||||
<div src="./images/live.svga" loops="0" clearsAfterStop="true" class="svga"></div>
|
||||
<p>
|
||||
<span class="girl"><img src="./images/girl.png" alt=""></span>
|
||||
</p>
|
||||
<div class="icon">
|
||||
<img class="icon1" src="./images/icon1.png" alt="">
|
||||
<img class="icon2" src="./images/icon2.png" alt="">
|
||||
</div>
|
||||
<img src="" alt="" class="icon_gh">
|
||||
</div>
|
||||
<div class="no no2">
|
||||
<img src="./images/no2.png" alt="" class="ts">
|
||||
<img src="./images/logo.png" alt="" class="tx">
|
||||
<div src="./images/live.svga" loops="0" clearsAfterStop="true" class="svga"></div>
|
||||
<p>
|
||||
<span class="girl"><img src="./images/girl.png" alt=""></span>
|
||||
</p>
|
||||
<div class="icon">
|
||||
<img class="icon1" src="./images/icon1.png" alt="">
|
||||
<img class="icon2" src="./images/icon2.png" alt="">
|
||||
</div>
|
||||
<img src="" alt="" class="icon_gh">
|
||||
</div>
|
||||
<div class="no no3">
|
||||
<img src="./images/no2.png" alt="" class="ts">
|
||||
<img src="./images/logo.png" alt="" class="tx">
|
||||
<div src="./images/live.svga" loops="0" clearsAfterStop="true" class="svga"></div>
|
||||
<p>
|
||||
<span class="girl"><img src="./images/girl.png" alt=""></span>
|
||||
</p>
|
||||
<div class="icon">
|
||||
<img class="icon1" src="./images/icon1.png" alt="">
|
||||
<img class="icon2" src="./images/icon2.png" alt="">
|
||||
</div>
|
||||
<img src="" alt="" class="icon_gh">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<script src="../../common/js/flexible.js"></script>
|
||||
<script src="../../common/js/jquery-3.2.1.min.js"></script>
|
||||
<script src="../../common/js/common2.js"></script>
|
||||
<script src="../../common/js/layer.js"></script>
|
||||
<script src="../../common/js/vconsole.min.js"></script>
|
||||
<script src="../../common/js/route-constant.js"></script>
|
||||
<script src="../../common/js/svga.js"></script>
|
||||
<script src="./js/index.js"></script>
|
410
view/yinmeng/modules/ranks/js/index.js
Normal file
@@ -0,0 +1,410 @@
|
||||
let urlPrefix = getUrlPrefix()
|
||||
let browser = checkVersion()
|
||||
let env = EnvCheck();
|
||||
if (env == 'test') {
|
||||
new VConsole();
|
||||
}
|
||||
// 封装layer消息提醒框
|
||||
let layerIndex
|
||||
const showLoading = (content = '加载中...') => {
|
||||
layer.open({
|
||||
type: 2,
|
||||
shadeClose: false,
|
||||
content,
|
||||
success (e) {
|
||||
layerIndex = $(e).attr('index')
|
||||
}
|
||||
})
|
||||
}
|
||||
const hideLoading = (index) => {
|
||||
layer.close(index)
|
||||
}
|
||||
const toastMsg = (content = '操作完成', time = 2) => {
|
||||
layer.open({
|
||||
content,
|
||||
time,
|
||||
skin: 'msg'
|
||||
})
|
||||
}
|
||||
var listType = 1;//榜单类型
|
||||
var datetype = 1;//时间类型 1 日 2 周 3 总 4 半小时 5 月 6 小时
|
||||
var type = 2;//榜单类型 1 收礼榜 2 送礼榜 3 房间榜
|
||||
// 初始化函数
|
||||
$(function () {
|
||||
getInfoFromClient()
|
||||
setTimeout(function () {
|
||||
// 页面全屏
|
||||
if (browser.app) {
|
||||
if (browser.android) {
|
||||
window.androidJsObj.initShowNav(false)
|
||||
} else {
|
||||
window.webkit.messageHandlers.initShowNav.postMessage(0)
|
||||
}
|
||||
};
|
||||
// 顶部返回事件
|
||||
$('.back').click(() => {
|
||||
if (browser.android) {
|
||||
window.androidJsObj.closeWebView()
|
||||
} else {
|
||||
window.webkit.messageHandlers.closeWebView.postMessage(null)
|
||||
}
|
||||
})
|
||||
getRank(type, datetype);
|
||||
}, 100)
|
||||
})
|
||||
// 获取榜单接口
|
||||
function getRank (type, datetype) {
|
||||
$('.list li').remove();
|
||||
showLoading()
|
||||
networkRequest({
|
||||
type: 'GEt',
|
||||
url: urlPrefix + '/allrank/geth5',
|
||||
data: { type, datetype, uid: pubInfo.uid },
|
||||
success (res) {
|
||||
if (res.code === 200) {
|
||||
var top3 = res.data.rankVoList.slice(0, 3);
|
||||
var notTop3 = res.data.rankVoList.slice(3);
|
||||
var arrAll = res.data.rankVoList;
|
||||
// 处理前三
|
||||
if (top3.length < 3) {
|
||||
let arr = new Array(3 - top3.length).fill({
|
||||
avatar: './images/logo.png',
|
||||
nick: '虚位以待',
|
||||
totalNum: "",
|
||||
gender: '',
|
||||
})
|
||||
top3.push(...arr)
|
||||
}
|
||||
top3.forEach((res, i) => {
|
||||
if (res.nick == '虚位以待') {
|
||||
$(`.header .topBox .no${i + 1} p span img`).hide();
|
||||
$(`.header .topBox .no${i + 1} .icon`).hide();
|
||||
$(`.header .topBox .no${i + 1} i`).hide();
|
||||
$(`.header .topBox .no${i + 1} .zl`).hide();
|
||||
} else {
|
||||
$(`.header .topBox .no${i + 1} p span img`).show();
|
||||
$(`.header .topBox .no${i + 1} .icon`).show();
|
||||
$(`.header .topBox .no${i + 1} i`).show();
|
||||
$(`.header .topBox .no${i + 1} .zl`).show();
|
||||
}
|
||||
$(`.header .topBox .no${i + 1} .ts`).attr('uid', res.uid);
|
||||
$(`.header .topBox .no${i + 1} .ts`).attr('inRoomUid', res.inRoomUid);
|
||||
$(`.header .topBox .no${i + 1} .ts`).attr('inMic', res.inMic);
|
||||
$(`.header .topBox .no${i + 1} .tx`).attr('src', res.avatar);
|
||||
$(`.header .topBox .no${i + 1} p`).html(`${res.nick.length > 6 ? `${res.nick.slice(0, 6)}...` : res.nick}<span class="${res.gender == 1 ? 'boy' : 'girl'}"><img src="./images/${res.gender == 1 ? 'boy' : 'girl'}.png" alt=""></span>`);
|
||||
$(`.header .topBox .no${i + 1} .icon .icon1`).attr('src', res.experUrl);
|
||||
$(`.header .topBox .no${i + 1} .icon .icon2`).attr('src', res.charmUrl);
|
||||
if (i >= 1) {
|
||||
$(`.header .topBox .no${i + 1} i`).text(`距上一名${unitProcessing((top3[i - 1].totalNum - res.totalNum), 10000, 1, 'W')}`);
|
||||
}
|
||||
if (res.inMic) {
|
||||
$(`.header .topBox .no${i + 1} .svga`).show();
|
||||
} else {
|
||||
$(`.header .topBox .no${i + 1} .svga`).hide();
|
||||
}
|
||||
})
|
||||
// 处理非前三
|
||||
var str = '';
|
||||
notTop3.forEach((res, i) => {
|
||||
str += `
|
||||
<li>
|
||||
<div class="num">${res.seqNo}</div>
|
||||
<img src="${res.avatar}" alt="" class="tx" uid="${res.uid}" inRoomUid = '${res.inRoomUid}' inMic="${res.inMic}" ">
|
||||
<div src="./images/live.svga" loops="0" clearsAfterStop="true" class="svga" style="display: ${res.inMic ? 'block' : 'none'};"></div>
|
||||
<div class="nameBox">
|
||||
<p>${res.nick.length > 7 ? `${res.nick.slice(0, 7)}...` : res.nick}
|
||||
<span class="${res.gender == 1 ? 'boy' : 'girl'}"><img src="./images/${res.gender == 1 ? 'boy' : 'girl'}.png" alt=""></span>
|
||||
</p>
|
||||
<div class="icon">
|
||||
<img src="${res.experUrl}" alt="">
|
||||
<img src="${res.charmUrl}" alt="">
|
||||
</div>
|
||||
</div>
|
||||
<div class="score">
|
||||
<b>${unitProcessing((arrAll[0 + 2].totalNum - res.totalNum), 10000, 1, 'W')}</b><br>
|
||||
<i>距上一名</i>
|
||||
</div>
|
||||
</li>`
|
||||
})
|
||||
$('.list').append(str);
|
||||
// 处理自己榜单
|
||||
$('.my .num').text(res.data.me.seqNo ? res.data.me.seqNo : '未上榜');
|
||||
$('.my .tx').attr('src', res.data.me.avatar);
|
||||
$('.my .p').text(res.data.me.nick);
|
||||
$('.my .score b').text(unitProcessing(res.data.me.totalNum, 10000, 1, 'W'));
|
||||
} else {
|
||||
toastMsg(res.message)
|
||||
}
|
||||
hideLoading(layerIndex)
|
||||
},
|
||||
error (err) {
|
||||
hideLoading(layerIndex)
|
||||
toastMsg('网络错误,请退出重进')
|
||||
}
|
||||
})
|
||||
}
|
||||
// 获取上期榜单接口
|
||||
function getlastTop (type, datetype) {
|
||||
showLoading()
|
||||
networkRequest({
|
||||
type: 'GEt',
|
||||
url: urlPrefix + '/allrank/last/top3',
|
||||
data: { type, datetype, uid: pubInfo.uid },
|
||||
success (res) {
|
||||
if (res.code === 200) {
|
||||
var top3 = res.data.rankVoList.slice(0, 3);
|
||||
// 处理前三
|
||||
if (top3.length < 3) {
|
||||
let arr = new Array(3 - top3.length).fill({
|
||||
avatar: './images/logo.png',
|
||||
nick: '虚位以待',
|
||||
totalNum: "",
|
||||
gender: '',
|
||||
assist: {
|
||||
avatar: './images/logo.png'
|
||||
}
|
||||
})
|
||||
top3.push(...arr)
|
||||
}
|
||||
top3.forEach((res, i) => {
|
||||
console.log(res.nick);
|
||||
if (res.nick == '虚位以待') {
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} .icon`).hide();
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} i`).hide();
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} .zl`).hide();
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} p span`).hide();
|
||||
console.log('123');
|
||||
} else {
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} p span img`).show();
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} .icon`).show();
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} i`).show();
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} .zl`).show();
|
||||
}
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} .ts`).attr('uid', res.uid);
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} .ts`).attr('inRoomUid', res.inRoomUid);
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} .tx`).attr('src', res.avatar);
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} .icon_gh`).attr('src', res.assist.avatar);
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} p`).html(`${res.nick.length > 6 ? `${res.nick.slice(0, 6)}...` : res.nick}<span class="${res.gender == 1 ? 'boy' : 'girl'}" style="display:${res.nick == '虚位以待' ? 'none' : 'inline-block'};"><img src="./images/${res.gender == 1 ? 'boy' : 'girl'}.png" alt=""></span>`);
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} .icon .icon1`).attr('src', res.experUrl);
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} .icon .icon2`).attr('src', res.charmUrl);
|
||||
|
||||
if (res.inMic) {
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} .svga`).show();
|
||||
} else {
|
||||
$(`.lastTopThree .lastTopThree_in .box .no${i + 1} .svga`).hide();
|
||||
}
|
||||
})
|
||||
$('.lastTopThree').show();
|
||||
} else {
|
||||
toastMsg(res.message)
|
||||
}
|
||||
hideLoading(layerIndex)
|
||||
},
|
||||
error (err) {
|
||||
hideLoading(layerIndex)
|
||||
toastMsg('网络错误,请退出重进')
|
||||
}
|
||||
})
|
||||
}
|
||||
// 获取工会榜单接口
|
||||
function clanListRank () {
|
||||
$('.list li').remove();
|
||||
showLoading()
|
||||
networkRequest({
|
||||
type: 'GEt',
|
||||
url: urlPrefix + '/clan/listRank',
|
||||
success (res) {
|
||||
if (res.code === 200) {
|
||||
// 处理前三
|
||||
var top3 = res.data.slice(0, 3);
|
||||
if (top3.length < 3) {
|
||||
let arr = new Array(3 - top3.length).fill({
|
||||
avatar: './images/logo.png',
|
||||
name: '虚位以待',
|
||||
})
|
||||
top3.push(...arr);
|
||||
}
|
||||
top3.forEach((res, i) => {
|
||||
$(`.header .topBox .no${i + 1} .ts`).attr('uid', res.uid);
|
||||
$(`.header .topBox .no${i + 1} .ts`).attr('inRoomUid', res.inRoomUid);
|
||||
$(`.header .topBox .no${i + 1} .ts`).attr('inMic', res.inMic);
|
||||
$(`.header .topBox .no${i + 1} .tx`).attr('src', res.avatar);
|
||||
$(`.header .topBox .no${i + 1} .icon_gh`).attr('src', res.levelIcon);
|
||||
$(`.header .topBox .no${i + 1} p`).html(`${res.name.length > 6 ? `${res.name.slice(0, 6)}...` : res.name}<span class="${res.gender == 1 ? 'boy' : 'girl'}"><img src="./images/${res.gender == 1 ? 'boy' : 'girl'}.png" alt=""></span>`);
|
||||
$(`.header .topBox .no${i + 1} .icon .icon1`).attr('src', res.experUrl);
|
||||
$(`.header .topBox .no${i + 1} .icon .icon2`).attr('src', res.charmUrl);
|
||||
if (i >= 1) {
|
||||
$(`.header .topBox .no${i + 1} i`).text(`距上一名${unitProcessing((top3[i - 1].totalNum - res.totalNum), 10000, 1, 'W')}`);
|
||||
}
|
||||
if (res.inMic) {
|
||||
$(`.header .topBox .no${i + 1} .svga`).show();
|
||||
} else {
|
||||
$(`.header .topBox .no${i + 1} .svga`).hide();
|
||||
}
|
||||
})
|
||||
// 处理非前三
|
||||
var notTop3 = res.data.slice(3);
|
||||
var str = '';
|
||||
notTop3.forEach((res, i) => {
|
||||
str += `
|
||||
<li>
|
||||
<div class="num">${i + 4}</div>
|
||||
<img src="${res.avatar}" alt="" class="tx" uid="${res.uid}" inRoomUid = '${res.inRoomUid}' inMic="${res.inMic}" ">
|
||||
<div src="./images/live.svga" loops="0" clearsAfterStop="true" class="svga" style="display: ${res.inMic ? 'block' : 'none'};"></div>
|
||||
<div class="nameBox">
|
||||
<p>${res.name.length > 7 ? `${res.name.slice(0, 7)}...` : res.name}
|
||||
<span class="${res.gender == 1 ? 'boy' : 'girl'}"><img src="./images/${res.gender == 1 ? 'boy' : 'girl'}.png" alt=""></span>
|
||||
</p>
|
||||
</div>
|
||||
<img style="display: block;" src="${res.levelIcon}" alt="" class="icon_gh">
|
||||
</li>`
|
||||
})
|
||||
$('.list').append(str);
|
||||
} else {
|
||||
toastMsg(res.message)
|
||||
}
|
||||
hideLoading(layerIndex)
|
||||
},
|
||||
error (err) {
|
||||
hideLoading(layerIndex)
|
||||
toastMsg('网络错误,请退出重进')
|
||||
}
|
||||
})
|
||||
}
|
||||
// 榜单切换按钮
|
||||
$('.header .tab div').click(function () {
|
||||
var i = $(this).index() + 1;
|
||||
listType = i;
|
||||
$('.header .timeTab div').css('color', 'rgba(255, 255, 255, 0.9)');
|
||||
$('.header .tab div').removeClass('active1').removeClass('active2').removeClass('active3').removeClass('active4');
|
||||
$('.header .tab div').eq(i - 1).addClass(`active${i}`);
|
||||
$('.header .timeTab div').removeClass('divBg1').removeClass('divBg2').removeClass('divBg3')
|
||||
$('.header .timeTab div').removeClass('active1').removeClass('active2').removeClass('active3').removeClass('active4')
|
||||
$('.header .timeTab div').addClass(`divBg${i}`);
|
||||
$('.header').removeClass('header2').removeClass('header3').removeClass('header4');
|
||||
$('.header .listLast span').removeClass('sp1').removeClass('sp2').removeClass('sp3');
|
||||
$('.header .listLast span').addClass(`sp${i}`)
|
||||
$('.header').addClass(`header${i}`);
|
||||
$('.header .topBox').removeClass('topBox1').removeClass('topBox2').removeClass('topBox3').removeClass('topBox4');
|
||||
$('.header .topBox').addClass(`topBox${i}`);
|
||||
$('.header .listLast').show();
|
||||
$('.my').show();
|
||||
$('.list li .right').hide();
|
||||
$('.header .topBox .no .zl').hide();
|
||||
$('.list li .icon_gh').hide();
|
||||
$('.list li .score').show();
|
||||
$('.list li .nameBox .icon').show();
|
||||
$('.list li .nameBox p span').show();
|
||||
$('.header .topBox .no .icon_gh').hide();
|
||||
$('.header .topBox .no .svga').show()
|
||||
$('.header .topBox .no .icon').show()
|
||||
$('.header .topBox .no p span').show()
|
||||
$('.header .topBox .no i').show()
|
||||
if (i == 1) {
|
||||
$('.my .score i').text('爱意值');
|
||||
type = 2;
|
||||
datetype = 1;
|
||||
getRank(type, datetype);
|
||||
} else if (i == 2) {
|
||||
$('.my .score i').text('魅力值');
|
||||
$('.list li .right').show();
|
||||
$('.header .topBox .no .zl').show();
|
||||
type = 1;
|
||||
datetype = 1;
|
||||
getRank(type, datetype);
|
||||
}
|
||||
if (i == 3) {
|
||||
$('.list li .right').show();
|
||||
$('.header .topBox .no .zl').show();
|
||||
$('.header .timeTab').addClass('timeTab2');
|
||||
$('.header .timeTab').show();
|
||||
$('.header .timeTab div').eq(0).addClass(`active${i}`);
|
||||
$('.header .timeTab div').eq(0).css('color', `${listType == 1 ? '#FF5391' : listType == 2 ? '#A34DFF' : listType == 3 ? '#5C68F2' : ''}`).siblings().css('color', 'rgba(255, 255, 255, 0.9)')
|
||||
$('.my .score i').text('房间值');
|
||||
$('.header .topBox .no p span').hide();
|
||||
type = 3;
|
||||
datetype = 6;
|
||||
getRank(type, datetype);
|
||||
} else if (i == 4) {
|
||||
$('.header .listLast').hide();
|
||||
$('.header .timeTab').hide();
|
||||
$('.header .timeTab div').eq(1).addClass(`active${i}`);
|
||||
$('.my').hide();
|
||||
$('.list li .icon_gh').show();
|
||||
$('.list li .score').hide();
|
||||
$('.list li .nameBox .icon').hide();
|
||||
$('.list li .nameBox p span').hide();
|
||||
$('.header .topBox .no .icon_gh').show();
|
||||
$('.header .topBox .no .svga').hide()
|
||||
$('.header .topBox .no .icon').hide()
|
||||
$('.header .topBox .no p span').hide()
|
||||
$('.header .topBox .no i').hide()
|
||||
clanListRank();
|
||||
} else {
|
||||
$('.header .timeTab').show();
|
||||
$('.header .timeTab').removeClass('timeTab2');
|
||||
$('.header .timeTab div').eq(1).addClass(`active${i}`);
|
||||
$('.header .timeTab div').eq(1).css('color', `${listType == 1 ? '#FF5391' : listType == 2 ? '#A34DFF' : listType == 3 ? '#5C68F2' : ''}`).siblings().css('color', 'rgba(255, 255, 255, 0.9)')
|
||||
}
|
||||
return false;
|
||||
})
|
||||
// 时间周期榜单切换
|
||||
$('.header .timeTab div').click(function () {
|
||||
var i = $(this).index() + 1;
|
||||
console.log(i);
|
||||
$('.header .timeTab div').removeClass('active1').removeClass('active2').removeClass('active3').removeClass('active4')
|
||||
$('.header .timeTab div').eq(i - 1).addClass(`active${i}`);
|
||||
$(this).css('color', `${listType == 1 ? '#FF5391' : listType == 2 ? '#A34DFF' : listType == 3 ? '#5C68F2' : ''}`).siblings().css('color', 'rgba(255, 255, 255, 0.9)')
|
||||
if (i == 1) {
|
||||
datetype = 6;
|
||||
} else if (i == 2) {
|
||||
datetype = 1;
|
||||
} else if (i == 3) {
|
||||
datetype = 2;
|
||||
} else if (i == 4) {
|
||||
datetype = 5;
|
||||
};
|
||||
getRank(type, datetype);
|
||||
})
|
||||
// 关闭上期前三
|
||||
$('.lastTopThree').click(function () {
|
||||
$('.lastTopThree').hide();
|
||||
})
|
||||
// 打开上期前三
|
||||
$('.header .listLast').click(function () {
|
||||
if (listType == 3 || listType == 2) {
|
||||
$('.lastTopThree .lastTopThree_in .box .no .icon_gh').show();
|
||||
} else {
|
||||
$('.lastTopThree .lastTopThree_in .box .no .icon_gh').hide();
|
||||
}
|
||||
getlastTop(type, datetype);
|
||||
})
|
||||
// 点击前三按钮
|
||||
$('.header .topBox .no .ts').on('click', function () {
|
||||
var uid = $(this).attr('uid');
|
||||
var inRoomUid = $(this).attr('inRoomUid');
|
||||
var inMic = $(this).attr('inMic');
|
||||
if (listType == 4) {
|
||||
return
|
||||
}
|
||||
if (inMic == true) {
|
||||
if (browser.ios) {
|
||||
window.webkit.messageHandlers.openRoom.postMessage(inRoomUid);
|
||||
} else if (browser.android) {
|
||||
if (androidJsObj && typeof androidJsObj === 'object') {
|
||||
window.androidJsObj.openRoom(inRoomUid);
|
||||
}
|
||||
}
|
||||
console.log('房间', uid, inRoomUid, inMic);
|
||||
} else {
|
||||
if (browser.ios) {
|
||||
window.webkit.messageHandlers.openPersonPage.postMessage(uid);
|
||||
} else if (browser.android) {
|
||||
if (androidJsObj && typeof androidJsObj === 'object') {
|
||||
window.androidJsObj.openPersonPage(uid);
|
||||
}
|
||||
}
|
||||
console.log('信息页', uid, inRoomUid, inMic);
|
||||
}
|
||||
|
||||
})
|