@tmsfe/tms-core 0.0.74 → 0.0.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/navbarUtils.js +4 -2
package/package.json
CHANGED
package/src/navbarUtils.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
|
|
1
2
|
/**
|
|
2
3
|
* 获取导航栏相关信息
|
|
3
4
|
* @returns {Object} data 导航栏布局信息
|
|
@@ -12,10 +13,11 @@
|
|
|
12
13
|
const getNavBarConfigData = () => {
|
|
13
14
|
const { statusBarHeight } = wx.getSystemInfoSync();
|
|
14
15
|
const { right, width, height = 0, top } = wx.getMenuButtonBoundingClientRect(); // 插件下基础库2.15.0起支持
|
|
16
|
+
const embedded = wx.getEnterOptionsSync().apiCategory === 'embedded'; // 是否半屏模式拉起小程序
|
|
15
17
|
return {
|
|
16
18
|
enable: true,
|
|
17
|
-
statusBarHeight, // 顶部状态栏高度
|
|
18
|
-
navBarHeight: height + ((top - statusBarHeight) * 2), // 小程序导航栏高度
|
|
19
|
+
statusBarHeight: embedded ? 0 : statusBarHeight, // 顶部状态栏高度
|
|
20
|
+
navBarHeight: embedded ? (height + (7 * 2)) : (height + ((top - statusBarHeight) * 2)), // 小程序导航栏高度
|
|
19
21
|
menuTop: top, // 菜单按钮上边距
|
|
20
22
|
menuRight: right, // 菜单按钮右边距离屏幕左边缘的距离
|
|
21
23
|
menuWidth: width, // 菜单按钮宽度
|