瀏覽代碼

专业库

shilipojs 3 年之前
父節點
當前提交
894bc411ae
共有 2 個文件被更改,包括 403 次插入365 次删除
  1. 40 6
      src/views/career/plan/new-profess-detail.vue
  2. 363 359
      src/views/videocourse/VideoDetail.vue

+ 40 - 6
src/views/career/plan/new-profess-detail.vue

@@ -1,15 +1,26 @@
 <template>
   <div id="professDetail" style="padding:24px 5%">
     <el-row :gutter="20">
-      <el-col :span="6">
-        <el-tabs type="border-card" @tab-click="tabClick" :value="type" stretch>
-          <el-tab-pane label="本科" name="本科">
+      <el-col :span="6" >
+        <el-tabs type="border-card" @tab-click="tabClick" :value="type"  stretch >
+          <el-tab-pane label="本科" name="本科" class="tree">
             <el-tree
+
               :data="majorList"
+              node-key="code"
+              :default-checked-keys="[code]"
+              :default-expanded-keys="[code]"
               :props="defaultProps"
-            ></el-tree>
+              @node-click="handleNodeClick"
+              :isLeaf="isLeaf"
+            >
+              <p  class="custom-tree-node" slot-scope="{node, data}">
+                <span>{{node.label }}</span>
+                <span>{{data.children ? data.children.length : ''}}</span>
+              </p>
+            </el-tree>
           </el-tab-pane>
-          <el-tab-pane label="专科"  name="专科">
+          <el-tab-pane label="专科"  name="专科" class="tree">
             <el-tree
               :data="majorList"
               :props="defaultProps"
