lsc 2 years ago
parent
commit
b646ef0698
1 changed files with 102 additions and 2 deletions
  1. 102 2
      src/components/student/studyStudent.vue

+ 102 - 2
src/components/student/studyStudent.vue

@@ -172,6 +172,82 @@
                   </div>
                 </div>
               </div>
+              <div class="vedioTaskBox" v-if="false">
+                <div class="box_course" v-if="
+                  chapterlist.length > 0
+                ">
+                  <div class="wheel" v-if="
+                    chapterlist[chapterIndex].type == 2
+                  ">
+                    <div class="workd_media" style="height: 100%">
+                      <video-player class="video-player vjs-custom-skin" :playsinline="true"
+                        :options="chapterlist[chapterIndex].src" @play="onPlayerPlay($event)"
+                        style="width: 90%; height: 100%; margin: 0 0 0 30px"></video-player>
+                    </div>
+                  </div>
+                  <div class="wheel" v-if="chapterlist[chapterIndex].type == 6" style="
+                      box-shadow: 0 0 6px 1px #f2f2f2;
+                      width: 95%;
+                      margin: 0 auto;
+                      background: #f1f1f1;
+                    ">
+                    <div class="title">查看文档</div>
+                    <el-form class="textBox">
+                      <el-form-item class="textTitle">
+                        <div style="
+                            font-size: 22px;
+                            max-height: 100px;
+                            overflow: auto;
+                          ">
+                          {{ chapterlist[chapterIndex].name }}
+                        </div>
+                      </el-form-item>
+                      <div v-html="chapterlist[chapterIndex].url" class="textContent"></div>
+                    </el-form>
+                  </div>
+                  <div class="wheel" v-if="chapterlist[chapterIndex].type == 3"
+                    style="height: 650px; width: 95%; margin: 0 auto">
+                    <iframe style="width: 100%; height: 100%; border: none"
+                      :src="chapterlist[chapterIndex].src"></iframe>
+                  </div>
+                  <div class="wheel" v-if="chapterlist[chapterIndex].type == 9"
+                    style="height: 650px; width: 95%; margin: 0 auto">
+                    <pdf :pdfUrl="chapterlist[chapterIndex].src" style="width: 100%; height: 100%; overflow: auto">
+                    </pdf>
+                  </div>
+                  <!-- <div class="wheel" v-if="chapterlist[chapterIndex].type == " style="height: 650px; width: 95%; margin: 0 auto">
+                    <el-image :src="pptImgUrl1" fit="cover" style="width: 100%"></el-image>
+                  </div> -->
+                </div>
+                <div class="vedioList" v-if="
+                  chapterlist.length > 0
+                ">
+                  <div class="navTitile">内容列表:</div>
+                  <div class="navBox">
+                    <div>
+                      <div class="vedioTimeBox" v-for="(chapter, cIndex) in chapterlist" :key="cIndex + '1'"
+                        @click="chapterIndex = cIndex">
+                        <div class="vedioName" :class="{ isClickNav: chapterIndex == cIndex }">
+                          {{ chapter.name }}
+                        </div>
+                      </div>
+                    </div>
+                  </div>
+                </div>
+              </div>
+              <div style="padding: 10px 30px 0" v-if="chapterlist[chapterIndex] == 3 || chapterlist[chapterIndex] == 9">
+                <el-button type="primary"
+                  @click="checkFileFull(showType, chapterlist[chapterIndex].src)">全屏查看</el-button>
+                <el-button type="primary" @click="downloadFile(chapterlist[chapterIndex].src)"
+                  v-if="isClickNav.indexOf('line') == -1">文件下载</el-button>
+                <el-button v-if="chapterlist[chapterIndex].src" type="primary"
+                  @click="openLine(chapterlist[chapterIndex].url)">打开链接
+                </el-button>
+              </div>
+              <div style="padding: 0px 30px" v-if="chapterlist[chapterIndex] == 6">
+                <el-button type="primary"
+                  @click="checkFileFull(showType, chapterlist[chapterIndex].url)">全屏查看</el-button>
+              </div>
             </div>
           </div>
 
@@ -475,10 +551,13 @@
 <script>
 import "../../common/aws-sdk-2.235.1.min.js";
 import EditorBar from "../tools/wangEnduit.vue";
+import Audio from "../components/audio.vue";
+import pdf from "../components/vpdf";
 
 export default {
   components: {
-    EditorBar,
+    EditorBar, Audio,
+    pdf
   },
   data() {
     return {
@@ -728,6 +807,8 @@ export default {
       checkChair: "",
       checkDeleteGroup: [],
       ManAarray: [],
+      chapterlist: [],
+      chapterIndex: 0
     };
   },
   methods: {
@@ -1105,8 +1186,27 @@ export default {
             this.chapInfo = JSON.parse(this.courseDetail.chapters)[
               this.courseType
             ];
-            this.chapInfoList = JSON.parse(this.courseDetail.chapters);
 
+            this.chapterlist = JSON.parse(JSON.stringify(a[this.taskCount].chapterData));
+            this.chapterIndex = 0
+            this.chapInfoList = JSON.parse(this.courseDetail.chapters);
+            if (this.chapterlist.length) {
+              for (var k = 0; k < this.chapterlist.length; k++) {
+                if (this.chapterlist[k].type == 2) {
+                  var d = JSON.parse(JSON.stringify(this.playerOptions));
+                  d.sources[0].src = this.chapterlist[k].src
+                  this.chapterlist[k].src = d
+                } else if (this.chapterlist[k].type == 3) {
+                  this.chapterlist[k].src = "https://view.officeapps.live.com/op/view.aspx?src=" + this.chapterlist[k].url;
+                } else if (this.chapterlist[k].type == 6) {
+                  this.chapterlist[k].name += '.doc'
+                } else if (this.chapterlist[k].type == 8) {
+
+                } else if (this.chapterlist[k].type == 9) {
+                  this.chapterlist[k].src = this.chapterlist[k].url
+                }
+              }
+            }
             for (var l = 0; l < this.chapInfoList.length; l++) {
               var w = this.chapInfoList[l].chapterInfo[0].taskJson;
               for (var m = 0; m < w.length; m++) {