@zfqh/uniapp 0.2.23 → 0.2.25
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 +16 -0
- package/lib/mixins/webview.js +1 -0
- package/lib/utils/consts.js +11 -0
- package/lib/utils/query.d.ts +2 -1
- package/lib/utils/uni.js +13 -7
- package/lib/utils/update.js +6 -6
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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.25](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.24...@zfqh/uniapp@0.2.25) (2026-06-30)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @zfqh/uniapp
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [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)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @zfqh/uniapp
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [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)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @zfqh/uniapp
|
package/lib/mixins/webview.js
CHANGED
package/lib/utils/consts.js
CHANGED
|
@@ -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,
|
package/lib/utils/query.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
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/lib/utils/update.js
CHANGED
|
@@ -55,17 +55,17 @@ export async function checkVersion(appId) {
|
|
|
55
55
|
data = await h5GetProperty(appId);
|
|
56
56
|
version = data.versionCode || 0;
|
|
57
57
|
// #endif
|
|
58
|
-
let type =
|
|
59
|
-
|
|
60
|
-
if (IS_WEBVIEW_ENV) {
|
|
61
|
-
type =
|
|
58
|
+
let type = 3;
|
|
59
|
+
let plat;
|
|
60
|
+
if (!IS_WEBVIEW_ENV && appId === app.appId) {
|
|
61
|
+
type = 1;
|
|
62
|
+
plat = { android: '1', ios: '2', harmony: '3', windows: '4', macos: '5' }[platform];
|
|
62
63
|
}
|
|
63
|
-
// #endif
|
|
64
64
|
const res = await getLastVersion({
|
|
65
65
|
version,
|
|
66
66
|
appId,
|
|
67
67
|
type,
|
|
68
|
-
platform:
|
|
68
|
+
platform: plat,
|
|
69
69
|
}, { custom: { message: false } });
|
|
70
70
|
const lastVer = { ...res?.data };
|
|
71
71
|
// #ifdef APP
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zfqh/uniapp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.25",
|
|
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": "
|
|
49
|
+
"gitHead": "19e7ced0de35708094280ef2f75d1ab789e9e994"
|
|
50
50
|
}
|