From ff8648d972d3dad3cfc492125a981da6afaa3cda Mon Sep 17 00:00:00 2001 From: theluyuan <1162963624@qq.com> Date: Thu, 3 Dec 2020 10:22:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/css/room.css | 2 +- public/js/iminit.js | 22 ++++++++++++++++++++++ public/zhibo.html | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/public/css/room.css b/public/css/room.css index 7d617ab..e544cd8 100644 --- a/public/css/room.css +++ b/public/css/room.css @@ -73,7 +73,7 @@ video{ width: 100%; height: 100%; padding: 10rem; - grid-area: 1/1/3/4; + grid-area: 1/1/3/5; border-radius: 17rem; } .video-box{ diff --git a/public/js/iminit.js b/public/js/iminit.js index d70933a..8066cb9 100644 --- a/public/js/iminit.js +++ b/public/js/iminit.js @@ -24,6 +24,22 @@ function getname(id){ }) } +function getgrouplist(){ + let promise = tim.getGroupOnlineMemberCount(window.roomid); + promise.then(function(imResponse) { + console.log(imResponse.data.memberCount); + if(imResponse.data.memberCount < 3){ + $("#main-video").css("grid-area","1/1/3/5") + $(".liaotian").css("grid-area","3/1/4/5") + }else{ + $("#main-video").css("grid-area","1/1/3/4") + $(".liaotian").css("grid-area","3/1/4/4") + } + }).catch(function(imError) { + console.warn('getGroupOnlineMemberCount error:', imError); // 获取直播群在线人数失败的相关信息 + }); +} + function formatDateTime (inputTime) { inputTime = inputTime * 1000 var date = new Date(inputTime); @@ -169,6 +185,9 @@ function formatDateTime (inputTime) { default: break; } + setInterval(() => { + getgrouplist() + }, 2000); }).catch((err)=>{ console.log(err) }) @@ -189,6 +208,9 @@ function formatDateTime (inputTime) { default: break; } + setInterval(() => { + getgrouplist() + }, 2000); }).catch((err)=>{ console.log(err) }) diff --git a/public/zhibo.html b/public/zhibo.html index 8743b07..319ef21 100644 --- a/public/zhibo.html +++ b/public/zhibo.html @@ -65,7 +65,7 @@ border-bottom: 1rem solid #EEEEEE; } .liaotian{ - grid-area: 3/1/4/4; + grid-area: 3/1/4/5; margin-top: 28rem; height: 90%; margin-left: 10rem;