@zfqh/uniapp 0.2.22 → 0.2.24

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/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
- ## [0.2.22](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.21...@zfqh/uniapp@0.2.22) (2026-06-27)
6
+ ## [0.2.24](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.23...@zfqh/uniapp@0.2.24) (2026-06-28)
7
7
 
8
8
  **Note:** Version bump only for package @zfqh/uniapp
9
9
 
@@ -11,6 +11,23 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
11
11
 
12
12
 
13
13
 
14
+ ## [0.2.23](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.22...@zfqh/uniapp@0.2.23) (2026-06-28)
15
+
16
+ **Note:** Version bump only for package @zfqh/uniapp
17
+
18
+
19
+
20
+
21
+
22
+
23
+ ## [0.2.22](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.21...@zfqh/uniapp@0.2.22) (2026-06-27)
24
+
25
+ **Note:** Version bump only for package @zfqh/uniapp
26
+
27
+
28
+
29
+
30
+
14
31
 
15
32
  ## [0.2.21](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.20...@zfqh/uniapp@0.2.21) (2026-06-26)
16
33
 
@@ -1,17 +1,45 @@
1
1
  import api from '../configs/api';
2
2
  import app from '../configs/app';
3
3
  import { createRequest, createInterceptors } from '../utils/request';
4
- import { LANGUAGE } from '../utils/consts';
4
+ import { LANGUAGE, SYSTEM_INFO } from '../utils/consts';
5
5
  import query from '../utils/query';
6
6
  import http from '@gmcb/uv-ui/libs/function/http';
