fix: 提交重启应用代码

This commit is contained in:
wangzhongjie 2025-10-28 17:22:38 +08:00
parent 198fa634fe
commit 46c3825c59
2 changed files with 24 additions and 7 deletions

View File

@ -427,12 +427,14 @@ struct Index {
const isRestart = await PreferenceUtils.getOtherModel("isRestart")
if (isRestart === "1") {
PreferenceUtils.writeOtherData("0", "isRestart")
router.pushUrl({
url: 'pages/UserInfo',
params: {
type: 1
}
}, router.RouterMode.Single);
setTimeout(() => {
router.pushUrl({
url: 'pages/UserInfo',
params: {
type: 1
}
}, router.RouterMode.Single);
}, 2000)
}
}

View File

@ -200,7 +200,7 @@ struct UserInfo {
}
async onPageShow() {
if (this.examCount > 2) {
if (this.examCount > 5) {
PreferenceUtils.writeOtherData("1", "isRestart")
this.cozyDialog.open()
// 延迟关闭
@ -1343,6 +1343,21 @@ struct UserInfo {
} else {
// Image($r('app.media.ksks_btn'))
// .commStyle()
// Button(){
// Text("add")
// }.width(100).height(30).onClick(()=>{
// this.examCount++
// if (this.examCount > 2) {
// PreferenceUtils.writeOtherData("1", "isRestart")
// this.cozyDialog.open()
// // 延迟关闭
// setTimeout(() => {
// this.cozyDialog.close()
// appRecovery.restartApp()
// }, 3000)
// }
//
// })
imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.ksks_btn') })
.margin({ bottom: 12 * this.ratio })
.onClick(async () => {