Commit 2442cbed by libai

测试

parent 64446a40
Showing with 39 additions and 9 deletions
...@@ -633,7 +633,7 @@ html * { ...@@ -633,7 +633,7 @@ html * {
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
.like-ul li:nth-child(4n) { .like-ul > a:nth-child(4n) li {
margin-right: 0; margin-right: 0;
} }
.like-shadow { .like-shadow {
......
...@@ -672,8 +672,11 @@ ...@@ -672,8 +672,11 @@
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
li:nth-child(4n){ >a:nth-child(4n){
margin-right: 0; li{
margin-right: 0;
}
} }
} }
......
...@@ -656,11 +656,12 @@ $(function(){ ...@@ -656,11 +656,12 @@ $(function(){
// console.log('拉取關注列表',data) // console.log('拉取關注列表',data)
var html=[]; var html=[];
var liveNum=0 var liveNum=0
var likeMcArr=[]
for(var i=0;i<data.rooms.length;i++){ for(var i=0;i<data.rooms.length;i++){
var list=data.rooms[i] var list=data.rooms[i]
if(list.liveState!=1)continue; if(list.liveState!=1)continue;
liveNum++ liveNum++
likeMcArr.push(list.uid)
html+='<a href="https://www.footseen.xyz/room/liveRoom.html?roomId='+list.uid+'"><li style="background: url(https://zhibocdn.yabolive.net/comm'+list.face+'?x-oss-process=image/resize,w_368) no-repeat;background-size: cover;">'; html+='<a href="https://www.footseen.xyz/room/liveRoom.html?roomId='+list.uid+'"><li style="background: url(https://zhibocdn.yabolive.net/comm'+list.face+'?x-oss-process=image/resize,w_368) no-repeat;background-size: cover;">';
if(list.liveScope==3&&list.selfLock==1)html+='<img class="lock" src="images/Lock-ok.png">'; if(list.liveScope==3&&list.selfLock==1)html+='<img class="lock" src="images/Lock-ok.png">';
else if(list.liveScope==3&&list.selfLock==0)html+='<img class="lock" src="images/Lock-no.png">'; else if(list.liveScope==3&&list.selfLock==0)html+='<img class="lock" src="images/Lock-no.png">';
...@@ -673,15 +674,38 @@ $(function(){ ...@@ -673,15 +674,38 @@ $(function(){
html+='<div class="like-no-box"><img src="images/front/no-icon.png"><p>暫無追蹤的在線主播</p></div>' html+='<div class="like-no-box"><img src="images/front/no-icon.png"><p>暫無追蹤的在線主播</p></div>'
} }
$(".like-ul").html(html); $(".like-ul").html(html);
console.log(likeMcArr)
if(liveNum==0){ if(liveNum<5){
$(".other-like-mc").show() $(".other-like-mc").show()
setTimeout(function(){ setTimeout(function(){
var data=hotList var data=hotList
var html=[]; var html=[];
for(var i=0;i<4;i++){
if(data.roomList[i]==undefined)break; var otherNum=0
var list=data.roomList[i] var otherMcArr=[]
console.log(data.roomList)
for(var i=0;i<data.roomList.length;i++){
var j=Math.floor(Math.random()*data.roomList.length)
var roomLikeEnd=false;
if(data.roomList[j]==undefined)break;
var list=data.roomList[j]
//已关注主播去重
for(var t=0;t<likeMcArr.length;t++){
if(list.roomId==likeMcArr[t]){
roomLikeEnd=true;
// i--;
continue;
}
}
//已显示主播去重
for(var y=0;y<otherMcArr.length;y++){
if(list.roomId==otherMcArr[y]){
roomLikeEnd=true;
i--;
continue
}
}
if(roomLikeEnd==true)continue;
html+='<li>'; html+='<li>';
html+='<a href="https://www.footseen.xyz/room/liveRoom.html?roomId='+list.roomId+'"><div style="background: url(https://zhibocdn.yabolive.net/comm'+list.face.split('?')[0]+'?x-oss-process=image/resize,w_368) no-repeat;background-size: cover;" class="live-top-box">'; html+='<a href="https://www.footseen.xyz/room/liveRoom.html?roomId='+list.roomId+'"><div style="background: url(https://zhibocdn.yabolive.net/comm'+list.face.split('?')[0]+'?x-oss-process=image/resize,w_368) no-repeat;background-size: cover;" class="live-top-box">';
if(list.liveScope==3&&list.selfLock==1)html+='<img class="lock" src="images/Lock-ok.png">'; if(list.liveScope==3&&list.selfLock==1)html+='<img class="lock" src="images/Lock-ok.png">';
...@@ -695,6 +719,9 @@ $(function(){ ...@@ -695,6 +719,9 @@ $(function(){
html+='</div>'; html+='</div>';
html+='<div class="live-name-box">'+list.nickname+'</div></a>'; html+='<div class="live-name-box">'+list.nickname+'</div></a>';
html+='</li>'; html+='</li>';
otherMcArr.push(list.roomId)
otherNum++
if(otherNum>4)break;
} }
$(".other-like-ul").html(html); $(".other-like-ul").html(html);
......
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