From bbc5f8fcf057b855f127dc261fb00a1851ccbd08 Mon Sep 17 00:00:00 2001 From: huangzhe <3451701311@qq.com> Date: Fri, 22 Aug 2025 16:00:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=20ios=20=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=EF=BC=8C=E5=8C=B9=E9=85=8D=E5=88=B0=20ios=20=E6=89=A7?= =?UTF-8?q?=E8=A1=8C=E5=AF=B9=E5=BA=94=E8=B7=B3=E8=BD=AC=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/projectdetails/projectDetails.vue | 35 ++++++++++++++++----- 1 file changed, 27 insertions(+), 8 deletions(-) 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;