This commit is contained in:
joshen
2025-11-24 17:57:45 +08:00

View File

@@ -1,6 +1,12 @@
<template> <template>
<div> <div>
<div class="xpage-coures-banner"> <div class="xpage-coures-banner">
<portal-header
current="course"
textColor="#fff"
:goSearch="1"
></portal-header>
<div style="margin: 0px 80px">
<portal-header <portal-header
current="course" current="course"
textColor="#fff" textColor="#fff"
@@ -1993,11 +1999,23 @@
timedOut = true; timedOut = true;
xmlhttp.abort(); xmlhttp.abort();
}, 1000); }, 1000);
xmlhttp.open( // 1. 拼接随机参数(时间戳+随机数确保URL唯一破缓存
"HEAD", const url =
window.location.protocol + "//uapi.boe.com.cn/500.html", window.location.protocol +
true "//uapi.boe.com.cn/500.html?t=" +
Date.now() +
Math.random();
// 2. 打开 HEAD 请求URL已带随机参数
xmlhttp.open("HEAD", url, true);
// 3. 设置禁用缓存的请求头(覆盖现代浏览器+老IE+代理)
xmlhttp.setRequestHeader(
"Cache-Control",
"no-cache, no-store, must-revalidate"
); );
xmlhttp.setRequestHeader("Pragma", "no-cache"); // IE兼容
xmlhttp.setRequestHeader("Expires", "0"); // 禁止过期缓存复用
// xmlhttp.open("HEAD", window.location.protocol + "//uapi.boe.com.cn/500.html", true);
xmlhttp.send(); xmlhttp.send();
xmlhttp.onreadystatechange = function () { xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) { if (xmlhttp.readyState == 4) {
@@ -2229,23 +2247,26 @@
}, this.appentInterval * 1000); }, this.appentInterval * 1000);
}, },
finishStudyItem() { //设置完成学习的内容,针对于音视频的内容 finishStudyItem() {
if (!this.contentData.studyItemId) { //设置完成学习的内容,针对于音视频的内容
//这种可能没有不过这里也是为了万中那个1 if (!this.contentData.studyItemId) {
!this.tentative && this.saveStudyInfo(); //这种可能没有不过这里也是为了万中那个1
} else { !this.tentative && this.saveStudyInfo();
// 如果正在处理完成请求,则直接返回,避免重复调用 } else {
if (this.isFinishingStudyItem) { // 如果正在处理完成请求,则直接返回,避免重复调用
return; if (this.isFinishingStudyItem) {
} return;
let params = { }
itemId: this.contentData.studyItemId, let params = {
studyId: this.studyId, itemId: this.contentData.studyItemId,
courseId: this.courseId, studyId: this.studyId,
cnum: this.totalContent courseId: this.courseId,
} cnum: this.totalContent,
this.isFinishingStudyItem = true; // 设置标志位 };
apiVideoStudy.finishStudyItem(params).then(res => { this.isFinishingStudyItem = true; // 设置标志位
apiVideoStudy
.finishStudyItem(params)
.then((res) => {
if (res.status == 200) { if (res.status == 200) {
this.contentData.status = 9; this.contentData.status = 9;
this.contentData.progress = 100; this.contentData.progress = 100;
@@ -2253,12 +2274,13 @@
console.log("记录完成学习失败:" + res.message + "" + res.error); console.log("记录完成学习失败:" + res.message + "" + res.error);
} }
this.isFinishingStudyItem = false; // 重置标志位 this.isFinishingStudyItem = false; // 重置标志位
}).catch(error => { })
.catch((error) => {
console.error("记录完成学习出错:", error); console.error("记录完成学习出错:", error);
this.isFinishingStudyItem = false; // 出错时也重置标志位 this.isFinishingStudyItem = false; // 出错时也重置标志位
}); });
} }
}, },
saveStudyItem() { saveStudyItem() {
//先保存学习的内容,针对于音视频的内容 //先保存学习的内容,针对于音视频的内容
@@ -2519,20 +2541,20 @@
} }
} }
.player-box { .player-box {
position: absolute; position: absolute;
width: 100%; width: 100%;
max-width: 300px; max-width: 300px;
margin: 20px auto; margin: 20px auto;
height: 187px; height: 187px;
background: rgba(74, 74, 74, .8); background: rgba(74, 74, 74, 0.8);
border-radius: 33px; border-radius: 33px;
text-align: center; text-align: center;
padding: 20px; padding: 20px;
top: 50%; top: 50%;
box-sizing: border-box; box-sizing: border-box;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
.player-praise { .player-praise {
margin-top: 25px; margin-top: 25px;