|
|
@@ -343,18 +343,18 @@ export default {
|
|
|
this.statusBarHeight = systemInfo.statusBarHeight || 0;
|
|
|
this.heroTopOffset = 0;
|
|
|
this.capsuleSafeRight = 0;
|
|
|
- const topLift = uni.upx2px(20);
|
|
|
- const liftTop = (px) => Math.max(this.statusBarHeight, px - topLift);
|
|
|
// #ifdef MP-WEIXIN
|
|
|
const menuButton = uni.getMenuButtonBoundingClientRect();
|
|
|
if (menuButton && menuButton.bottom) {
|
|
|
- this.heroTopOffset = liftTop(menuButton.bottom + 12);
|
|
|
+ this.heroTopOffset = menuButton.bottom + 12;
|
|
|
}
|
|
|
if (menuButton && menuButton.left) {
|
|
|
this.capsuleSafeRight = systemInfo.windowWidth - menuButton.left + 8;
|
|
|
}
|
|
|
// #endif
|
|
|
// #ifdef APP-PLUS
|
|
|
+ const appTopLift = uni.upx2px(20);
|
|
|
+ const liftAppTop = (px) => Math.max(this.statusBarHeight, px - appTopLift);
|
|
|
const statusBar = this.statusBarHeight;
|
|
|
const safeInsetTop =
|
|
|
(systemInfo.safeAreaInsets && systemInfo.safeAreaInsets.top) ||
|
|
|
@@ -365,10 +365,10 @@ export default {
|
|
|
systemInfo.platform === "ios" || (systemInfo.osName && systemInfo.osName.toLowerCase() === "ios");
|
|
|
if (isIos) {
|
|
|
// iOS 刘海屏 safeArea.top 已含状态栏,仅补内容与顶部的间距
|
|
|
- this.heroTopOffset = liftTop(topInset + 12);
|
|
|
+ this.heroTopOffset = liftAppTop(topInset + 12);
|
|
|
} else {
|
|
|
// Android 自定义导航:状态栏 + 约 44px 标题区(与微信胶囊下边距接近)
|
|
|
- this.heroTopOffset = liftTop(topInset + 44 + 12);
|
|
|
+ this.heroTopOffset = liftAppTop(topInset + 44 + 12);
|
|
|
}
|
|
|
// #endif
|
|
|
} catch (e) {
|