@zfqh/uniapp 0.2.4 → 0.2.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/CHANGELOG.md +8 -0
- package/lib/mixins/webview.d.ts +0 -1
- package/lib/mixins/webview.js +5 -7
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.5](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.4...@zfqh/uniapp@0.2.5) (2026-06-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @zfqh/uniapp
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [0.2.4](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.3...@zfqh/uniapp@0.2.4) (2026-06-23)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @zfqh/uniapp
|
package/lib/mixins/webview.d.ts
CHANGED
package/lib/mixins/webview.js
CHANGED
|
@@ -19,11 +19,8 @@ export default {
|
|
|
19
19
|
};
|
|
20
20
|
},
|
|
21
21
|
computed: {
|
|
22
|
-
loginInfo() {
|
|
23
|
-
return this.$store.state.login?.info || {};
|
|
24
|
-
},
|
|
25
22
|
queryString() {
|
|
26
|
-
const { accessToken, storeId, userId, tenantId, storeName, tenantName, nickName, username, } = this.
|
|
23
|
+
const { accessToken, storeId, userId, tenantId, storeName, tenantName, nickName, username, } = this.$store.state.login?.info || {};
|
|
27
24
|
const q = {
|
|
28
25
|
token: accessToken,
|
|
29
26
|
storeId,
|
|
@@ -134,15 +131,16 @@ export default {
|
|
|
134
131
|
try {
|
|
135
132
|
if (!this.__webView) {
|
|
136
133
|
// #ifdef H5
|
|
137
|
-
this.
|
|
134
|
+
const iframe = this.$el.parentNode?.querySelector('iframe') || document.querySelector('iframe');
|
|
135
|
+
this.__webView = iframe?.contentWindow;
|
|
138
136
|
this.__postMessage = (data) => {
|
|
139
|
-
this.__webView
|
|
137
|
+
this.__webView?.postMessage({ type: 'WEBVIEW_MESSAGE', data }, '*');
|
|
140
138
|
};
|
|
141
139
|
// #endif
|
|
142
140
|
// #ifdef APP-PLUS
|
|
143
141
|
this.__webView = this.$scope.$getAppWebview().children()[0];
|
|
144
142
|
this.__postMessage = (data) => {
|
|
145
|
-
this.__webView
|
|
143
|
+
this.__webView?.evalJS(`window.onmessage({ data: { type: 'WEBVIEW_MESSAGE', data: ${JSON.stringify(data)} } })`);
|
|
146
144
|
};
|
|
147
145
|
// #endif
|
|
148
146
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zfqh/uniapp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
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": "32175e636352128b9795ac2d7ade1d1f714d8896"
|
|
50
50
|
}
|