xsc 1 yıl önce
ebeveyn
işleme
a76ef58e71

+ 2 - 2
src/main.js

@@ -2,7 +2,7 @@
  * @Author: xvying 1615026511@qq.com
  * @Date: 2022-10-09 11:40:36
  * @LastEditors: king
- * @LastEditTime: 2023-03-25 16:05:59
+ * @LastEditTime: 2023-03-25 18:52:14
  * @FilePath: main.js
  * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  */
@@ -48,7 +48,7 @@ Vue.prototype.base_url =
 //Vue.use(ElementUI, { locale })
 // 如果想要中文版 element-ui,按如下方式声明
 Vue.use(ElementUI);
-
+Vue.prototype.$baseConfirm  = ElementUI.MessageBox.confirm
 Vue.config.productionTip = false;
 
 // 注册 EventBus

+ 1 - 6
src/views/setting/components/ConfigureManage.vue

@@ -258,12 +258,7 @@ export default {
       this.$refs["form"].validate(async (valid) => {
         if (valid) {
           const { message } = await doAdd(this.form);
-          this.$baseMessage(
-            message,
-            "success",
-            false,
-            "vab-hey-message-success"
-          );
+          this.$message({ message, type: "success" });
           this.$emit("fetch-data");
           this.close();
         }

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

@@ -4,7 +4,7 @@
  * @Author: King
  * @Date: 2022-02-14 14:46:14
  * @LastEditors: king
- * @LastEditTime: 2023-03-24 18:39:05
+ * @LastEditTime: 2023-03-25 18:16:04
  */
 import request from '@/utils/request'
 //章节模块接口--------------------------------------------------------------
@@ -26,7 +26,7 @@ export function chapterAdd(data) {
 //章节修改 -->此处data需要穿一个id
 export function chapterEdit(data) {
   return request({
-    url: '/course/chapter/' + data.id,
+    url: '/course/chapter',
     method: 'put',
     data,
   })

+ 9 - 1
src/views/video/api/course_detail.js

@@ -4,7 +4,7 @@
  * @Author: 小六
  * @Date: 2022-01-22 17:07:20
  * @LastEditors: king
- * @LastEditTime: 2023-03-25 11:58:19
+ * @LastEditTime: 2023-03-25 21:45:33
  */
 
 import request from '@/utils/request'
@@ -40,3 +40,11 @@ export function getShoucang(data) {
     data,
   })
 }
+//详情
+export function showDetail(params) {
+  return request({
+    url: '/course/show-detail',
+    method: 'get',
+    params,
+  })
+}

+ 20 - 1
src/views/video/api/video.js

@@ -4,7 +4,7 @@
  * @Author: King
  * @Date: 2022-02-14 14:46:14
  * @LastEditors: king
- * @LastEditTime: 2023-03-24 18:36:56
+ * @LastEditTime: 2023-03-25 20:23:16
  */
 import request from '@/utils/request'
 //视频模块接口--------------------------------------------------------------
@@ -23,11 +23,20 @@ export function videoAdd(data) {
     data,
   })
 }
+//视频详情
+export function videoDetail(params) {
+  return request({
+    url: '/course/video',
+    method: 'get',
+    params,
+  })
+}
 //视频修改 -->此处data需要穿一个id
 export function videoEdit(data) {
   return request({
     url: '/course/video',
     method: 'put',
+    data,
   })
 }
 // 课程删除 --》此处data需要穿一个id
@@ -35,5 +44,15 @@ export function videoDelete(data) {
   return request({
     url: '/course/video',
     method: 'delete',
+    data
+  })
+}
+
+// 视频记录
+export function lookRecord(data) {
+  return request({
+    url: '/course/video/look-record',
+    method: 'post',
+    data,
   })
 }

+ 20 - 12
src/views/video/chapter.vue

@@ -1,6 +1,11 @@
 <template>
   <div class="department-management-container">
-    <el-page-header @back="goBack" content="章节管理" style="margin-bottom: 20px;"> </el-page-header>
+    <el-page-header
+      @back="goBack"
+      content="章节管理"
+      style="margin-bottom: 20px"
+    >
+    </el-page-header>
     <vab-query-form style="display: flex; justify-content: space-between">
       <vab-query-form-left-panel :span="12">
         <el-button icon="el-icon-plus" type="primary" @click="handleEdit">
@@ -68,12 +73,8 @@
         show-overflow-tooltip
       >
         <template #default="{ row }">
-          <el-tag v-if="row.status == 1">
-           正常
-          </el-tag>
-          <el-tag v-if="row.status == 0" type="danger">
-            禁用
-          </el-tag>
+          <el-tag v-if="row.status == 1"> 正常 </el-tag>
+          <el-tag v-if="row.status == 0" type="danger"> 禁用 </el-tag>
         </template>
       </el-table-column>
       <!-- 命名需要再改 -->
@@ -139,7 +140,7 @@ export default {
     // this.courseId = route.query.courseId
     // // 视频id
     // this.queryForm.videoId = route.query.videoId
-    this.queryForm.courseId = route.query.courseId;
+    this.queryForm.course_id = route.query.id;
     this.videoId = route.query.videoId;
     this.getChapterList();
   },
@@ -181,7 +182,7 @@ export default {
         const { message } = await chapterEdit(this.editForm);
         console.log(message, "message");
         // location.reload()
-        this.$message({message, type:"success"});
+        this.$message({ message, type: "success" });
         this.getChapterList();
       } else {
         return;
@@ -213,9 +214,16 @@ export default {
     },
     handleDelete(row) {
       if (row.id) {
-        this.$baseConfirm("你确定要删除当前项吗", null, async () => {
-          const { message } = await chapterDelete({ id: row.id });
-          this.$message({message, type:"success"});
+        this.$confirm("你确定要删除当前项吗, 是否继续?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }).then(async () => {
+          var data = {
+            id: row.id,
+          };
+          const { message } = await chapterDelete(data);
+          this.$message({ message, type: "success" });
           await this.getChapterList();
         });
       }

+ 87 - 100
src/views/video/components/ChapterManage.vue

@@ -7,10 +7,7 @@
   >
     <el-form ref="form" label-width="120px" :model="form" :rules="rules">
       <el-form-item label="章节名称" prop="title">
-        <el-input
-          v-model="form.title"
-          placeholder="请输入章节名称"
-        />
+        <el-input v-model="form.title" placeholder="请输入章节名称" />
       </el-form-item>
       <el-form-item label="章节排序" prop="sort">
         <el-input
@@ -39,105 +36,95 @@
 </template>
 
 <script>
-  import { chapterAdd, chapterEdit } from '../api/chapter'
+import { chapterAdd, chapterEdit } from "../api/chapter";
 
-  export default {
-    name: 'DepartmentManagementEdit',
-    data() {
-      return {
-        form: {
-          title: '',
-          status: 1,
-          course_id: '',
-          sort: 0,
-        },
-        rules: {
-          title: [
-            {
-              required: true,
-              trigger: 'blur',
-              message: '请输入章节名称',
-            },
-          ],
-          sort: [
-            {
-              required: true,
-              trigger: 'blur',
-              message: '请输入章节排序',
-            },
-          ],
-          // status: [
-          //   {
-          //     required: true,
-          //     trigger: 'change',
-          //     message: '请选择章节状态',
-          //   },
-          // ],
-        },
-        title: '',
-        dialogFormVisible: false,
+export default {
+  name: "DepartmentManagementEdit",
+  data() {
+    return {
+      form: {
+        title: "",
+        status: 1,
+        course_id: "",
+        sort: 0,
+      },
+      rules: {
+        title: [
+          {
+            required: true,
+            trigger: "blur",
+            message: "请输入章节名称",
+          },
+        ],
+        sort: [
+          {
+            required: true,
+            trigger: "blur",
+            message: "请输入章节排序",
+          },
+        ],
+        // status: [
+        //   {
+        //     required: true,
+        //     trigger: 'change',
+        //     message: '请选择章节状态',
+        //   },
+        // ],
+      },
+      title: "",
+      dialogFormVisible: false,
+    };
+  },
+  created() {},
+  methods: {
+    // handleNodeClick(node) {
+    //   this.form.parent_name = node.name
+    //   this.form.parent_id = node.id
+    // },
+    showEdit(row) {
+      console.log(row, "章节列表的传过来的");
+      if (!row) {
+        this.title = "添加";
+        let route = this.$route;
+        console.log(route.query, "route.que12121ry");
+        this.form.course_id = route.query.id;
+        console.log(this.form.course_id, "route.que12121ry");
+      } else {
+        this.title = "编辑";
+        this.form = Object.assign({}, row);
+        this.form.course_id = row.id;
       }
+
+      this.dialogFormVisible = true;
+    },
+    close() {
+      this.$refs["form"].resetFields();
+      // this.form = this.$options.data().form
+      this.dialogFormVisible = false;
     },
-    created() {},
-    methods: {
-      // handleNodeClick(node) {
-      //   this.form.parent_name = node.name
-      //   this.form.parent_id = node.id
-      // },
-      showEdit(row) {
-        console.log(row, '章节列表的传过来的')
-        if (!row) {
-          this.title = '添加'
-          let route = this.$route
-          console.log(route.query, 'route.que12121ry')
-          this.form.course_id = route.query.id
-          console.log(this.form.course_id, 'route.que12121ry')
-        } else {
-          this.title = '编辑'
-          this.form = Object.assign({}, row)
-          this.form.course_id = row.course.id
+    //编辑保存
+    save() {
+      console.log(this.form, "999999999999");
+      this.$refs["form"].validate(async (valid) => {
+        if (valid) {
+          const { message } = await chapterEdit(this.form);
+          this.$message({ message, type: "success" });
+          this.$emit("fetch-data");
+          this.close();
         }
-
-        this.dialogFormVisible = true
-      },
-      close() {
-        this.$refs['form'].resetFields()
-        // this.form = this.$options.data().form
-        this.dialogFormVisible = false
-      },
-      //编辑保存
-      save() {
-        console.log(this.form, '999999999999')
-        this.$refs['form'].validate(async (valid) => {
-          if (valid) {
-            const { message } = await chapterEdit(this.form)
-            this.$baseMessage(
-              message,
-              'success',
-              false,
-              'vab-hey-message-success'
-            )
-            this.$emit('fetch-data')
-            this.close()
-          }
-        })
-      },
-      //添加
-      add() {
-        this.$refs['form'].validate(async (valid) => {
-          if (valid) {
-            const { message } = await chapterAdd(this.form)
-            this.$baseMessage(
-              message,
-              'success',
-              false,
-              'vab-hey-message-success'
-            )
-            this.$emit('fetch-data')
-            this.close()
-          }
-        })
-      },
+      });
+    },
+    //添加
+    add() {
+      this.$refs["form"].validate(async (valid) => {
+        if (valid) {
+          const { message } = await chapterAdd(this.form);
+          this.$message({ message, type: "success" });
+          this.$emit("fetch-data");
+          this.close();
+        }
+      });
     },
-  }
+  },
+};
 </script>

+ 2 - 13
src/views/video/components/CourseManage.vue

@@ -238,12 +238,7 @@ export default {
       this.$refs["form"].validate(async (valid) => {
         if (valid) {
           const { message } = await doEdit(this.form);
-          this.$message(
-            message,
-            "success",
-            false,
-            "vab-hey-message-success"
-          );
+          this.$message({ message, type: "success" });
           this.$emit("fetch-data");
           this.fileList = [];
           this.close();
@@ -256,15 +251,9 @@ export default {
       this.$refs["form"].validate(async (valid) => {
         if (valid) {
           const { message } = await doAdd(this.form);
-          this.$message(
-            message,
-            "success",
-            false,
-            "vab-hey-message-success"
-          );
+          this.$message({ message, type: "success" });
           this.$emit("fetch-data");
           this.fileList = [];
-
           this.close();
         }
       });

+ 18 - 51
src/views/video/course_detail.vue

@@ -4,7 +4,7 @@
  * @Author: 小六
  * @Date: 2022-01-21 10:44:04
  * @LastEditors: king
- * @LastEditTime: 2023-03-25 13:51:32
+ * @LastEditTime: 2023-03-25 21:48:17
 -->
 <template>
   <div class="class_container">
@@ -71,17 +71,6 @@
               <i class="el-icon-s-custom"></i>
               <span>{{ detail.user_count }}人</span>
             </div>
-            <div class="nums_right" @click="shoucang">
-              <span v-if="!detail.is_collection_status">
-                <i class="el-icon-star-off"></i>
-                收藏
-              </span>
-              <span v-else class="yishoucang">
-                <i class="el-icon-star-on"></i>
-
-                已收藏
-              </span>
-            </div>
           </div>
           <span
             class="course_join"
@@ -201,9 +190,8 @@
 <script>
   import {
     getCourse_detail,
-    join,
-    getShoucang,
     chapterList,
+    showDetail
   } from './api/course_detail'
 
   export default {
@@ -229,10 +217,11 @@
     },
     created() {
       console.log(this.$route.query, 'this.$route.query')
-      this.course_slug = this.$route.query.course_slug
+      this.course_slug = this.$route.query.slug
       this.course_id = this.$route.query.id
       this.getCourse_detail()
       this.chapterList()
+      this.showDetail()
     },
 
     methods: {
@@ -252,27 +241,20 @@
         this.detail = data
         // this.course_zhangjie = data.directory
       },
+      // 获取课程
+    async showDetail() {
+      this.loading = true;
+      const { data } = await showDetail({ slug: this.course_slug });
+      this.loading = false;
+      console.log(data);
+      this.course_zhangjie = data.directory;
+    },
       //获取章节分类
       async chapterList() {
-        const { data } = await chapterList({id:this.course_id})
+        const { data } = await chapterList({course_id:this.course_id})
         console.log(data, 'zhangjie')
         // this.detail = data
-        this.course_zhangjie = data.data
-      },
-      // 加入课程
-      async join_course() {
-        let params = {
-          course_id: this.course_id,
-        }
-        console.log(params, 'xaingqing')
-
-        const { message } = await join(params)
-        this.$message({
-          message: message,
-          type: 'success',
-        })
-        this.getCourse_detail()
-        // console.log(message, 'xaingqing')
+        // this.course_zhangjie = data.data
       },
       //跳转到另一个详情页
       to_sec_course() {
@@ -281,7 +263,7 @@
           path: './videoDetail',
           query: {
             course_id: this.course_id,
-            course_slug: this.course_slug,
+            slug: this.course_slug,
           },
         })
       },
@@ -296,15 +278,6 @@
           this.current_zhedie.push(e)
         }
       },
-      // 收藏课程
-      async shoucang() {
-        const { message } = await getShoucang({ course_id: this.detail.id })
-        this.$message({
-          message: message,
-          type: 'success',
-        })
-        this.getCourse_detail()
-      },
       //分页
       handleCurrentChange(val) {
         this.queryForm.page = val
@@ -317,23 +290,17 @@
       },
       to_video(video_id, video_slug) {
         console.log(video_id, 'taiozhaun')
-        if (this.detail.watch_progress || this.detail.watch_progress === 0) {
           // 跳转到视频页
           this.$router.push({
-            path: './videoList',
+            path: './videoDetail',
             query: {
               video_id: video_id,
               course_id: this.course_id,
-              course_slug: this.course_slug,
+              slug: this.course_slug,
               video_slug: video_slug,
             },
           })
-        } else {
-          this.$message({
-            message: '请先订阅课程',
-            type: 'warning',
-          })
-        }
+
       },
     },
   }

+ 24 - 14
src/views/video/editvideo.vue

@@ -45,11 +45,11 @@
           <el-button size="small" type="primary"> 上传视频 </el-button>
           <div slot="tip" class="el-upload__tip">只能上传mp4格式</div>
         </el-upload>
-        <div v-if="title == '编辑视频'">
-          <a :href="form.fileList.url" target="_blank">
-            {{ form.fileList.url }}
+        <!-- <div v-if="title == '编辑视频'">
+          <a :href="form.url_resource" target="_blank">
+            {{ form.url_resource }}
           </a>
-        </div>
+        </div> -->
       </el-form-item>
 
       <el-form-item label="视频简介:" prop="short_description">
@@ -120,8 +120,8 @@
           <div slot="tip" class="el-upload__tip">只能上传(vtt格式)</div>
         </el-upload>
         <div v-if="title == '编辑视频'">
-          <a :href="form.subtitle_zh_path_resource.url" target="_blank">
-            {{ form.subtitle_zh_path_resource.url }}
+          <a :href="form.subtitle_zh_path_resource" target="_blank">
+            {{ form.subtitle_zh_path_resource }}
           </a>
         </div>
       </el-form-item>
@@ -142,8 +142,8 @@
           <div slot="tip" class="el-upload__tip">只能上传(vtt格式)</div>
         </el-upload>
         <div v-if="title == '编辑视频'">
-          <a :href="form.subtitle_en_path_resource.url" target="_blank">
-            {{ form.subtitle_en_path_resource.url }}
+          <a :href="form.subtitle_en_path_resource" target="_blank">
+            {{ form.subtitle_en_path_resource }}
           </a>
         </div>
       </el-form-item>
@@ -170,7 +170,7 @@
 </template>
 
 <script>
-import { videoAdd, videoEdit } from "./api/video";
+import { videoAdd, videoEdit,videoDetail } from "./api/video";
 import { chapterList } from "./api/chapter";
 export default {
   name: "DepartmentManagementEdit",
@@ -235,6 +235,7 @@ export default {
     this.videoId = route.query.videoId;
     if (route.query.videoId) {
       this.title = "编辑视频";
+      this.getDetail()
     } else {
       this.title = "添加视频";
     }
@@ -272,28 +273,36 @@ export default {
     //获取章节列表
     async getChapterList() {
       const { data } = await chapterList({
-        courseId: this.courseId,
+        course_id: this.courseId,
         status: 1,
       });
       console.log(data, "章节列表");
       this.chapterData = data.data;
     },
+    async getDetail() {
+      const { data } = await videoDetail({
+        id:this.videoId
+      });
+      console.log(data, "视频详情");
+      this.form = data
+      this.form.course_id = this.courseId
+      this.form.fileList = []
+      // this.chapterData = data.data;
+    },
     //视频上传成功
     videoSuccess(response, file) {
-      console.log(response, "图片上传成功");
-      console.log(file, "图片上传成功");
       this.form.url = response.data.id;
       this.form.fileList.push(file);
       this.$refs.form.validateField("fileList");
     },
     //中文字幕上传成功
     zhSuccess(response) {
-      console.log(response, "图片上传成功");
+      console.log(response, "上传成功");
       this.form.subtitle_zh_path = response.data.id;
     },
     //英文字幕上传成功
     enSuccess(response) {
-      console.log(response, "图片上传成功");
+      console.log(response, "上传成功");
       this.form.subtitle_en_path = response.data.id;
     },
     uploadErr(err) {
@@ -317,6 +326,7 @@ export default {
       this.form.duration = this.hours * 3600 + this.minute * 60 + this.second;
       this.$refs["form"].validate(async (valid) => {
         if (valid) {
+          console.log(this.form)
           const { message } = await videoEdit(this.form);
           this.$message({ message, type: "success" });
           this.$router.push({

+ 167 - 179
src/views/video/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="department-management-container">
-    <vab-query-form style="display: flex;justify-content: space-between;">
+    <vab-query-form style="display: flex; justify-content: space-between">
       <vab-query-form-left-panel :span="12">
         <!-- 添加暂时不要求 -->
         <el-button icon="el-icon-plus" type="primary" @click="handleEdit">
@@ -19,7 +19,7 @@
           </el-form-item>
           <el-form-item>
             <el-button icon="el-icon-search" type="primary" @click="queryData">
-             搜索
+              搜索
             </el-button>
           </el-form-item>
         </el-form>
@@ -156,12 +156,8 @@
         show-overflow-tooltip
       >
         <template #default="{ row }">
-          <el-tag v-if="row.status == 1">
-           正常
-          </el-tag>
-          <el-tag v-if="row.status == 0" type="danger">
-            禁用
-          </el-tag>
+          <el-tag v-if="row.status == 1"> 正常 </el-tag>
+          <el-tag v-if="row.status == 0" type="danger"> 禁用 </el-tag>
         </template>
       </el-table-column>
       <el-table-column
@@ -177,15 +173,9 @@
           <el-button type="text" @click="courseZhang(row)">
             章节管理
           </el-button>
-          <el-button type="text" @click="handleEdit(row)">
-            编辑
-          </el-button>
-          <el-button type="text" @click="courseDetail(row)">
-            详情
-          </el-button>
-          <el-button type="text" @click="handleDelete(row)">
-            删除
-          </el-button>
+          <el-button type="text" @click="handleEdit(row)"> 编辑 </el-button>
+          <el-button type="text" @click="courseDetail(row)"> 详情 </el-button>
+          <el-button type="text" @click="handleDelete(row)"> 删除 </el-button>
         </template>
       </el-table-column>
       <template #empty>
@@ -210,174 +200,172 @@
 </template>
 
 <script>
-  import { courseList, doDelete, doEdit } from './api/index'
-  import Edit from './components/CourseManage.vue'
+import { courseList, doDelete, doEdit } from "./api/index";
+import Edit from "./components/CourseManage.vue";
 
-  export default {
-    name: 'CourseManage',
-    components: { Edit },
-    data() {
-      return {
-        //修改排序
-        editForm: {},
-        oldSort: 0,
-        editStatus: 0, //排序编辑状态 0为正常 1显示输入框
-        //课程列表数组
-        list: [],
-        listLoading: true,
-        layout: 'total, sizes, prev, pager, next, jumper',
-        total: 0,
-        queryForm: {
-          page: 1,
-          per_page: 15,
-          title: '',
-        },
+export default {
+  name: "CourseManage",
+  components: { Edit },
+  data() {
+    return {
+      //修改排序
+      editForm: {},
+      oldSort: 0,
+      editStatus: 0, //排序编辑状态 0为正常 1显示输入框
+      //课程列表数组
+      list: [],
+      listLoading: true,
+      layout: "total, sizes, prev, pager, next, jumper",
+      total: 0,
+      queryForm: {
+        page: 1,
+        per_page: 15,
+        title: "",
+      },
+    };
+  },
+  created() {
+    this.getCourseList();
+  },
+  methods: {
+    //修改排序事件
+    cancelSort(row) {
+      this.editStatus = 0;
+      row.sort = this.oldSort;
+    },
+    //修改排序事件
+    async changeSort(row) {
+      console.log("1111111111");
+      this.editStatus = 1;
+      this.editForm = row;
+      this.oldSort = row.sort;
+      this.$nextTick(() => {
+        this.$refs["getFocus"].focus();
+      });
+      //await doEdit(this.editForm)
+    },
+    //修改排序
+    inputSort(e) {
+      console.log(e, "000000000");
+      this.editForm.sort = e;
+    },
+    // 修改排序报错
+    async sureChange() {
+      this.editStatus = 0;
+      console.log(this.editForm, "课程列表中修改排序传递参数");
+      if (this.oldSort !== this.editForm.sort) {
+        const { message } = await doEdit(this.editForm);
+        console.log(message, "message");
+        // location.reload()
+        this.$message({ message, type: "success" });
+        this.getList();
+      } else {
+        return;
       }
     },
-    created() {
-      this.getCourseList()
+    //跳转视频列表页面
+    courseZhang(row) {
+      console.log(row.id, "课程列表页跳转到视频列表页row.id就是课程id");
+      this.$router.push({
+        path: "/video/chapter",
+        query: {
+          id: row.id,
+        },
+      });
     },
-    methods: {
-      //修改排序事件
-      cancelSort(row) {
-        this.editStatus = 0
-        row.sort = this.oldSort
-      },
-      //修改排序事件
-      async changeSort(row) {
-        console.log('1111111111')
-        this.editStatus = 1
-        this.editForm = row
-        this.oldSort = row.sort
-        this.$nextTick(() => {
-          this.$refs['getFocus'].focus()
-        })
-        //await doEdit(this.editForm)
-      },
-      //修改排序
-      inputSort(e) {
-        console.log(e, '000000000')
-        this.editForm.sort = e
-      },
-      // 修改排序报错
-      async sureChange() {
-        this.editStatus = 0
-        console.log(this.editForm, '课程列表中修改排序传递参数')
-        if (this.oldSort !== this.editForm.sort) {
-          const { message } = await doEdit(this.editForm)
-          console.log(message, 'message')
-          // location.reload()
-          this.$baseMessage(
-            message,
-            'success',
-            false,
-            'vab-hey-message-success'
-          )
-          this.getList()
-        } else {
-          return
-        }
-      },
-      //跳转视频列表页面
-      courseZhang(row) {
-        console.log(row.id, '课程列表页跳转到视频列表页row.id就是课程id')
-        this.$router.push({
-          path: '/video/chapter',
-          query: {
-            id: row.id,
-          },
-        })
-      },
-      // 跳转到课程详情页面
-      courseVideo(row) {
-        console.log(row.id, '课程列表页跳转到课程详情页row.id就是课程id')
-        this.$router.push({
-          path: '/video/videoList',
-          query: {
-            id: row.id,
-          },
-        })
-      },
-      courseDetail(row) {
-        console.log(row.id, '课程列表页跳转到课程详情页row.id就是课程id')
-        this.$router.push({
-          path: '/video/courseDetail',
-          query: {
+    // 跳转到课程详情页面
+    courseVideo(row) {
+      console.log(row.id, "课程列表页跳转到课程详情页row.id就是课程id");
+      this.$router.push({
+        path: "/video/videoList",
+        query: {
+          id: row.id,
+        },
+      });
+    },
+    courseDetail(row) {
+      console.log(row.id, "课程列表页跳转到课程详情页row.id就是课程id");
+      this.$router.push({
+        path: "/video/courseDetail",
+        query: {
+          id: row.id,
+          slug:row.slug
+        },
+      });
+    },
+    // 打开到添加编辑弹窗--》并传递参数到编辑中  暂时不要求有
+    handleEdit(row) {
+      console.log(row, row.id, "点击000");
+      if (row.id) {
+        this.$refs["edit"].showEdit(row);
+      } else {
+        this.$refs["edit"].showEdit();
+      }
+    },
+    // 删除
+    handleDelete(row) {
+      if (row.id) {
+        this.$confirm("你确定要删除当前项吗, 是否继续?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        }).then(async () => {
+          var data = {
             id: row.id,
-          },
-        })
-      },
-      // 打开到添加编辑弹窗--》并传递参数到编辑中  暂时不要求有
-      handleEdit(row) {
-        console.log(row, row.id, '点击000')
-        if (row.id) {
-          this.$refs['edit'].showEdit(row)
-        } else {
-          this.$refs['edit'].showEdit()
-        }
-      },
-      // 删除
-      handleDelete(row) {
-        if (row.id) {
-          this.$baseConfirm('你确定要删除当前项吗', null, async () => {
-            const { message } = await doDelete({ id: row.id })
-            this.$baseMessage(
-              message,
-              'success',
-              false,
-              'vab-hey-message-success'
-            )
-            await this.getCourseList()
-          })
-        }
-      },
-      handleSizeChange(val) {
-        this.queryForm.per_page = val
-        this.getCourseList()
-      },
-      handleCurrentChange(val) {
-        this.queryForm.page = val
-        this.getCourseList()
-      },
-      queryData() {
-        this.queryForm.page = 1
-        this.getCourseList()
-      },
-      // 获取课程列表数据
-      async getCourseList() {
-        this.listLoading = true
-        const { data } = await courseList(this.queryForm)
-        console.log(data, '课程列表信息')
-        const { list, meta } = data
-        console.log(list)
-        this.list = data.data
-        this.total = meta.pagination.total
-        this.listLoading = false
-      },
+          };
+          const { message } = await doDelete(data);
+          this.$message({ message, type: "success" });
+          await this.getCourseList();
+        });
+      }
+    },
+    handleSizeChange(val) {
+      this.queryForm.per_page = val;
+      this.getCourseList();
+    },
+    handleCurrentChange(val) {
+      this.queryForm.page = val;
+      this.getCourseList();
+    },
+    queryData() {
+      this.queryForm.page = 1;
+      this.getCourseList();
+    },
+    // 获取课程列表数据
+    async getCourseList() {
+      this.listLoading = true;
+      const { data } = await courseList(this.queryForm);
+      console.log(data, "课程列表信息");
+      const { list, meta } = data;
+      console.log(list);
+      this.list = data.data;
+      this.total = meta.pagination.total;
+      this.listLoading = false;
     },
-  }
+  },
+};
 </script>
 <style scoped lang="scss">
-  /* 修改排序样式 */
-  .edit {
-    display: inline-block;
-    width: 110px;
-  }
-  .input-sort {
-    display: inline-block;
-    width: 80px;
-    margin-right: 10px;
-    margin-left: 10px;
-    border: none;
-  }
-  .sort-num {
-    display: inline-block;
-    margin-right: 10px;
-  }
-  .el-icon-edit,
-  .el-icon-circle-check,
-  .el-icon-circle-close {
-    color: #1890ff;
-    cursor: pointer;
-  }
+/* 修改排序样式 */
+.edit {
+  display: inline-block;
+  width: 110px;
+}
+.input-sort {
+  display: inline-block;
+  width: 80px;
+  margin-right: 10px;
+  margin-left: 10px;
+  border: none;
+}
+.sort-num {
+  display: inline-block;
+  margin-right: 10px;
+}
+.el-icon-edit,
+.el-icon-circle-check,
+.el-icon-circle-close {
+  color: #1890ff;
+  cursor: pointer;
+}
 </style>

+ 138 - 173
src/views/video/videoList.vue

@@ -1,8 +1,13 @@
 <template>
   <div class="department-management-container">
     <!-- <el-page-header content="视频列表" @back="goBack" /> -->
-    <el-page-header @back="goBack" content="视频管理" style="margin-bottom: 20px;"> </el-page-header>
-    <vab-query-form style="display: flex;justify-content: space-between;">
+    <el-page-header
+      @back="goBack"
+      content="视频管理"
+      style="margin-bottom: 20px"
+    >
+    </el-page-header>
+    <vab-query-form style="display: flex; justify-content: space-between">
       <vab-query-form-left-panel :span="12">
         <!-- 暂时不要求添加 -->
         <el-button icon="el-icon-plus" type="primary" @click="handleEdit">
@@ -80,12 +85,8 @@
         show-overflow-tooltip
       >
         <template #default="{ row }">
-          <el-tag v-if="row.status == 1">
-            正常
-          </el-tag>
-          <el-tag v-if="row.status == 0" type="danger">
-            禁用
-          </el-tag>
+          <el-tag v-if="row.status == 1"> 正常 </el-tag>
+          <el-tag v-if="row.status == 0" type="danger"> 禁用 </el-tag>
         </template>
       </el-table-column>
       <el-table-column
@@ -106,9 +107,7 @@
           <el-button type="text" @click="handleEditVideo(row)">
             编辑
           </el-button>
-          <el-button type="text" @click="handleDelete(row)">
-            删除
-          </el-button>
+          <el-button type="text" @click="handleDelete(row)"> 删除 </el-button>
         </template>
       </el-table-column>
       <template #empty>
@@ -132,181 +131,147 @@
 </template>
 
 <script>
-  //  , videoEdit
-  import { videoList, videoDelete } from './api/video'
-  // import { mapActions } from 'vuex'
-  // import { handleActivePath } from '@/utils/routes'
+//  , videoEdit
+import { videoList, videoDelete } from "./api/video";
+// import { mapActions } from 'vuex'
+// import { handleActivePath } from '@/utils/routes'
 
-  export default {
-    name: 'CourseManage',
-    data() {
-      return {
-        //修改排序
-        editForm: '',
-        oldSort: 0,
-        editStatus: 0, //排序编辑状态 0为正常 1显示输入框
-        //
-        list: [],
-        listLoading: true,
-        layout: 'total, sizes, prev, pager, next, jumper',
-        total: 0,
-        queryForm: {
-          page: 1,
-          per_page: 15,
-          title: '',
-        },
+export default {
+  name: "CourseManage",
+  data() {
+    return {
+      //修改排序
+      editForm: "",
+      oldSort: 0,
+      editStatus: 0, //排序编辑状态 0为正常 1显示输入框
+      //
+      list: [],
+      listLoading: true,
+      layout: "total, sizes, prev, pager, next, jumper",
+      total: 0,
+      queryForm: {
+        page: 1,
+        per_page: 15,
+        title: "",
+      },
+    };
+  },
+  watch: {
+    $route: "getVideoList",
+  },
+  created() {
+    const route = this.$route;
+    console.log(route, route.query, route.query.id, "idididii");
+    // 接收课程页面传过来的参数--》此id是课程id
+    this.queryForm.course_id = route.query.id;
+    this.getVideoList();
+  },
+  methods: {
+    goBack() {
+      this.$router.push({
+        path: "/video/index",
+      });
+    },
+    handleDelete(row) {
+      if (row.id) {
+        this.$confirm('你确定要删除当前项吗, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(async() => {
+          var data = {
+            id:row.id
+          }
+          const { message } = await videoDelete(data);
+          this.$message({ message, type: "success" });
+          await this.getVideoList();
+        })
       }
     },
-    watch: {
-      $route: 'getVideoList',
+    handleSizeChange(val) {
+      this.queryForm.per_page = val;
+      this.getVideoList();
     },
-    created() {
-      const route = this.$route
-      console.log(route, route.query, route.query.id, 'idididii')
-      // 接收课程页面传过来的参数--》此id是课程id
-      this.queryForm.id = route.query.id
-      this.getVideoList()
+    handleCurrentChange(val) {
+      this.queryForm.page = val;
+      this.getVideoList();
     },
-    methods: {
-      goBack() {
+    queryData() {
+      this.queryForm.page = 1;
+      this.getVideoList();
+    },
+    async getVideoList() {
+      this.listLoading = true;
+      const { data } = await videoList(this.queryForm);
+      console.log(data, "视频列表");
+      this.list = data.data;
+      this.total = data.meta.pagination.total;
+      this.listLoading = false;
+    },
+    //修改排序事件
+    async changeSort(row) {
+      console.log("1111111111");
+      this.editStatus = 1;
+      this.editForm = row;
+      this.oldSort = row.sort;
+
+      //await doEdit(this.editForm)
+    },
+    // async sureChange() {
+    //   this.editStatus = 0
+    //   if (this.oldSort !== this.editForm.sort) {
+    //     const { message } = await videoEdit(this.editForm)
+    //     console.log(message, 'message')
+    //     // location.reload()
+    //      this.$message({ message, type: "success" });
+    //     this.getVideoList()
+    //   } else {
+    //     return
+    //   }
+    // },
+    //暂时不要求添加视频
+    handleEdit() {
       this.$router.push({
-        path: "/video/index",
+        path: "/video/editvideo",
+        query: {
+          courseId: this.queryForm.course_id,
+        },
       });
     },
-      //章节管理
-      chapterManage(row) {
-        console.log(row.id, this.queryForm.id, '视频跳转到章节传递的参数')
+    //暂时不要求编辑视频
+    handleEditVideo(row) {
+      console.log(row, row.id, "点击视频列表中的编辑按钮");
+      if (row.id != undefined) {
         this.$router.push({
-          path: '/course/chapter',
+          path: "/video/editvideo",
           query: {
-            // 视频id
+            // course_chapter_id: row.id,
             videoId: row.id,
-            // 课程id
-            courseId: this.queryForm.id,
+            courseId: this.queryForm.course_id,
           },
-        })
-      },
-      //附件管理
-      handleEnclosure(row) {
-        console.log(row.id, this.queryForm.id, '视频跳转到附件传递的参数')
-        this.$router.push({
-          path: '/course/enclosure',
-          query: {
-            // 视频id
-            videoId: row.id,
-            // 课程id
-            courseId: this.queryForm.id,
-          },
-        })
-      },
-      handleDelete(row) {
-        if (row.id) {
-          this.$baseConfirm('你确定要删除当前项吗', null, async () => {
-            const { message } = await videoDelete({ id: row.id })
-            this.$baseMessage(
-              message,
-              'success',
-              false,
-              'vab-hey-message-success'
-            )
-            await this.getVideoList()
-          })
-        }
-      },
-      handleSizeChange(val) {
-        this.queryForm.per_page = val
-        this.getVideoList()
-      },
-      handleCurrentChange(val) {
-        this.queryForm.page = val
-        this.getVideoList()
-      },
-      queryData() {
-        this.queryForm.page = 1
-        this.getVideoList()
-      },
-      async getVideoList() {
-        this.listLoading = true
-        const { data } = await videoList(this.queryForm)
-        console.log(data, '视频列表')
-        this.list = data.data
-        this.total = data.meta.pagination.total
-        this.listLoading = false
-      },
-      //修改排序事件
-      async changeSort(row) {
-        console.log('1111111111')
-        this.editStatus = 1
-        this.editForm = row
-        this.oldSort = row.sort
-
-        //await doEdit(this.editForm)
-      },
-      //修改排序
-      inputSort(e) {
-        console.log(e, '000000000')
-        this.editForm.sort = e
-      },
-      // async sureChange() {
-      //   this.editStatus = 0
-      //   if (this.oldSort !== this.editForm.sort) {
-      //     const { message } = await videoEdit(this.editForm)
-      //     console.log(message, 'message')
-      //     // location.reload()
-      //     this.$baseMessage(
-      //       message,
-      //       'success',
-      //       false,
-      //       'vab-hey-message-success'
-      //     )
-      //     this.getVideoList()
-      //   } else {
-      //     return
-      //   }
-      // },
-      //暂时不要求添加视频
-      handleEdit() {
-        this.$router.push({
-          path: '/video/editvideo',
-          query: {
-            courseId: this.queryForm.id,
-          },
-        })
-      },
-      //暂时不要求编辑视频
-      // handleEditVideo(row) {
-      //   console.log(row, row.id, '点击视频列表中的编辑按钮')
-      //   if (row.id != undefined) {
-      //     this.$router.push({
-      //       path: '/course/editvideo',
-      //       query: {
-      //         // course_chapter_id: row.id,
-      //         videoId: row.id,
-      //         courseId: this.queryForm.id,
-      //       },
-      //     })
-      //   }
-      // },
+        });
+      }
     },
-  }
+  },
+};
 </script>
 <style scoped lang="scss">
-  /* 修改排序样式 */
-  .edit {
-    display: inline-block;
-    width: 110px;
-  }
-  .input-sort {
-    display: inline-block;
-    width: 100px;
-    margin-left: 10px;
-    border: none;
-  }
-  .sort-num {
-    display: inline-block;
-    margin-left: 10px;
-  }
-  .el-icon-edit {
-    color: #1890ff;
-  }
+/* 修改排序样式 */
+.edit {
+  display: inline-block;
+  width: 110px;
+}
+.input-sort {
+  display: inline-block;
+  width: 100px;
+  margin-left: 10px;
+  border: none;
+}
+.sort-num {
+  display: inline-block;
+  margin-left: 10px;
+}
+.el-icon-edit {
+  color: #1890ff;
+}
 </style>

+ 31 - 10
src/views/video/video_detail.vue

@@ -88,10 +88,9 @@
 <script>
   import {
     videoList,
-    videoDetail,
     lookRecord,
   } from './api/video'
-  import { getCourse_detail,chapterList } from './api/course_detail'
+  import { chapterList ,showDetail} from './api/course_detail'
 
   var myPlayer = ''
   var playTimeInterval = '' //播放事件定时器
@@ -171,7 +170,7 @@
       let route = this.$route
       this.courseId = route.query.course_id
       this.video_slug = route.query.video_slug
-      this.course_slug = route.query.course_slug
+      this.course_slug = route.query.slug
       this.isLearn = this.videoId = route.query.video_id
       console.log(this.videoId, this.courseId, this.video_slug, '123')
       this.getCourse_detail()
@@ -179,6 +178,7 @@
       console.log(this.vIndex, 'YYYYYYYYYYYYYY')
       clearInterval(playTimeInterval)
       this.getCourseDetail()
+      this.showDetail()
       this.show = false
       this.$nextTick(() => {
         this.show = true
@@ -187,11 +187,32 @@
     methods: {
       //获取课程章节
       async getCourse_detail() {
-        const { data } = await chapterList({id:this.courseId})
+        const { data } = await chapterList({course_id:this.courseId})
         console.log(data, 'xaingqing')
         // this.course_zhangjie = data.data
         // this.course_fenlei = data
       },
+      // 获取课程
+    async showDetail() {
+      this.loading = true;
+      const { data } = await showDetail({ slug: this.course_slug });
+      this.loading = false;
+      console.log(data);
+      this.course_zhangjie = data.directory;
+      this.lookVideo()
+      // if (this.videoId) {
+      //   this.isLearn = this.videoId;
+      //   //this.isLearn = this.video_slug
+      //   let route = this.$route;
+      //   this.vIndex = route.query.v_index;
+      //   this.cIndex = route.query.c_index;
+      // } else {
+      //   console.log(data, "YYYYY YYY");
+      //   this.isLearn = this.videoId = data.directory[0].children[0].id;
+      //   //this.isLearn = this.video_slug = data.directory[0].children[0].slug
+      //   this.videoList = this.directory[0].children;
+      // }
+    },
       //章节折叠
       zhedie(e) {
         // if (this.current_zhedie.includes(e)) {
@@ -340,7 +361,7 @@
       //定时发送视频播放记录
       async lookRecord() {
         let data = {
-          video_id: this.videoId,
+          video_id: this.course_zhangjie[this.videoIndex].id,
           //video_slug: this.video_slug,
           watch_seconds: this.playTime,
           is_watched: this.isWatch,
@@ -351,9 +372,9 @@
       },
       //获取课程详情章节列表和视频列表
       async getCourseDetail() {
-        const { data } = await videoList()
+        const { data } = await videoList({course_id:this.courseId})
         console.log(data)
-        this.course_zhangjie = data.data
+        // this.course_zhangjie = data.data
 
         // if (this.videoId) {
         //   this.isLearn = this.videoId
@@ -368,7 +389,7 @@
         //   this.videoList = this.directory[0].children
         // }
 
-        this.lookVideo()
+
         //   this.videoComments()
         console.log(data.directory, '课程详情')
       },
@@ -401,7 +422,7 @@
         console.log(this.video_slug, 'this.video_slug')
         // this.videoTitle = data.video.title
         console.log(this.course_zhangjie)
-        myPlayer.src(this.course_zhangjie[this.videoIndex].url_resource)
+        myPlayer.src(this.course_zhangjie[this.videoIndex].children[0].url_resource.url)
 
         this.attaches = data.attaches
         this.videoDescription = data.video.description
@@ -444,7 +465,7 @@
         this.$router.push({
           path: 'courseDetail',
           query: {
-            course_slug: this.course_slug,
+            slug: this.course_slug,
             id: this.courseId,
           },
         })

+ 9 - 0
src/views/xuexi/api/course_detail.js

@@ -40,3 +40,12 @@ export function getShoucang(data) {
     data,
   })
 }
+
+// 课程分类
+export function showDetail(params) {
+  return request({
+    url: '/course/show-detail',
+    method: 'get',
+    params,
+  })
+}

+ 19 - 1
src/views/xuexi/api/video.js

@@ -4,7 +4,7 @@
  * @Author: King
  * @Date: 2022-02-14 14:46:14
  * @LastEditors: king
- * @LastEditTime: 2023-03-25 17:46:11
+ * @LastEditTime: 2023-03-25 21:27:53
  */
 import request from '@/utils/request'
 //视频模块接口--------------------------------------------------------------
@@ -37,3 +37,21 @@ export function videoDelete(data) {
     method: 'delete',
   })
 }
+
+// 视频记录
+export function lookRecord(data) {
+  return request({
+    url: '/course/video/look-record',
+    method: 'post',
+    data,
+  })
+}
+
+// 课程分类
+export function showDetail(params) {
+  return request({
+    url: '/course/show-detail',
+    method: 'get',
+    params,
+  })
+}

+ 368 - 404
src/views/xuexi/course_detail.vue

@@ -4,7 +4,7 @@
  * @Author: 小六
  * @Date: 2022-01-21 10:44:04
  * @LastEditors: king
- * @LastEditTime: 2023-03-25 17:53:37
+ * @LastEditTime: 2023-03-25 21:30:36
 -->
 <template>
   <div class="class_container">
@@ -71,24 +71,8 @@
               <i class="el-icon-s-custom"></i>
               <span>{{ detail.user_count }}人</span>
             </div>
-            <div class="nums_right" @click="shoucang">
-              <span v-if="!detail.is_collection_status">
-                <i class="el-icon-star-off"></i>
-                收藏
-              </span>
-              <span v-else class="yishoucang">
-                <i class="el-icon-star-on"></i>
-
-                已收藏
-              </span>
-            </div>
           </div>
-          <span
-            class="course_join"
-            @click="to_sec_course"
-          >
-            去学习
-          </span>
+          <span class="course_join" @click="to_sec_course"> 去学习 </span>
           <!-- <span
             v-if="detail.watch_progress || detail.watch_progress === 0"
             class="course_join"
@@ -199,449 +183,429 @@
 </template>
 
 <script>
-  import {
-    getCourse_detail,
-    join,
-    getShoucang,
-    chapterList,
-  } from './api/course_detail'
+import { getCourse_detail, chapterList, showDetail } from "./api/course_detail";
+
+export default {
+  data() {
+    return {
+      value1: 0,
+      course_slug: "",
+      detail: {},
+      course_id: "",
+      course_zhangjie: [],
+      current_zhedie: [],
+      current_sec_nav: 1,
+      content: "",
+      queryForm: {
+        page: 1,
+        per_page: 15,
+      },
+      layout: "total, sizes, prev, pager, next, jumper",
+      total: 0,
+      // 课程中标签的颜色数组
+      colorList: ["primary", "warning", "info", "danger"],
+    };
+  },
+  created() {
+    console.log(this.$route.query, "this.$route.query");
+    this.course_slug = this.$route.query.slug;
+    this.course_id = this.$route.query.id;
+    console.log(this.course_id);
+    this.getCourse_detail();
+    this.showDetail();
+    this.chapterList();
+  },
 
-  export default {
-    data() {
-      return {
-        value1: 0,
-        course_slug: '',
-        detail: {},
-        course_id: '',
-        course_zhangjie: [],
-        current_zhedie: [],
-        current_sec_nav: 1,
-        content: '',
-        queryForm: {
-          page: 1,
-          per_page: 15,
+  methods: {
+    //返回上一页
+    goBack() {
+      this.$router.push({
+        path: "/xuexi/index",
+        query: {
+          id: this.courseId,
         },
-        layout: 'total, sizes, prev, pager, next, jumper',
-        total: 0,
-        // 课程中标签的颜色数组
-        colorList: ['primary', 'warning', 'info', 'danger'],
-      }
+      });
     },
-    created() {
-      console.log(this.$route.query, 'this.$route.query')
-      this.course_slug = this.$route.query.course_slug
-      this.course_id = this.$route.query.id
-      console.log(this.course_id)
-      this.getCourse_detail()
-      this.chapterList()
+    //获取课程分类
+    async getCourse_detail() {
+      const { data } = await getCourse_detail({ id: this.course_id });
+      console.log(data, "xaingqing");
+      this.detail = data;
+      // this.course_zhangjie = data.directory
     },
-
-    methods: {
-      //返回上一页
-      goBack() {
-        this.$router.push({
-          path: '/xuexi/index',
-          query: {
-            id: this.courseId,
-          },
-        })
-      },
-      //获取课程分类
-      async getCourse_detail() {
-        const { data } = await getCourse_detail({id:this.course_id})
-        console.log(data, 'xaingqing')
-        this.detail = data
-        // this.course_zhangjie = data.directory
-      },
-      //获取章节分类
-      async chapterList() {
-        const { data } = await chapterList({id:this.course_id})
-        console.log(data, 'zhangjie')
-        // this.detail = data
-        this.course_zhangjie = data.data
-      },
-      // 加入课程
-      async join_course() {
-        let params = {
+    // 获取课程
+    async showDetail() {
+      this.loading = true;
+      const { data } = await showDetail({ slug: this.course_slug });
+      this.loading = false;
+      console.log(data);
+      this.course_zhangjie = data.directory;
+    },
+    //获取章节分类
+    async chapterList() {
+      const { data } = await chapterList({ course_id: this.course_id });
+      console.log(data, "zhangjie");
+      // this.detail = data
+      // this.course_zhangjie = data.data;
+    },
+    //跳转到另一个详情页
+    to_sec_course() {
+      // 跳转到视频页
+      this.$router.push({
+        path: "./videoDetail",
+        query: {
           course_id: this.course_id,
-        }
-        console.log(params, 'xaingqing')
-
-        const { message } = await join(params)
-        this.$message({
-          message: message,
-          type: 'success',
-        })
-        this.getCourse_detail()
-        // console.log(message, 'xaingqing')
-      },
-      //跳转到另一个详情页
-      to_sec_course() {
-        // 跳转到视频页
-        this.$router.push({
-          path: './videoDetail',
-          query: {
-            course_id: this.course_id,
-            course_slug: this.course_slug,
-          },
-        })
-      },
+          slug: this.course_slug,
+        },
+      });
+    },
 
-      //章节折叠
-      zhedie(e) {
-        if (this.current_zhedie.includes(e)) {
-          this.current_zhedie = this.current_zhedie.filter((item) => {
-            return item != e
-          })
-        } else {
-          this.current_zhedie.push(e)
-        }
-      },
-      // 收藏课程
-      async shoucang() {
-        const { message } = await getShoucang({ course_id: this.detail.id })
-        this.$message({
-          message: message,
-          type: 'success',
-        })
-        this.getCourse_detail()
-      },
-      //分页
-      handleCurrentChange(val) {
-        this.queryForm.page = val
-      },
-      handleSizeChange(val) {
-        this.queryForm.pageSize = val
-      },
-      chang_sec_nav(e) {
-        this.current_sec_nav = e
-      },
-      to_video(video_id, video_slug) {
-        console.log(video_id, 'taiozhaun')
-          // 跳转到视频页
-          this.$router.push({
-            path: './videoList',
-            query: {
-              video_id: video_id,
-              course_id: this.course_id,
-              course_slug: this.course_slug,
-              video_slug: video_slug,
-            },
-          })
-      },
+    //章节折叠
+    zhedie(e) {
+      if (this.current_zhedie.includes(e)) {
+        this.current_zhedie = this.current_zhedie.filter((item) => {
+          return item != e;
+        });
+      } else {
+        this.current_zhedie.push(e);
+      }
     },
-  }
+    //分页
+    handleCurrentChange(val) {
+      this.queryForm.page = val;
+    },
+    handleSizeChange(val) {
+      this.queryForm.pageSize = val;
+    },
+    chang_sec_nav(e) {
+      this.current_sec_nav = e;
+    },
+    to_video(video_id, video_slug) {
+      console.log(video_id, "taiozhaun");
+      // 跳转到视频页
+      this.$router.push({
+        path: "./videoDetail",
+        query: {
+          video_id: video_id,
+          course_id: this.course_id,
+          slug: this.course_slug,
+          video_slug: video_slug,
+        },
+      });
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-  .class_container {
-    padding: 0 !important;
-    background: none !important;
-    width: 1200px;
-    margin: 0 auto 30px;
-    .detail_header {
-      // padding-top: 24px;
-      color: #919191;
-      cursor: pointer;
-      .sec {
-        display: inline-block;
-        vertical-align: middle;
-        max-width: 90%;
-        overflow: hidden;
-        text-overflow: ellipsis;
-        white-space: nowrap;
-      }
+.class_container {
+  padding: 0 !important;
+  background: none !important;
+  width: 1200px;
+  margin: 0 auto 30px;
+  .detail_header {
+    // padding-top: 24px;
+    color: #919191;
+    cursor: pointer;
+    .sec {
+      display: inline-block;
+      vertical-align: middle;
+      max-width: 90%;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
     }
-    .course_title {
-      position: relative;
-      padding: 32px 32px 16px;
-      margin-top: 16px;
-      background-color: #fff;
-      display: flex;
-      justify-content: space-between;
-      .course_img {
-        width: 43.165%;
-        .img {
+  }
+  .course_title {
+    position: relative;
+    padding: 32px 32px 16px;
+    margin-top: 16px;
+    background-color: #fff;
+    display: flex;
+    justify-content: space-between;
+    .course_img {
+      width: 43.165%;
+      .img {
+        position: relative;
+        width: 100%;
+        img {
           position: relative;
+          left: 0;
+          top: 0;
           width: 100%;
-          img {
-            position: relative;
-            left: 0;
-            top: 0;
-            width: 100%;
-            height: 270px;
-            object-fit: cover;
-          }
+          height: 270px;
+          object-fit: cover;
         }
       }
-      .course_money {
-        position: relative;
-        width: 53.957%;
-        .money_top {
-          // min-height: 250px;
+    }
+    .course_money {
+      position: relative;
+      width: 53.957%;
+      .money_top {
+        // min-height: 250px;
 
-          .title {
-            font-size: 30px;
-            color: #333;
-            font-weight: 500;
-            margin: 0 0 20px;
-            display: -webkit-box; /*将对象转为弹性盒模型展示*/
-            -webkit-box-orient: vertical; /*设置弹性盒模型子元素的排列方式*/
-            -webkit-line-clamp: 1; /*限制文本行数*/
-            overflow: hidden;
-          }
+        .title {
+          font-size: 30px;
+          color: #333;
+          font-weight: 500;
+          margin: 0 0 20px;
+          display: -webkit-box; /*将对象转为弹性盒模型展示*/
+          -webkit-box-orient: vertical; /*设置弹性盒模型子元素的排列方式*/
+          -webkit-line-clamp: 1; /*限制文本行数*/
+          overflow: hidden;
+        }
 
-          .des {
-            background-color: #f9f9f9;
-            padding: 10px;
-            min-height: 100px;
-          }
-          .money {
-            // margin-top: 12px;
-            // margin-bottom: 12px;
-            // padding-left: 12px;
-            height: 20px;
-            // background-color: #f9f9f9;
+        .des {
+          background-color: #f9f9f9;
+          padding: 10px;
+          min-height: 100px;
+        }
+        .money {
+          // margin-top: 12px;
+          // margin-bottom: 12px;
+          // padding-left: 12px;
+          height: 20px;
+          // background-color: #f9f9f9;
+          color: #666;
+          line-height: 20px;
+        }
+        .time {
+          margin-top: 16px;
+          .time_title {
+            margin-right: 6px;
+            width: 80px;
+            text-align: right;
             color: #666;
-            line-height: 20px;
-          }
-          .time {
-            margin-top: 16px;
-            .time_title {
-              margin-right: 6px;
-              width: 80px;
-              text-align: right;
-              color: #666;
-              &:last-child {
-                color: grey;
-                font-size: small;
-              }
+            &:last-child {
+              color: grey;
+              font-size: small;
             }
           }
         }
-        .join {
-          // text-align: right;
-          // margin-left: 10px;
-          margin-top: 80px;
+      }
+      .join {
+        // text-align: right;
+        // margin-left: 10px;
+        margin-top: 80px;
+        display: flex;
+        align-items: center;
+        justify-content: space-between;
+        .nums {
+          padding: 0;
+          // margin-top: 20px;
+          margin-bottom: 0;
+          list-style: none;
+          color: #999;
           display: flex;
           align-items: center;
           justify-content: space-between;
-          .nums {
-            padding: 0;
-            // margin-top: 20px;
-            margin-bottom: 0;
-            list-style: none;
-            color: #999;
-            display: flex;
-            align-items: center;
-            justify-content: space-between;
+          font-size: 14px;
+          width: 80%;
+          .nums_left {
+            i {
+              margin-right: 5px;
+            }
+          }
+          .nums_right {
+            cursor: pointer;
             font-size: 14px;
-            width: 80%;
-            .nums_left {
-              i {
-                margin-right: 5px;
-              }
+            // margin-top: 12px;
+            i {
+              margin-right: 5px;
             }
-            .nums_right {
-              cursor: pointer;
-              font-size: 14px;
-              // margin-top: 12px;
+            .yishoucang {
+              color: #ff7e56;
               i {
-                margin-right: 5px;
-              }
-              .yishoucang {
-                color: #ff7e56;
-                i {
-                  font-size: 16px;
-                }
+                font-size: 16px;
               }
             }
           }
-          .course_join {
-            display: inline-block;
-            padding: 6px 24px;
-            height: 32px;
-            font-weight: 500;
-            color: #fff;
-            background-color: #ff7e56;
-            line-height: 20px;
-            cursor: pointer;
-            border-radius: 4px;
-            margin-left: 10px;
-          }
+        }
+        .course_join {
+          display: inline-block;
+          padding: 6px 24px;
+          height: 32px;
+          font-weight: 500;
+          color: #fff;
+          background-color: #ff7e56;
+          line-height: 20px;
+          cursor: pointer;
+          border-radius: 4px;
+          margin-left: 10px;
         }
       }
     }
-    .course_content {
-      margin-top: 24px;
-      display: flex;
-      justify-content: space-between;
-      .content_left {
-        width: 74.49%;
-        .nav {
-          margin: 0;
-          position: relative;
-          padding: 16px 0;
-          margin-bottom: 0;
-          width: 100%;
-          height: 52px;
-          text-align: center;
-          list-style: none;
-          background-color: #fff;
-          border-bottom: 1px solid #ebebeb;
-          li {
-            display: inline-block;
-            margin: 0 80px;
-            cursor: pointer;
-            span {
-              position: relative;
-              color: #666;
-              transition: all 0.3s ease;
-            }
+  }
+  .course_content {
+    margin-top: 24px;
+    display: flex;
+    justify-content: space-between;
+    .content_left {
+      width: 74.49%;
+      .nav {
+        margin: 0;
+        position: relative;
+        padding: 16px 0;
+        margin-bottom: 0;
+        width: 100%;
+        height: 52px;
+        text-align: center;
+        list-style: none;
+        background-color: #fff;
+        border-bottom: 1px solid #ebebeb;
+        li {
+          display: inline-block;
+          margin: 0 80px;
+          cursor: pointer;
+          span {
+            position: relative;
+            color: #666;
+            transition: all 0.3s ease;
           }
-          .active {
-            span {
-              font-size: 16px;
-              color: #46c37b;
-              &::after {
-                position: absolute;
-                bottom: -18px;
-                left: 0;
-                content: '';
-                width: 100%;
-                height: 3px;
-                background-color: #46c37b;
-                border-radius: 2px;
-              }
+        }
+        .active {
+          span {
+            font-size: 16px;
+            color: #46c37b;
+            &::after {
+              position: absolute;
+              bottom: -18px;
+              left: 0;
+              content: "";
+              width: 100%;
+              height: 3px;
+              background-color: #46c37b;
+              border-radius: 2px;
             }
           }
         }
-        .content_wrap {
-          .jianjie {
-            padding: 32px 16px 16px;
-            margin-top: 0;
-            background-color: #fff;
-            display: none;
-            h3 {
-              position: relative;
-              margin: 0;
-              padding-left: 14px;
-              font-size: 18px;
-              font-weight: 500;
-              line-height: 24px;
-              color: #333;
-            }
-            .jianjie_wrap {
-              padding-left: 14px;
-              padding-top: 10px;
-              line-height: 22px;
-              font-size: 14px;
-            }
+      }
+      .content_wrap {
+        .jianjie {
+          padding: 32px 16px 16px;
+          margin-top: 0;
+          background-color: #fff;
+          display: none;
+          h3 {
+            position: relative;
+            margin: 0;
+            padding-left: 14px;
+            font-size: 18px;
+            font-weight: 500;
+            line-height: 24px;
+            color: #333;
+          }
+          .jianjie_wrap {
+            padding-left: 14px;
+            padding-top: 10px;
+            line-height: 22px;
+            font-size: 14px;
           }
-          .mulu {
-            padding: 32px 16px 16px;
+        }
+        .mulu {
+          padding: 32px 16px 16px;
+          margin-top: 24px;
+          background-color: #fff;
+          display: none;
+          h3 {
+            position: relative;
+            margin: 0;
+            padding-left: 14px;
+            font-size: 18px;
+            font-weight: 500;
+            line-height: 24px;
+            color: #333;
+          }
+          .empty {
+            padding-left: 14px;
+            padding-top: 10px;
+            line-height: 22px;
+            font-size: 14px;
+            color: rgba(0, 0, 0, 0.56);
+          }
+          .item_wrap {
             margin-top: 24px;
-            background-color: #fff;
-            display: none;
-            h3 {
-              position: relative;
-              margin: 0;
-              padding-left: 14px;
-              font-size: 18px;
-              font-weight: 500;
-              line-height: 24px;
-              color: #333;
-            }
-            .empty {
-              padding-left: 14px;
-              padding-top: 10px;
-              line-height: 22px;
-              font-size: 14px;
-              color: rgba(0, 0, 0, 0.56);
-            }
-            .item_wrap {
-              margin-top: 24px;
-              ul {
-                list-style: none;
-                padding: 0;
-                margin-bottom: 0;
-                .out_wrap {
-                  margin-bottom: 10px;
-                  cursor: pointer;
+            ul {
+              list-style: none;
+              padding: 0;
+              margin-bottom: 0;
+              .out_wrap {
+                margin-bottom: 10px;
+                cursor: pointer;
 
-                  .zhangjie {
+                .zhangjie {
+                  display: flex;
+                  justify-content: space-between;
+                  align-items: center;
+                  background-color: #f5f5f5;
+                  padding-right: 17px;
+                }
+                .keshi {
+                  li {
                     display: flex;
                     justify-content: space-between;
                     align-items: center;
-                    background-color: #f5f5f5;
+                    margin-bottom: 10px;
                     padding-right: 17px;
-                  }
-                  .keshi {
-                    li {
-                      display: flex;
-                      justify-content: space-between;
-                      align-items: center;
-                      margin-bottom: 10px;
-                      padding-right: 17px;
 
-                      cursor: pointer;
-                      // padding-right: 17px;
-                      &:hover {
-                        background-color: #f3fee8;
-                      }
+                    cursor: pointer;
+                    // padding-right: 17px;
+                    &:hover {
+                      background-color: #f3fee8;
                     }
                   }
-                  .is_zhedie {
-                    display: none;
+                }
+                .is_zhedie {
+                  display: none;
+                }
+                i {
+                  font-size: 18px;
+                }
+                .left {
+                  padding: 0 0 0 17px;
+                  display: flex;
+                  align-items: center;
+                  .scrle {
+                    display: inline-block;
+                    width: 16px;
+                    height: 16px;
+                    border-radius: 50%;
+                    border: 2px solid #999;
+                    box-sizing: border-box;
                   }
-                  i {
-                    font-size: 18px;
+                  img {
+                    width: 16px;
+                    height: 16px;
                   }
-                  .left {
-                    padding: 0 0 0 17px;
-                    display: flex;
-                    align-items: center;
-                    .scrle {
-                      display: inline-block;
-                      width: 16px;
-                      height: 16px;
-                      border-radius: 50%;
-                      border: 2px solid #999;
-                      box-sizing: border-box;
-                    }
-                    img {
-                      width: 16px;
-                      height: 16px;
-                    }
-                    .complate {
-                      color: #46c37b;
-                    }
-                    .title {
-                      display: inline-block;
-                      padding: 15px 100px 15px 0;
-                      margin-left: 20px;
-                    }
+                  .complate {
+                    color: #46c37b;
                   }
-                  .right {
-                    display: flex;
-                    align-items: center;
-                    color: #999;
-                    span {
-                      margin-right: 5px;
-                    }
+                  .title {
+                    display: inline-block;
+                    padding: 15px 100px 15px 0;
+                    margin-left: 20px;
+                  }
+                }
+                .right {
+                  display: flex;
+                  align-items: center;
+                  color: #999;
+                  span {
+                    margin-right: 5px;
                   }
                 }
               }
             }
           }
-          .noShow {
-            display: none;
-          }
-          .isShow {
-            display: block;
-          }
+        }
+        .noShow {
+          display: none;
+        }
+        .isShow {
+          display: block;
         }
       }
     }
   }
+}
 </style>

+ 2 - 8
src/views/xuexi/index.vue

@@ -96,7 +96,6 @@ export default {
 
   created() {
     this.getCourse();
-    // this.showDetail()
     this.current_tag = this.$route.query.course_tag;
     console.log(this.role_id, "role_id");
   },
@@ -113,19 +112,14 @@ export default {
 
       console.log(this.course_list, "course_list");
     },
-    // 获取课程
-    // async showDetail() {
-    //   this.loading = true;
-    //   const { data } = await showDetail({slug:'INjDU5NR'});
-    //   this.loading = false;
-    //   console.log(data);
-    // },
+
     toDetail(e) {
       // 跳转到课程详情页
       this.$router.push({
         path: "/xuexi/courseDetail",
         query: {
           id: e.id,
+          slug:e.slug
         },
       });
     },

+ 669 - 665
src/views/xuexi/video_detail.vue

@@ -1,4 +1,3 @@
-
 <template>
   <div class="video_container">
     <div :class="['left_video', isNav ? 'all' : '']">
@@ -23,9 +22,7 @@
       </div>
       <div class="nav">
         <ul>
-          <li>
-            目录
-          </li>
+          <li>目录</li>
         </ul>
       </div>
       <div v-if="index == 1" class="nav_item">
@@ -86,732 +83,739 @@
   </div>
 </template>
 <script>
-  import {
-    videoList,
-    videoDetail,
-    lookRecord,
-  } from './api/video'
-  import { getCourse_detail,chapterList } from './api/course_detail'
+import { videoList, lookRecord, showDetail } from "./api/video";
+import { chapterList } from "./api/course_detail";
 
-  var myPlayer = ''
-  var playTimeInterval = '' //播放事件定时器
-  export default {
-    data() {
-      return {
-        index: 1,
-        isNav: true,
-        course_zhangjie: [],
-        video_slug: '',
-        current_zhedie: [],
+var myPlayer = "";
+var playTimeInterval = ""; //播放事件定时器
+export default {
+  data() {
+    return {
+      index: 1,
+      isNav: true,
+      course_zhangjie: [],
+      video_slug: "",
+      current_zhedie: [],
 
-        ban_drag: 0, //当前播放视频是否禁止拖动
-        time: 3, //倒计时
-        isFull: false, //是否全屏
-        loading: true,
-        vIndex: 0, //当前播放视频索引
-        cIndex: 0, //当前播放视频所属章节索引
-        zhUrl: '', //中文字幕地址
-        enUrl: '', //英文字幕地址
-        nextVideo: false,
-        dialogVisible: false,
-        activeName: 'zero',
+      ban_drag: 0, //当前播放视频是否禁止拖动
+      time: 3, //倒计时
+      isFull: false, //是否全屏
+      loading: true,
+      vIndex: 0, //当前播放视频索引
+      cIndex: 0, //当前播放视频所属章节索引
+      zhUrl: "", //中文字幕地址
+      enUrl: "", //英文字幕地址
+      nextVideo: false,
+      dialogVisible: false,
+      activeName: "zero",
 
-        directory: [], //章节视频列表
-        videoList: [], //当前章节的视频列表
-        isLearn: '', //是否正在学习中
-        courseId: '', //课程id
-        videoId: '', //正在学习的视频id
-        isWatch: 0, //是否完成学习
-        videoTitle: '', //正在播放的视频名称
-        playTime: 0, //视频播放秒数
-        queryForm: {
-          page: 1,
-          per_page: 15,
-        },
-        show: false,
-        form: {
-          danmu: 'admin-pro',
-        },
-        player: null,
-        videoIndex:0
-      }
-    },
-    watch: {
-      $route: 'getCourseDetail',
+      directory: [], //章节视频列表
+      videoList: [], //当前章节的视频列表
+      isLearn: "", //是否正在学习中
+      courseId: "", //课程id
+      videoId: "", //正在学习的视频id
+      isWatch: 0, //是否完成学习
+      videoTitle: "", //正在播放的视频名称
+      playTime: 0, //视频播放秒数
+      queryForm: {
+        page: 1,
+        per_page: 15,
+      },
+      show: false,
+      form: {
+        danmu: "admin-pro",
+      },
+      player: null,
+      videoIndex: 0,
+    };
+  },
+  watch: {
+    $route: "getCourseDetail",
+  },
+  // computed: {
+  //   ...mapGetters({
+  //     token: 'user/token',
+  //   }),
+  // },
+  mounted() {
+    // this.player = this.$refs.player.dp
+    this.nextVideo = false;
+    console.log("测试");
+    this.initVideo();
+    // clearInterval(this.playTimeInterval)
+    // console.log(this.player.video.paused, 'ppppp')
+  },
+  beforeDestroy() {
+    //  组件销毁时,清除播放器
+    myPlayer.dispose(); // 该方法会重置videojs的内部状态并移除dom
+    clearInterval(playTimeInterval);
+
+    if (myPlayer) {
+      console.log("清除视频播放组件");
+      myPlayer.dispose(); // 该方法会重置videojs的内部状态并移除dom
+    }
+  },
+  destroyed() {
+    clearInterval(playTimeInterval);
+
+    console.log("清除视频播放组件");
+  },
+  created() {
+    let route = this.$route;
+    this.courseId = route.query.course_id;
+    this.video_slug = route.query.video_slug;
+    this.course_slug = route.query.slug;
+    this.isLearn = this.videoId = route.query.video_id;
+    console.log(this.videoId, this.courseId, this.video_slug, "123");
+    this.getCourse_detail();
+    this.nextVideo = false;
+    console.log(this.vIndex, "YYYYYYYYYYYYYY");
+    clearInterval(playTimeInterval);
+    this.getCourseDetail();
+    this.showDetail();
+    this.show = false;
+    this.$nextTick(() => {
+      this.show = true;
+    });
+  },
+  methods: {
+    //获取课程章节
+    async getCourse_detail() {
+      const { data } = await chapterList({ id: this.courseId });
+      console.log(data, "xaingqing");
+      // this.course_zhangjie = data.data
+      // this.course_fenlei = data
     },
-    // computed: {
-    //   ...mapGetters({
-    //     token: 'user/token',
-    //   }),
-    // },
-    mounted() {
-      // this.player = this.$refs.player.dp
-      this.nextVideo = false
-      console.log('测试')
-      this.initVideo()
-      // clearInterval(this.playTimeInterval)
-      // console.log(this.player.video.paused, 'ppppp')
+    // 获取课程
+    async showDetail() {
+      this.loading = true;
+      const { data } = await showDetail({ slug: this.course_slug });
+      this.loading = false;
+      console.log(data);
+      this.course_zhangjie = data.directory;
+      this.lookVideo()
+      // if (this.videoId) {
+      //   this.isLearn = this.videoId;
+      //   //this.isLearn = this.video_slug
+      //   let route = this.$route;
+      //   this.vIndex = route.query.v_index;
+      //   this.cIndex = route.query.c_index;
+      // } else {
+      //   console.log(data, "YYYYY YYY");
+      //   this.isLearn = this.videoId = data.directory[0].children[0].id;
+      //   //this.isLearn = this.video_slug = data.directory[0].children[0].slug
+      //   this.videoList = this.directory[0].children;
+      // }
     },
-    beforeDestroy() {
-      //  组件销毁时,清除播放器
-      myPlayer.dispose() // 该方法会重置videojs的内部状态并移除dom
-      clearInterval(playTimeInterval)
-
-      if (myPlayer) {
-        console.log('清除视频播放组件')
-        myPlayer.dispose() // 该方法会重置videojs的内部状态并移除dom
+    //章节折叠
+    zhedie(e) {
+      if (this.current_zhedie.includes(e)) {
+        this.current_zhedie = this.current_zhedie.filter((item) => {
+          return item != e;
+        });
+      } else {
+        this.current_zhedie.push(e);
       }
+      // this.videoIndex = e
+      // this.lookVideo()
     },
-    destroyed() {
-      clearInterval(playTimeInterval)
-
-      console.log('清除视频播放组件')
-    },
-    created() {
-      let route = this.$route
-      this.courseId = route.query.course_id
-      this.video_slug = route.query.video_slug
-      this.course_slug = route.query.course_slug
-      this.isLearn = this.videoId = route.query.video_id
-      console.log(this.videoId, this.courseId, this.video_slug, '123')
-      this.getCourse_detail()
-      this.nextVideo = false
-      console.log(this.vIndex, 'YYYYYYYYYYYYYY')
-      clearInterval(playTimeInterval)
-      this.getCourseDetail()
-      this.show = false
-      this.$nextTick(() => {
-        this.show = true
-      })
+    //点击重新播放
+    refLook() {
+      this.cIndex = 0;
+      this.vIndex = 0;
+      this.videoList = this.directory[this.cIndex].children;
+      console.log(this.video_list, "list");
+      //let video_list = this.directory[this.cIndex].children
+      this.isLearn = this.videoId = this.videoList[this.vIndex].id;
+      // this.isLearn = this.video_slug = this.videoList[this.vIndex].slug
+      this.lookVideo();
+      //this.videoComments()
     },
-    methods: {
-      //获取课程章节
-      async getCourse_detail() {
-        const { data } = await chapterList({id:this.courseId})
-        console.log(data, 'xaingqing')
-        // this.course_zhangjie = data.data
-        // this.course_fenlei = data
-      },
-      //章节折叠
-      zhedie(e) {
-        // if (this.current_zhedie.includes(e)) {
-        //   this.current_zhedie = this.current_zhedie.filter((item) => {
-        //     return item != e
-        //   })
-        // } else {
-        //   this.current_zhedie.push(e)
-        // }
-        this.videoIndex = e
-        this.lookVideo()
-      },
-      //点击重新播放
-      refLook() {
-        this.cIndex = 0
-        this.vIndex = 0
-        this.videoList = this.directory[this.cIndex].children
-        console.log(this.video_list, 'list')
-        //let video_list = this.directory[this.cIndex].children
-        this.isLearn = this.videoId = this.videoList[this.vIndex].id
-        // this.isLearn = this.video_slug = this.videoList[this.vIndex].slug
-        this.lookVideo()
-        //this.videoComments()
-      },
-      initVideo() {
-        let that = this
-        //初始化视频方法
-        myPlayer = this.$video(document.getElementById('myVideo'), {
-          language: 'zh-CN',
-          //确定播放器是否具有用户可以与之交互的控件。没有控件,启动视频播放的唯一方法是使用autoplay属性或通过Player API。
-          controls: true,
-          //自动播放属性,muted:静音播放
-          autoplay: 'autoplay',
-          //建议浏览器是否应在<video>加载元素后立即开始下载视频数据。
-          preload: 'auto',
-        })
-
-        myPlayer.ready(function () {
-          myPlayer.volume(0.5)
-          myPlayer.play()
-        })
-        console.log(myPlayer, 'document.getElementById')
-        //监听视频播放完成
-        myPlayer.on('ended', function () {
-          console.log(this.course_slug, 'YYYYYYYYYYYYYY---视频播放结束')
-          clearInterval(playTimeInterval)
-          that.isWatch = 1
-          that.playTime = parseInt(myPlayer.currentTime())
-          that.lookRecord()
-          that.playTime = 0
-          // let params = {
-          //   course_id: that.courseId,
-          // }
-          // debugger
-          // getCourseDetail(params).then((res) => {
-          //   console.log(res, '刷新章节列表')
-          //   that.directory = res.data.directory
-          // })
-          myPlayer.exitFullscreen()
-          // that.getCourseDetail()
-          setTimeout(function () {
-            that.autoPlayNext()
-          }, 3000)
-
-          console.log('视频播放结束')
-        })
-        //监听视频暂停
-        myPlayer.on('pause', function () {
-          console.log('YYYYYYYYYYYYYY---视频播放暂停')
-          clearInterval(playTimeInterval)
-          console.log(parseInt(myPlayer.currentTime()), '视频播放进度暂停')
-          if (this.ban_drag == 0) {
-            let time = parseInt(myPlayer.currentTime())
-            if (time - this.playTime > 10) {
-              myPlayer.currentTime(this.playTime)
-            }
-          }
-          console.log(that.playTime, '视频播放时长')
-          console.log('用户点击了暂停')
-        })
-        //监听视频播放
-        myPlayer.on('play', function () {
-          that.time = 0
-          that.nextVideo = false
-          console.log('YYYYYYYYYYYYYY---视频播放')
-          that.getPlayTime()
-          console.log('视频播放')
-        })
-      },
-      //获取视频播放事件每秒加一
-      //自动播放下一章节事件
-      autoPlayNext() {
-        //获取视频判断当前视频是不是本章节的最后一条
-        console.log(this.directory, this.cIndex, 'this.directory')
+    initVideo() {
+      let that = this;
+      //初始化视频方法
+      myPlayer = this.$video(document.getElementById("myVideo"), {
+        language: "zh-CN",
+        //确定播放器是否具有用户可以与之交互的控件。没有控件,启动视频播放的唯一方法是使用autoplay属性或通过Player API。
+        controls: true,
+        //自动播放属性,muted:静音播放
+        autoplay: "autoplay",
+        //建议浏览器是否应在<video>加载元素后立即开始下载视频数据。
+        preload: "auto",
+      });
 
-        this.videoList = this.directory[this.cIndex].children
-        this.vIndex = Number(this.vIndex)
-        console.log(typeof this.vIndex + 1, 'vIndex')
-        let vIndexnum = this.vIndex + 1
-        console.log(vIndexnum == this.videoList.length, 'length')
-        if (vIndexnum == this.videoList.length) {
-          //是---判断章节是不是最后一张
-          this.cIndex = Number(this.cIndex)
-          let cIndexnum = this.cIndex + 1
-          if (cIndexnum == this.directory.length) {
-            clearInterval(playTimeInterval)
-            this.nextVideo = true
-            return
-            //是最后一张-----提示用户本课程视频已学完
-          } else {
-            //不是最后一张---播放下一章节的第一条视频
-            console.log(' //不是最后一张---播放下一章节的第一条视频')
-            this.cIndex = this.cIndex + 1
-            this.vIndex = 0
-            let video_list = this.directory[this.cIndex].children
-            this.isLearn = this.videoId = video_list[this.vIndex].id
-            this.video_slug = video_list[this.vIndex].slug
+      myPlayer.ready(function () {
+        myPlayer.volume(0.5);
+        myPlayer.play();
+      });
+      console.log(myPlayer, "document.getElementById");
+      //监听视频播放完成
+      myPlayer.on("ended", function () {
+        console.log(this.course_slug, "YYYYYYYYYYYYYY---视频播放结束");
+        clearInterval(playTimeInterval);
+        that.isWatch = 1;
+        that.playTime = parseInt(myPlayer.currentTime());
+        that.lookRecord();
+        that.playTime = 0;
+        // let params = {
+        //   course_id: that.courseId,
+        // }
+        // debugger
+        // getCourseDetail(params).then((res) => {
+        //   console.log(res, '刷新章节列表')
+        //   that.directory = res.data.directory
+        // })
+        myPlayer.exitFullscreen();
+        // that.getCourseDetail()
+        setTimeout(function () {
+          that.autoPlayNext();
+        }, 3000);
 
-            this.lookVideo()
-            /// this.videoComments()
+        console.log("视频播放结束");
+      });
+      //监听视频暂停
+      myPlayer.on("pause", function () {
+        console.log("YYYYYYYYYYYYYY---视频播放暂停");
+        clearInterval(playTimeInterval);
+        console.log(parseInt(myPlayer.currentTime()), "视频播放进度暂停");
+        if (this.ban_drag == 0) {
+          let time = parseInt(myPlayer.currentTime());
+          if (time - this.playTime > 10) {
+            myPlayer.currentTime(this.playTime);
           }
-        } else {
-          //不是---视频索引+1播放下一条
-          console.log(' // //不是---视频索引+1播放下一条')
-          this.vIndex = this.vIndex + 1
-          let video_list = this.directory[this.cIndex].children
-          console.log(video_list, 'video_list')
-          this.isLearn = this.videoId = video_list[this.vIndex].id
-          this.video_slug = video_list[this.vIndex].slug
-          console.log(this.videoId, 'this.videoId')
-          this.lookVideo()
-          //  this.videoComments()
         }
-      },
-      getPlayTime() {
-        clearInterval(playTimeInterval)
-        let that = this
-        playTimeInterval = setInterval(function () {
-          that.playTime = parseInt(myPlayer.currentTime())
-          if (Math.floor(that.playTime / 10) > 0 && that.playTime % 10 == 0) {
-            that.lookRecord()
-            console.log(that.playTime, 'that.playTime')
-          }
-        }, 1000)
-      },
-      //定时发送视频播放记录
-      async lookRecord() {
-        let data = {
-          video_id: this.videoId,
-          //video_slug: this.video_slug,
-          watch_seconds: this.playTime,
-          is_watched: this.isWatch,
-          course_id: this.courseId,
-        }
-        const { message } = await lookRecord(data)
-        console.log(message, 'ooooooooo')
-      },
-      //获取课程详情章节列表和视频列表
-      async getCourseDetail() {
-        const { data } = await videoList()
-        console.log(data)
-        this.course_zhangjie = data.data
+        console.log(that.playTime, "视频播放时长");
+        console.log("用户点击了暂停");
+      });
+      //监听视频播放
+      myPlayer.on("play", function () {
+        that.time = 0;
+        that.nextVideo = false;
+        console.log("YYYYYYYYYYYYYY---视频播放");
+        that.getPlayTime();
+        console.log("视频播放");
+      });
+    },
+    //获取视频播放事件每秒加一
+    //自动播放下一章节事件
+    autoPlayNext() {
+      //获取视频判断当前视频是不是本章节的最后一条
+      console.log(this.directory, this.cIndex, "this.directory");
 
-        // if (this.videoId) {
-        //   this.isLearn = this.videoId
-        //   //this.isLearn = this.video_slug
-        //   let route = this.$route
-        //   this.vIndex = route.query.v_index
-        //   this.cIndex = route.query.c_index
-        // } else {
-        //   console.log(data, 'YYYYY YYY')
-        //   this.isLearn = this.videoId = data.directory[0].children[0].id
-        //   //this.isLearn = this.video_slug = data.directory[0].children[0].slug
-        //   this.videoList = this.directory[0].children
-        // }
+      this.videoList = this.directory[this.cIndex].children;
+      this.vIndex = Number(this.vIndex);
+      console.log(typeof this.vIndex + 1, "vIndex");
+      let vIndexnum = this.vIndex + 1;
+      console.log(vIndexnum == this.videoList.length, "length");
+      if (vIndexnum == this.videoList.length) {
+        //是---判断章节是不是最后一张
+        this.cIndex = Number(this.cIndex);
+        let cIndexnum = this.cIndex + 1;
+        if (cIndexnum == this.directory.length) {
+          clearInterval(playTimeInterval);
+          this.nextVideo = true;
+          return;
+          //是最后一张-----提示用户本课程视频已学完
+        } else {
+          //不是最后一张---播放下一章节的第一条视频
+          console.log(" //不是最后一张---播放下一章节的第一条视频");
+          this.cIndex = this.cIndex + 1;
+          this.vIndex = 0;
+          let video_list = this.directory[this.cIndex].children;
+          this.isLearn = this.videoId = video_list[this.vIndex].id;
+          this.video_slug = video_list[this.vIndex].slug;
 
-        this.lookVideo()
-        //   this.videoComments()
-        console.log(data.directory, '课程详情')
-      },
-      //选择需要播放的视频
-      async clickVideo(item, vIndex, cIndex) {
-        this.vIndex = vIndex
-        this.cIndex = cIndex
-        clearInterval(playTimeInterval)
-        console.log(vIndex, 'vIndex, cIndex')
-        console.log(cIndex, 'vIndex, cIndex')
-        this.nextVideo = false
-        this.isWatch = 0
-        console.log(item, '点击时间点')
-        this.isLearn = item.id
-        this.videoTitle = item.title
-        this.videoId = item.id
-        this.video_slug = item.slug
-        this.playTime = 0
-        this.lookVideo()
+          this.lookVideo();
+          /// this.videoComments()
+        }
+      } else {
+        //不是---视频索引+1播放下一条
+        console.log(" // //不是---视频索引+1播放下一条");
+        this.vIndex = this.vIndex + 1;
+        let video_list = this.directory[this.cIndex].children;
+        console.log(video_list, "video_list");
+        this.isLearn = this.videoId = video_list[this.vIndex].id;
+        this.video_slug = video_list[this.vIndex].slug;
+        console.log(this.videoId, "this.videoId");
+        this.lookVideo();
         //  this.videoComments()
-      },
-      async lookVideo() {
-        var oldTracks = myPlayer.remoteTextTracks()
-        var i = oldTracks.length
-        while (i--) {
-          myPlayer.removeRemoteTextTrack(oldTracks[i])
+      }
+    },
+    getPlayTime() {
+      clearInterval(playTimeInterval);
+      let that = this;
+      playTimeInterval = setInterval(function () {
+        that.playTime = parseInt(myPlayer.currentTime());
+        if (Math.floor(that.playTime / 10) > 0 && that.playTime % 10 == 0) {
+          that.lookRecord();
+          console.log(that.playTime, "that.playTime");
         }
-        // const { data } = await videoDetail({ id: this.videoId })
-        // const { data } = await videoDetail(this.video_slug)
-        console.log(this.video_slug, 'this.video_slug')
-        // this.videoTitle = data.video.title
-        console.log(this.course_zhangjie)
-        myPlayer.src(this.course_zhangjie[this.videoIndex].url_resource)
+      }, 1000);
+    },
+    //定时发送视频播放记录
+    async lookRecord() {
+      let data = {
+        video_id: this.course_zhangjie[this.videoIndex].id,
+        //video_slug: this.video_slug,
+        watch_seconds: this.playTime,
+        is_watched: this.isWatch,
+        course_id: this.courseId,
+      };
+      const { message } = await lookRecord(data);
+      console.log(message, "ooooooooo");
+    },
+    //获取课程详情章节列表和视频列表
+    async getCourseDetail() {
+      const { data } = await videoList({ course_id: this.courseId });
+      console.log(data);
+      // this.course_zhangjie = data.data
 
-        this.attaches = data.attaches
-        this.videoDescription = data.video.description
-        this.loading = false
-        this.ban_drag = data.video.ban_drag
-        let enurl = data.video.subtitle_en_path_resource.url
-        let url = data.video.subtitle_zh_path_resource.url
-        var zhurl = {
-          kind: 'subtitles',
-          label: '中文简体',
-          src: url,
-          default: 'true',
-        }
-        //https://platform.site.ximengnaikang.com/storage/course_video/hKy5X404wDrRAuAS8gZxfZIDbx6sFkAW.webvtt
-        // this.enUrl = data.video.subtitle_en_path_resource
-        myPlayer.addRemoteTextTrack(zhurl, true)
-        console.log(myPlayer, 'myPlayer')
-        console.log(data.video.subtitle_zh_path_resource, 'myPlayer')
-        if (enurl) {
-          var enUrl = {
-            kind: 'subtitles',
-            label: 'English',
-            src: enurl,
-            default: 'true',
-          }
-          myPlayer.addRemoteTextTrack(enUrl, true)
-        }
+      // this.lookVideo();
+      //   this.videoComments()
+      console.log(data.directory, "课程详情");
+    },
+    //选择需要播放的视频
+    async clickVideo(item, vIndex, cIndex) {
+      this.vIndex = vIndex;
+      this.cIndex = cIndex;
+      clearInterval(playTimeInterval);
+      console.log(vIndex, "vIndex, cIndex");
+      console.log(cIndex, "vIndex, cIndex");
+      this.nextVideo = false;
+      this.isWatch = 0;
+      console.log(item, "点击时间点");
+      this.isLearn = item.id;
+      this.videoTitle = item.title;
+      this.videoId = item.id;
+      this.video_slug = item.slug;
+      this.playTime = 0;
+      this.lookVideo();
+      //  this.videoComments()
+    },
+    async lookVideo() {
+      var oldTracks = myPlayer.remoteTextTracks();
+      var i = oldTracks.length;
+      while (i--) {
+        myPlayer.removeRemoteTextTrack(oldTracks[i]);
+      }
+      // const { data } = await videoDetail({ id: this.videoId })
+      // const { data } = await videoDetail(this.video_slug)
+      console.log(this.video_slug, "this.video_slug");
+      // this.videoTitle = data.video.title
+      console.log(this.course_zhangjie);
+      myPlayer.src(
+        this.course_zhangjie[this.videoIndex].children[0].url_resource.url
+      );
 
-        console.log(data.video.subtitle_en_path_resource, '视频详情')
-      },
+      this.attaches = data.attaches;
+      this.videoDescription = data.video.description;
+      this.loading = false;
+      this.ban_drag = data.video.ban_drag;
+      let enurl = data.video.subtitle_en_path_resource.url;
+      let url = data.video.subtitle_zh_path_resource.url;
+      var zhurl = {
+        kind: "subtitles",
+        label: "中文简体",
+        src: url,
+        default: "true",
+      };
+      //https://platform.site.ximengnaikang.com/storage/course_video/hKy5X404wDrRAuAS8gZxfZIDbx6sFkAW.webvtt
+      // this.enUrl = data.video.subtitle_en_path_resource
+      myPlayer.addRemoteTextTrack(zhurl, true);
+      console.log(myPlayer, "myPlayer");
+      console.log(data.video.subtitle_zh_path_resource, "myPlayer");
+      if (enurl) {
+        var enUrl = {
+          kind: "subtitles",
+          label: "English",
+          src: enurl,
+          default: "true",
+        };
+        myPlayer.addRemoteTextTrack(enUrl, true);
+      }
 
-      change(e) {
-        this.index = e
-      },
-      change_nav() {
-        this.isNav = !this.isNav
-      },
-      back() {
-        // this.$router.go(-1)
-        this.$router.push({
-          path: 'courseDetail',
-          query: {
-            course_slug: this.course_slug,
-            id: this.courseId,
-          },
-        })
-      },
+      console.log(data.video.subtitle_en_path_resource, "视频详情");
     },
-  }
+
+    change(e) {
+      this.index = e;
+    },
+    change_nav() {
+      this.isNav = !this.isNav;
+    },
+    back() {
+      // this.$router.go(-1)
+      this.$router.push({
+        path: "courseDetail",
+        query: {
+          course_slug: this.course_slug,
+          id: this.courseId,
+        },
+      });
+    },
+  },
+};
 </script>
 <style lang="scss" scoped>
-  .video_container {
-    ul,
-    li {
-      margin: 0;
-      padding: 0;
-    }
-    position: fixed;
-    width: 100%;
-    background-color: #e5e5e5;
-    height: 100%;
-    .left_video {
+.video_container {
+  ul,
+  li {
+    margin: 0;
+    padding: 0;
+  }
+  position: fixed;
+  width: 100%;
+  background-color: #e5e5e5;
+  height: 100%;
+  .left_video {
+    position: absolute;
+    left: 26px;
+    right: 35px;
+    top: 0;
+    padding-top: 54px;
+    bottom: 70px;
+    transition: 0.5s;
+    .video_header {
       position: absolute;
-      left: 26px;
-      right: 35px;
       top: 0;
-      padding-top: 54px;
-      bottom: 70px;
-      transition: 0.5s;
-      .video_header {
-        position: absolute;
-        top: 0;
-        left: 0;
-        right: 0;
-        height: 54px;
-        line-height: 54px;
-        color: #999;
-        font-size: 16px;
-        z-index: 1;
-        overflow: hidden;
-        .back {
-          color: #666;
-          padding-right: 20px;
-          border-right: 1px solid #c1c1c1;
-          margin-right: 20px;
-          cursor: pointer;
-        }
+      left: 0;
+      right: 0;
+      height: 54px;
+      line-height: 54px;
+      color: #999;
+      font-size: 16px;
+      z-index: 1;
+      overflow: hidden;
+      .back {
+        color: #666;
+        padding-right: 20px;
+        border-right: 1px solid #c1c1c1;
+        margin-right: 20px;
+        cursor: pointer;
       }
-      .video_body {
-        position: relative;
-        background-color: #000;
-        height: 88%;
-        overflow: hidden;
-        .my_video {
-          width: 100%;
-          // height: calc(100vh - 300px);
-        }
-        .vjs-error .vjs-error-display:before {
-          content: none !important;
-        }
-        .video-js .vjs-big-play-button {
-          /*对播放按钮的样式进行设置*/
-          width: 100%;
-          // height: calc(100vh - 300px);
-          border-radius: 50%;
-        }
-        .video-js {
-          width: 100% !important;
-          height: 100% !important;
-        }
-        .video-js .vjs-big-play-button {
-          position: absolute !important;
-          top: 50% !important;
-          left: 50% !important;
-          display: block;
-          width: 50px !important;
-          height: 50px !important;
-          padding: 0;
-          margin-top: -25px !important;
-          margin-left: -25px !important;
-          font-size: 3em;
-          line-height: 42px !important;
-          cursor: pointer;
-          background-color: #2b333f;
-          background-color: rgba(43, 51, 63, 0.7);
-          border: 0.06666em solid #fff;
-          border-radius: 50% !important;
-          opacity: 1;
-          -webkit-transition: all 0.4s;
-          transition: all 0.4s;
-        }
+    }
+    .video_body {
+      position: relative;
+      background-color: #000;
+      height: 88%;
+      overflow: hidden;
+      .my_video {
+        width: 100%;
+        // height: calc(100vh - 300px);
       }
-      .video_footer {
+      .vjs-error .vjs-error-display:before {
+        content: none !important;
+      }
+      .video-js .vjs-big-play-button {
+        /*对播放按钮的样式进行设置*/
+        width: 100%;
+        // height: calc(100vh - 300px);
+        border-radius: 50%;
+      }
+      .video-js {
+        width: 100% !important;
+        height: 100% !important;
+      }
+      .video-js .vjs-big-play-button {
+        position: absolute !important;
+        top: 50% !important;
+        left: 50% !important;
+        display: block;
+        width: 50px !important;
+        height: 50px !important;
+        padding: 0;
+        margin-top: -25px !important;
+        margin-left: -25px !important;
+        font-size: 3em;
+        line-height: 42px !important;
+        cursor: pointer;
+        background-color: #2b333f;
+        background-color: rgba(43, 51, 63, 0.7);
+        border: 0.06666em solid #fff;
+        border-radius: 50% !important;
+        opacity: 1;
+        -webkit-transition: all 0.4s;
+        transition: all 0.4s;
       }
     }
-    .all {
-      right: 395px;
+    .video_footer {
     }
-    .right_nav {
-      position: absolute;
-      right: 0;
-      top: 0;
-      bottom: 0;
-      width: 360px;
-      right: -360px;
-      background-color: #fff;
-      box-shadow: -1px 0 5px rgba(0, 0, 0, 0.1);
-      transition: 0.5s;
+  }
+  .all {
+    right: 395px;
+  }
+  .right_nav {
+    position: absolute;
+    right: 0;
+    top: 0;
+    bottom: 0;
+    width: 360px;
+    right: -360px;
+    background-color: #fff;
+    box-shadow: -1px 0 5px rgba(0, 0, 0, 0.1);
+    transition: 0.5s;
 
-      .btn {
-        position: absolute;
-        top: 50%;
-        left: -32px;
-        margin-top: -24px;
-        width: 32px;
+    .btn {
+      position: absolute;
+      top: 50%;
+      left: -32px;
+      margin-top: -24px;
+      width: 32px;
+      text-align: center;
+      line-height: 48px;
+      height: 48px;
+      border-radius: 100px 0 0 100px;
+      cursor: pointer;
+      background: #46c37b;
+      color: #fff;
+      font-size: 18px;
+    }
+    .nav {
+      ul {
+        padding: 0;
+        margin: 0;
+        height: 56px;
+        list-style: none;
         text-align: center;
-        line-height: 48px;
-        height: 48px;
-        border-radius: 100px 0 0 100px;
+        border-bottom: 1px solid #f5f5f5;
+        font-size: 16px;
+        font-weight: 500;
+        color: #666;
+        line-height: 56px;
+        display: flex;
+        justify-content: space-around;
+        align-items: center;
+        position: relative;
         cursor: pointer;
-        background: #46c37b;
-        color: #fff;
-        font-size: 18px;
-      }
-      .nav {
-        ul {
-          padding: 0;
-          margin: 0;
-          height: 56px;
-          list-style: none;
-          text-align: center;
-          border-bottom: 1px solid #f5f5f5;
-          font-size: 16px;
-          font-weight: 500;
-          color: #666;
-          line-height: 56px;
-          display: flex;
-          justify-content: space-around;
-          align-items: center;
+        li {
           position: relative;
-          cursor: pointer;
-          li {
-            position: relative;
-          }
-          .active {
-            &::after {
-              content: '';
-              display: block;
-              position: absolute;
-              bottom: 0;
-              left: 50%;
-              transform: translateX(-50%);
-              width: 36px;
-              height: 2px;
-              border-radius: 1px;
-              background: #46c37b;
-            }
+        }
+        .active {
+          &::after {
+            content: "";
+            display: block;
+            position: absolute;
+            bottom: 0;
+            left: 50%;
+            transform: translateX(-50%);
+            width: 36px;
+            height: 2px;
+            border-radius: 1px;
+            background: #46c37b;
           }
         }
       }
-      .nav_item {
-        position: absolute;
-        top: 57px;
-        bottom: 0;
-        width: 100%;
-        // overflow-y: hidden;
-        overflow-x: hidden;
-        margin-bottom: 20px;
-        overflow-y: scroll;
-        .item_wrap {
-          margin-top: 24px;
-          ul {
-            list-style: none;
-            padding: 0;
-            margin-bottom: 0;
-            .out_wrap {
-              margin-bottom: 10px;
-              cursor: pointer;
+    }
+    .nav_item {
+      position: absolute;
+      top: 57px;
+      bottom: 0;
+      width: 100%;
+      // overflow-y: hidden;
+      overflow-x: hidden;
+      margin-bottom: 20px;
+      overflow-y: scroll;
+      .item_wrap {
+        margin-top: 24px;
+        ul {
+          list-style: none;
+          padding: 0;
+          margin-bottom: 0;
+          .out_wrap {
+            margin-bottom: 10px;
+            cursor: pointer;
+
+            .zhangjie {
+              display: flex;
+              justify-content: space-between;
+              background-color: #f5f5f5;
+              padding-right: 17px;
 
-              .zhangjie {
+              align-items: center;
+            }
+            .keshi {
+              li {
                 display: flex;
                 justify-content: space-between;
-                background-color: #f5f5f5;
-                padding-right: 17px;
-
                 align-items: center;
-              }
-              .keshi {
-                li {
-                  display: flex;
-                  justify-content: space-between;
-                  align-items: center;
-                  margin-bottom: 10px;
-                  cursor: pointer;
-                  padding-right: 17px;
-                  &:hover {
-                    background-color: #f3fee8;
-                  }
-                }
-                .li-active {
+                margin-bottom: 10px;
+                cursor: pointer;
+                padding-right: 17px;
+                &:hover {
                   background-color: #f3fee8;
                 }
               }
-              .is_zhedie {
-                display: none;
+              .li-active {
+                background-color: #f3fee8;
               }
-              i {
-                font-size: 18px;
+            }
+            .is_zhedie {
+              display: none;
+            }
+            i {
+              font-size: 18px;
+            }
+            .left {
+              padding: 0 0 0 17px;
+              display: flex;
+              align-items: center;
+              width: calc(100% - 60px);
+              .scrle {
+                display: inline-block;
+                width: 16px;
+                height: 16px;
+                border-radius: 50%;
+                border: 2px solid #999;
+                box-sizing: border-box;
+                flex-shrink: 0;
               }
-              .left {
-                padding: 0 0 0 17px;
-                display: flex;
-                align-items: center;
-                width: calc(100% - 60px);
-                .scrle {
-                  display: inline-block;
-                  width: 16px;
-                  height: 16px;
-                  border-radius: 50%;
-                  border: 2px solid #999;
-                  box-sizing: border-box;
-                  flex-shrink: 0;
-                }
-                img {
-                  width: 16px;
-                  height: 16px;
-                }
-                .complate {
-                  color: #46c37b;
-                }
-                .title {
-                  display: inline-block;
-                  padding: 15px 10px 15px 0;
-                  margin-left: 20px;
-                  // width: calc(100% - 20px);
-                }
+              img {
+                width: 16px;
+                height: 16px;
               }
-              .right {
-                display: flex;
-                align-items: center;
-                color: #999;
-                span {
-                  margin-right: 5px;
-                }
+              .complate {
+                color: #46c37b;
+              }
+              .title {
+                display: inline-block;
+                padding: 15px 10px 15px 0;
+                margin-left: 20px;
+                // width: calc(100% - 20px);
+              }
+            }
+            .right {
+              display: flex;
+              align-items: center;
+              color: #999;
+              span {
+                margin-right: 5px;
               }
             }
           }
         }
       }
-      .biji {
-        height: 100%;
-        overflow: hidden;
-        padding: 15px;
-        .text {
-          margin-bottom: 15px;
-          height: 70vh;
-          ::v-deep .menu-management-container {
-            height: 65vh;
-          }
-          ::v-deep .tox-tinymce {
-            height: 65vh !important;
-          }
-          ::v-deep .tox-editor-container {
-            height: 65vh;
+    }
+    .biji {
+      height: 100%;
+      overflow: hidden;
+      padding: 15px;
+      .text {
+        margin-bottom: 15px;
+        height: 70vh;
+        ::v-deep .menu-management-container {
+          height: 65vh;
+        }
+        ::v-deep .tox-tinymce {
+          height: 65vh !important;
+        }
+        ::v-deep .tox-editor-container {
+          height: 65vh;
+        }
+        .input_wrap {
+          width: 100%;
+          height: 34px;
+          padding: 6px 12px;
+          background-color: #fff;
+          background-image: none;
+          border: 1px solid #ccc;
+          border-radius: 4px;
+          -webkit-transition: border-color 0.15s ease-in-out,
+            box-shadow 0.15s ease-in-out;
+          -o-transition: border-color ease-in-out 0.15s,
+            box-shadow ease-in-out 0.15s;
+          transition: border-color 0.15s ease-in-out,
+            box-shadow 0.15s ease-in-out;
+          margin-bottom: 10px;
+          input {
+            width: 100%;
+            height: 100%;
+            outline: none;
+            margin: 0;
+            padding: 0;
+            color: #666;
+            border-color: #e1e1e1;
+            border: none;
           }
-          .input_wrap {
+        }
+      }
+      .biji_btn {
+        text-align: right;
+        margin-bottom: 15px;
+        cursor: pointer;
+
+        span {
+          display: inline-block;
+          border-color: #34a263;
+          background-color: #46c37b;
+          color: #fff;
+          padding: 6px 12px;
+          font-size: 14px;
+          border-radius: 4px;
+        }
+      }
+    }
+    .question {
+      height: 100%;
+      overflow: hidden;
+      .question_body {
+        margin-bottom: 0;
+        padding: 15px;
+        .input_wrap {
+          width: 100%;
+          height: 34px;
+          padding: 6px 12px;
+          background-color: #fff;
+          background-image: none;
+          border: 1px solid #ccc;
+          border-radius: 4px;
+          -webkit-transition: border-color 0.15s ease-in-out,
+            box-shadow 0.15s ease-in-out;
+          -o-transition: border-color ease-in-out 0.15s,
+            box-shadow ease-in-out 0.15s;
+          transition: border-color 0.15s ease-in-out,
+            box-shadow 0.15s ease-in-out;
+          input {
             width: 100%;
-            height: 34px;
-            padding: 6px 12px;
-            background-color: #fff;
-            background-image: none;
-            border: 1px solid #ccc;
-            border-radius: 4px;
-            -webkit-transition: border-color 0.15s ease-in-out,
-              box-shadow 0.15s ease-in-out;
-            -o-transition: border-color ease-in-out 0.15s,
-              box-shadow ease-in-out 0.15s;
-            transition: border-color 0.15s ease-in-out,
-              box-shadow 0.15s ease-in-out;
-            margin-bottom: 10px;
-            input {
-              width: 100%;
-              height: 100%;
-              outline: none;
-              margin: 0;
-              padding: 0;
-              color: #666;
-              border-color: #e1e1e1;
-              border: none;
-            }
+            height: 100%;
+            outline: none;
+            margin: 0;
+            padding: 0;
+            color: #666;
+            border-color: #e1e1e1;
+            border: none;
           }
         }
-        .biji_btn {
+        .question_detail {
+          margin: 10px 0 15px;
+        }
+        .question_btn {
+          margin: 10px 0 15px;
           text-align: right;
-          margin-bottom: 15px;
-          cursor: pointer;
+          font-size: 12px;
 
-          span {
+          .cancle {
+            display: inline-block;
+            margin-right: 5px;
+            cursor: pointer;
+          }
+          .asck {
             display: inline-block;
             border-color: #34a263;
             background-color: #46c37b;
             color: #fff;
-            padding: 6px 12px;
-            font-size: 14px;
-            border-radius: 4px;
-          }
-        }
-      }
-      .question {
-        height: 100%;
-        overflow: hidden;
-        .question_body {
-          margin-bottom: 0;
-          padding: 15px;
-          .input_wrap {
-            width: 100%;
-            height: 34px;
-            padding: 6px 12px;
-            background-color: #fff;
+            border-radius: 2px;
+            cursor: pointer;
             background-image: none;
-            border: 1px solid #ccc;
-            border-radius: 4px;
-            -webkit-transition: border-color 0.15s ease-in-out,
-              box-shadow 0.15s ease-in-out;
-            -o-transition: border-color ease-in-out 0.15s,
-              box-shadow ease-in-out 0.15s;
-            transition: border-color 0.15s ease-in-out,
-              box-shadow 0.15s ease-in-out;
-            input {
-              width: 100%;
-              height: 100%;
-              outline: none;
-              margin: 0;
-              padding: 0;
-              color: #666;
-              border-color: #e1e1e1;
-              border: none;
-            }
-          }
-          .question_detail {
-            margin: 10px 0 15px;
-          }
-          .question_btn {
-            margin: 10px 0 15px;
-            text-align: right;
-            font-size: 12px;
-
-            .cancle {
-              display: inline-block;
-              margin-right: 5px;
-              cursor: pointer;
-            }
-            .asck {
-              display: inline-block;
-              border-color: #34a263;
-              background-color: #46c37b;
-              color: #fff;
-              border-radius: 2px;
-              cursor: pointer;
-              background-image: none;
-              border: 1px solid transparent;
-              white-space: nowrap;
-              padding: 5px;
-            }
+            border: 1px solid transparent;
+            white-space: nowrap;
+            padding: 5px;
           }
         }
       }
     }
-    .chuxian {
-      right: 0px;
-    }
   }
+  .chuxian {
+    right: 0px;
+  }
+}
 </style>