mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 11:26:43 +08:00
课程查看时,scorm预览问题
This commit is contained in:
@@ -202,6 +202,9 @@
|
||||
<!-- <iframe :src="contentData.content" style="width: 100%;border:0px;min-height: 473px;" frameborder="0"></iframe> -->
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="contentData.contentType == 50">
|
||||
<iframe v-if="scormUrl" :src="scormUrl" frameborder="0" border="0px" style="width:100%;height:510px;border:0px;"></iframe>
|
||||
</div>
|
||||
<div v-if="contentData.contentType == 60">
|
||||
<homework :showTest="showTest" :showRecord="isDetails" :showSubmit="false" :content="contentData" ></homework>
|
||||
</div>
|
||||
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user