Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
hello uni-app x
提交
8437c963
H
hello uni-app x
项目概览
DCloud
/
hello uni-app x
通知
5995
Star
90
Fork
162
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hello uni-app x
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
8437c963
编写于
1月 04, 2024
作者:
D
DCloud_LXH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 升级 uni-upgrade-center 至 0.7.8
上级
d8a6ba74
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
21 addition
and
154 deletion
+21
-154
uni_modules/uni-upgrade-center-app/changelog.md
uni_modules/uni-upgrade-center-app/changelog.md
+6
-0
uni_modules/uni-upgrade-center-app/components/uni-upgrade-center-app/uni-upgrade-center-app.uvue
...onents/uni-upgrade-center-app/uni-upgrade-center-app.uvue
+5
-60
uni_modules/uni-upgrade-center-app/package.json
uni_modules/uni-upgrade-center-app/package.json
+2
-2
uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue
uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue
+5
-3
uni_modules/uts-progressNotification/changelog.md
uni_modules/uts-progressNotification/changelog.md
+2
-0
uni_modules/uts-progressNotification/package.json
uni_modules/uts-progressNotification/package.json
+1
-1
uni_modules/uts-progressNotification/utssdk/app-ios/config.json
...dules/uts-progressNotification/utssdk/app-ios/config.json
+0
-3
uni_modules/uts-progressNotification/utssdk/app-ios/index.uts
...modules/uts-progressNotification/utssdk/app-ios/index.uts
+0
-85
未找到文件。
uni_modules/uni-upgrade-center-app/changelog.md
浏览文件 @
8437c963
## 0.7.8(2024-01-04)
-
新增 移除无用代码
## 0.7.7(2024-01-04)
-
新增 uni-app x 项目中新增 @show 回调
## 0.7.6(2023-12-21)
-
修复 iOS使用升级中心云打包时报错(使用新版的
[
uts-progressNotification
](
https://ext.dcloud.net.cn/plugin?name=uts-progressNotification
)
插件,如果之前下载过请删除
`uts-progressNotification\utssdk\app-ios`
文件夹)
## 0.7.5(2023-12-12)
-
新增 通知栏进度条使用 uts-progressNotification 插件
-
新增 依赖 uni-installApk、uts-progressNotification。使用前要安装插件三方依赖
...
...
uni_modules/uni-upgrade-center-app/components/uni-upgrade-center-app/uni-upgrade-center-app.uvue
浏览文件 @
8437c963
...
...
@@ -67,63 +67,17 @@
import { UniUpgradeCenterResult, StoreListItem } from '../../utils/call-check-version'
import { openSchema } from '../../utils/utils.uts'
const localFilePathKey = 'UNI_ADMIN_UPGRADE_CENTER_LOCAL_FILE_PATH'
const platform_iOS = 'iOS';
const platform_Android = 'Android';
const requiredKey = ['version', 'url', 'type']
let downloadTask : DownloadTask | null = null;
let openSchemePromise: Promise<boolean> | null = null;
let notificationAbortDownload: boolean = false
/**
* 对比版本号,如需要,请自行修改判断规则
* 支持比对 ("3.0.0.0.0.1.0.1", "3.0.0.0.0.1") ("3.0.0.1", "3.0") ("3.1.1", "3.1.1.1") 之类的
* @param {Object} v1
* @param {Object} v2
* v1 > v2 return 1
* v1 < v2 return -1
* v1 == v2 return 0
*/
function compare(v1 : string = '0', v2 : string = '0') : number {
const v1_array = v1.split('.')
const v2_array = v2.split('.')
const minVersionLens = Math.min(v1.length, v2.length);
let result = 0;
for (let i = 0; i < minVersionLens; i++) {
const curV1 = parseInt(v1_array[i])
const curV2 = parseInt(v2_array[i])
if (curV1 > curV2) {
result = 1
break;
} else if (curV1 < curV2) {
result = -1
break;
}
}
if (result === 0 && (v1_array.length !== v2_array.length)) {
const v1BiggerThenv2 = v1_array.length > v2_array.length;
const maxLensVersion = v1BiggerThenv2 ? v1_array : v2_array;
for (let i = minVersionLens; i < maxLensVersion.length; i++) {
const curVersion = parseInt(maxLensVersion[i])
if (curVersion > 0) {
v1BiggerThenv2 ? result = 1 : result = -1
break;
}
}
}
return result;
}
export default {
emits: ['close'],
emits: ['close'
, 'show'
],
data() {
return {
shown: false,
showTabbar: false,
// 从之前下载安装
installForBeforeFilePath: '',
...
...
@@ -177,8 +131,6 @@
show(shown : boolean, localPackageInfo : UniUpgradeCenterResult | null) {
if (localPackageInfo === null) return;
uni.hideTabBar()?.then(_ => { this.showTabbar = true })?.catch(_ => { })
for (let key in localPackageInfo) {
if (requiredKey.indexOf(key) != -1 && localPackageInfo[key] === null) {
console.error(`参数 ${key} 必填,请检查后重试`)
...
...
@@ -195,6 +147,8 @@
this.version = localPackageInfo.version
this.store_list = localPackageInfo.store_list
this.shown = shown
this.$emit('show')
},
askAbortDownload() {
uni.showModal({
...
...
@@ -227,10 +181,6 @@
},
closePopup() {
this.shown = false
if (this.showTabbar) {
uni.showTabBar()?.then(_ => { })?.catch(_ => { })
}
this.downloadSuccess = false
this.downloading = false
this.downLoadPercent = 0
...
...
@@ -238,15 +188,11 @@
this.packageFileSize = 0
this.tempFilePath = ''
this.installing = false
;
this.installing = false
this.installed = false
this.showTabbar = false
if (this.needNotificationProgress) cancelNotificationProgress()
if (!notificationAbortDownload) this.$emit('close')
notificationAbortDownload = false
this.$emit('close')
},
updateApp() {
const checkStoreScheme = this.checkStoreScheme()
...
...
@@ -312,7 +258,6 @@
onClick: () => {
if (!this.downloadSuccess) {
this.askAbortDownload()
notificationAbortDownload = true
}
}
} as CreateNotificationProgressOptions)
...
...
uni_modules/uni-upgrade-center-app/package.json
浏览文件 @
8437c963
{
"id"
:
"uni-upgrade-center-app"
,
"displayName"
:
"升级中心 uni-upgrade-center - App"
,
"version"
:
"0.7.
5
"
,
"version"
:
"0.7.
8
"
,
"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"
:
"^3.
2.14
"
"HBuilderX"
:
"^3.
97
"
},
"dcloudext"
:
{
"sale"
:
{
...
...
uni_modules/uni-upgrade-center-app/pages/upgrade-popup.vue
浏览文件 @
8437c963
...
...
@@ -64,7 +64,9 @@
</template>
<
script
>
// #ifdef APP
import
{
createNotificationProgress
,
cancelNotificationProgress
,
finishNotificationProgress
}
from
'
@/uni_modules/uts-progressNotification
'
// #endif
const
localFilePathKey
=
'
UNI_ADMIN_UPGRADE_CENTER_LOCAL_FILE_PATH
'
const
platform_iOS
=
'
iOS
'
;
const
platform_Android
=
'
Android
'
;
...
...
@@ -187,16 +189,16 @@
return
this
.
type
===
'
wgt
'
},
isiOS
()
{
return
!
this
.
isWGT
?
this
.
platform
.
in
cludes
(
platform_iOS
)
:
false
;
return
!
this
.
isWGT
?
this
.
platform
.
in
dexOf
(
platform_iOS
)
!==
-
1
:
false
;
},
isAndroid
()
{
return
this
.
platform
.
in
cludes
(
platform_Android
)
return
this
.
platform
.
in
dexOf
(
platform_Android
)
!==
-
1
},
isAppStore
()
{
return
this
.
isiOS
||
(
!
this
.
isiOS
&&
!
this
.
isWGT
&&
this
.
url
.
indexOf
(
'
.apk
'
)
===
-
1
)
},
needNotificationProgress
()
{
return
this
.
isAndroid
&&
!
this
.
is_mandatory
return
this
.
platform
.
indexOf
(
platform_iOS
)
===
-
1
&&
!
this
.
is_mandatory
}
},
methods
:
{
...
...
uni_modules/uts-progressNotification/changelog.md
浏览文件 @
8437c963
## 1.0.8(2023-12-21)
去除app-ios目录
## 1.0.7(2023-12-11)
去除无用代码
## 1.0.6(2023-12-11)
...
...
uni_modules/uts-progressNotification/package.json
浏览文件 @
8437c963
{
"id"
:
"uts-progressNotification"
,
"displayName"
:
"uts-progressNotification"
,
"version"
:
"1.0.
7
"
,
"version"
:
"1.0.
8
"
,
"description"
:
"uts-progressNotification"
,
"keywords"
:
[
"uts-progressNotification"
...
...
uni_modules/uts-progressNotification/utssdk/app-ios/config.json
已删除
100644 → 0
浏览文件 @
d8a6ba74
{
"deploymentTarget"
:
"9"
}
\ No newline at end of file
uni_modules/uts-progressNotification/utssdk/app-ios/index.uts
已删除
100644 → 0
浏览文件 @
d8a6ba74
/**
* 引用 iOS 系统库,示例如下:
* import { UIDevice } from "UIKit";
* [可选实现,按需引入]
*/
/* 引入 interface.uts 文件中定义的变量 */
import { MyApiOptions, MyApiResult, MyApi, MyApiSync } from '../interface.uts';
/* 引入 unierror.uts 文件中定义的变量 */
import { MyApiFailImpl } from '../unierror';
/**
* 引入三方库
* [可选实现,按需引入]
*
* 在 iOS 平台引入三方库有以下两种方式:
* 1、通过引入三方库framework 或者.a 等方式,需要将 .framework 放到 ./Frameworks 目录下,将.a 放到 ./Libs 目录下。更多信息[详见](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html#ios-平台原生配置)
* 2、通过 cocoaPods 方式引入,将要引入的 pod 信息配置到 config.json 文件下的 dependencies-pods 字段下。详细配置方式[详见](https://uniapp.dcloud.net.cn/plugin/uts-ios-cocoapods.html)
*
* 在通过上述任意方式依赖三方库后,使用时需要在文件中 import:
* 示例:import { LottieLoopMode } from 'Lottie'
*/
/**
* UTSiOS 为平台内置对象,不需要 import 可直接调用其API,[详见](https://uniapp.dcloud.net.cn/uts/utsios.html)
*/
/**
* 异步方法
*
* uni-app项目中(vue/nvue)调用示例:
* 1、引入方法声明 import { myApi } from "@/uni_modules/uts-api"
* 2、方法调用
* myApi({
* paramA: false,
* complete: (res) => {
* console.log(res)
* }
* });
*
*/
export const myApi : MyApi = function (options : MyApiOptions) {
if (options.paramA == true) {
// 返回数据
const res : MyApiResult = {
fieldA: 85,
fieldB: true,
fieldC: 'some message'
};
options.success?.(res);
options.complete?.(res);
} else {
// 返回错误
let failResult = new MyApiFailImpl(9010001);
options.fail?.(failResult)
options.complete?.(failResult)
}
}
/**
* 同步方法
*
* uni-app项目中(vue/nvue)调用示例:
* 1、引入方法声明 import { myApiSync } from "@/uni_modules/uts-api"
* 2、方法调用
* myApiSync(true);
*
*/
export const myApiSync : MyApiSync = function (paramA : boolean) : MyApiResult {
// 返回数据,根据插件功能获取实际的返回值
const res : MyApiResult = {
fieldA: 85,
fieldB: paramA,
fieldC: 'some message'
};
return res;
}
/**
* 更多插件开发的信息详见:https://uniapp.dcloud.net.cn/plugin/uts-plugin.html
*/
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录