From 394a8e34b4e07da29eec608cfcf46ee2a6bd274a Mon Sep 17 00:00:00 2001 From: theluyuan <1162963624@qq.com> Date: Thu, 3 Dec 2020 16:24:22 +0800 Subject: [PATCH 1/7] zhibo --- public/js/common.js | 21 ++++++++---- public/js/iminit.js | 4 +-- public/zhibo.html | 78 +++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 88 insertions(+), 15 deletions(-) diff --git a/public/js/common.js b/public/js/common.js index 42d4031..4c8ab8d 100644 --- a/public/js/common.js +++ b/public/js/common.js @@ -157,9 +157,9 @@ function setBtnClickFuc() { $('#logout-btn').on('click', () => { // window.location.hash='edit' // console.log(window.location.hash) - var x; - var r=confirm("您确认关闭吗?"); - if (r==true){ + // var x; + // var r=confirm("您确认关闭吗?"); + // if (r==true){ leave(); $('#room-root').hide(); $('#login-root').show(); @@ -188,6 +188,9 @@ function setBtnClickFuc() { }, success(){ res(1) + }, + error(){ + res(2) } }) }) @@ -204,10 +207,10 @@ function setBtnClickFuc() { window.parent.location.href="/regime/livedetail?id=" + window.liveid; }) - } - else{ - x="你按下了\"取消\"按钮!"; - } + // } + // else{ + // x="你按下了\"取消\"按钮!"; + // } // leave(); // $('#room-root').hide(); // $('#login-root').show(); @@ -333,11 +336,14 @@ function addMemberView(id) { const src = $(el.target).attr("src") == "img/camera-on.png" ? 1 : 0 console.log("video" + id); sendsx(id,src) + window.message(src == 1 ? "关闭摄像头成功" : "解禁摄像头成功") + }) memberElm.find("#mic-btn").click((el)=>{ const src = $(el.target).attr("src") == "img/mic-on.png" ? 1 : 0 console.log("mic" + id); sendjinyan(id,src) + window.message(src == 1 ? "关闭麦克风成功" : "解禁麦克风成功") }) memberElm.find("#video-btn").removeAttr("id") memberElm.find("#mic-btn").removeAttr("id") @@ -345,6 +351,7 @@ function addMemberView(id) { console.log("移除") getname(id).then((res)=>{ $("#" + id).find('div.member-id').html(res); + // console.log(.length) }) memberElm.appendTo($('#member-list')); diff --git a/public/js/iminit.js b/public/js/iminit.js index 8066cb9..c31d3f5 100644 --- a/public/js/iminit.js +++ b/public/js/iminit.js @@ -29,10 +29,10 @@ function getgrouplist(){ promise.then(function(imResponse) { console.log(imResponse.data.memberCount); if(imResponse.data.memberCount < 3){ - $("#main-video").css("grid-area","1/1/3/5") + $(".video-box").eq(0).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") + $(".video-box").eq(0).css("grid-area","1/1/3/4") $(".liaotian").css("grid-area","3/1/4/4") } }).catch(function(imError) { diff --git a/public/zhibo.html b/public/zhibo.html index 319ef21..a7bb88f 100644 --- a/public/zhibo.html +++ b/public/zhibo.html @@ -8,6 +8,10 @@ + + + + @@ -390,7 +429,7 @@
- + @@ -465,11 +504,13 @@ @@ -535,6 +576,31 @@ } }) },5000) + + + + + +