@@ -228,7 +239,7 @@ export default {
     },
     // 主要就业地区分布
     jobAddress() {
-      if(!this.prospects.jobRegionDistribution.length) return
+      if(!this.prospects.jobRegionDistribution) return
       const pieData = this.prospects.jobRegionDistribution
       const options  = {
         toolbox: {
@@ -347,6 +358,14 @@ export default {
     }
   },
   methods: {
+    handleNodeClick(data,node) {
+      if(!node.isLeaf) return
+      console.log('跳转')
+        // 跳转
+    },
+    isLeaf(data,node) {
+      return node.childCount == 0
+    },
     tabClick(type) {
       this.type =type.name
     },
@@ -397,6 +416,12 @@ export default {
     height: 100%;
     background: rgba(66, 185, 131, 0.1);
   }
+  .custom-tree-node{
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    width: 100%;
+  }
 
   .tabs-wrap {
     margin-top: 20px;
@@ -441,5 +466,14 @@ export default {
     background: #47C6A2;
     height: 1px;
   }
+
+}
+</style>
+<style>
+.el-tabs--border-card > .el-tabs__content{
+  height: calc(100vh - 176px) ;
+  overflow: hidden;
+  overflow-y: auto;
+
 }
 </style>

+ 363 - 359
src/views/videocourse/VideoDetail.vue

@@ -1,359 +1,363 @@
-<template>
-  <div class="video_detail_contianer">
-    <el-container>
-      <el-aside width="284px">
-        <div class="aside_header">
-          <span>CONTACT</span>
-          <span>章节目录</span>
-        </div>
-        <div class="aside_content">
-          <el-tree ref="treeBox" :data="videoList" :props="defaultProps" :default-expanded-keys="expandId" node-key="id" :default-checked-keys="childrenId" :highlight-current="true" @node-click="treeNodeClick"></el-tree>
-        </div>
-      </el-aside>
-      <el-main>
-        <div class="video_wrap">
-          <div class="videoplay">
-            <div class="video">
-              <mx-video :aliIdType="aliIdType" :src="section_aliId"></mx-video>
-            </div>
-          </div>
-          <div class="text">
-            <span :class="infoActive == 1 ? 'info_active' : ''" @click="infoActive = 1">课程概要</span>
-            <!-- <span :class="infoActive == 2 ? 'info_active' : ''" @click="infoActive = 2">课时介绍</span> -->
-            <!-- <span :class="infoActive == 3 ? 'info_active' : ''" @click="infoActive = 3">主要讲师</span> -->
-          </div>
-        </div>
-        <!-- 视频 信息 -->
-        <div class="video_info">
-          <!-- 课程概要 -->
-          <div class="summary" v-show="infoActive == 1">
-            <div class="summary_tit">
-              {{ videoInfo.title }}
-            </div>
-            <div class="vis_totle">
-              <img src="@/assets/images/icon_eye.png" alt="" />
-              <span>1885人已观看</span>
-            </div>
-          </div>
-          <!-- 课时介绍 -->
-          <div class="introduce" v-show="infoActive == 2">
-            <div class="introduce_tit">散文阅读之显性内容</div>
-            <div class="introduce_con">
-              各龙地却意制心收北叫示系者受志术叫叫该名光前劳基外通任体给温律太术社维问住角金议计数原科压么广速会好真商太数再还话种受王样率人为很反现严号约正生。写越花机还件口原受术标心需场象设开族着半风角不代运斯党派看回量类林集天学山员连地准真王几联。走海号音节身外期先管新直验美信所千料状到南民状西又统达交通无因指再五条给商今计生线斯至流还类业法认。
-            </div>
-          </div>
-          <!-- 主要讲师 -->
-          <div class="teacher" v-show="infoActive == 3">
-            <el-col :span="5">
-              <div class="teacher_info">
-                <img src="@/assets/images/teacher_avatar.png" alt="" />
-                <span style="font-weight: 600; color: #343434; margin: 6px 0">Andre Long</span>
-                <span>哈佛大学精英讲师</span>
-              </div>
-            </el-col>
-            <el-col :span="14">
-              <div class="teacher_ach">
-                <div style="color: #ffa400; margin-bottom: 8px">教学成就</div>
-                <div class="teacher_ach_info">
-                  <div class="ach_item">“全球交科研先进个人”获得者</div>
-                  <div class="ach_item">“全球交科研先进个人”获得者</div>
-                  <div class="ach_item">全球十大杰出精英讲师</div>
-                  <div class="ach_item">全球十大杰出精英讲师</div>
-                  <div class="ach_item">全球十大杰出精英讲师</div>
-                  <div class="ach_item">全球十大杰出精英讲师</div>
-                  <div class="ach_item">全球十大杰出精英讲师</div>
-                  <div class="ach_item">全球十大杰出精英讲师</div>
-                </div>
-              </div>
-            </el-col>
-          </div>
-        </div>
-      </el-main>
-    </el-container>
-  </div>
-</template>
-
-<script>
-import aliplayer from "./compoent/aliplayer";
-import {
-  videoInfo,
-  getVideoPlayAuth
-} from "@/api/webApi/webVideo";
-export default {
-  components: {
-    aliplayer,
-  },
-  data() {
-    return {
-      infoActive: 1,
-      packId: "",
-      videoList: [],
-      defaultProps: {
-        children: "children",
-        label: "section_name",
-      },
-      aliIdType: '',
-      section_aliId: "", // 默认的视频aliId
-      expandId: [], // 默认展开的节点id
-      childrenId: [], // 默认选中的节点id
-      checkNode: {}, //选中的节点
-      videoUrl: "",
-      videoInfo: {},
-    };
-  },
-  created() {
-    this.packId = this.$route.query.packId;
-    this.aliIdType = this.$route.query.aliIdType;
-    this.section_aliId = this.$route.query.section_aliId;
-    this.expandId.push(this.$route.query.chapter_id);
-    this.childrenId.push(this.$route.query.childrenId);
-    this.getVideos();
-  },
-  methods: {
-    handle() {
-      console.log(111);
-    },
-    getVideos() {
-      videoInfo({
-        packId: this.packId
-      }).then((res) => {
-        console.log(res.rows);
-        let arr = res.rows.map((item, index) => {
-          if (item.chapter_name) {
-            item.section_name = item.chapter_name;
-            delete item.chapter_name;
-          }
-          if (item.chapter_id) {
-            item.id = item.chapter_id;
-            delete item.chapter_id;
-          }
-          item.children.map((child, childIndex) => {
-            child.section_name = `${index + 1}-${childIndex + 1} ${child.section_name
-              } `;
-          });
-          return item;
-        });
-        console.log(arr);
-        this.videoList = res.rows;
-        this.$nextTick(function () {
-          this.$refs.treeBox.setCurrentKey(this.childrenId[0]);
-          this.checkNode = this.$refs.treeBox.getCheckedNodes();
-        });
-      });
-    },
-    treeNodeClick(data) {
-      if (data.hasOwnProperty("children")) {
-        return;
-      }
-      this.checkNode = data;
-      this.aliIdType = data.aliIdType;
-      this.section_aliId = data.section_aliId;
-    },
-  },
-};
-</script>
-
-<style scoped>
-.video_detail_contianer {
-  padding: 20px;
-  min-height: 100vh;
-  background: #f7f7f7;
-}
-
-.el-main {
-  padding: 7px 8px;
-  background: #fff;
-}
-
-.aside_header {
-  background: white;
-  display: flex;
-  flex-direction: column;
-  justify-content: flex-end;
-  padding: 24px 16px 0 16px;
-  margin-bottom: 16px;
-}
-
-.el-aside {
-  background: white;
-  padding: 0;
-  margin-bottom: 0;
-  margin-right: 16px;
-}
-
-.aside_header span {
-  margin-top: 5px;
-  width: 84px;
-  height: 22px;
-  font-size: 16px;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: 500;
-  color: #343434;
-  line-height: 22px;
-}
-
-.aside_header span:first-child {
-  width: 173px;
-  height: 27px;
-  background: linear-gradient(180deg, #ffffff 0%, #47c6a2 100%);
-  opacity: 0.5;
-}
-
-.video_wrap {
-  border-bottom: 10px solid #f7f7f7;
-}
-
-.video_wrap video {
-  width: 100%;
-  height: 566px;
-}
-
-.text {
-  padding-left: 32px;
-}
-
-.text span {
-  cursor: pointer;
-  width: 64px;
-  font-size: 16px;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: 600;
-  color: #343434;
-  margin-right: 16px;
-  position: relative;
-  padding: 32px 0 25px 0;
-  display: inline-block;
-}
-
-.video_info {
-  width: 100%;
-  height: 172px;
-  background: #ffffff;
-  border-radius: 4px;
-  padding-top: 28px;
-  padding-left: 32px;
-  font-size: 14px;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: 500;
-  color: #343434;
-}
-
-.info_active::after {
-  content: "";
-  width: 0px;
-  height: 0px;
-  border-width: 10px;
-  border-style: solid;
-  border-color: transparent transparent #47c6a2 transparent;
-  position: absolute;
-  bottom: -10px;
-  left: 50%;
-  transform: translateX(-50%);
-}
-
-.video_info {
-  border-top: 4px solid #47c6a2;
-  border-radius: 4px 4px 0px 0px;
-}
-
-.summary_tit {
-  margin-bottom: 16px;
-}
-
-.vis_totle {
-  display: flex;
-  flex-direction: row;
-  align-items: center;
-}
-
-.vis_totle img {
-  margin-right: 6px;
-}
-
-.introduce .introduce_tit {
-  height: 20px;
-  font-size: 14px;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: 600;
-  color: #343434;
-  line-height: 20px;
-  margin-bottom: 12px;
-}
-
-.introduce_con {
-  height: 66px;
-  font-size: 14px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #727272;
-  line-height: 22px;
-}
-
-.teacher_info {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-}
-
-.teacher_ach_info {
-  display: flex;
-  flex-wrap: wrap;
-}
-
-.teacher_ach_info .ach_item {
-  margin-bottom: 4px;
-  flex: 50%;
-  height: 20px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #797979;
-  line-height: 20px;
-  font-size: 14px;
-}
-
-.el-tree {
-  overflow: scroll;
-  height: 600px;
-  scroll-margin: 20px;
-  overflow-x: hidden;
-}
-
-::-webkit-scrollbar {
-  width: 4px;
-}
-
-::-webkit-scrollbar-thumb {
-  -webkit-box-shadow: inset 0 0 1px rgba(136, 136, 136, 0.3);
-  background-color: rgb(238, 241, 245);
-}
-</style>
-<style>
-.el-tree-node__content {
-  padding-top: 6px;
-  padding-bottom: 6px;
-  height: 32px;
-  font-size: 14px;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: 500;
-  color: #343434;
-  line-height: 20px;
-}
-
-.el-tree-node {
-  padding-left: 16px;
-}
-
-.el-tree-node__expand-icon.expanded {
-  content: "";
-}
-
-.el-tree-node__content > .el-tree-node__expand-icon {
-  padding: 6px;
-  /* position: absolute; */
-  right: 16px;
-}
-
-.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
-  color: #47c6a2;
-}
-</style>
+<template>
+  <div class="video_detail_contianer">
+    <el-container>
+      <el-aside width="284px">
+        <div class="aside_header">
+          <span>CONTACT</span>
+          <span>章节目录</span>
+        </div>
+        <div class="aside_content">
+          <el-tree ref="treeBox" :data="videoList" :props="defaultProps" :default-expanded-keys="expandId" node-key="id" :default-checked-keys="childrenId" :highlight-current="true" @node-click="treeNodeClick">
+             <span class="custom-tree-node" slot-scope="{ node, data }">
+                <span class="" :title="node.label">{{ node.label }}</span>
+              </span>
+          </el-tree>
+        </div>
+      </el-aside>
+      <el-main>
+        <div class="video_wrap">
+          <div class="videoplay">
+            <div class="video">
+              <mx-video :aliIdType="aliIdType" :src="section_aliId"></mx-video>
+            </div>
+          </div>
+          <div class="text">
+            <span :class="infoActive == 1 ? 'info_active' : ''" @click="infoActive = 1">课程概要</span>
+            <!-- <span :class="infoActive == 2 ? 'info_active' : ''" @click="infoActive = 2">课时介绍</span> -->
+            <!-- <span :class="infoActive == 3 ? 'info_active' : ''" @click="infoActive = 3">主要讲师</span> -->
+          </div>
+        </div>
+        <!-- 视频 信息 -->
+        <div class="video_info">
+          <!-- 课程概要 -->
+          <div class="summary" v-show="infoActive == 1">
+            <div class="summary_tit">
+              {{ videoInfo.title }}
+            </div>
+            <div class="vis_totle">
+              <img src="@/assets/images/icon_eye.png" alt="" />
+              <span>1885人已观看</span>
+            </div>
+          </div>
+          <!-- 课时介绍 -->
+          <div class="introduce" v-show="infoActive == 2">
+            <div class="introduce_tit">散文阅读之显性内容</div>
+            <div class="introduce_con">
+              各龙地却意制心收北叫示系者受志术叫叫该名光前劳基外通任体给温律太术社维问住角金议计数原科压么广速会好真商太数再还话种受王样率人为很反现严号约正生。写越花机还件口原受术标心需场象设开族着半风角不代运斯党派看回量类林集天学山员连地准真王几联。走海号音节身外期先管新直验美信所千料状到南民状西又统达交通无因指再五条给商今计生线斯至流还类业法认。
+            </div>
+          </div>
+          <!-- 主要讲师 -->
+          <div class="teacher" v-show="infoActive == 3">
+            <el-col :span="5">
+              <div class="teacher_info">
+                <img src="@/assets/images/teacher_avatar.png" alt="" />
+                <span style="font-weight: 600; color: #343434; margin: 6px 0">Andre Long</span>
+                <span>哈佛大学精英讲师</span>
+              </div>
+            </el-col>
+            <el-col :span="14">
+              <div class="teacher_ach">
+                <div style="color: #ffa400; margin-bottom: 8px">教学成就</div>
+                <div class="teacher_ach_info">
+                  <div class="ach_item">“全球交科研先进个人”获得者</div>
+                  <div class="ach_item">“全球交科研先进个人”获得者</div>
+                  <div class="ach_item">全球十大杰出精英讲师</div>
+                  <div class="ach_item">全球十大杰出精英讲师</div>
+                  <div class="ach_item">全球十大杰出精英讲师</div>
+                  <div class="ach_item">全球十大杰出精英讲师</div>
+                  <div class="ach_item">全球十大杰出精英讲师</div>
+                  <div class="ach_item">全球十大杰出精英讲师</div>
+                </div>
+              </div>
+            </el-col>
+          </div>
+        </div>
+      </el-main>
+    </el-container>
+  </div>
+</template>
+
+<script>
+import aliplayer from "./compoent/aliplayer";
+import {
+  videoInfo,
+  getVideoPlayAuth
+} from "@/api/webApi/webVideo";
+export default {
+  components: {
+    aliplayer,
+  },
+  data() {
+    return {
+      infoActive: 1,
+      packId: "",
+      videoList: [],
+      defaultProps: {
+        children: "children",
+        label: "section_name",
+      },
+      aliIdType: '',
+      section_aliId: "", // 默认的视频aliId
+      expandId: [], // 默认展开的节点id
+      childrenId: [], // 默认选中的节点id
+      checkNode: {}, //选中的节点
+      videoUrl: "",
+      videoInfo: {},
+    };
+  },
+  created() {
+    this.packId = this.$route.query.packId;
+    this.aliIdType = this.$route.query.aliIdType;
+    this.section_aliId = this.$route.query.section_aliId;
+    this.expandId.push(this.$route.query.chapter_id);
+    this.childrenId.push(this.$route.query.childrenId);
+    this.getVideos();
+  },
+  methods: {
+    handle() {
+      console.log(111);
+    },
+    getVideos() {
+      videoInfo({
+        packId: this.packId
+      }).then((res) => {
+        console.log(res.rows);
+        let arr = res.rows.map((item, index) => {
+          if (item.chapter_name) {
+            item.section_name = item.chapter_name;
+            delete item.chapter_name;
+          }
+          if (item.chapter_id) {
+            item.id = item.chapter_id;
+            delete item.chapter_id;
+          }
+          item.children.map((child, childIndex) => {
+            child.section_name = `${index + 1}-${childIndex + 1} ${child.section_name
+              } `;
+          });
+          return item;
+        });
+        console.log(arr);
+        this.videoList = res.rows;
+        this.$nextTick(function () {
+          this.$refs.treeBox.setCurrentKey(this.childrenId[0]);
+          this.checkNode = this.$refs.treeBox.getCheckedNodes();
+        });
+      });
+    },
+    treeNodeClick(data) {
+      if (data.hasOwnProperty("children")) {
+        return;
+      }
+      this.checkNode = data;
+      this.aliIdType = data.aliIdType;
+      this.section_aliId = data.section_aliId;
+    },
+  },
+};
+</script>
+
+<style scoped>
+.video_detail_contianer {
+  padding: 20px;
+  min-height: 100vh;
+  background: #f7f7f7;
+}
+
+.el-main {
+  padding: 7px 8px;
+  background: #fff;
+}
+
+.aside_header {
+  background: white;
+  display: flex;
+  flex-direction: column;
+  justify-content: flex-end;
+  padding: 24px 16px 0 16px;
+  margin-bottom: 16px;
+}
+
+.el-aside {
+  background: white;
+  padding: 0;
+  margin-bottom: 0;
+  margin-right: 16px;
+}
+
+.aside_header span {
+  margin-top: 5px;
+  width: 84px;
+  height: 22px;
+  font-size: 16px;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #343434;
+  line-height: 22px;
+}
+
+.aside_header span:first-child {
+  width: 173px;
+  height: 27px;
+  background: linear-gradient(180deg, #ffffff 0%, #47c6a2 100%);
+  opacity: 0.5;
+}
+
+.video_wrap {
+  border-bottom: 10px solid #f7f7f7;
+}
+
+.video_wrap video {
+  width: 100%;
+  height: 566px;
+}
+
+.text {
+  padding-left: 32px;
+}
+
+.text span {
+  cursor: pointer;
+  width: 64px;
+  font-size: 16px;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 600;
+  color: #343434;
+  margin-right: 16px;
+  position: relative;
+  padding: 32px 0 25px 0;
+  display: inline-block;
+}
+
+.video_info {
+  width: 100%;
+  height: 172px;
+  background: #ffffff;
+  border-radius: 4px;
+  padding-top: 28px;
+  padding-left: 32px;
+  font-size: 14px;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #343434;
+}
+
+.info_active::after {
+  content: "";
+  width: 0px;
+  height: 0px;
+  border-width: 10px;
+  border-style: solid;
+  border-color: transparent transparent #47c6a2 transparent;
+  position: absolute;
+  bottom: -10px;
+  left: 50%;
+  transform: translateX(-50%);
+}
+
+.video_info {
+  border-top: 4px solid #47c6a2;
+  border-radius: 4px 4px 0px 0px;
+}
+
+.summary_tit {
+  margin-bottom: 16px;
+}
+
+.vis_totle {
+  display: flex;
+  flex-direction: row;
+  align-items: center;
+}
+
+.vis_totle img {
+  margin-right: 6px;
+}
+
+.introduce .introduce_tit {
+  height: 20px;
+  font-size: 14px;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 600;
+  color: #343434;
+  line-height: 20px;
+  margin-bottom: 12px;
+}
+
+.introduce_con {
+  height: 66px;
+  font-size: 14px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #727272;
+  line-height: 22px;
+}
+
+.teacher_info {
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+}
+
+.teacher_ach_info {
+  display: flex;
+  flex-wrap: wrap;
+}
+
+.teacher_ach_info .ach_item {
+  margin-bottom: 4px;
+  flex: 50%;
+  height: 20px;
+  font-family: PingFangSC-Regular, PingFang SC;
+  font-weight: 400;
+  color: #797979;
+  line-height: 20px;
+  font-size: 14px;
+}
+
+.el-tree {
+  overflow: scroll;
+  height: 600px;
+  scroll-margin: 20px;
+  overflow-x: hidden;
+}
+
+::-webkit-scrollbar {
+  width: 4px;
+}
+
+::-webkit-scrollbar-thumb {
+  -webkit-box-shadow: inset 0 0 1px rgba(136, 136, 136, 0.3);
+  background-color: rgb(238, 241, 245);
+}
+</style>
+<style lang="scss" scoped>
+.video_detail_contianer ::v-deep .el-tree-node__content {
+  padding-top: 6px;
+  padding-bottom: 6px;
+  height: 32px;
+  font-size: 14px;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #343434;
+  line-height: 20px;
+}
+
+.video_detail_contianer ::v-deep .el-tree-node {
+  padding-left: 16px;
+}
+
+.video_detail_contianer ::v-deep .el-tree-node__expand-icon.expanded {
+  content: "";
+}
+
+.video_detail_contianer ::v-deep .el-tree-node__content > .el-tree-node__expand-icon {
+  padding: 6px;
+  /* position: absolute; */
+  right: 16px;
+}
+
+.video_detail_contianer ::v-deep .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
+  color: #47c6a2;
+}
+</style>