dusenyao 3 年之前
父節點
當前提交
cfde078627
共有 3 個文件被更改,包括 13 次插入9 次删除
  1. 1 0
      src/components/live/CurMaterial.vue
  2. 3 6
      src/views/live/SelectDevice.vue
  3. 9 3
      src/views/live/teacher/index.vue

+ 1 - 0
src/components/live/CurMaterial.vue

@@ -311,6 +311,7 @@ export default {
 
     getFileStoreInfo() {
       GetFileStoreInfo({ file_id: this.material_id }).then(({ file_relative_path, file_url_https }) => {
+        this.category = 'file';
         this.file_relative_path = file_relative_path;
         this.file_url_https = file_url_https;
         const fileType = file_url_https.slice(file_url_https.lastIndexOf('.') + 1, file_url_https.length);

+ 3 - 6
src/views/live/SelectDevice.vue

@@ -77,16 +77,13 @@ export default {
   watch: {
     dialogVisibleDevice(newValue) {
       if (newValue) {
-        const device = this.$store.state.app.liveDevice;
-        this.video = this.device.video.length === 0 ? '' : this.selectValue(this.device.video, device.video);
-        this.audio = this.device.audio.length === 0 ? '' : this.selectValue(this.device.audio, device.audio);
+        const { video, audio } = this.$store.state.app.liveDevice;
+        this.video = video;
+        this.audio = audio;
       }
     }
   },
   methods: {
-    selectValue(arr, value) {
-      return arr.some(item => item.deviceId === value) ? value : arr[0].deviceId;
-    },
     dialogDeviceClose() {
       this.$emit('dialogDeviceClose', { audio: this.audio, video: this.video });
     }

+ 9 - 3
src/views/live/teacher/index.vue

@@ -491,9 +491,15 @@ export default {
     },
 
     closeLiveRoom() {
-      CloseLiveRoom({ task_id: this.task_id }).then(() => {
-        this.$router.push('/');
-        this.$message.success(this.$i18n.t('Key426'));
+      this.$confirm('是否关闭当前直播?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        CloseLiveRoom({ task_id: this.task_id }).then(() => {
+          this.$router.push('/');
+          this.$message.success(this.$i18n.t('Key426'));
+        });
       });
     },