Explorar el Código

录播课音频审核

natasha hace 1 año
padre
commit
4285f29e37

+ 0 - 1
src/components/AudioLine.vue

@@ -239,7 +239,6 @@ export default {
     },
     // 音频加载完之后
     onLoadedmetadata(res) {
-      console.log(res.target.duration);
       this.audio.maxTime = parseInt(res.target.duration);
       this.audioAllTime = this.realFormatSecond(this.audio.maxTime);
     },

+ 9 - 6
src/views/content_manage/course_manage/CheckLBCourse.vue

@@ -11,11 +11,11 @@
             <el-button @click="handleCheck('false')" type="danger" size="small" plain>驳回</el-button>
         </div>
     </div>
-    <template v-if="type==='0'">
-        <video-detail :lessonCatalog="lessonCatalog" :data="info"></video-detail>
+    <template v-if="type==0">
+        <video-detail :lessonCatalog="lessonCatalog" :lessonCatalogEdsc="lessonCatalogEdsc" :data="info"></video-detail>
     </template>
-    <template v-if="type==='1'">
-        <course-detail :lessonCatalog="lessonCatalog" :data="info" type='audio'></course-detail>
+    <template v-if="type==1">
+        <course-detail :lessonCatalog="lessonCatalog" :lessonCatalogEdsc="lessonCatalogEdsc" :data="info" type='audio'></course-detail>
     </template>
   </div>
 </template>
@@ -40,7 +40,8 @@ export default {
         info: null,
         id: this.$route.query.id?this.$route.query.id:'',
         type: this.$route.query.type?this.$route.query.type:'',
-        lessonCatalog: []
+        lessonCatalog: [],
+        lessonCatalogEdsc: []
     }
   },
   //计算属性 类似于data概念
