diff --git a/pages.json b/pages.json index 8e06e39..084236e 100644 --- a/pages.json +++ b/pages.json @@ -11,8 +11,13 @@ "style": { "navigationBarTitleText": "", "navigationStyle": "custom", + "navigationBarTextStyle": "black", "backgroundColor": "#ffd1c7", - "backgroundColorTop": "#ffd1c7" + "backgroundColorTop": "#ffd1c7", + "mp-weixin": { + "navigationStyle": "custom", + "backgroundColorTop": "#ffd1c7" + } } }, { @@ -176,7 +181,10 @@ // "navigationBarTitleText": "uni-app", // "navigationBarBackgroundColor": "#F8F8F8", // "backgroundColor": "#F8F8F8", - "navigationStyle": "custom" + "navigationStyle": "custom", + "navigationBarTextStyle": "black", + "backgroundColor": "#ffd1c7", + "backgroundColorTop": "#ffd1c7" }, "uniIdRouter": {}, diff --git a/pages/yxg-magic/index.vue b/pages/yxg-magic/index.vue index a1dad16..108af73 100644 --- a/pages/yxg-magic/index.vue +++ b/pages/yxg-magic/index.vue @@ -6,16 +6,37 @@ import { computed } from 'vue' import { YXG_H5_BASE, YXG_H5_VERSION } from '@/util/yxgConfig.js' -const sys = uni.getSystemInfoSync() -const sbh = sys.statusBarHeight || 0 +/** H5 顶栏安全区:状态栏 + 胶囊行,避免 logo 与内容重叠 */ +function topInsetPx() { + const sys = uni.getSystemInfoSync() + const statusBar = sys.statusBarHeight || 0 + // #ifdef MP-WEIXIN + try { + const menu = uni.getMenuButtonBoundingClientRect() + if (menu && menu.bottom > statusBar) { + return Math.ceil(menu.bottom + 6) + } + } catch (_) {} + // #endif + return statusBar + 44 +} + +const topInset = topInsetPx() const h5Url = computed( - () => `${YXG_H5_BASE}?mp=1&v=${YXG_H5_VERSION}&sbh=${sbh}`, + () => `${YXG_H5_BASE}?mp=1&v=${YXG_H5_VERSION}&sbh=${topInset}`, ) + + diff --git a/util/yxgConfig.js b/util/yxgConfig.js index 24ae0fb..f18e6bd 100644 --- a/util/yxgConfig.js +++ b/util/yxgConfig.js @@ -1,4 +1,4 @@ /** 愈心魔方 H5(digital-psychology user-h5) */ -export const YXG_H5_VERSION = '202608252' +export const YXG_H5_VERSION = '202608253' export const YXG_H5_BASE = 'https://h5.yuxingu.com.cn/psy/' export const YXG_H5_HOME_URL = `${YXG_H5_BASE}?mp=1&v=${YXG_H5_VERSION}`