高能榜刷新优化
parent
b6464a4a7c
commit
d22a0acf1b
52
js/handle.js
52
js/handle.js
|
@ -166,34 +166,38 @@ function receiveMessage(event)
|
|||
return false
|
||||
}
|
||||
|
||||
let leaderInfo = ''
|
||||
|
||||
console.log(highList, '获取的高能榜单')
|
||||
// 高能榜列表
|
||||
if (highList.length > 0) {
|
||||
leaderInfo = highList[0]
|
||||
// 获取当前领舞人
|
||||
let currentLeader = getLeader()
|
||||
let now = (new Date).getTime()/1000
|
||||
if (currentLeader['name'] === '') {
|
||||
setLeader(highList[0], leaderTime)
|
||||
} else {
|
||||
//领舞人存在 检查过期时间
|
||||
if (currentLeader['time'] === 0 || currentLeader['time'] < now) {
|
||||
// 切换领舞
|
||||
// let currentLeader = getLeader()
|
||||
// let now = (new Date).getTime()/1000
|
||||
// if (currentLeader['name'] === '') {
|
||||
// setLeader(highList[0], leaderTime)
|
||||
// } else {
|
||||
// //领舞人存在 检查过期时间
|
||||
// if (currentLeader['time'] === 0 || currentLeader['time'] < now) {
|
||||
// // 切换领舞
|
||||
|
||||
// 当前领舞人
|
||||
let leaderIndex = highList.indexOf(currentLeader['name'])
|
||||
let newLeader
|
||||
if (leaderIndex == -1) {
|
||||
newLeader = highList[0]
|
||||
} else {
|
||||
let newIndex = leaderIndex + 1
|
||||
if (newIndex >= highList.length) {
|
||||
newIndex = 0
|
||||
}
|
||||
newLeader = highList[newIndex]
|
||||
}
|
||||
// // 当前领舞人
|
||||
// let leaderIndex = highList.indexOf(currentLeader['name'])
|
||||
// let newLeader
|
||||
// if (leaderIndex == -1) {
|
||||
// newLeader = highList[0]
|
||||
// } else {
|
||||
// let newIndex = leaderIndex + 1
|
||||
// if (newIndex >= highList.length) {
|
||||
// newIndex = 0
|
||||
// }
|
||||
// newLeader = highList[newIndex]
|
||||
// }
|
||||
|
||||
setLeader(newLeader, leaderTime)
|
||||
}
|
||||
}
|
||||
// setLeader(newLeader, leaderTime)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
// uid是否存在 不存在则存入uidObj
|
||||
|
@ -213,7 +217,7 @@ function receiveMessage(event)
|
|||
// custom.js中 每条弹幕的处理 放到了此处
|
||||
// -------------------- 每条弹幕处理 begin -----------------------
|
||||
// 获取领舞信息
|
||||
let leaderInfo = sessionStorage.getItem('leader')
|
||||
// let leaderInfo = sessionStorage.getItem('leader')
|
||||
|
||||
let eventName = getEvent(data.danmaku)
|
||||
let isLeader = data.uname == leaderInfo ? 1 : 0
|
||||
|
|
Loading…
Reference in New Issue