@@ -75,7 +76,8 @@ export default {
             if(res.status===1){
                 this.info = res.lb_course
                 this.lessonCatalog = res.cs_item_list
-                this.lessonCatalog.forEach(item => {
+                this.lessonCatalog.forEach((item,index) => {
+                    item.index = index
                     if(item.file_media_duration){
                         if(item.file_media_duration<60){
                             item.timeCn = '1分钟'
@@ -95,6 +97,7 @@ export default {
                         item.timeCn = '-'
                     }
                 });
+                this.lessonCatalogEdsc = JSON.parse(JSON.stringify(this.lessonCatalog)).reverse()
             }
         })
         .catch(() => {

+ 5 - 51
src/views/content_manage/course_manage/components/LessonCatalog.vue

@@ -5,15 +5,14 @@
         <div><a :class="[sort==='ASCE'?'active':'']" @click="handleChangeSort('ASCE')">正序</a><div class="border"></div><a :class="[sort==='DESC'?'active':'']" @click="handleChangeSort('DESC')">倒序</a></div>
     </div>
     <ul class="catalog">
-        <li v-for="(item,index) in list" :key="index" :class="[isBuy||index<2?'buy':'',playNumber===index?'active':'']" @click="handleChangeCourse(index)">
-            <span class="number">{{sort==='ASCE'?(index+1):(list.length-index) + '.'}}</span>
+        <li v-for="(item,index) in sort==='ASCE'?list:lessonCatalogEdsc" :key="index" :class="[playNumber===item.index?'active':'']" @click="handleChangeCourse(item.index)">
+            <span class="number">{{Number(item.index)+1 + '.'}}</span>
             <div class="center">
                 <b class="title">{{item.name}}</b>
                 <span class="teacher">{{'主讲教师 '+item.teacher_name}}</span>
                 <span class="time-length">{{item.timeCn}}</span>
             </div>
-            <i class="el-icon-caret-right" v-if="playNumber===index"></i>
-            <!-- <i class="el-icon-lock" v-if="!(isBuy||index<2)"></i> -->
+            <i class="el-icon-caret-right" v-if="playNumber===item.index"></i>
         </li>
     </ul>
   </div>
@@ -22,11 +21,10 @@
 <script>
 //这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 //例如:import 《组件名称》from ‘《组件路径》';
-import { getLogin } from "@/api/ajax";
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: { },
-  props: ["data", "isBuy","LoginNavIndex","userBg","headerBorder","headerBg"],
+  props: ["data", "lessonCatalogEdsc"],
   data() {
     //这里存放数据
     return {
@@ -47,54 +45,12 @@ export default {
     // 切换排序
     handleChangeSort(value){
         this.sort = value
-        this.getInfos()
     },
     // 切换课程
     handleChangeCourse(index){
         this.playNumber = index
         this.$emit("getInfo",index)
     },
-    // 获取课程信息
-    getInfos(){
-        this.loading = true
-        let MethodName = "/CourseServer/Manager/LBCourseManager/GetLBCourseInfo";
-        let data = {
-            id: this.$route.query.id?this.$route.query.id:'',
-            is_contain_cs_item:'true',
-            cs_item_sort_mode: this.sort
-        }
-        getLogin(MethodName, data)
-        .then((res) => {
-            this.loading = false
-            if(res.status===1){
-                this.playNumber = this.list.length-this.playNumber-1
-                this.list = res.cs_item_list
-                this.list.forEach(item => {
-                    if(item.file_media_duration){
-                        if(item.file_media_duration<60){
-                            item.timeCn = '1分钟'
-                        }else if(item.file_media_duration<600){
-                            item.timeCn = Math.ceil(item.file_media_duration/60)+'分钟'
-                        }else{
-                            let first = Math.ceil(item.file_media_duration/60).toString().substring(0,Math.ceil(item.file_media_duration/60).toString().length-1)*1
-                            let last = Math.ceil(item.file_media_duration/60).toString().substring(Math.ceil(item.file_media_duration/60).toString().length-1)*1
-                            if(last<5){
-                                item.timeCn = first+'0分钟'
-                            }else{
-                                item.timeCn = (first+1)+'0分钟'
-                            }
-                            
-                        }
-                    }else{
-                        item.timeCn = '-'
-                    }
-                });
-            }
-        })
-        .catch(() => {
-            this.loading = false
-        });
-    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
@@ -177,9 +133,7 @@ ul{
             border: 1px solid #F7F8FA;
             display: flex;
             padding: 16px;
-            &.buy{
-                cursor: pointer;
-            }
+            cursor: pointer;
             &.active{
                 border-color: #0081F1;
                 background: #E7F3FF;

+ 4 - 4
src/views/content_manage/course_manage/courseDetail.vue

@@ -23,7 +23,7 @@
                 <div class="info-detail" v-html="info.lb_course_cs_item.intro" v-if="infoIndex===0"></div>
                 <resources-list :data="info.resource_file_list" :type='type' v-if="infoIndex===1"></resources-list>
             </div>
-            <lesson-catalog :data="lessonCatalog" class="main-bottom-right" @getInfo="getInfo"></lesson-catalog>
+            <lesson-catalog :data="lessonCatalog" :lessonCatalogEdsc="lessonCatalogEdsc" class="main-bottom-right" @getInfo="getInfo"></lesson-catalog>
         </div>
     </div>
   </div>
@@ -40,7 +40,7 @@ import { getLogin } from "@/api/ajax";
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: { LessonCatalog, AudioLine, ResourcesList},
-  props: ["lessonCatalog", "data", "type"],
+  props: ["lessonCatalog", "data", "type", "lessonCatalogEdsc"],
   data() {
     //这里存放数据
     return {
@@ -66,14 +66,14 @@ export default {
         this.loading = true
         let MethodName = "/CourseServer/Manager/LBCourseManager/GetLBCourseCSItemInfo";
         let data = {
-            id: index?this.lessonCatalog[index].id:this.lessonCatalog[this.lessonIndex].id
+            id: index||index===0?this.lessonCatalog[index].id:this.lessonCatalog[this.lessonIndex].id
         }
         getLogin(MethodName, data)
         .then((res) => {
             this.loading = false
             if(res.status===1){
                 this.info = res
-                this.lessonIndex = index?index:this.lessonIndex
+                this.lessonIndex = index||index===0?index:this.lessonIndex
             }
         })
         .catch(() => {