From f853688ce0e1162e037a0b521fbf0cc9690cdb13 Mon Sep 17 00:00:00 2001
From: deepblues <452698686@qq.com>
Date: Fri, 5 May 2023 17:30:49 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=A7=A9=20=E4=BF=AE=E6=94=B9?=
=?UTF-8?q?=E8=89=BA=E6=9C=AF=E7=82=B9=E4=BD=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/index.html | 39 +++++++++++--------
public/static/android/android.js | 4 ++
.../PublicComponent/PublicComponent.vue | 4 ++
src/components/TypeBtnList/TypeBtnList.vue | 2 +-
src/composables/useHandleScreen.ts | 1 +
src/types/window.d.ts | 11 ++++++
src/views/Art/Art.vue | 1 +
7 files changed, 45 insertions(+), 17 deletions(-)
create mode 100644 public/static/android/android.js
create mode 100644 src/types/window.d.ts
diff --git a/public/index.html b/public/index.html
index 42f2e6a..e60c860 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1,19 +1,26 @@
-
-
-
-
-
- <%= htmlWebpackPlugin.options.title %>
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ <%= htmlWebpackPlugin.options.title %>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/public/static/android/android.js b/public/static/android/android.js
new file mode 100644
index 0000000..3d40852
--- /dev/null
+++ b/public/static/android/android.js
@@ -0,0 +1,4 @@
+
+window.leaveScreenSave= ()=>{
+ // 离开屏保需要调用
+}
diff --git a/src/components/PublicComponent/PublicComponent.vue b/src/components/PublicComponent/PublicComponent.vue
index 5221965..37c3a12 100644
--- a/src/components/PublicComponent/PublicComponent.vue
+++ b/src/components/PublicComponent/PublicComponent.vue
@@ -53,6 +53,10 @@ function handleDetail() {
onMounted(() => {
!window.Map_QM && useInitMap()
window.addEventListener('touchend', checkHandleScreen)
+
+ window.leaveScreenSave = () => {
+ checkHandleScreen(new TouchEvent('touchstart'))
+ }
})
onBeforeUnmount(() => {
window.removeEventListener('touchend', checkHandleScreen)
diff --git a/src/components/TypeBtnList/TypeBtnList.vue b/src/components/TypeBtnList/TypeBtnList.vue
index 2d723c0..bb590c5 100644
--- a/src/components/TypeBtnList/TypeBtnList.vue
+++ b/src/components/TypeBtnList/TypeBtnList.vue
@@ -10,7 +10,7 @@
{{ switchLanguage(item, 'title') }}
-
+
diff --git a/src/composables/useHandleScreen.ts b/src/composables/useHandleScreen.ts
index 3328f16..5195b1e 100644
--- a/src/composables/useHandleScreen.ts
+++ b/src/composables/useHandleScreen.ts
@@ -68,6 +68,7 @@ export const useHandleScreen = (callback: () => void) => {
callback()
}
await sleepToWallpaper()
+ window?.android?.goScreenSave() //进入屏保
callback()
}, DELAY_CHECK_TIME)
}
diff --git a/src/types/window.d.ts b/src/types/window.d.ts
new file mode 100644
index 0000000..c65a27a
--- /dev/null
+++ b/src/types/window.d.ts
@@ -0,0 +1,11 @@
+/**
+ * android.goScreenSave () 进入屏保
+leaveScreenSave() 离开屏保需要调用我这里的方法
+ */
+type Android = {
+ goScreenSave: () => void
+}
+declare interface Window {
+ android: Android
+ leaveScreenSave: () => void
+}
diff --git a/src/views/Art/Art.vue b/src/views/Art/Art.vue
index 94cb484..07cef8f 100644
--- a/src/views/Art/Art.vue
+++ b/src/views/Art/Art.vue
@@ -471,6 +471,7 @@ function clickGo(item: any) {
top: 85px;
left: 510px;
li {
+ margin-bottom: -108px;
img {
height: 205px;
}