feat: alipay navbar
This commit is contained in:
@@ -2,12 +2,21 @@ const SYSTEM = uni.getSystemInfoSync();
|
||||
|
||||
export const getStatusBarHeight = () => SYSTEM.statusBarHeight || 15;
|
||||
export const getTitleBarHeight = () => {
|
||||
// #ifdef MP-ALIPAY
|
||||
return 44;
|
||||
// #endif
|
||||
|
||||
if (uni.getMenuButtonBoundingClientRect) {
|
||||
const { top, height } = uni.getMenuButtonBoundingClientRect();
|
||||
return height + (top - getStatusBarHeight()) * 2;
|
||||
} else {
|
||||
return 40;
|
||||
try {
|
||||
const rect = uni.getMenuButtonBoundingClientRect();
|
||||
if (rect && rect.top && rect.height) {
|
||||
return rect.height + (rect.top - getStatusBarHeight()) * 2;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
return 44;
|
||||
};
|
||||
|
||||
export const getBavBarHeight = () => getStatusBarHeight() + getTitleBarHeight();
|
||||
|
||||
Reference in New Issue
Block a user