feat: 增加 ios 检测,匹配到 ios 执行对应跳转方法

This commit is contained in:
2025-08-22 16:00:48 +08:00
parent 1179b29028
commit bbc5f8fcf0

View File

@@ -675,12 +675,18 @@ function toFinish(d, sName, chapterOrStageId,studyModel) {
});
} else if (typeof TASK_TYPES.path[d.type] === "function") {
if (d.type == 5) {
// 模拟点击跳转
const url = TASK_TYPES.path[d.type](d) + d.targetId
const a = document.createElement("a");
a.href = url;
// a.target = "_blank";
a.click();
if (isIOS()){
// 模拟点击跳转
const url = TASK_TYPES.path[d.type](d) + d.targetId
const a = document.createElement("a");
a.href = url;
// a.target = "_blank";
a.click();
window.location.href = url
return
}
// 保底解决兼容问题
window.open(url, "_top");
@@ -716,7 +722,20 @@ function toFinish(d, sName, chapterOrStageId,studyModel) {
// }
}
function toOffcoursePlanPage(id){
function isIOS() {
return [
'iPad Simulator',
'iPhone Simulator',
'iPod Simulator',
'iPad',
'iPhone',
'iPod'
].includes(navigator.platform) ||
// iPad on iOS 13 detection
(navigator.userAgent.includes("Mac") && "ontouchend" in document);
}
function toOffcoursePlanPage(id) {
window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${id}`, '_top')
}
@@ -753,7 +772,7 @@ const queryAllStatus = (data) => {
display: flex;
flex-direction: column;
//justify-content: center;
margin-top: 10px;
//margin-top: 10px;
.up {
width: 100%;
height: 162px;