mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/student-h5.git
synced 2025-12-06 09:26:46 +08:00
feat: 增加 ios 检测,匹配到 ios 执行对应跳转方法
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user