liming преди 1 ден
родител
ревизия
408e21a5df
променени са 7 файла, в които са добавени 17 реда и са изтрити 20 реда
  1. 1 0
      android/app/capacitor.build.gradle
  2. 1 0
      package.json
  3. 1 16
      src/App.vue
  4. 1 0
      src/assets/css/global.less
  5. 2 2
      src/layout/app/index.vue
  6. 10 1
      src/main.js
  7. 1 1
      src/views/dapp/index.vue

+ 1 - 0
android/app/capacitor.build.gradle

@@ -22,6 +22,7 @@ dependencies {
     implementation project(':capacitor-status-bar')
     implementation project(':capacitor-toast')
     implementation project(':capgo-capacitor-updater')
+    implementation project(':capacitor-plugin-safe-area')
 
 }
 

+ 1 - 0
package.json

@@ -37,6 +37,7 @@
     "@capacitor/toast": "^7.0.1",
     "@capgo/capacitor-updater": "^7.8.7",
     "axios": "^1.10.0",
+    "capacitor-plugin-safe-area": "latest",
     "clipboard": "^2.0.11",
     "crypto-js": "^4.2.0",
     "dayjs": "^1.11.13",

+ 1 - 16
src/App.vue

@@ -69,22 +69,7 @@ onBeforeMount(async () => {
 });
 
 onMounted(() => {
-  LocalNotifications.requestPermissions()
-  
-  // setTimeout(() => {
-  //    setupNotifications(3);
-  // }, 500);
-  //  setTimeout(() => {
-  //    setupNotifications(4);
-  // }, 500);
-  //  setTimeout(() => {
-  //    setupNotifications(5);
-  // }, 500);
-  //  setTimeout(() => {
-  //    setupNotifications(5);
-  // }, 2500); 
-  // setupNotifications(5);
-  // setupNotifications(6);
+  LocalNotifications.requestPermissions() 
 });
 
 watch(

+ 1 - 0
src/assets/css/global.less

@@ -11,6 +11,7 @@
 :root body[arco-theme="dark"] {
   --root-layout-bg-color: var(--color-bg-3); /* 暗黑主题下的值 */
   --root-bg-login-color: var(--color-bg-1);
+  --safe-area-bottom: 0px;
 }
 
 

+ 2 - 2
src/layout/app/index.vue

@@ -75,8 +75,8 @@ onBeforeMount(async () => {
   height: 25px;
 }
 .van-tabbar--fixed{
-  height: 60px;
-  padding: 18px 0 30px 0;
+  height: calc(60px + var(--safe-area-bottom));
+  padding: 8px 0 var(--safe-area-bottom) 0;
   // padding-top: 10px;
   box-sizing: border-box;
 } 

+ 10 - 1
src/main.js

@@ -18,6 +18,8 @@ import SvgIcon from "@/components/Svg-icon/SvgIcon.vue";
 import { initCapacitor } from "./plugins";
 import { setup } from "./plugins/storage";
 
+import { SafeArea } from "capacitor-plugin-safe-area";
+
 import VConsole from "vconsole";
 
 if (process.env.NODE_ENV === "development") {
@@ -43,4 +45,11 @@ async function appInit() {
   app.mount("#app", true);
 }
 
-appInit().then(() => {});
+appInit().then(async () => {
+  const { insets } = await SafeArea.getSafeAreaInsets();
+  console.log("底部安全区域:", insets); // 直接获取底部间距
+  document.documentElement.style.setProperty(
+    "--safe-area-bottom",
+    `${insets.bottom}px`
+  );
+});

+ 1 - 1
src/views/dapp/index.vue

@@ -442,7 +442,7 @@ onMounted(async () => {
 
   .tab-box {
     padding: 16px 10px 0px;
-    height: calc(100vh - 590px);
+    height: calc(100vh - 590px - var(--safe-area-bottom));
     overflow-y: auto;
     &::-webkit-scrollbar {
       display: none;