From 0d3361b7bc35884567fa68d54f07804258df1519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BD=AA?= Date: Tue, 15 Apr 2025 16:46:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/adminMy/index.vue | 30 +++++++++++++++++++++++++++++- pages/index/index.vue | 2 +- pages/login/login.vue | 3 ++- pages/user/index.vue | 32 ++++++++++++++++++++++++++++++-- 4 files changed, 62 insertions(+), 5 deletions(-) diff --git a/pages/adminMy/index.vue b/pages/adminMy/index.vue index b72e8d5..15f0ed8 100644 --- a/pages/adminMy/index.vue +++ b/pages/adminMy/index.vue @@ -14,7 +14,7 @@ - + -1 || u.indexOf("Adr") > -1; //android + // let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios + try { + if (isAndroid && AndroidJs) { + console.log("%c%s", "color:red", "安卓--调用返回方法"); + const reqRow = { + name: "logout", + data: "", + }; + AndroidJs.func(JSON.stringify(reqRow)); // 给安卓传参 + } else { + console.log("%c%s", "color:red", "苹果--调用返回方法"); + const reqRow = { + name: "back-iphone", + data: "", + }; + window.webkit.messageHandlers.func.postMessage( + JSON.stringify(reqRow) + ); // 给ios 传参 + } + } catch (e) { + console.log(e, "e-----判断安卓苹果类型出错"); + } + return + } if (!path) return; useRouter(path, {}, "navigateTo"); }, diff --git a/pages/index/index.vue b/pages/index/index.vue index 9b3e90b..83646f8 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -2,7 +2,7 @@ 调试录入卡片 - 调试token过期 + diff --git a/pages/login/login.vue b/pages/login/login.vue index 18cdd46..9039b5f 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -38,7 +38,8 @@ export default { onLoad() {}, methods: { login1Fn() { - this.phone = "13800451500"; + // this.phone = "13800451500"; + this.phone = "18174010561"; this.pwd = "123456"; const normalTabBar = [ diff --git a/pages/user/index.vue b/pages/user/index.vue index 019d1c7..c85134b 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -36,7 +36,7 @@ -1 || u.indexOf("Adr") > -1; //android + // let isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios + try { + if (isAndroid && AndroidJs) { + console.log("%c%s", "color:red", "安卓--调用返回方法"); + const reqRow = { + name: "logout", + data: "", + }; + AndroidJs.func(JSON.stringify(reqRow)); // 给安卓传参 + } else { + console.log("%c%s", "color:red", "苹果--调用返回方法"); + const reqRow = { + name: "back-iphone", + data: "", + }; + window.webkit.messageHandlers.func.postMessage( + JSON.stringify(reqRow) + ); // 给ios 传参 + } + } catch (e) { + console.log(e, "e-----判断安卓苹果类型出错"); + } + return + } if (!path) return; useRouter(path, {}, "navigateTo");