From 444b897528ce686547e584715f717e08d04796b0 Mon Sep 17 00:00:00 2001 From: GYJ <1157756119@qq.com> Date: Thu, 19 Dec 2024 11:39:43 +0800 Subject: [PATCH] =?UTF-8?q?iOS=20=20=E8=B7=B3=E8=BD=AC=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=20=E9=80=82=E9=85=8D=20iOS=20=E7=9A=84?= =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BE=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 31 +++++++++- me/detail/detail.nvue | 1 + me/detail/detailIOS.nvue | 118 ++++++++++++++++++++++----------------- pages.json | 44 +++++++++++++++ 4 files changed, 141 insertions(+), 53 deletions(-) diff --git a/main.js b/main.js index b63d655..9fb1ab5 100644 --- a/main.js +++ b/main.js @@ -21,7 +21,7 @@ Vue.use(uView); const app = new Vue({ - ...App + ...App }) // http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用 @@ -33,3 +33,32 @@ import httpApi from '@/common/http.api.js' Vue.use(httpApi, app) app.$mount() + +console.log(uni); + +// #ifdef APP + +const sysInfo = uni.getSystemInfoSync(); +let isIos = sysInfo.platform == 'ios' + +if (isIos) { + const originNavigateTo = uni.navigateTo + + uni.navigateTo = (params) => { + + console.log("自定义 navigate 。。。。。。。。。。"); + + let jsonParam = JSON.parse(JSON.stringify(params)) + + + if (isIos && jsonParam.url.includes('/me/detail/detail')) { + console.log('iOS 跳转视频也'); + jsonParam.url = jsonParam.url.replace('/me/detail/detail', '/me/detail/detailIOS') + } + + originNavigateTo(jsonParam) + } +} + + +// #endif \ No newline at end of file diff --git a/me/detail/detail.nvue b/me/detail/detail.nvue index f4fef46..8a0011f 100644 --- a/me/detail/detail.nvue +++ b/me/detail/detail.nvue @@ -402,6 +402,7 @@ } }, onShow() { + console.log('ios video on nvue'); console.log('onSHow video'); //当应用从后台进入前台时自动播放 if (this.videoContext) { diff --git a/me/detail/detailIOS.nvue b/me/detail/detailIOS.nvue index 0e69ea1..258bc47 100644 --- a/me/detail/detailIOS.nvue +++ b/me/detail/detailIOS.nvue @@ -1,5 +1,5 @@