@zfqh/uniapp 0.2.18 → 0.2.19

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,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.19](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.18...@zfqh/uniapp@0.2.19) (2026-06-25)
7
+
8
+ **Note:** Version bump only for package @zfqh/uniapp
9
+
10
+
11
+
12
+
13
+
6
14
  ## [0.2.18](http://10.10.10.16/caoben/front-end/compare/@zfqh/uniapp@0.2.17...@zfqh/uniapp@0.2.18) (2026-06-25)
7
15
 
8
16
  **Note:** Version bump only for package @zfqh/uniapp
@@ -7,7 +7,7 @@ export interface VersionInfo {
7
7
  fileUrl: string;
8
8
  }
9
9
  export interface InstallOptions {
10
- appid: string;
10
+ appId: string;
11
11
  url: string;
12
12
  progress?: (p: number) => void;
13
13
  success?: () => void;
@@ -15,6 +15,6 @@ export interface InstallOptions {
15
15
  message: string;
16
16
  }) => void;
17
17
  }
18
- export declare function checkVersion(appid: string): Promise<VersionInfo | null>;
18
+ export declare function checkVersion(appId: string): Promise<VersionInfo | null>;
19
19
  export declare function installUpdate(options: InstallOptions): void;
20
20
  export declare function restartApp(): void;
@@ -7,13 +7,13 @@ import { getLastVersion } from '../apis/core';
7
7
  const { platform, brand } = SYSTEM_INFO;
8
8
  let _installMessageHandler = null;
9
9
  // #ifdef APP
10
- function appGetProperty(appid) {
10
+ function appGetProperty(appId) {
11
11
  return new Promise((resolve) => {
12
- if (appid === app.appId) {
12
+ if (appId === app.appId) {
13
13
  plus.runtime.getProperty(String(plus.runtime.appid), (res) => resolve(res));
14
14
  }
15
15
  else {
16
- plus.io.resolveLocalFileSystemURL(`_doc/${appid}/manifest.json`, (entry) => {
16
+ plus.io.resolveLocalFileSystemURL(`_doc/${appId}/manifest.json`, (entry) => {
17
17
  entry.file((file) => {
18
18
  const reader = new plus.io.FileReader();
19
19
  reader.onloadend = (e) => {
@@ -32,28 +32,27 @@ function appGetProperty(appid) {
32
32
  }
33
33
  // #endif
34
34
  // #ifdef H5
35
- function h5GetProperty(appid) {
35
+ function h5GetProperty(appId) {
36
36
  return new Promise((resolve) => {
37
- if (appid === app.appId) {
37
+ if (appId === app.appId) {
38
38
  resolve({ version: ver.name, versionCode: ver.code });
39
39
  }
40
40
  else if (window.electron) {
41
- window.electron.webUtils.getProperty(appid, (manifest) => resolve(manifest || {}));
41
+ window.electron.webUtils.getProperty(appId, (manifest) => resolve(manifest || {}));
42
42
  }
43
43
  });
44
44
  }
45
45
  // #endif
46
- export async function checkVersion(appid) {
46
+ export async function checkVersion(appId) {
47
47
  try {
48
48
  let version = 0;
49
- let packageName = appid;
50
49
  let data = null;
51
50
  // #ifdef APP
52
- data = await appGetProperty(appid);
51
+ data = await appGetProperty(appId);
53
52
  version = data.versionCode || 0;
54
53
  // #endif
55
54
  // #ifdef H5
56
- data = await h5GetProperty(appid);
55
+ data = await h5GetProperty(appId);
57
56
  version = data.versionCode || 0;
58
57
  // #endif
59
58
  let type = 1;
@@ -64,20 +63,20 @@ export async function checkVersion(appid) {
64
63
  // #endif
65
64
  const res = await getLastVersion({
66
65
  version,
67
- packageName,
66
+ appId,
68
67
  type,
69
68
  platform: { android: 1, ios: 2, windows: 4 }[platform],
70
69
  }, { custom: { message: false } });
71
70
  const lastVer = { ...res?.data };
72
71
  // #ifdef APP
73
- if (uni.$store?.state?.dict && platform === 'android' && appid === app.appId && env.key === 'prod') {
72
+ if (uni.$store?.state?.dict && platform === 'android' && appId === app.appId && env.key === 'prod') {
74
73
  await uni.$store.dispatch('getDictInfo', { name: 'group_relation', cache: true });
75
74
  if (uni.$store.state.dict.info.group_relation?.values?.includes(brand)) {
76
75
  lastVer.hotUpdateUrl = '';
77
76
  }
78
77
  }
79
78
  // #endif
80
- if (lastVer.status > 2 && Number(lastVer.version) > Number(version)) {
79
+ if (Number(lastVer.version) > Number(version)) {
81
80
  return lastVer;
82
81
  }
83
82
  return null;
@@ -87,14 +86,14 @@ export async function checkVersion(appid) {
87
86
  }
88
87
  }
89
88
  // #ifdef APP
90
- function appInstall({ appid, url, progress, success, fail }) {
89
+ function appInstall({ appId, url, progress, success, fail }) {
91
90
  const downloadTask = uni.downloadFile({
92
91
  url,
93
92
  success(res) {
94
93
  if (res.statusCode !== 200)
95
94
  return fail?.({ message: 'download failed' });
96
95
  progress?.(100);
97
- if (appid === app.appId) {
96
+ if (appId === app.appId) {
98
97
  plus.runtime.install(res.tempFilePath, { force: true }, success, fail);
99
98
  }
100
99
  else {
@@ -116,7 +115,7 @@ function h5Install(options) {
116
115
  postMessage({
117
116
  type: TYPES.MESSAGE.APP_INSTALL,
118
117
  payload: {
119
- appid: options.appid,
118
+ appId: options.appId,
120
119
  url: options.url,
121
120
  },
122
121
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zfqh/uniapp",
3
- "version": "0.2.18",
3
+ "version": "0.2.19",
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": "b3f0e4ae84dc3d2c971e9dc87bad839e6f9ae018"
49
+ "gitHead": "5c4b549af6bc65943179fb99ec1fb7e2641cd610"
50
50
  }