7
7
  http.interceptors.request.use((conf) => {
8
8
  const store = uni.$store;
9
9
  if (store) {
10
10
  const { tenantId } = store.state.login?.info || {};
11
+ let channel = query.channel || app.channel;
12
+ let terminal = 0;
13
+ // #ifdef MP-WEIXIN
14
+ terminal = 10;
15
+ // #endif
16
+ // #ifdef APP
17
+ if (SYSTEM_INFO.platform === 'android') {
18
+ terminal = 32;
19
+ }
20
+ else if (SYSTEM_INFO.platform === 'ios') {
21
+ terminal = 31;
22
+ }
23
+ // #endif
24
+ // #ifdef H5
25
+ terminal = 20;
26
+ if (query.platform === 'mp') {
27
+ terminal = 10;
28
+ }
29
+ else if (query.platform === 'app') {
30
+ if (SYSTEM_INFO.platform === 'android') {
31
+ terminal = 32;
32
+ }
33
+ else if (SYSTEM_INFO.platform === 'ios') {
34
+ terminal = 31;
35
+ }
36
+ }
37
+ // #endif
11
38
  const header = {
12
39
  'X-Language': LANGUAGE[query.locale || uni.getLocale()],
13
40
  'Tenant-Id': tenantId || 1,
14
- Channel: query.channel || app.channel,
41
+ channel,
42
+ terminal,
15
43
  };
16
44
  conf.header = {
17
45
  ...header,
@@ -35,6 +35,7 @@ export default {
35
35
  app: app.code,
36
36
  channel: app.channel,
37
37
  platform: PLATFORM_CODE,
38
+ safeTop: SYSTEM_INFO.safeAreaInsets.top,
38
39
  safeBottom: SYSTEM_INFO.safeAreaInsets.bottom,
39
40
  locale: uni.$i18n?.global?.locale,
40
41
  };
@@ -5,11 +5,11 @@
5
5
  /* #ifndef APP-NVUE */
6
6
  @import './reset-vue.scss';
7
7
  @import './text-vue.scss';
8
- @import './layout-vue.scss';
8
+ @import './layout-vue.scss';
9
9
  @import './flex-vue.scss';
10
10
  /* #endif */
11
11
  /* #ifdef APP-NVUE */
12
- @import './text-nvue.scss';
12
+ @import './text-nvue.scss';
13
13
  @import './layout-nvue.scss';
14
14
  @import './flex-nvue.scss';
15
15
  /* #endif */
@@ -13,9 +13,9 @@
13
13
  word-break: break-all;
14
14
  }
15
15
  }
16
- .break-all {
17
- word-break: break-all;
18
- }
19
- .break-word {
20
- word-break: break-word;
16
+ .break-all {
17
+ word-break: break-all;
18
+ }
19
+ .break-word {
20
+ word-break: break-word;
21
21
  }
@@ -8,6 +8,17 @@ export const MENU_BUTTON = { height: 0, width: 0, top: 0, bottom: 0, left: 0 };
8
8
  Object.assign(MENU_BUTTON, uni.getMenuButtonBoundingClientRect());
9
9
  // #endif
10
10
  export const SYSTEM_INFO = Object.assign({}, uni.getWindowInfo(), uni.getDeviceInfo(), uni.getAppBaseInfo());
11
+ // #ifdef H5
12
+ const safeTop = Number(query.safeTop);
13
+ const safeBottom = Number(query.safeBottom);
14
+ if (safeTop > 0) {
15
+ SYSTEM_INFO.statusBarHeight = safeTop;
16
+ SYSTEM_INFO.safeAreaInsets.top = safeTop;
17
+ }
18
+ if (safeBottom) {
19
+ SYSTEM_INFO.safeAreaInsets.bottom = safeBottom;
20
+ }
21
+ // #endif
11
22
  // webview宿主环境
12
23
  export const WEBVIEW_ENV = {
13
24
  h5: false,
@@ -1,10 +1,11 @@
1
1
  interface Query {
2
2
  platform?: string;
3
+ channel?: string;
3
4
  token?: string;
4
5
  accessToken?: string;
5
6
  primary?: string;
6
- brand?: string;
7
7
  app?: string;
8
+ safeTop?: string | number;
8
9
  safeBottom?: string | number;
9
10
  tabbar?: string | number;
10
11
  [key: string]: any;
package/lib/utils/uni.js CHANGED
@@ -4,7 +4,7 @@ import { colorGradient } from '@gmcb/uv-ui/libs/function/colorGradient';
4
4
  import { app } from '../configs/app';
5
5
  import mp from '../configs/mp';
6
6
  import color from '../configs/color';
7
- import { IS_WEBVIEW_ENV, SYSTEM_INFO } from './consts';
7
+ import { IS_WEBVIEW_ENV } from './consts';
8
8
  import query from './query';
9
9
  // #ifndef H5
10
10
  uni.webView = uni;
@@ -96,14 +96,20 @@ uni.showAppFromBackground = true;
96
96
  });
97
97
  // #ifdef H5
98
98
  if (query) {
99
- // 给H5添加安全区域,需再url地址参数中添加safeBottom
100
- if (Number(query.safeBottom) > 0) {
101
- SYSTEM_INFO.safeAreaInsets.bottom = Number(query.safeBottom);
99
+ const safeTop = Number(query.safeTop);
100
+ const safeBottom = Number(query.safeBottom);
101
+ if (safeTop > 0 || safeBottom > 0) {
102
102
  const node = document.createElement('style');
103
103
  node.type = 'text/css';
104
- node.innerText = `
105
- .uv-safe-area-inset-bottom { padding-bottom: ${query.safeBottom}px; }
106
- `.trim();
104
+ const styles = [];
105
+ if (safeTop > 0) {
106
+ styles.push(`.uv-safe-area-inset-top { padding-top: ${safeTop}px; }`);
107
+ document.documentElement.style.setProperty('--status-bar-height', `${safeTop}px`);
108
+ }
109
+ if (safeBottom > 0) {
110
+ styles.push(`.uv-safe-area-inset-bottom { padding-bottom: ${safeBottom}px; }`);
111
+ }
112
+ node.innerText = styles.join('\n');
107
113
  document.body.append(node);
108
114
  }
109
115
  // 隐藏子应用tabbar,不传或者为空字符表示显式子应用tabbar
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zfqh/uniapp",
3
- "version": "0.2.22",
3
+ "version": "0.2.24",
4
4
  "description": "uniapp公共模块",
5
5
  "author": "yinjiazeng@163.com",
6
6
  "license": "MIT",
@@ -46,5 +46,5 @@
46
46
  "@types/qs": "^6.9.16",
47
47
  "@types/url-parse": "^1.4.11"
48
48
  },
49
- "gitHead": "88efb2bfd3a0ae8c05726a8efee46a3602cfb1a1"
49
+ "gitHead": "ed95ef16d9f6367fd1ba104d6ff8a8c805d307df"
50
50
  }
package/types/index.d.ts CHANGED
@@ -9,7 +9,7 @@ declare global {
9
9
  interface Uni extends UniTypes {
10
10
  $store: Store;
11
11
  $i18n: I18n;
12
- $uv: any;
12
+ $uv: any;
13
13
  webView: any;
14
14
  showAppFromBackground: boolean;
15
15
  getLocationCallback: {
@@ -22,9 +22,9 @@ declare global {
22
22
  }
23
23
 
24
24
  interface Window {
25
- __wxjs_environment: string;
26
- electron: any;
27
- versionName: string;
25
+ __wxjs_environment: string;
26
+ electron: any;
27
+ versionName: string;
28
28
  versionCode: number;
29
29
  }
30
30
  }