liuyu 5 年之前
父节点
当前提交
7b13d42da7
共有 1 个文件被更改,包括 11 次插入6 次删除
  1. 11 6
      src/views/live/roomDetail.vue

+ 11 - 6
src/views/live/roomDetail.vue

@@ -8,7 +8,7 @@
         <div :style="{ height: lheight, width: lwidth }" id="look-video-left" class="video-box col-div look-video-left"></div>
         <div id="look-video-right" :style="{ height: rheight, width: rwidth }" class="video-box col-div look-video-right"></div>
       </div>
-      <div id="othediv" :style="{ transform: transform, height: otheheight, width: vwidth, padding: othepadding, position: 'absolute' }">
+      <div id="othediv" v-show="othedivshow" :style="{ transform: transform, height: otheheight, width: vwidth, padding: othepadding, position: 'absolute' }">
         <div id="othe-video-1" :style="{ height: otheheight, width: othewidth }" class="video-box col-div othe-video-left"></div>
         <div id="othe-video-2" :style="{ height: otheheight, width: othewidth }" class="video-box col-div othe-video-left"></div>
         <div id="othe-video-3" :style="{ height: otheheight, width: othewidth }" class="video-box col-div othe-video-left"></div>
@@ -182,6 +182,7 @@ export default {
       background_: '#000',
       swichusers: [],
       sbuser: '',
+      othedivshow: false,
     };
   },
   created() {
@@ -217,6 +218,7 @@ export default {
       lvr_.style.cssText = style;
     },
     swichposition(objid) {
+      objid = this.userid_;
       if (!objid) {
         return;
       }
@@ -302,21 +304,22 @@ export default {
     },
     channel() {
       console.log('in function:');
+      console.log(`/exchange/switch_shmai_` + this.id);
       this.$stomp({
         [`/exchange/public_chat_` + this.id]: this.onMessage,
       });
       this.$stomp({
-        [`/exchange/quest_publish_` + this.id]: this.onQueMessage,
+        [`/exchange/switch_role_` + this.user.uid]: this.onSwichMessage,
       });
       this.$stomp({
-        [`/exchange/switch_role_` + this.user.uid]: this.onSwichMessage,
+        [`/exchange/switch_shmai_` + this.id]: this.onSwichShmaiMessage,
+      });
+      this.$stomp({
+        [`/exchange/quest_publish_` + this.id]: this.onQueMessage,
       });
       // this.$stomp({
       //   [`/exchange/othe_publish_` + this.id]: this.onOtheMessage,
       // });
-      this.$stomp({
-        [`/exchange/switch_shmai_` + this.id]: this.onSwichShmaiMessage,
-      });
     },
     onMessage(message) {
       // console.log('receive a message: ', message.body);
@@ -356,6 +359,7 @@ export default {
     },
     onSwichShmaiMessage() {
       let body = _.get(message, 'body');
+      console.log(body);
       if (body) {
         body = JSON.parse(body);
         if (body.shmaiid === this.user.uid) {
@@ -390,6 +394,7 @@ export default {
       wx.miniProgram.navigateTo({ url });
     },
     async roomMeetSwich() {
+      this.othedivshow = true;
       if (this.iscamera) {
         const videoTrack = this.localStream_.getVideoTrack();
         if (videoTrack) {