From 6dbbcff0b665472989c02be9d4f92acd53f4ef33 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 12 May 2022 17:07:18 +0800 Subject: [PATCH] no message --- .../assets/js/components/Mobile/Back.vue | 24 +++++++++++- .../assets/js/components/Mobile/Tabbar.vue | 37 +++++++++++++++++++ resources/assets/js/pages/manage.vue | 6 +++ .../pages/manage/components/DialogWrapper.vue | 8 +++- resources/assets/sass/components/mobile.scss | 10 +++++ resources/assets/sass/dark.scss | 3 ++ resources/assets/sass/pages/common.scss | 4 ++ 7 files changed, 90 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/components/Mobile/Back.vue b/resources/assets/js/components/Mobile/Back.vue index 00d3f54ce..bcb87a53e 100644 --- a/resources/assets/js/components/Mobile/Back.vue +++ b/resources/assets/js/components/Mobile/Back.vue @@ -23,7 +23,7 @@ export default { }, created() { - + this.appAndroidEvents() }, mounted() { @@ -55,14 +55,17 @@ export default { this.x = touch.clientX this.y = touch.clientY }, + touchstart(event) { this.getXY(event) // 判断是否是边缘滑动 this.show = this.canBack() && this.x < 30; }, + touchmove(event) { this.getXY(event) }, + touchend() { // 判断停止时的位置偏移 if (this.x > 90 && this.show) { @@ -71,6 +74,7 @@ export default { this.x = 0 this.show = false }, + canBack() { if (!this.showTabbar) { return true; @@ -80,6 +84,7 @@ export default { } return this.cacheDrawerOverlay.length > 0; }, + onBack() { if (this.$Modal.removeLast()) { return; @@ -89,6 +94,23 @@ export default { return; } this.goBack(); + }, + + appAndroidEvents() { + if (window && window.navigator + && /eeui/i.test(window.navigator.userAgent) + && /android/i.test(window.navigator.userAgent)) { + let eeui = requireModuleJs("eeui"); + eeui.setPageBackPressed({ + pageName: 'firstPage', + }, _ => { + if (this.canBack()) { + this.onBack(); + } else { + eeui.goDesktop() + } + }); + } } }, }; diff --git a/resources/assets/js/components/Mobile/Tabbar.vue b/resources/assets/js/components/Mobile/Tabbar.vue index f8d8f4cee..326584a63 100644 --- a/resources/assets/js/components/Mobile/Tabbar.vue +++ b/resources/assets/js/components/Mobile/Tabbar.vue @@ -4,6 +4,14 @@
  • {{$L(item.label)}}
    + +
  • @@ -11,6 +19,8 @@