perf: 优化app新版本提示

This commit is contained in:
kuaifan 2024-11-05 10:27:57 +08:00
parent 5962a593da
commit 65c398880b
2 changed files with 25 additions and 2 deletions

View File

@ -62,6 +62,7 @@ export default {
routePath: null,
appInter: null,
countDown: Math.min(30, 60 - $A.daytz().second()),
lastCheckUpgradeYmd: $A.daytz().format('YYYY-MM-DD')
}
},
@ -331,6 +332,10 @@ export default {
this.autoTheme()
$A.updateTimezone()
$A.IDBTest()
if (this.lastCheckUpgradeYmd != $A.daytz().format('YYYY-MM-DD')) {
this.lastCheckUpgradeYmd = $A.daytz().format('YYYY-MM-DD')
$A.eeuiAppCheckUpdate();
}
}
//
window.__onPagePause = () => {
@ -434,8 +439,12 @@ export default {
//
$A.eeuiAppSetHapticBackEnabled(false)
//
$A.eeuiAppSetVariate("languageWebBrowser", this.$L("浏览器打开"))
$A.eeuiAppSetVariate("languageWebRefresh", this.$L("刷新"))
$A.eeuiAppSetCachesString("languageWebBrowser", this.$L("浏览器打开"))
$A.eeuiAppSetCachesString("languageWebRefresh", this.$L("刷新"))
$A.eeuiAppSetCachesString("updateDefaultTitle", this.$L("发现新版本"))
$A.eeuiAppSetCachesString("updateDefaultContent", this.$L("暂无更新介绍!"))
$A.eeuiAppSetCachesString("updateDefaultCancelText", this.$L("以后再说"))
$A.eeuiAppSetCachesString("updateDefaultUpdateText", this.$L("立即更新"))
},
otherEvents() {

View File

@ -156,6 +156,14 @@
})
},
// 检查更新
eeuiAppCheckUpdate() {
if (!$A.isEEUiApp) return;
$A.eeuiModule("eeui").then(obj => {
obj.checkUpdate();
})
},
// 获取主题名称 light|dark
eeuiAppGetThemeName() {
if (!$A.isEEUiApp) return;
@ -174,6 +182,12 @@
$A.eeuiModuleSync("eeui").setVariate(key, value);
},
// 设置缓存数据
eeuiAppSetCachesString(key, value, expired = 0) {
if (!$A.isEEUiApp) return;
$A.eeuiModuleSync("eeui").setCachesString(key, value, expired);
},
// 长按内容震动仅支持android、iOS无效
eeuiAppSetHapticBackEnabled(val) {
if (!$A.isEEUiApp) return;