@zfqh/uniapp 0.3.6 → 0.3.8
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 +6 -1
- package/lib/modules/dict.js +2 -2
- package/lib/utils/consts.d.ts +2 -0
- package/lib/utils/consts.js +2 -0
- package/lib/utils/permit.js +10 -1
- 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.3.8](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.3.7...@zfqh/uniapp@0.3.8) (2026-07-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @zfqh/uniapp
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.3.7](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.3.6...@zfqh/uniapp@0.3.7) (2026-07-28)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @zfqh/uniapp
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [0.3.6](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.3.5...@zfqh/uniapp@0.3.6) (2026-07-16)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @zfqh/uniapp
|
package/lib/mixins/webview.js
CHANGED
|
@@ -2,7 +2,7 @@ import Url from 'url-parse';
|
|
|
2
2
|
import { stringify, parse } from 'qs';
|
|
3
3
|
import { PLATFORM_CODE, IS_WEBVIEW_ENV, SYSTEM_INFO, TYPES } from '../utils/consts';
|
|
4
4
|
import app from '../configs/app';
|
|
5
|
-
import { requestPermission } from '../utils/permit';
|
|
5
|
+
import { requestPermission, openAuthorizeSetting } from '../utils/permit';
|
|
6
6
|
import web from '../configs/web';
|
|
7
7
|
import cdn from '../configs/cdn';
|
|
8
8
|
import link from '../configs/link';
|
|
@@ -97,6 +97,11 @@ export default {
|
|
|
97
97
|
}
|
|
98
98
|
break;
|
|
99
99
|
}
|
|
100
|
+
case TYPES.MESSAGE.PERM_LOCATION:
|
|
101
|
+
case TYPES.MESSAGE.PERM_BLUETOOTH: {
|
|
102
|
+
openAuthorizeSetting(payload.name);
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
100
105
|
case TYPES.MESSAGE.GET_LOCATION:
|
|
101
106
|
case TYPES.MESSAGE.OPEN_LOCATION: {
|
|
102
107
|
const type = TYPES.MESSAGE.GET_LOCATION || TYPES.MESSAGE.OPEN_LOCATION;
|
package/lib/modules/dict.js
CHANGED
|
@@ -20,12 +20,12 @@ const store = {
|
|
|
20
20
|
const enums = {};
|
|
21
21
|
const values = [];
|
|
22
22
|
const labels = [];
|
|
23
|
-
const items = e.data.map(({ label, value }) => {
|
|
23
|
+
const items = e.data.map(({ label, value, ...rest }) => {
|
|
24
24
|
values.push(value);
|
|
25
25
|
labels.push(label);
|
|
26
26
|
enums[label] = value;
|
|
27
27
|
enums[value] = label;
|
|
28
|
-
return { label, value };
|
|
28
|
+
return { label, value, ...rest };
|
|
29
29
|
});
|
|
30
30
|
commit('setDictInfo', {
|
|
31
31
|
[name]: {
|
package/lib/utils/consts.d.ts
CHANGED
|
@@ -46,6 +46,8 @@ export declare const TYPES: {
|
|
|
46
46
|
readonly WEBVIEW_MESSAGE: "WEBVIEW_MESSAGE";
|
|
47
47
|
readonly APP_RESTART: "APP_RESTART";
|
|
48
48
|
readonly APP_INSTALL: "APP_INSTALL";
|
|
49
|
+
readonly PERM_LOCATION: "PERM_LOCATION";
|
|
50
|
+
readonly PERM_BLUETOOTH: "PERM_BLUETOOTH";
|
|
49
51
|
};
|
|
50
52
|
readonly STORAGE: {
|
|
51
53
|
readonly APP: "app";
|
package/lib/utils/consts.js
CHANGED
package/lib/utils/permit.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import color from '../configs/color';
|
|
2
|
-
import { SYSTEM_INFO } from './consts';
|
|
2
|
+
import { SYSTEM_INFO, IS_WEBVIEW_ENV, TYPES } from './consts';
|
|
3
|
+
import { postMessage } from './index';
|
|
3
4
|
// #ifdef APP
|
|
4
5
|
import permission from './permission';
|
|
5
6
|
// #endif
|
|
@@ -76,6 +77,14 @@ const requestMpPermission = async (scope) => {
|
|
|
76
77
|
};
|
|
77
78
|
// #endif
|
|
78
79
|
export function openAuthorizeSetting(name) {
|
|
80
|
+
// #ifdef H5
|
|
81
|
+
if (IS_WEBVIEW_ENV) {
|
|
82
|
+
postMessage({
|
|
83
|
+
type: name === 'location' ? TYPES.MESSAGE.PERM_LOCATION : TYPES.MESSAGE.PERM_BLUETOOTH,
|
|
84
|
+
payload: { name },
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
// #endif
|
|
79
88
|
// #ifdef APP
|
|
80
89
|
if (SYSTEM_INFO.platform == 'ios') {
|
|
81
90
|
plus.runtime.openURL('app-settings://');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zfqh/uniapp",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
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": "63f20fe9369c21bdbfb5b650e3b4596aca30a7d1"
|
|
50
50
|
}
|