Browse Source

医网签页面

徐勤民 6 months ago
parent
commit
bd7ec970f3
1 changed files with 7 additions and 3 deletions
  1. 7 3
      src/main/ets/utils/ToolsHelper.ets

+ 7 - 3
src/main/ets/utils/ToolsHelper.ets

@@ -119,7 +119,7 @@ export class ToolsHelper {
    * 双击退出
    * @param msg
    */
-  static doubleAndExit() {
+  static doubleAndExit(event?:()=>void) {
     const cTime = new Date().getTime()
     console.log('=====>', cTime)
     console.log('=====>', cTime - ToolsHelper.oTime)
@@ -127,8 +127,12 @@ export class ToolsHelper {
       ToolsHelper.oTime = cTime
       ToolsHelper.showMessage('双击退出')
     } else {
-      // getContext().getApplicationContext().killAllProcesses();
-      (getContext() as common.UIAbilityContext).terminateSelf()
+      if (event) {
+        event()
+      }else{
+        (getContext() as common.UIAbilityContext).terminateSelf()
+        // getContext().getApplicationContext().killAllProcesses();
+      }
     }
     return true
   }