diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 1ae75d9c..6c562829 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -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) } } diff --git a/entry/src/main/ets/pages/UserInfo.ets b/entry/src/main/ets/pages/UserInfo.ets index 58c418cd..e3e74f10 100644 --- a/entry/src/main/ets/pages/UserInfo.ets +++ b/entry/src/main/ets/pages/UserInfo.ets @@ -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 () => {