Bläddra i källkod

fix: ui高度兼容性

liming 2 veckor sedan
förälder
incheckning
f6a54b45af

+ 19 - 0
README.md

@@ -67,4 +67,23 @@ apply plugin: 'com.android.application'
         }
     }
 
+```
+
+```
+ext {
+    minSdkVersion = 26
+    compileSdkVersion = 35
+    targetSdkVersion = 35
+    androidxActivityVersion = '1.9.2'
+    androidxAppCompatVersion = '1.7.0'
+    androidxCoordinatorLayoutVersion = '1.2.0'
+    androidxCoreVersion = '1.15.0'
+    androidxFragmentVersion = '1.8.4'
+    coreSplashScreenVersion = '1.0.1'
+    androidxWebkitVersion = '1.12.1'
+    junitVersion = '4.13.2'
+    androidxJunitVersion = '1.2.1'
+    androidxEspressoCoreVersion = '3.6.1'
+    cordovaAndroidVersion = '10.1.1'
+}
 ```

+ 28 - 17
src/App.vue

@@ -7,44 +7,53 @@
     class="app-bar-header"
     :style="notchStyle"
   />
-  <RouterView />
+  <div class="main" :style="appMainViewStyle">
+    <RouterView  />
+  </div>
 </template>
 
-<script setup>
+<script setup> 
 import { appStart } from "@/hooks/updataApp";
 import { getNotchHeight } from "@/utils/statusBar";
 const route = useRoute();
 const router = useRouter();
 
+const height = ref(0);
 const notchStyle = ref({});
- 
- 
+// const appMainViewStyle = ref({});
+
+const appMainViewStyle = computed(() => {
+  let mainHeight = 0
+  if (route.meta.navbar)  mainHeight = height.value + 46;
+  if (route.meta.tabbar) mainHeight = mainHeight + 60
+  return { 
+    height: `calc(100vh - ${mainHeight}px)`
+  };
+});
+
 const goBack = () => {
   if (route.meta.navbar) {
     if (route.meta.to) {
       router.push({
         path: route.meta.to,
       });
-      return
+      return;
     }
     router.back();
   }
 };
 
 onBeforeMount(async () => {
-  const getLoadingNode = document.getElementById('Loading')
-  const { body } = document
+  const getLoadingNode = document.getElementById("Loading");
+  const { body } = document;
   if (getLoadingNode) {
-    body.removeChild(getLoadingNode)
+    body.removeChild(getLoadingNode);
   }
 
-  const height = await getNotchHeight();
-  notchStyle.value = { 
-    paddingTop: `${height}px`,
+  height.value = await getNotchHeight();
+  notchStyle.value = {
+    paddingTop: `${height.value}px`,
   };
- 
-
-  // appStart()
 });
 </script>
 
@@ -55,15 +64,17 @@ body {
   height: 100%;
   background-color: @bg-color2;
 }
- 
 </style>
 
 <style scoped lang="less">
+.app-container {
+  background-color: #000;
+}
 .app-bar-header {
-  :deep(.van-nav-bar__title){
+  :deep(.van-nav-bar__title) {
     font-weight: 500;
   }
-  :deep(.van-icon){
+  :deep(.van-icon) {
     color: @font-color3;
   }
 }

+ 0 - 64
src/components/Biometrics/biometrics.js

@@ -1,67 +1,3 @@
-
-// export  const  verifyFingerprint = async()=> {
-//   // if (!window.Fingerprint) {
-//   //   alert('设备不支持指纹或插件未加载');
-//   //   return;
-//   // }
-//   // window.Fingerprint.isAvailable(
-//   //   (result) => {
-//   //     console.log('生物识别可用类型:', result); // 例如:FACE 或 FINGERPRINT
-//   //     alert('生物识别可用类型:' + JSON.stringify(result));
-//   //   },
-//   //   (error) => {
-//   //     console.error('生物识别不可用或未注册', error);
-//   //     alert('生物识别不可用或未注册' + JSON.stringify(error));
-//   //   }
-//   // );
-  
-
-//   // try {
-//   //   const result = await new Promise((resolve, reject) => {
-//   //     window.Fingerprint.show(
-//   //       {
-//   //         clientId: "com.example.app",       // 安卓必填,随便写
-//   //         clientSecret: "123456",      // 安卓必填,随便写 // ios必填,随便写
-//   //         disableBackup: false,          // 是否禁用备用密码(false表示允许用户输入密码)
-//   //         localizedFallbackTitle: "使用密码登录",  // 备用密码按钮文字
-//   //         localizedReason: "请验证指纹完成支付",  // 弹窗提示信息
-//   //       },
-//   //       resolve,
-//   //       reject
-//   //     );
-//   //   });
-
-//   //   if (result) {
-//   //     alert('验证成功!你可以执行支付逻辑了'); 
-//   //   }
-//   // } catch (error) { 
-//   //   alert("验证失败:" + JSON.stringify(error));
-//   //   console.error(error);
-//   // }
-
-
-
-// // const { FaceId } = Plugins;
-//  alert("开始验证")
-// // check if device supports Face ID or Touch ID
-//   // FaceId.isAvailable().then(checkResult => {
-//   //   if(checkResult.value) {
-//   //     FaceId.auth().then(() => {
-//   //       console.log('authenticated');
-//   //     }).catch((error) => {
-//   //       // handle rejection errors
-//   //       alert("验证失败:" + JSON.stringify(error));
-//   //       console.error(error.message);
-//   //     });
-//   //   } else {
-//   //     alert("自定义回退身份验证在这里" + JSON.stringify(error));
-//   //     // use custom fallback authentication here
-//   //   }
-//   // });
-
-// }
-
-
 import { BiometricAuth, AndroidBiometryStrength } from '@aparajita/capacitor-biometric-auth';
 
 export  const  verifyFingerprint = async()=> {

+ 1 - 1
src/views/me/addAddress/index.vue

@@ -98,7 +98,7 @@ const confirm = () => {
 .container{
     display: flex;
     flex-direction: column;
-    height: calc(100vh - 44px);
+height: 100%;
     padding: 17px 17px 33px;
     box-sizing: border-box;
     .content{

+ 1 - 1
src/views/me/addressManagement/index.vue

@@ -78,7 +78,7 @@ const changeDelete = (index) => {
 .container{
     display: flex;
     flex-direction: column;
-    height: calc(100vh - 44px);
+    height: 100%;
     padding: 17px 17px 33px;
     box-sizing: border-box;
     .content{

+ 1 - 1
src/views/me/download/index.vue

@@ -13,7 +13,7 @@ const qrtext = ref('123');
 
 <style lang="less" scoped>
 .container{
-    height: calc(100vh - 44px);
+    height: 100%;
     background: url('../../../assets/img/down-icon.jpg') no-repeat;
     background-size: 100% 100%;
     position: relative;

+ 1 - 1
src/views/me/nodeDividend/index.vue

@@ -132,7 +132,7 @@ onMounted(async ()=>{
 .container{
     background: url('@/assets/img/bg.png') no-repeat;
     background-size: 100% 100%;
-    height: calc(100vh - 44px);
+height: 100%;
     display: flex;
     flex-direction: column;
     .content{

+ 1 - 1
src/views/me/walletManagement/index.vue

@@ -105,7 +105,7 @@ const goToPage = (id) => {
 
 <style scoped lang="less">
 .container{
-    height: calc(100vh - 44px);
+height: 100%;
     display: flex;
     flex-direction: column;
 }

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

@@ -167,7 +167,7 @@ onMounted(async ()=>{
 
 <style lang="less" scoped>
 .container{
-  height: calc(100vh - 44px);
+height: 100%;
   display: flex;
   flex-direction: column;
   padding: 16px;

+ 1 - 1
src/views/transaction/jys/index.vue

@@ -449,7 +449,7 @@ onMounted(async ()=>{
 
 <style lang="less" scoped>
 .container{
-    height: calc(100vh - 44px);
+height: 100%;
     display: flex;
     flex-direction: column;
     padding: 16px;

+ 1 - 1
src/views/wallet/proceeds/index.vue

@@ -25,7 +25,7 @@ const qrtext = walletStore.account;
 .container{
     display: flex;
     flex-direction: column;
-    height: calc(100vh - 44px);
+    height: 86vh;
     padding: 17px 17px 33px;
     box-sizing: border-box;
     .content{

+ 1 - 1
src/views/wallet/transferDetail/index.vue

@@ -285,7 +285,7 @@ const sendToken = async (privateKey, tokenAddress, toAddress, amount) => {
 .container{
     display: flex;
     flex-direction: column;
-    height: calc(100vh - 44px);
+    height: 86vh;
     padding: 17px 17px 33px;
     box-sizing: border-box;
     .content{

+ 1 - 1
src/views/wallet/walletDetail/index.vue

@@ -143,7 +143,7 @@ const formatAddress = address => {
 <style lang="less" scoped>
 .container {
     padding: 25px 17px 33px;
-    height: calc(100vh - 44px);
+height: 100%;
     box-sizing: border-box;
     display: flex;
     flex-direction: column;

+ 1 - 1
src/views/wallet/ybExchange/index.vue

@@ -157,7 +157,7 @@ onMounted(async ()=>{
 
 <style lang="less" scoped>
 .container{
-    height: calc(100vh - 44px);
+height: 100%;
     display: flex;
     flex-direction: column;
     padding: 15px 17px;