From aab62a1c9ddc084efbd8b2610783bf491315d8f1 Mon Sep 17 00:00:00 2001 From: daihh Date: Thu, 9 Mar 2023 19:38:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=9F=A5=E7=9C=8B=E6=97=B6?= =?UTF-8?q?=EF=BC=8Cscorm=E9=A2=84=E8=A7=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/auditCourse2.vue | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/components/Course/auditCourse2.vue b/src/components/Course/auditCourse2.vue index 6b65ee7e..c266374c 100644 --- a/src/components/Course/auditCourse2.vue +++ b/src/components/Course/auditCourse2.vue @@ -202,6 +202,9 @@ +
+ +
@@ -346,6 +349,7 @@ export default { isEdit: true, fileBaseUrl: this.$xpage.constants.fileBaseUrl, contentData: {}, + scormUrl:'', curCFile:{},//课件内容 getType: getType, btnLoading: false, @@ -763,6 +767,31 @@ export default { } }); + }else if(r.contentType == 50){ + apiCourseFile.detail(r.contentRefId).then(scormFile => { + if (!scormFile.status == 200) { + $this.$message.error('加载SCORM课件失败'); + }else{ + var curContent=scormFile.result; + //console.log(curContent,'curContent') + if(!curContent.content){ + this.$message({type: 'error',message: '无SCORM内容,SCORM包解析失败'}); + return; + } + //scorm课件的内容,取第一个sco + var scorm=JSON.parse(curContent.content); + //console.log(scorm,'scorm') + if(scorm){ + let urlPre=window.location.protocol; + let configUrl=process.env.VUE_APP_SCORM_URL; + configUrl=urlPre+configUrl.substring(configUrl.indexOf(':')+1); + //这里需要提取的到配置文件中,实际中只需要传 rowId就可以了 + this.scormUrl=configUrl+'?mode=preview&scormId='+curContent.id;//播放的首页 + }else{ + this.$message({type: 'error',message: 'SCORM包解析失败'}); + } + } + }); } this.type = 0; },