Commit 15d24222 by libai

测试

parent 09491d59
Showing with 45 additions and 37 deletions
...@@ -873,10 +873,13 @@ $(function(){ ...@@ -873,10 +873,13 @@ $(function(){
success:function(data){ success:function(data){
console.log('直播列表',data) console.log('直播列表',data)
var html=[]; var html=[];
var obj={
}
var j=0 var j=0
for(var i=0;i<data.normalRoomList.length;i++){ for(var i=0;i<data.normalRoomList.length;i++){
var list=data.normalRoomList[i] var list=data.normalRoomList[i]
console.log(i) obj.push(list)
if(i%3==0&&i!=0){ if(i%3==0&&i!=0){
if(data.vipRoomList[j]!=undefined){ if(data.vipRoomList[j]!=undefined){
list2=data.vipRoomList[j] list2=data.vipRoomList[j]
...@@ -908,6 +911,7 @@ $(function(){ ...@@ -908,6 +911,7 @@ $(function(){
html+='</li></a>'; html+='</li></a>';
} }
$(".box1 .live-ul").html(html); $(".box1 .live-ul").html(html);
console.log(obj)
} }
}) })
......
...@@ -1161,7 +1161,7 @@ $(function(){ ...@@ -1161,7 +1161,7 @@ $(function(){
} }
function moreMc(){ function moreMc(){
$.ajax({ $.ajax({
url:$ip+'frontPage/queryLiveUsers', url:$ip+'frontPage/queryLiveUsers/v2',
data:{ data:{
pageNum:1, pageNum:1,
pageSize:3, pageSize:3,
...@@ -1179,8 +1179,8 @@ $(function(){ ...@@ -1179,8 +1179,8 @@ $(function(){
} }
var html=''; var html='';
for(var i=0;i<3;i++){ for(var i=0;i<3;i++){
if(data.roomList[i]==undefined)break; if(data.normalRoomList[i]==undefined)break;
var list=data.roomList[i] var list=data.normalRoomList[i]
html+='<a href="liveRoom.html?roomId='+list.roomId+'&v=2022112502"><li>'; html+='<a href="liveRoom.html?roomId='+list.roomId+'&v=2022112502"><li>';
html+='<span class="more-mc-num">'+list.hotnum+'</span>'; html+='<span class="more-mc-num">'+list.hotnum+'</span>';
html+='<img class="more-mc-face" src="https://zhibocdn.yabolive.net/comm'+list.face+'?x-oss-process=image/resize,w_150" alt="">'; html+='<img class="more-mc-face" src="https://zhibocdn.yabolive.net/comm'+list.face+'?x-oss-process=image/resize,w_150" alt="">';
...@@ -1204,48 +1204,52 @@ $(function(){ ...@@ -1204,48 +1204,52 @@ $(function(){
pageID:localStorage.canvasCode pageID:localStorage.canvasCode
}, },
success:function(data){ success:function(data){
// console.log('直播列表',data) console.log('直播列表',data)
if(data.code==-5008){ if(data.code==-5008){
setTimeout(function() { setTimeout(function() {
liveList(1) liveList(1)
}, 500); }, 500);
return; return;
} }
var bottomNum var obj={
var topNum
for(var i=0;i<data.roomList.length;i++){ }
var list=data.roomList[i] // var bottomNum
// list.roomId // var topNum
if(list.roomId==sessionStorage.roomId){
if(i+1==data.roomList.length){
BottomRoomId=data.roomList[0].roomId
bottomNum=0
}else{
BottomRoomId=data.roomList[i+1].roomId
bottomNum=(i+1)
}
if(i==0){ // for(var i=0;i<data.roomList.length;i++){
topRoomId=data.roomList[data.roomList.length-1].roomId // var list=data.roomList[i]
topNum=data.roomList.length-1 // // list.roomId
}else{ // if(list.roomId==sessionStorage.roomId){
topRoomId=data.roomList[i-1].roomId // if(i+1==data.roomList.length){
topNum=(i-1) // BottomRoomId=data.roomList[0].roomId
} // bottomNum=0
// }else{
// BottomRoomId=data.roomList[i+1].roomId
// bottomNum=(i+1)
// }
if(data.roomList.length==1){ // if(i==0){
topRoomId=list.roomId // topRoomId=data.roomList[data.roomList.length-1].roomId
BottomRoomId=list.roomId // topNum=data.roomList.length-1
bottomNum=0 // }else{
topNum=0 // topRoomId=data.roomList[i-1].roomId
} // topNum=(i-1)
// }
// if(data.roomList.length==1){
// topRoomId=list.roomId
// BottomRoomId=list.roomId
// bottomNum=0
// topNum=0
// }
} // }
} // }
if(topRoomId==0){ // if(topRoomId==0){
topRoomId=data.roomList[0].roomId // topRoomId=data.roomList[0].roomId
BottomRoomId=data.roomList[1].roomId // BottomRoomId=data.roomList[1].roomId
} // }
// var html=[]; // var html=[];
// html+='<div class="top-bg-box"> <img src="https://zhibocdn.yabolive.net/comm'+data.roomList[topNum].face+'?x-oss-process=image/resize,w_350"> </div>'; // html+='<div class="top-bg-box"> <img src="https://zhibocdn.yabolive.net/comm'+data.roomList[topNum].face+'?x-oss-process=image/resize,w_350"> </div>';
// html+='<div class="bottom-bg-box"> <img src="https://zhibocdn.yabolive.net/comm'+data.roomList[bottomNum].face+'?x-oss-process=image/resize,w_350"> </div>'; // html+='<div class="bottom-bg-box"> <img src="https://zhibocdn.yabolive.net/comm'+data.roomList[bottomNum].face+'?x-oss-process=image/resize,w_350"> </div>';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment