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");