fix:切换课程卸载iframe

This commit is contained in:
zxj
2025-12-12 15:45:14 +08:00
parent 45a537a0d4
commit 61208a6b16

View File

@@ -165,14 +165,9 @@
<div v-if="resType == 41"> <div v-if="resType == 41">
<div style="padding: 20px" v-html="contentData.content"></div> <div style="padding: 20px" v-html="contentData.content"></div>
</div> </div>
<div <div v-if="resType == 50" style="min-height: 500px">
v-if="resType == 50 || isLoadIframe"
v-show="!(resType != 50 && isLoadIframe)"
style="min-height: 500px"
>
<iframe <iframe
v-if="scormUrl || isLoadIframe" v-if="scormUrl"
v-show="!(resType != 50 && isLoadIframe)"
:src="scormUrl" :src="scormUrl"
frameborder="0" frameborder="0"
border="0px" border="0px"
@@ -949,10 +944,6 @@ export default {
warn: "测试内容", warn: "测试内容",
warnTitle: "测试标题", warnTitle: "测试标题",
isFinishingStudyItem: false, // 防止重复调用完成状态更新接口 isFinishingStudyItem: false, // 防止重复调用完成状态更新接口
// // 全局状态:是否正在等待接口完成
isLoadIframe: false,
// // 待执行的切换操作(存储点击的目标课程)
// pendingSwitchAction: null,
}; };
}, },
mounted() { mounted() {
@@ -1149,13 +1140,6 @@ export default {
this.$refs.mynote.showVideoTimeBtn(false); this.$refs.mynote.showVideoTimeBtn(false);
let $this = this; let $this = this;
this.resType = r.contentType; this.resType = r.contentType;
if (this.resType == 50) {
this.isLoadIframe = true;
} else {
setTimeout(() => {
this.isLoadIframe = false;
}, 10000);
}
this.contentData = r; this.contentData = r;
this.activeId = this.contentData.id; this.activeId = this.contentData.id;
if (item) { if (item) {