feat: 版本更新、列表记录数量取值、

This commit is contained in:
2026-06-12 17:08:16 +08:00
parent 795de5ff62
commit fd282413d8
5 changed files with 206 additions and 25 deletions
+20 -1
View File
@@ -256,6 +256,20 @@ export const downloadAndOpenApk = async (url, { progress } = {}) => {
}
try {
const tempFilePath = await downloadFileWithProgress(url, { progress, stageText: '下载中...' })
const isAppPlus = typeof plus !== 'undefined' && !!plus?.runtime?.install
if (isAppPlus) {
if (progress?.set) progress.set(100, '安装中...')
await new Promise((resolve, reject) => {
plus.runtime.install(
tempFilePath,
{},
() => resolve(),
(e) => reject(e),
)
})
if (progress?.hide) progress.hide()
return
}
if (progress?.hide) progress.hide()
uni.showToast({ title: '下载成功', icon: 'success' })
uni.saveFile({
@@ -266,7 +280,12 @@ export const downloadAndOpenApk = async (url, { progress } = {}) => {
})
} catch (e) {
if (progress?.hide) progress.hide()
uni.showToast({ title: '下载失败,请检查网络', icon: 'none' })
uni.showModal({
title: '失败提示',
content: String(e?.message || e?.code || e || '安装失败'),
showCancel: false,
confirmColor: 'var(--color2)',
})
}
}