@zfqh/uniapp 0.2.6 → 0.2.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 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.8](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.7...@zfqh/uniapp@0.2.8) (2026-06-24)
7
+
8
+ **Note:** Version bump only for package @zfqh/uniapp
9
+
10
+
11
+
12
+
13
+
14
+ ## [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)
15
+
16
+ **Note:** Version bump only for package @zfqh/uniapp
17
+
18
+
19
+
20
+
21
+
6
22
  ## [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
23
 
8
24
  **Note:** Version bump only for package @zfqh/uniapp
@@ -2,7 +2,6 @@ import api from '../configs/api';
2
2
  import app from '../configs/app';
3
3
  import { createRequest, createInterceptors } from '../utils/request';
4
4
  import { LANGUAGE } from '../utils/consts';
5
- import { defaultLocale } from '../utils/locale';
6
5
  import query from '../utils/query';
7
6
  import http from '@gmcb/uv-ui/libs/function/http';
8
7
  http.interceptors.request.use((conf) => {
@@ -10,7 +9,7 @@ http.interceptors.request.use((conf) => {
10
9
  if (store) {
11
10
  const { tenantId } = store.state.login?.info || {};
12
11
  const header = {
13
- 'X-Language': LANGUAGE[defaultLocale],
12
+ 'X-Language': LANGUAGE[query.locale || uni.getLocale()],
14
13
  'Tenant-Id': tenantId || 1,
15
14
  Channel: query.channel || app.channel,
16
15
  };
@@ -1,4 +1,12 @@
1
1
  declare const _default: {
2
+ mixins: {
3
+ data(): {
4
+ pageShow: boolean;
5
+ };
6
+ onShow(): void;
7
+ onHide(): void;
8
+ onUnload(): void;
9
+ }[];
2
10
  data(): {
3
11
  shareData: {};
4
12
  params: {};
@@ -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: {},
@@ -34,6 +36,7 @@ export default {
34
36
  channel: app.channel,
35
37
  platform: PLATFORM_CODE,
36
38
  safeBottom: SYSTEM_INFO.safeAreaInsets.bottom,
39
+ locale: uni.$i18n?.global?.locale,
37
40
  };
38
41
  if (query.primary) {
39
42
  if (String(query.primary).startsWith('#')) {
@@ -223,29 +226,31 @@ export default {
223
226
  // #ifdef H5
224
227
  if (!IS_WEBVIEW_ENV) {
225
228
  this.__onWindowMessage = (e) => {
226
- try {
227
- if (e.data.type === 'WEBVIEW_APP_MESSAGE') {
228
- this.onMessage({ detail: { data: [e.data.data] } });
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
- }
229
+ if (this.pageShow) {
230
+ try {
231
+ if (e.data.type === 'WEBVIEW_APP_MESSAGE') {
232
+ this.onMessage({ detail: { data: [e.data.data] } });
239
233
  }
240
- if (this.__iframe) {
241
- const { name, arg } = e.data.data || {};
242
- if (['navigateTo', 'redirectTo', 'reLaunch', 'switchTab', 'navigateBack'].includes(name)) {
243
- uni[name](arg);
234
+ else if (e.data.type === 'WEB_INVOKE_APPSERVICE') {
235
+ // webview页面自定义iframe,嵌套页面中调用uni.webView[xx](),必须实现如下功能,否则无效
236
+ if (this.__iframe == null) {
237
+ if (this.$el.tagName === 'IFRAME' || this.$el.querySelector?.('iframe')) {
238
+ this.__iframe = true;
239
+ }
240
+ else {
241
+ this.__iframe = false;
242
+ }
243
+ }
244
+ if (this.__iframe) {
245
+ const { name, arg } = e.data.data || {};
246
+ if (['navigateTo', 'redirectTo', 'reLaunch', 'switchTab', 'navigateBack'].includes(name)) {
247
+ uni[name](arg);
248
+ }
244
249
  }
245
250
  }
246
251
  }
252
+ catch (e) { }
247
253
  }
248
- catch (e) { }
249
254
  };
250
255
  window.addEventListener('message', this.__onWindowMessage);
251
256
  }
@@ -1,5 +1,5 @@
1
1
  import { I18nOptions } from 'vue-i18n';
2
- export declare const defaultLocale: string;
2
+ export declare const defaultLocale: any;
3
3
  export declare const fallbackLocale = "zh-Hans";
4
4
  export declare function createI18n(opts: I18nOptions): import("vue-i18n").I18n<import("vue-i18n").LocaleMessages<import("vue-i18n").VueMessageType>, import("vue-i18n").IntlDateTimeFormats, import("vue-i18n").IntlNumberFormats, boolean>;
5
5
  export declare function getLocaleMessage(key: string): string;
@@ -1,5 +1,6 @@
1
1
  import { createI18n as _createI18n } from 'vue-i18n';
2
- export const defaultLocale = uni.getLocale();
2
+ import query from './query';
3
+ export const defaultLocale = query.locale || uni.getLocale();
3
4
  export const fallbackLocale = 'zh-Hans';
4
5
  export function createI18n(opts) {
5
6
  const i18n = _createI18n(opts);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zfqh/uniapp",
3
- "version": "0.2.6",
3
+ "version": "0.2.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": "d2abc06f15cf1915b7c24dd3006360a49ab5752c"
49
+ "gitHead": "22cb223cffcd4193053f42828dbb39eaa952888f"
50
50
  }