dusenyao 3 years ago
parent
commit
e052fb69c5
2 changed files with 11 additions and 11 deletions
  1. 10 10
      src/views/live/teacher/index.vue
  2. 1 1
      src/views/live/teacher/live.js

+ 10 - 10
src/views/live/teacher/index.vue

@@ -236,6 +236,7 @@ export default {
       task_id: this.$route.query.task_id,
       // 连麦
       connect: false,
+      connectStudent: {},
       // 等待接通
       callLoading: false,
       dialogVisible: false,
@@ -312,9 +313,9 @@ export default {
       }
       return '#38d514';
     },
-    connectStudent() {
-      let connect = this.student_list.find(item => item.deal_mode !== 0);
-      return connect || {};
+    connectUid() {
+      let connect = this.student_list.find(item => item.connection_status !== 0);
+      return connect ? connect.room_user_id : '';
     }
   },
   watch: {
@@ -461,6 +462,7 @@ export default {
         return;
       }
       this.callLoading = true;
+      this.connectStudent = student;
       GetLiveRoomInfo({ task_id: this.task_id })
         .then(({ video_mode }) => {
           let uid = student.room_user_id;
@@ -518,25 +520,23 @@ export default {
 
     // 下麦
     handsDown() {
+      console.log(this.connectUid);
       common.handsDown({
-        uid: this.connectStudent.room_user_id,
+        uid: this.connectUid,
         success: str => {
           if (this.callLoading) {
             common.sendPublishMessage({
               type: 'handsDown-load',
-              uid: this.connectStudent.room_user_id
+              uid: this.connectUid
             });
           }
 
-          this.dealStudentConnection(
-            this.connectStudent.room_user_id,
-            0,
-            this.connectStudent.connection_mode
-          );
+          this.dealStudentConnection(this.connectUid, 0, this.connectStudent.connection_mode);
 
           this.callLoading = false;
           common.updateMcResult('', 0);
           this.$message.success('下麦成功');
+          this.connectStudent = {};
         },
         fail: data => {
           this.callLoading = false;

+ 1 - 1
src/views/live/teacher/live.js

@@ -178,7 +178,7 @@ export function initListener(vue) {
             vue.callLoading = false;
           }
           if (streamType === 10) {
-            vue.dealStudentConnection(vue.connectStudent.room_user_id, 2, vue.roomInfo.video_mode);
+            vue.dealStudentConnection(vue.connectUid, 2, vue.roomInfo.video_mode);
           }
         },
         fail(err) {