Commit 91e6b8bb by libai

测试

parent 97de0e43
Showing with 41 additions and 25 deletions
......@@ -1145,46 +1145,62 @@ $(function(){
pageID:localStorage.canvasCode
},
success:function(data){
console.log('直播列表',data)
var html=[];
// console.log('直播列表',data)
var newList=''
newList+='['
var j=0
for(var i=0;i<data.normalRoomList.length;i++){
var list=data.normalRoomList[i]
if(i!=data.normalRoomList.length-1)newList+=(JSON.stringify(list)+',')
else newList+=(JSON.stringify(list))
if(i%3==0&&i!=0){
if(data.vipRoomList[j]!=undefined){
list2=data.vipRoomList[j]
if(i==data.normalRoomList.length-1)newList+=(','+JSON.stringify(list2))
else newList+=(JSON.stringify(list2)+',')
j++;
html+='<a href="room/liveRoom.html?roomId='+list2.roomId+'&sound=1&v=2022112502&back=1"><li data-type="https://zhibocdn.yabolive.net/comm'+list2.face.split("?")[0]+'?x-oss-process=image/resize,w_180">';
if(list2.liveScope==3)html+='<img class="secret" src="images/Lock-no.png" alt="">';
if(list2.liveScope!=3)html+='<div class="hot-num-box"><img src="images/hot.png"><span>'+list2.onlinenum+'</span></div>';
// html+='<img class="live-li-face" src="images/layz.png" alt="">';
html+='<img class="live-li-face" src="https://zhibocdn.yabolive.net/comm'+list2.face.split("?")[0]+'?x-oss-process=image/resize,w_300" alt="">';
html+='<div class="live-shadow"></div>';
html+='<div class="live-bottom-box">';
html+='<p>'+list2.nickname+'</p>';
html+='<p>'+list2.introduce+'</p>';
html+='</div>';
html+='</li></a>';
}
}
}
newList+="]"
newList=JSON.parse(newList)
for(var i=0;i<newList.length;i++){
var list=newList[i]
// list.roomId
if(list.roomId==sessionStorage.roomId){
//最后一个
if(i+1==newList.length){
BottomRoomId=newList[0].roomId
}else{
BottomRoomId=newList[i+1].roomId
}
//第一个
if(i==0){
topRoomId=newList[newList.length-1].roomId
}else{
topRoomId=newList[i-1].roomId
}
//只有一个
if(newList.length==1){
topRoomId=list.roomId
BottomRoomId=list.roomId
}
}
html+='<a href="room/liveRoom.html?roomId='+list.roomId+'&sound=1&v=2022112502&back=1"><li data-type="https://zhibocdn.yabolive.net/comm'+list.face.split("?")[0]+'?x-oss-process=image/resize,w_180">';
if(list.liveScope==3)html+='<img class="secret" src="images/Lock-no.png" alt="">';
if(list.liveScope!=3)html+='<div class="hot-num-box"><img src="images/hot.png"><span>'+list.onlinenum+'</span></div>';
// html+='<img class="live-li-face" src="images/layz.png" alt="">';
html+='<img class="live-li-face" src="https://zhibocdn.yabolive.net/comm'+list.face.split("?")[0]+'?x-oss-process=image/resize,w_300" alt="">';
html+='<div class="live-shadow"></div>';
html+='<div class="live-bottom-box">';
html+='<p>'+list.nickname+'</p>';
html+='<p>'+list.introduce+'</p>';
html+='</div>';
html+='</li></a>';
}
$(".box1 .live-ul").html(html);
if(topRoomId==0){
topRoomId=newList[0].roomId
BottomRoomId=newList[1].roomId
}
// 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="bottom-bg-box"> <img src="https://zhibocdn.yabolive.net/comm'+data.roomList[bottomNum].face+'?x-oss-process=image/resize,w_350"> </div>';
// $(".room-bg").append(html)
}
})
}
function hotList() {
$.ajax({
url: $ip + 'room/hot',
......
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