lrf402788946 4 vuotta sitten
vanhempi
commit
584c460d89
1 muutettua tiedostoa jossa 7 lisäystä ja 0 poistoa
  1. 7 0
      src/views/trainVidoe/viewVideo.vue

+ 7 - 0
src/views/trainVidoe/viewVideo.vue

@@ -4,6 +4,7 @@
       <el-col :span="24" class="top">
         <span>课程权属:{{ videoInfo.teacher || '中心提供' }}</span>
         <span>所讲课程:{{ videoInfo.subname }}</span>
+        <el-link :underline="false" @click="toDownload">点击下载</el-link>
       </el-col>
       <el-col :span="24" class="info">
         <video :src="videoInfo.url" controls="controls">
@@ -19,6 +20,7 @@
 </template>
 
 <script>
+const _ = require('lodash');
 import detailFrame from '@frame/layout/admin/detail-frame';
 import { mapState, createNamespacedHelpers } from 'vuex';
 const { mapActions: trainvideo } = createNamespacedHelpers('trainvideo');
@@ -41,6 +43,11 @@ export default {
         this.$set(this, `videoInfo`, res.data);
       }
     },
+    toDownload() {
+      let duplicate = _.cloneDeep(this.videoInfo);
+      const { url } = duplicate;
+      if (url) window.open(url);
+    },
     // 提交评价
     onSubmit() {
       console.log(this.evaluate);