From 15d242227bc7b2b9a7bc8cb0f738a617c273affd Mon Sep 17 00:00:00 2001 From: libai <libai@yazhai.co> Date: Wed, 21 Dec 2022 14:34:39 +0800 Subject: [PATCH] 测试 --- mTest/index.html | 6 +++++- mTest/room/liveRoom.html | 76 ++++++++++++++++++++++++++++++++++++++++------------------------------------ 2 files changed, 45 insertions(+), 37 deletions(-) diff --git a/mTest/index.html b/mTest/index.html index 4a7e08d..a9e0f1a 100644 --- a/mTest/index.html +++ b/mTest/index.html @@ -873,10 +873,13 @@ $(function(){ success:function(data){ console.log('直播列表',data) var html=[]; + var obj={ + + } var j=0 for(var i=0;i<data.normalRoomList.length;i++){ var list=data.normalRoomList[i] - console.log(i) + obj.push(list) if(i%3==0&&i!=0){ if(data.vipRoomList[j]!=undefined){ list2=data.vipRoomList[j] @@ -908,6 +911,7 @@ $(function(){ html+='</li></a>'; } $(".box1 .live-ul").html(html); + console.log(obj) } }) diff --git a/mTest/room/liveRoom.html b/mTest/room/liveRoom.html index bf36bf5..8a6b042 100644 --- a/mTest/room/liveRoom.html +++ b/mTest/room/liveRoom.html @@ -1161,7 +1161,7 @@ $(function(){ } function moreMc(){ $.ajax({ - url:$ip+'frontPage/queryLiveUsers', + url:$ip+'frontPage/queryLiveUsers/v2', data:{ pageNum:1, pageSize:3, @@ -1179,8 +1179,8 @@ $(function(){ } var html=''; for(var i=0;i<3;i++){ - if(data.roomList[i]==undefined)break; - var list=data.roomList[i] + if(data.normalRoomList[i]==undefined)break; + var list=data.normalRoomList[i] html+='<a href="liveRoom.html?roomId='+list.roomId+'&v=2022112502"><li>'; 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="">'; @@ -1204,48 +1204,52 @@ $(function(){ pageID:localStorage.canvasCode }, success:function(data){ - // console.log('直播列表',data) + console.log('直播列表',data) if(data.code==-5008){ setTimeout(function() { liveList(1) }, 500); return; } - var bottomNum - var topNum - for(var i=0;i<data.roomList.length;i++){ - var list=data.roomList[i] - // list.roomId - 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) - } + var obj={ + + } + // var bottomNum + // var topNum - if(i==0){ - topRoomId=data.roomList[data.roomList.length-1].roomId - topNum=data.roomList.length-1 - }else{ - topRoomId=data.roomList[i-1].roomId - topNum=(i-1) - } + // for(var i=0;i<data.roomList.length;i++){ + // var list=data.roomList[i] + // // list.roomId + // 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(data.roomList.length==1){ - topRoomId=list.roomId - BottomRoomId=list.roomId - bottomNum=0 - topNum=0 - } + // if(i==0){ + // topRoomId=data.roomList[data.roomList.length-1].roomId + // topNum=data.roomList.length-1 + // }else{ + // 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){ - topRoomId=data.roomList[0].roomId - BottomRoomId=data.roomList[1].roomId - } + // } + // } + // if(topRoomId==0){ + // topRoomId=data.roomList[0].roomId + // BottomRoomId=data.roomList[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>'; -- libgit2 0.25.0