dusenyao 3 年 前
コミット
5808157a4c
2 ファイル変更27 行追加7 行削除
  1. 12 6
      src/views/live/student/index.vue
  2. 15 1
      src/views/live/teacher/group.vue

+ 12 - 6
src/views/live/student/index.vue

@@ -227,13 +227,19 @@ export default {
     }
   },
   created() {
-    this.$loading({
-      text: '加载直播所需SDK中...',
-      background: '#fff'
+    GetGroupStatus({ task_id: this.task_id }).then(({ is_enable_group }) => {
+      if (is_enable_group === 'true') {
+        this.getMyGroupInfo_Student();
+      } else {
+        this.$loading({
+          text: '加载直播所需SDK中...',
+          background: '#fff'
+        });
+        common.downloadWebSDK(this);
+        this.getLiveRoomStudentList();
+        this.getLiveRoomInfo();
+      }
     });
-    common.downloadWebSDK(this);
-    this.getLiveRoomStudentList();
-    this.getLiveRoomInfo();
   },
   mounted() {
     this.getCurMaterialSent();

+ 15 - 1
src/views/live/teacher/group.vue

@@ -133,7 +133,8 @@ import {
   CreateEnterLiveRoomSession,
   JoinGroup_Teacher,
   ExitCurGroup_Teacher,
-  GetMyGroupInfo_Teacher
+  GetMyGroupInfo_Teacher,
+  GetGroupStatus
 } from '@/api/live';
 import * as common from './group';
 
@@ -209,6 +210,19 @@ export default {
     }
   },
   created() {
+    GetGroupStatus({ task_id: this.task_id }).then(({ is_teacher_in_group }) => {
+      if (is_teacher_in_group === 'true') {
+        GetMyGroupInfo_Teacher({
+          task_id: this.task_id
+        }).then(({ room_id, teacher: { session_id }, student_list }) => {
+          this.room_id = room_id;
+          this.session_id = session_id;
+          this.student_list = student_list;
+          common.downloadWebSDK(this);
+          this.isGroup = true;
+        });
+      }
+    });
     this.getLiveRoomInfo();
     GetGroupInfo_Teacher({ task_id: this.task_id }).then(
       ({ live_room_sys_user_id, group_list }) => {