liuyu 4 years ago
parent
commit
41638142cd
1 changed files with 5 additions and 3 deletions
  1. 5 3
      src/views/live/roomDetail.vue

+ 5 - 3
src/views/live/roomDetail.vue

@@ -180,6 +180,7 @@ export default {
       swichusers: [],
       sbuser: '',
       othedivshow: false,
+      shmaiindex: 0,
     };
   },
   created() {
@@ -233,6 +234,7 @@ export default {
         for (const elm of this.swichusers) {
           if (elm.swichuserid === objid) {
             const id_ = 'othe-video-' + elm.swichindex;
+            this.shmaiindex = elm.swichindex;
             const thr_ = document.getElementById(id_);
             let style = 'width:70%;';
             style += 'height:200px;';
@@ -253,8 +255,8 @@ export default {
       } else {
         console.log('share--' + this.othedivshow);
         if (this.othedivshow) {
-          for (const i = 1; i < 6; i++) {
-            const id_ = 'othe-video-' + i;
+          if (this.shmaiindex !== 0) {
+            const id_ = 'othe-video-' + this.shmaiindex;
             const thr_ = document.getElementById(id_);
             const left_ = (width / 5) * (i - 1);
             let style = 'width:20%;';
@@ -265,7 +267,7 @@ export default {
             thr_.style.cssText = style;
           }
         }
-        console.log('share设置大小--');
+        console.log('share设置大小--' + this.shmaiindex);
         const lvl_ = document.getElementById('look-video-left');
         let stylell = 'width:70%;';
         stylell += 'height:200px;';