macmini 1 settimana fa
parent
commit
6e0c8c36cb
3 ha cambiato i file con 19 aggiunte e 10 eliminazioni
  1. 7 1
      src/pages/income/income.vue
  2. 3 2
      src/utils/index.ts
  3. 9 7
      src/utils/systemInfo.ts

+ 7 - 1
src/pages/income/income.vue

@@ -100,6 +100,12 @@ const activeTab = ref('pending')
 function changeTab(tab: string) {
     activeTab.value = tab
 }
+
+function goPage(page: string) {
+    uni.navigateTo({
+        url: `/pages-A/${page}/index`,
+    })
+}
 </script>
 
 <template>
@@ -115,7 +121,7 @@ function changeTab(tab: string) {
                         7297491.08
                     </view>
                     <view class="income-header-balance-num-btns">
-                        <view class="income-header-balance-num-btn js">
+                        <view class="income-header-balance-num-btn js" @click="goPage('unlockRewards')">
                             解锁
                         </view>
                         <view class="income-header-balance-num-btn tx">

+ 3 - 2
src/utils/index.ts

@@ -2,6 +2,7 @@ import type { PageMetaDatum, SubPackages } from '@uni-helper/vite-plugin-uni-pag
 import { isMpWeixin } from '@uni-helper/uni-env'
 import { pages, subPackages } from '@/pages.json'
 import { changtime } from './directive'
+import { menuButtonInfo, safeAreaInsets, systemInfo } from './systemInfo'
 
 export type PageInstance = Page.PageInstance<AnyObject, object> & { $page: Page.PageInstance<AnyObject, object> & { fullPath: string } }
 
@@ -159,5 +160,5 @@ export const isDoubleTokenMode = import.meta.env.VITE_AUTH_MODE === 'double'
  */
 export const HOME_PAGE = `/${(pages as PageMetaDatum[]).find(page => page.type === 'home')?.path || (pages as PageMetaDatum[])[0].path}`
 
-// 导出时间格式化函数
-export { changtime }
+// 导出时间格式化函数和系统信息
+export { changtime, menuButtonInfo, safeAreaInsets, systemInfo }

+ 9 - 7
src/utils/systemInfo.ts

@@ -2,18 +2,20 @@
 // 获取屏幕边界到安全区域距离
 let systemInfo
 let safeAreaInsets
+const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
 
 // #ifdef MP-WEIXIN
 // 微信小程序使用新的API
 systemInfo = uni.getWindowInfo()
+console.log(9990, systemInfo)
 safeAreaInsets = systemInfo.safeArea
-  ? {
-      top: systemInfo.safeArea.top,
-      right: systemInfo.windowWidth - systemInfo.safeArea.right,
-      bottom: systemInfo.windowHeight - systemInfo.safeArea.bottom,
-      left: systemInfo.safeArea.left,
+    ? {
+        top: systemInfo.safeArea.top,
+        right: systemInfo.windowWidth - systemInfo.safeArea.right,
+        bottom: systemInfo.windowHeight - systemInfo.safeArea.bottom,
+        left: systemInfo.safeArea.left,
     }
-  : null
+    : null
 // #endif
 
 // #ifndef MP-WEIXIN
@@ -35,4 +37,4 @@ console.log('systemInfo', systemInfo)
 // windowHeight: 753
 // windowTop: 0
 // windowWidth: 390
-export { safeAreaInsets, systemInfo }
+export { menuButtonInfo, safeAreaInsets, systemInfo }