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