mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/student-h5.git
synced 2025-12-07 01:46:45 +08:00
feat: 增加 ios 检测,匹配到 ios 执行对应跳转方法
This commit is contained in:
@@ -675,6 +675,8 @@ function toFinish(d, sName, chapterOrStageId,studyModel) {
|
|||||||
});
|
});
|
||||||
} else if (typeof TASK_TYPES.path[d.type] === "function") {
|
} else if (typeof TASK_TYPES.path[d.type] === "function") {
|
||||||
if (d.type == 5) {
|
if (d.type == 5) {
|
||||||
|
|
||||||
|
if (isIOS()){
|
||||||
// 模拟点击跳转
|
// 模拟点击跳转
|
||||||
const url = TASK_TYPES.path[d.type](d) + d.targetId
|
const url = TASK_TYPES.path[d.type](d) + d.targetId
|
||||||
const a = document.createElement("a");
|
const a = document.createElement("a");
|
||||||
@@ -682,6 +684,10 @@ function toFinish(d, sName, chapterOrStageId,studyModel) {
|
|||||||
// a.target = "_blank";
|
// a.target = "_blank";
|
||||||
a.click();
|
a.click();
|
||||||
|
|
||||||
|
window.location.href = url
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// 保底解决兼容问题
|
// 保底解决兼容问题
|
||||||
window.open(url, "_top");
|
window.open(url, "_top");
|
||||||
} else {
|
} else {
|
||||||
@@ -716,6 +722,19 @@ function toFinish(d, sName, chapterOrStageId,studyModel) {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
function toOffcoursePlanPage(id) {
|
||||||
window.open(`${location.protocol}//${location.host}${import.meta.env.VITE_BASE_API}/stu/project/redirectDetail?courseId=${id}`, '_top')
|
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;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
//justify-content: center;
|
//justify-content: center;
|
||||||
margin-top: 10px;
|
//margin-top: 10px;
|
||||||
.up {
|
.up {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 162px;
|
height: 162px;
|
||||||
|
|||||||
Reference in New Issue
Block a user