剩余模块:生产入库,销售出库
This commit is contained in:
@@ -1,23 +1,3 @@
|
||||
## 0.9.5(2025-02-06)
|
||||
- 新增 完善下载失败时的处理逻辑
|
||||
## 0.9.4(2024-12-28)
|
||||
- 修复 腾讯云在使用扩展存储时报错的 Bug
|
||||
## 0.9.3(2024-12-23)
|
||||
- 修复 升级中心在大屏上的显示效果
|
||||
## 0.9.2(2024-11-06)
|
||||
- 更新 部分 ts 类型
|
||||
## 0.9.1(2024-11-01)
|
||||
- 更新 支持 HarmonyOS Next 设备整包更新、wgt 更新。需要 `HBuilderX 4.32+` [详情](https://doc.dcloud.net.cn/uniCloud/upgrade-center.html#uni-upgrade-center-app-harmonyos)
|
||||
## 0.9.0(2024-10-30)
|
||||
- **重要更新** 在 uni-app x 项目中弃用之前弹窗方案使用[dialogPage](https://doc.dcloud.net.cn/uni-app-x/api/dialog-page.html)实现,需要 `HBuilderX 4.31+`
|
||||
## 0.8.5(2024-10-26)
|
||||
- 优化 去除不必要代码
|
||||
## 0.8.4(2024-10-26)
|
||||
- 修复 uni-app x 项目升级到 4.31 alpha 后中间有空隙的Bug
|
||||
## 0.8.3(2024-07-31)
|
||||
- 修复 部分类型报错
|
||||
## 0.8.2(2024-07-15)
|
||||
- 更新 static 下的静态图片放入 static/app 目录下,防止编译除 app 平台以外的平台时带入
|
||||
## 0.8.1(2024-04-28)
|
||||
- 修复 在 HX 4.0.3+ uni-app x 项目运行到 Android 调不起安装的Bug
|
||||
## 0.8.0(2024-04-15)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "uni-upgrade-center-app",
|
||||
"displayName": "升级中心 uni-upgrade-center - App",
|
||||
"version": "0.9.5",
|
||||
"version": "0.8.1",
|
||||
"description": "uni升级中心 - 客户端检查更新",
|
||||
"keywords": [
|
||||
"uniCloud",
|
||||
@@ -11,7 +11,7 @@
|
||||
],
|
||||
"repository": "https://gitee.com/dcloud/uni-upgrade-center/tree/master/uni_modules/uni-upgrade-center-app",
|
||||
"engines": {
|
||||
"HBuilderX": "^4.31"
|
||||
"HBuilderX": "^4.03"
|
||||
},
|
||||
"dcloudext": {
|
||||
"sale": {
|
||||
@@ -35,6 +35,7 @@
|
||||
},
|
||||
"uni_modules": {
|
||||
"dependencies": [
|
||||
"uni-installApk",
|
||||
"uts-progressNotification",
|
||||
"uts-openSchema"
|
||||
],
|
||||
@@ -47,35 +48,33 @@
|
||||
},
|
||||
"client": {
|
||||
"App": {
|
||||
"app-vue": "y",
|
||||
"app-nvue": "y",
|
||||
"app-harmony": "u",
|
||||
"app-uvue": "y"
|
||||
"app-vue": "y",
|
||||
"app-nvue": "u"
|
||||
},
|
||||
"H5-mobile": {
|
||||
"Safari": "n",
|
||||
"Android Browser": "n",
|
||||
"微信浏览器(Android)": "n",
|
||||
"QQ浏览器(Android)": "n"
|
||||
"Safari": "y",
|
||||
"Android Browser": "y",
|
||||
"微信浏览器(Android)": "y",
|
||||
"QQ浏览器(Android)": "y"
|
||||
},
|
||||
"H5-pc": {
|
||||
"Chrome": "n",
|
||||
"IE": "n",
|
||||
"Edge": "n",
|
||||
"Firefox": "n",
|
||||
"Safari": "n"
|
||||
"Chrome": "y",
|
||||
"IE": "y",
|
||||
"Edge": "y",
|
||||
"Firefox": "y",
|
||||
"Safari": "y"
|
||||
},
|
||||
"小程序": {
|
||||
"微信": "n",
|
||||
"阿里": "n",
|
||||
"百度": "n",
|
||||
"字节跳动": "n",
|
||||
"QQ": "n",
|
||||
"京东": "n"
|
||||
"微信": "u",
|
||||
"阿里": "u",
|
||||
"百度": "u",
|
||||
"字节跳动": "u",
|
||||
"QQ": "u",
|
||||
"京东": "u"
|
||||
},
|
||||
"快应用": {
|
||||
"华为": "n",
|
||||
"联盟": "n"
|
||||
"华为": "u",
|
||||
"联盟": "u"
|
||||
},
|
||||
"Vue": {
|
||||
"vue2": "y",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,16 @@
|
||||
import callCheckVersion, { UniUpgradeCenterResult } from "./call-check-version"
|
||||
import { platform_iOS } from './utils'
|
||||
// #ifdef UNI-APP-X
|
||||
import { openSchema } from '@/uni_modules/uts-openSchema'
|
||||
// #endif
|
||||
|
||||
// 推荐再App.vue中使用
|
||||
const PACKAGE_INFO_KEY = '__package_info__'
|
||||
// #ifdef APP-HARMONY
|
||||
export default function (component?: any) : Promise<UniUpgradeCenterResult> {
|
||||
|
||||
// uni-app 项目无法从 vue 中导出 ComponentPublicInstance 类型,故使用条件编译
|
||||
// #ifdef UNI-APP-X
|
||||
export default function (component : ComponentPublicInstance | null = null) : Promise<UniUpgradeCenterResult> {
|
||||
// #endif
|
||||
// #ifndef APP-HARMONY
|
||||
// #ifndef UNI-APP-X
|
||||
export default function () : Promise<UniUpgradeCenterResult> {
|
||||
// #endif
|
||||
return new Promise<UniUpgradeCenterResult>((resolve, reject) => {
|
||||
@@ -18,13 +19,12 @@ export default function () : Promise<UniUpgradeCenterResult> {
|
||||
const code = uniUpgradeCenterResult.code
|
||||
const message = uniUpgradeCenterResult.message
|
||||
const url = uniUpgradeCenterResult.url // 安装包下载地址
|
||||
|
||||
// 此处逻辑仅为示例,可自行编写
|
||||
if (code > 0) {
|
||||
// 腾讯云获取下载链接
|
||||
if (/^cloud:\/\//.test(url)) {
|
||||
const tcbRes = await uniCloud.getTempFileURL({ fileList: [url] });
|
||||
if (typeof tcbRes.fileList[0].tempFileURL !== 'undefined') uniUpgradeCenterResult.url = tcbRes.fileList[0].tempFileURL;
|
||||
}
|
||||
// 腾讯云和阿里云下载链接不同,需要处理一下,阿里云会原样返回
|
||||
const tcbRes = await uniCloud.getTempFileURL({ fileList: [url] });
|
||||
if (typeof tcbRes.fileList[0].tempFileURL !== 'undefined') uniUpgradeCenterResult.url = tcbRes.fileList[0].tempFileURL;
|
||||
|
||||
/**
|
||||
* 提示升级一
|
||||
@@ -55,7 +55,6 @@ export default function () : Promise<UniUpgradeCenterResult> {
|
||||
* 官方适配的升级弹窗,可自行替换资源适配UI风格
|
||||
*/
|
||||
// #ifndef UNI-APP-X
|
||||
// #ifdef APP-PLUS
|
||||
uni.setStorageSync(PACKAGE_INFO_KEY, uniUpgradeCenterResult)
|
||||
uni.navigateTo({
|
||||
url: `/uni_modules/uni-upgrade-center-app/pages/upgrade-popup?local_storage_key=${PACKAGE_INFO_KEY}`,
|
||||
@@ -65,27 +64,8 @@ export default function () : Promise<UniUpgradeCenterResult> {
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
// #ifdef APP-HARMONY
|
||||
if (component) {
|
||||
component.show(true, uniUpgradeCenterResult)
|
||||
} else {
|
||||
reject({
|
||||
code: -1,
|
||||
message: '在 HarmonyOS Next 平台请传递组件使用'
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
// #endif
|
||||
// #ifdef UNI-APP-X
|
||||
uni.setStorageSync(PACKAGE_INFO_KEY, uniUpgradeCenterResult)
|
||||
uni.openDialogPage({
|
||||
url: `/uni_modules/uni-upgrade-center-app/pages/uni-app-x/upgrade-popup?local_storage_key=${PACKAGE_INFO_KEY}`,
|
||||
disableEscBack: true,
|
||||
fail: (err) => {
|
||||
console.error('更新弹框跳转失败', err)
|
||||
uni.removeStorageSync(PACKAGE_INFO_KEY)
|
||||
}
|
||||
})
|
||||
component?.$callMethod('show', true, uniUpgradeCenterResult)
|
||||
// #endif
|
||||
|
||||
return resolve(uniUpgradeCenterResult)
|
||||
@@ -115,7 +95,7 @@ function updateUseModal(packageInfo : UniUpgradeCenterResult) : void {
|
||||
} = packageInfo;
|
||||
|
||||
let isWGT = type === 'wgt'
|
||||
let isiOS = !isWGT ? platform.includes(platform_iOS) : false;
|
||||
let isiOS = !isWGT ? platform.includes('iOS') : false;
|
||||
|
||||
// #ifndef UNI-APP-X
|
||||
let confirmText = isiOS ? '立即跳转更新' : '立即下载更新'
|
||||
@@ -164,19 +144,7 @@ function updateUseModal(packageInfo : UniUpgradeCenterResult) : void {
|
||||
}, () => {
|
||||
if (is_mandatory) {
|
||||
//更新完重启app
|
||||
// #ifdef APP-PLUS
|
||||
plus.runtime.restart();
|
||||
// #endif
|
||||
// #ifdef APP-HARMONY
|
||||
uni.showModal({
|
||||
title: '安装成功',
|
||||
content: '请手动重启应用',
|
||||
showCancel: false,
|
||||
success: res => {
|
||||
plus.runtime.quit();
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
return;
|
||||
}
|
||||
uni.showModal({
|
||||
@@ -184,12 +152,7 @@ function updateUseModal(packageInfo : UniUpgradeCenterResult) : void {
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
//更新完重启app
|
||||
// #ifdef APP-PLUS
|
||||
plus.runtime.restart();
|
||||
// #endif
|
||||
// #ifdef APP-HARMONY
|
||||
plus.runtime.quit();
|
||||
// #endif
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -214,7 +177,7 @@ function updateUseModal(packageInfo : UniUpgradeCenterResult) : void {
|
||||
fail: err => {
|
||||
uni.showModal({
|
||||
title: '更新失败',
|
||||
content: err.errMsg,
|
||||
content: err.message,
|
||||
showCancel: false
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user