@zfqh/uniapp 0.2.6 → 0.2.7
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 +8 -0
- package/lib/mixins/webview.js +22 -18
- 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.7](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.6...@zfqh/uniapp@0.2.7) (2026-06-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @zfqh/uniapp
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [0.2.6](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.5...@zfqh/uniapp@0.2.6) (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
|
@@ -8,7 +8,9 @@ import link from '../configs/link';
|
|
|
8
8
|
import path from '../configs/path';
|
|
9
9
|
import { base64ToPath } from '../utils/file';
|
|
10
10
|
import query from '../utils/query';
|
|
11
|
+
import show from './show';
|
|
11
12
|
export default {
|
|
13
|
+
mixins: [show],
|
|
12
14
|
data() {
|
|
13
15
|
return {
|
|
14
16
|
shareData: {},
|
|
@@ -223,29 +225,31 @@ export default {
|
|
|
223
225
|
// #ifdef H5
|
|
224
226
|
if (!IS_WEBVIEW_ENV) {
|
|
225
227
|
this.__onWindowMessage = (e) => {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
else if (e.data.type === 'WEB_INVOKE_APPSERVICE') {
|
|
231
|
-
// webview页面自定义iframe,嵌套页面中调用uni.webView[xx](),必须实现如下功能,否则无效
|
|
232
|
-
if (this.__iframe == null) {
|
|
233
|
-
if (this.$el.tagName === 'IFRAME' || this.$el.querySelector?.('iframe')) {
|
|
234
|
-
this.__iframe = true;
|
|
235
|
-
}
|
|
236
|
-
else {
|
|
237
|
-
this.__iframe = false;
|
|
238
|
-
}
|
|
228
|
+
if (this.pageShow) {
|
|
229
|
+
try {
|
|
230
|
+
if (e.data.type === 'WEBVIEW_APP_MESSAGE') {
|
|
231
|
+
this.onMessage({ detail: { data: [e.data.data] } });
|
|
239
232
|
}
|
|
240
|
-
if (
|
|
241
|
-
|
|
242
|
-
if (
|
|
243
|
-
|
|
233
|
+
else if (e.data.type === 'WEB_INVOKE_APPSERVICE') {
|
|
234
|
+
// webview页面自定义iframe,嵌套页面中调用uni.webView[xx](),必须实现如下功能,否则无效
|
|
235
|
+
if (this.__iframe == null) {
|
|
236
|
+
if (this.$el.tagName === 'IFRAME' || this.$el.querySelector?.('iframe')) {
|
|
237
|
+
this.__iframe = true;
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
this.__iframe = false;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (this.__iframe) {
|
|
244
|
+
const { name, arg } = e.data.data || {};
|
|
245
|
+
if (['navigateTo', 'redirectTo', 'reLaunch', 'switchTab', 'navigateBack'].includes(name)) {
|
|
246
|
+
uni[name](arg);
|
|
247
|
+
}
|
|
244
248
|
}
|
|
245
249
|
}
|
|
246
250
|
}
|
|
251
|
+
catch (e) { }
|
|
247
252
|
}
|
|
248
|
-
catch (e) { }
|
|
249
253
|
};
|
|
250
254
|
window.addEventListener('message', this.__onWindowMessage);
|
|
251
255
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zfqh/uniapp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
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": "2390fbfc7c075d7d96f7074553234ec0cfc7f669"
|
|
50
50
|
}
|