xsc hace 1 año
padre
commit
67655e8e7d
Se han modificado 3 ficheros con 8 adiciones y 48 borrados
  1. 2 2
      src/views/video/api/chapter.js
  2. 6 30
      src/views/video/editvideo.vue
  3. 0 16
      src/views/video/video.vue

+ 2 - 2
src/views/video/api/chapter.js

@@ -4,13 +4,13 @@
  * @Author: King
  * @Date: 2022-02-14 14:46:14
  * @LastEditors: king
- * @LastEditTime: 2023-03-24 17:29:12
+ * @LastEditTime: 2023-03-24 18:39:05
  */
 import request from '@/utils/request'
 //章节模块接口--------------------------------------------------------------
 export function chapterList(params) {
   return request({
-    url: '/course/chapter',
+    url: '/course/chapters',
     method: 'get',
     params,
   })

+ 6 - 30
src/views/video/editvideo.vue

@@ -38,7 +38,7 @@
         <el-upload
           ref="upload"
           accept=".mp4"
-          :action="action"
+          :action="base_url+'/upload'"
           class="upload-demo"
           :data="videoUploadData"
           :file-list="form.fileList"
@@ -126,7 +126,7 @@
         <el-upload
           ref="upload"
           accept=".vtt"
-          :action="action"
+          :action="base_url+'/upload'"
           class="upload-demo"
           :data="zhUploadData"
           :limit="limit"
@@ -155,7 +155,7 @@
         <el-upload
           ref="upload"
           accept=".vtt"
-          :action="action"
+          :action="base_url+'/upload'"
           class="upload-demo"
           :data="enUploadData"
           :limit="limit"
@@ -200,7 +200,7 @@
 </template>
 
 <script>
-  import { videoAdd, videoEdit, videoDetail } from './api/video'
+  import { videoAdd, videoEdit } from './api/video'
   import { chapterList } from './api/chapter'
   export default {
     name: 'DepartmentManagementEdit',
@@ -270,12 +270,11 @@
       this.videoId = route.query.videoId
       if (route.query.videoId) {
         this.title = '编辑视频'
-        this.getVideoDetail()
       } else {
         this.title = '添加视频'
       }
       console.log(route.query, 'ids')
-      this.action = baseURL + '/common/upload'
+      // this.action = baseURL + '/common/upload'
       this.chapterData = []
       this.getChapterList()
     },
@@ -285,30 +284,7 @@
       getTnyMac(res) {
         this.form.intro = res
       },
-      //获取视频详情
-      async getVideoDetail() {
-        let params = {
-          courseId: this.courseId,
-          videoId: this.videoId,
-        }
-        const { data } = await videoDetail(params)
-        console.log(data, '视频详情')
-        this.form = data
-        this.form.fileList = data.url_resource
-        let time = data.duration
-        this.hours =
-          parseInt(time / 3600) < 10
-            ? '0' + parseInt(time / 3600)
-            : parseInt(time / 3600)
-        this.minute =
-          parseInt((time % 3600) / 60) < 10
-            ? '0' + parseInt((time % 3600) / 60)
-            : parseInt((time % 3600) / 60)
-        this.second =
-          parseInt((time % 3600) % 60) < 10
-            ? '0' + parseInt((time % 3600) % 60)
-            : parseInt((time % 3600) % 60)
-      },
+
       //返回上一页
       goBack() {
         this.$router.push({

+ 0 - 16
src/views/video/video.vue

@@ -106,9 +106,6 @@
           <el-button type="text" @click="handleEditVideo(row)">
             编辑
           </el-button>
-          <el-button type="text" @click="videoDetail(row)">
-            详情
-          </el-button>
           <el-button type="text" @click="handleDelete(row)">
             删除
           </el-button>
@@ -202,19 +199,6 @@
           },
         })
       },
-      // 跳转到视频详情页面
-      videoDetail(row) {
-        console.log(row.id, '课程列表页跳转到课程详情页row.id就是课程id')
-        this.$router.push({
-          path: '/course/videoDetail',
-          query: {
-            // 视频id
-            videoId: row.id,
-            // 课程id
-            courseId: this.queryForm.id,
-          },
-        })
-      },
       handleDelete(row) {
         if (row.id) {
           this.$baseConfirm('你确定要删除当前项吗', null, async () => {