瀏覽代碼

上传视频 素材库

yuhongqi 1 月之前
父節點
當前提交
9c14263e7b

+ 1 - 0
src/components/LiveVideoUpload/index.vue

@@ -155,6 +155,7 @@ export default {
     this.reset()
   },
   methods: {
+
 // 提供重置方法供父组件调用
     reset() {
       this.txProgress = 0;

+ 4 - 8
src/views/live/liveConfig/preview.vue

@@ -126,7 +126,7 @@ export default {
         if(this.liveId == null) {
           return;
         }
-        this.getLive();
+        this.getLiveVideo();
       },
       // 初始化时立即执行一次
       immediate: true
@@ -156,8 +156,7 @@ export default {
       addLiveVideo(doParam).then(response => {
         if (response.code == 200) {
           this.$message.success("上传成功");
-          this.videoList = []
-          this.videoList.push(doParam)
+          this.getLiveVideo()
         } else {
           this.$message.warning(response.msg);
         }
@@ -189,6 +188,7 @@ export default {
 
         this.videoList.push(dataEntity);
       });
+      this.loading = false;
     },
     /**
      * 提取文件名称核心方法
@@ -254,11 +254,7 @@ export default {
     // 上传视频处理
     handleUploadVideo() {
       // 模拟上传视频逻辑,实际需调用上传组件或接口
-      if (this.liveInfo.liveType == 1) {
-        this.open = true;
-      }else{
-        this.$message.error("仅直播可上传预告片段");
-      }
+      this.open = true;
     },
   },
 };

+ 4 - 0
src/views/live/liveVideo/index.vue

@@ -214,6 +214,10 @@ export default {
       this.reset();
       this.open = true;
       this.title = "添加直播视频";
+      this.videoUrl = '';
+      setTimeout(() => {
+        this.$refs.videoUpload.reset();
+      }, 500);
     },
     /** 修改按钮操作 */
     handleUpdate(row) {