my-uniapp-tools 1.0.3 → 1.0.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-uniapp-tools",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "main": "src/index.js",
5
5
  "type": "module",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -12,7 +12,3 @@ export * from './system'
12
12
 
13
13
  // 本地存储相关
14
14
  export * from './localStorage'
15
-
16
-
17
- // 其他工具函数
18
- export * from './utils'
@@ -149,12 +149,12 @@ export const getStatusBarHeight = () => {
149
149
  export const getMenuButtonBoundingClientRect = () => {
150
150
  try {
151
151
  const platform = getPlatform();
152
-
152
+
153
153
  // 只有在小程序平台才执行getMenuButtonBoundingClientRect
154
154
  if (platform === 'weixin' || platform === 'alipay') {
155
155
  return uni.getMenuButtonBoundingClientRect();
156
156
  }
157
-
157
+
158
158
  // 非小程序平台返回null
159
159
  return null;
160
160
  } catch (error) {
@@ -173,7 +173,7 @@ export const getNavHeight = () => {
173
173
  // 获取状态栏高度
174
174
  const statusBarHeight = getStatusBarHeight();
175
175
  const platform = getPlatform();
176
-
176
+
177
177
  // 小程序平台:状态栏高度 + 菜单按钮高度
178
178
  if (platform === 'weixin' || platform === 'alipay') {
179
179
  const menuButtonInfo = getMenuButtonBoundingClientRect();
@@ -183,17 +183,17 @@ export const getNavHeight = () => {
183
183
  return navHeight;
184
184
  }
185
185
  }
186
-
186
+
187
187
  // App和H5平台:使用默认导航栏高度
188
- const defaultNavHeight = 44; // 默认导航栏高度
188
+ const defaultNavHeight = 0; // 默认导航栏高度
189
189
  const totalHeight = statusBarHeight + defaultNavHeight;
190
190
  console.log(`🚀 ~ ${platform}平台导航栏高度:`, totalHeight);
191
-
191
+
192
192
  return totalHeight;
193
193
  } catch (error) {
194
194
  console.error('获取导航栏高度失败:', error);
195
195
  // 返回默认高度(状态栏高度 + 44px 默认导航栏高度)
196
- return getStatusBarHeight() + 44;
196
+ return getStatusBarHeight() + 0;
197
197
  }
198
198
  }
199
199