diff --git a/src/components/Course/auditCourse1.vue b/src/components/Course/auditCourse1.vue index edf1a8c0..979eb012 100644 --- a/src/components/Course/auditCourse1.vue +++ b/src/components/Course/auditCourse1.vue @@ -594,19 +594,23 @@ export default { } if($this.coursewareInfo.content.contentType == 40) { //console.log(con.content,'con.content'); - if(con.content != '' && con.content.indexOf('.pdf') > -1) { - $this.coursewareInfo.content.content = con.content; - }else { + // if(con.content != '' && con.content.indexOf('.pdf') > -1) { + // $this.coursewareInfo.content.content = con.content; + // }else { apiCourseFile.detail(con.contentRefId).then(cfrs => { if (cfrs.status == 200) { - $this.curCFile=cfrs.result; - $this.converStatus = cfrs.result.converStatus; $this.coursewareInfo.content.content = cfrs.result.previewFilePath; + if(cfrs.result.previewFilePath == '' && cfrs.result.filePath.indexOf('pdf') > -1) { + $this.coursewareInfo.content.content = cfrs.result.filePath; + } else { + $this.curCFile=cfrs.result; + $this.converStatus = cfrs.result.converStatus; + } } else { $this.$message.error('加载pdf课件文件失败'); } }); - } + // } } } else if (con.sortIndex == 2) { $this.homeworkInfo = con; diff --git a/src/components/Course/auditCourse2.vue b/src/components/Course/auditCourse2.vue index 9c79582d..7eb77481 100644 --- a/src/components/Course/auditCourse2.vue +++ b/src/components/Course/auditCourse2.vue @@ -650,21 +650,25 @@ export default { } } else if(r.contentType == 40) { this.contentData.content=""; - if (r.content != '' && r.content.indexOf('.pdf') > -1) { - this.contentData.content = cfrs.result.previewFilePath; - }else{ + // if (r.content != '' && r.content.indexOf('.pdf') > -1) { + // // this.contentData.content = cfrs.result.previewFilePath; + // }else{ apiCourseFile.detail(r.contentRefId).then(cfrs => { if (cfrs.status == 200) { - this.curCFile=cfrs.result; - this.converStatus = cfrs.result.converStatus; this.contentData.content = cfrs.result.previewFilePath; + if(cfrs.result.previewFilePath == '' && cfrs.result.filePath.indexOf('pdf') > -1) { + this.contentData.content = cfrs.result.filePath; + } else { + this.converStatus = cfrs.result.converStatus; + this.curCFile=cfrs.result; + } //console.log(r.content); }else { this.contentData.content=""; this.$message.error('加载pdf课件文件失败'); } }); - } + // } } this.type = 0; }, diff --git a/src/components/Course/weikeContent.vue b/src/components/Course/weikeContent.vue index 06ba2c8c..49cb2704 100644 --- a/src/components/Course/weikeContent.vue +++ b/src/components/Course/weikeContent.vue @@ -738,11 +738,15 @@ }else{ apiCourseFile.detail(this.cware.content.contentRefId).then(rs=>{ if(rs.status==200){ - this.curCFile=rs.result; - this.converStatus = rs.result.converStatus; this.courseFileShow = false; this.cware.content.pdfPath=rs.result.previewFilePath; - this.$forceUpdate(); + if(rs.result.previewFilePath == '' && rs.result.filePath.indexOf('pdf') > -1) { + this.cware.content.pdfPath = rs.result.filePath; + } else { + this.curCFile=rs.result; + this.converStatus = rs.result.converStatus; + } + this.$forceUpdate(); } }); } diff --git a/src/views/portal/course/Micro.vue b/src/views/portal/course/Micro.vue index da23d7ff..50f42ca5 100644 --- a/src/views/portal/course/Micro.vue +++ b/src/views/portal/course/Micro.vue @@ -290,6 +290,7 @@ import courseImage from "@/components/Course/courseImage.vue"; import studyUtil from '@/utils/study.js'; import {encrypt} from '@/utils/jsencrypt.js'; import cookies from 'vue-cookies' +import { log } from 'util'; export default { name: "micro", components: { @@ -311,7 +312,9 @@ export default { }, data() { return { - curCFile:{}, + curCFile:{ + converStatus:4, + }, sex:null, playerBoxShow:false, userAvatarText, @@ -444,16 +447,22 @@ export default { } else if (con.contentType == 40) { //需要读取pdf的路径 - if($this.coursewareInfo.content.content!='' && $this.coursewareInfo.content.content.indexOf('.pdf')==-1){ + // if($this.coursewareInfo.content.content!='' && $this.coursewareInfo.content.content.indexOf('.pdf')==-1){ apiCourseFile.detail($this.coursewareInfo.content.contentRefId).then(cfrs=>{ if(cfrs.status==200){ - this.curCFile = cfrs.result; + // this.curCFile = cfrs.result; $this.coursewareInfo.content.content=cfrs.result.previewFilePath; + if(cfrs.result.previewFilePath == '' && cfrs.result.filePath.indexOf('pdf') > -1) { + $this.coursewareInfo.content.content = cfrs.result.filePath; + } else { + $this.curCFile=rs.result; + // this.converStatus = rs.result.converStatus; + } }else{ $this.$message.error('加载pdf课件文件失败'); } }); - } + // } //let url = this.fileBaseUrl + r.content; }else if(con.contentType ==52){ if(con.content.startsWith('\{')){ diff --git a/src/views/study/PortalIndex.vue b/src/views/study/PortalIndex.vue index b4b702e4..010ed9ec 100644 --- a/src/views/study/PortalIndex.vue +++ b/src/views/study/PortalIndex.vue @@ -263,7 +263,9 @@ export default { components: { courseImage, portalHeader, portalFooter, hyperLink, comments, homework, exam, interactBar, assess, pdfPreview, audioPlayer, videoPlayer }, data() { return { - curCFile:{}, + curCFile:{ + converStatus:4, + }, interactRuning:false, playerBoxShow:false, userAvatarText, @@ -820,9 +822,10 @@ export default { apiCourseFile.detail(r.contentRefId).then(cfrs => { if (cfrs.status == 200) { r.content = cfrs.result.previewFilePath; - this.curCFile = cfrs.result; if(cfrs.result.previewFilePath == '' && cfrs.result.filePath.indexOf('pdf') > -1) { r.content = cfrs.result.filePath; + } else { + this.curCFile = cfrs.result; } } else { $this.$message.error('加载pdf课件文件失败');