diff --git a/src/views/projectdetails/projectDetails.vue b/src/views/projectdetails/projectDetails.vue index f509717..836b517 100644 --- a/src/views/projectdetails/projectDetails.vue +++ b/src/views/projectdetails/projectDetails.vue @@ -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;