提交 5d9b130e 编写于 作者: D DCloud_LXH

feat: 更新升级中心插件

上级 e303f016
## 0.8.1(2024-04-28)
- 修复 在 HX 4.0.3+ uni-app x 项目运行到 Android 调不起安装的Bug
## 0.8.0(2024-04-15)
- 修复 更新弹窗 data 中新增初始化字段
## 0.7.9(2024-03-15)
- 移除无用代码
- 调整 is_silently 类型为可为 null
## 0.7.8(2024-01-04) ## 0.7.8(2024-01-04)
- 新增 移除无用代码 - 新增 移除无用代码
## 0.7.7(2024-01-04) ## 0.7.7(2024-01-04)
......
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</template> </template>
<script> <script>
import { openSchema as utsOpenSchema } from '@/uni_modules/uts-openSchema' import { openSchema as utsOpenSchema } from '@/uni_modules/uts-openSchema'
import { createNotificationProgress, cancelNotificationProgress, finishNotificationProgress } from '@/uni_modules/uts-progressNotification' import { createNotificationProgress, cancelNotificationProgress, finishNotificationProgress } from '@/uni_modules/uts-progressNotification'
import { type CreateNotificationProgressOptions, type FinishNotificationProgressOptions } from '@/uni_modules/uts-progressNotification/utssdk/interface.uts' import { type CreateNotificationProgressOptions, type FinishNotificationProgressOptions } from '@/uni_modules/uts-progressNotification/utssdk/interface.uts'
import { UniUpgradeCenterResult, StoreListItem } from '../../utils/call-check-version' import { UniUpgradeCenterResult, StoreListItem } from '../../utils/call-check-version'
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
let downloadTask : DownloadTask | null = null; let downloadTask : DownloadTask | null = null;
let openSchemePromise: Promise<boolean> | null = null; let openSchemePromise: Promise<boolean> | null = null;
const openSchema = (url: string): Promise<boolean> => new Promise<boolean>((resolve,reject) =>{ const openSchema = (url: string): Promise<boolean> => new Promise<boolean>((resolve,reject) =>{
try{ try{
utsOpenSchema(url) utsOpenSchema(url)
resolve(true) resolve(true)
......
{ {
"id": "uni-upgrade-center-app", "id": "uni-upgrade-center-app",
"displayName": "升级中心 uni-upgrade-center - App", "displayName": "升级中心 uni-upgrade-center - App",
"version": "0.7.8", "version": "0.8.1",
"description": "uni升级中心 - 客户端检查更新", "description": "uni升级中心 - 客户端检查更新",
"keywords": [ "keywords": [
"uniCloud", "uniCloud",
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
], ],
"repository": "https://gitee.com/dcloud/uni-upgrade-center/tree/master/uni_modules/uni-upgrade-center-app", "repository": "https://gitee.com/dcloud/uni-upgrade-center/tree/master/uni_modules/uni-upgrade-center-app",
"engines": { "engines": {
"HBuilderX": "^3.97" "HBuilderX": "^4.03"
}, },
"dcloudext": { "dcloudext": {
"sale": { "sale": {
...@@ -43,7 +43,8 @@ ...@@ -43,7 +43,8 @@
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "y", "tcb": "y",
"aliyun": "y" "aliyun": "y",
"alipay": "y"
}, },
"client": { "client": {
"App": { "App": {
......
...@@ -139,7 +139,11 @@ ...@@ -139,7 +139,11 @@
// 默认安装包信息 // 默认安装包信息
title: '更新日志', title: '更新日志',
contents: '', contents: '',
version: '',
is_mandatory: false, is_mandatory: false,
url: '',
platform: [],
store_list: null,
// 可自定义属性 // 可自定义属性
subTitle: '发现新版本', subTitle: '发现新版本',
......
...@@ -18,7 +18,7 @@ export type UniUpgradeCenterResult = { ...@@ -18,7 +18,7 @@ export type UniUpgradeCenterResult = {
uni_platform : string // "android" | "ios" // 版本号 1.0.0 uni_platform : string // "android" | "ios" // 版本号 1.0.0
stable_publish : boolean // 是否是稳定版 stable_publish : boolean // 是否是稳定版
is_mandatory : boolean // 是否强制更新 is_mandatory : boolean // 是否强制更新
is_silently : boolean // 是否静默更新 is_silently : boolean | null // 是否静默更新
create_env : string // "upgrade-center" create_env : string // "upgrade-center"
create_date : number create_date : number
message : string message : string
...@@ -77,7 +77,6 @@ export default function () : Promise<UniUpgradeCenterResult> { ...@@ -77,7 +77,6 @@ export default function () : Promise<UniUpgradeCenterResult> {
name: 'uni-upgrade-center', name: 'uni-upgrade-center',
data: data data: data
}).then(res => { }).then(res => {
console.log('res: ',res);
const code = res.result['code'] const code = res.result['code']
const codeIsNumber = ['Int', 'Long', 'number'].includes(typeof code) const codeIsNumber = ['Int', 'Long', 'number'].includes(typeof code)
if (codeIsNumber) { if (codeIsNumber) {
...@@ -86,7 +85,7 @@ export default function () : Promise<UniUpgradeCenterResult> { ...@@ -86,7 +85,7 @@ export default function () : Promise<UniUpgradeCenterResult> {
code: res.result['code'], code: res.result['code'],
message: res.result['message'] message: res.result['message']
}) })
} else if (code < 0) { } else if ((code as number) < 0) {
reject({ reject({
code: res.result['code'], code: res.result['code'],
message: res.result['message'] message: res.result['message']
......
## 1.1.0(2024-03-08)
修复uniapp打包报错问题
## 1.0.9(2024-02-29) ## 1.0.9(2024-02-29)
去除代码过时警告 去除代码过时警告
## 1.0.8(2023-12-21) ## 1.0.8(2023-12-21)
......
{ {
"id": "uts-progressNotification", "id": "uts-progressNotification",
"displayName": "uts-progressNotification", "displayName": "uts-progressNotification",
"version": "1.0.9", "version": "1.1.0",
"description": "uts-progressNotification", "description": "uts-progressNotification",
"keywords": [ "keywords": [
"uts-progressNotification" "uts-progressNotification"
......
...@@ -4,7 +4,7 @@ import Build from 'android.os.Build'; ...@@ -4,7 +4,7 @@ import Build from 'android.os.Build';
import View from 'android.view.View'; import View from 'android.view.View';
import Color from 'android.graphics.Color'; import Color from 'android.graphics.Color';
import WindowManager from 'android.view.WindowManager'; import WindowManager from 'android.view.WindowManager';
import { globalNotificationProgressFinishCallBack, globalNotificationProgressCallBack } from './index.uts'; import { globalNotificationProgressFinishCallBack, globalNotificationProgressCallBack } from './callbacks.uts';
import { ACTION_DOWNLOAD_FINISH, ACTION_DOWNLOAD_PROGRESS } from "./constant.uts" import { ACTION_DOWNLOAD_FINISH, ACTION_DOWNLOAD_PROGRESS } from "./constant.uts"
......
...@@ -8,7 +8,8 @@ import ComponentName from 'android.content.ComponentName'; ...@@ -8,7 +8,8 @@ import ComponentName from 'android.content.ComponentName';
import PendingIntent from 'android.app.PendingIntent'; import PendingIntent from 'android.app.PendingIntent';
import { CreateNotificationProgressOptions, FinishNotificationProgressOptions } from '../interface.uts'; import { CreateNotificationProgressOptions, FinishNotificationProgressOptions } from '../interface.uts';
import { ACTION_DOWNLOAD_FINISH, ACTION_DOWNLOAD_PROGRESS } from "./constant.uts" import { ACTION_DOWNLOAD_FINISH, ACTION_DOWNLOAD_PROGRESS } from "./constant.uts"
import { globalNotificationProgressFinishCallBack, globalNotificationProgressCallBack } from './callbacks.uts';
export { TransparentActivity } from './TransparentActivity.uts'; export { TransparentActivity } from './TransparentActivity.uts';
...@@ -26,8 +27,7 @@ let histroyProgress = 0 ...@@ -26,8 +27,7 @@ let histroyProgress = 0
let isProgress = false let isProgress = false
export let globalNotificationProgressCallBack : (() => void) | null = () => { }
export let globalNotificationProgressFinishCallBack = () => { }
export function createNotificationProgress(options : CreateNotificationProgressOptions) : void { export function createNotificationProgress(options : CreateNotificationProgressOptions) : void {
const { content, progress, onClick } = options const { content, progress, onClick } = options
...@@ -156,4 +156,4 @@ function getAppName(context : Context) : string { ...@@ -156,4 +156,4 @@ function getAppName(context : Context) : string {
e.printStackTrace() e.printStackTrace()
} }
return appName return appName
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册