first commit

This commit is contained in:
chenzhen
2025-07-22 11:21:01 +08:00
commit 09d0e316e1
164 changed files with 7907 additions and 0 deletions

44
src/utils/system.js Normal file
View File

@@ -0,0 +1,44 @@
// 旧版
// const SYSTEM_INFO = uni.getSystemInfoSync();
const SYSTEM_INFO = uni.getWindowInfo();
// 获取状态栏高度
// const systemInfo = uni.getSystemInfoSync()
// statusBarHeight.value = systemInfo.statusBarHeight || 0
// 计算导航栏总高度 (状态栏 + 导航栏)
// 通常导航栏高度在H5中是44px小程序中是48px
// const platform = systemInfo.platform
// navbarHeight.value = statusBarHeight.value + (platform === 'ios' ? 44 : 48)
//时间电量状态栏高度
export const getStatusBarHeight = ()=> SYSTEM_INFO.statusBarHeight;
export const getTitleBarHeight = ()=>{
//关闭按钮胶囊
if(uni.getMenuButtonBoundingClientRect){
let {top,height} = uni.getMenuButtonBoundingClientRect();
return height + (top - getStatusBarHeight())*2
}else{
return 0;
}
}
export const getNavBarHeight = () => getStatusBarHeight()+getTitleBarHeight();
export const getNavBarPaddingTop = () => {
let h=0;
if(uni.getMenuButtonBoundingClientRect){
let {top,height} = uni.getMenuButtonBoundingClientRect();
h = height + (top - getStatusBarHeight());
}else{
// #ifdef APP-PLUS
h=22
// #endif
// #ifndef APP-PLUS
h=0
// #endif
}
console.log("h=>",h)
return h;
}