Browse Source

feat: 新增部分注释、 为弹窗添加节流

YuJing 2 weeks ago
parent
commit
1a33f72416

+ 6 - 0
commons/basic/src/main/ets/components/generalComp/YTDiaLogComp.ets

@@ -17,6 +17,8 @@ export struct YTDiaLogComp {
     yTRouter.pop('', false)
   }
 
+  lastTime: number = 0
+
   @Monitor('isBack')
   fatherIsBack(){
     setTimeout(() => {
@@ -25,6 +27,10 @@ export struct YTDiaLogComp {
   }
 
   private _onBackPress(ans?: ESObject) {
+    let now = Date.now()
+    if(now - this.lastTime < 500) return
+    this.lastTime = now
+
     animateToImmediately({
       duration: 300
     }, () => {

+ 1 - 0
features/feature/src/main/ets/pages/MsgDetailPage.ets

@@ -2,6 +2,7 @@ import { RouterPage, YTAvoid } from 'basic'
 import { _YtHeader } from '../components/YtComp/_YtHeader'
 import { MilitaryNewsItem } from '../model/Index'
 
+// 军事咨询 详细页
 @ComponentV2
 struct MsgDetailPage {
   @Local safeTop: number = AppStorage.get(YTAvoid.SAFE_TOP_KEY) as number

+ 2 - 0
features/feature/src/main/ets/pages/observationalPage.ets

@@ -3,6 +3,8 @@ import { observationalComp } from '../components/observationalComp';
 import { _YtHeader } from '../components/YtComp/_YtHeader';
 import { observationalViewModel } from '../viewModel/PageVm/observationalViewModel';
 
+
+// 观察记忆训练
 @ComponentV2
 @RouterPage
 struct observationalPage {

+ 2 - 0
features/feature/src/main/ets/pages/reagencyPage.ets

@@ -3,6 +3,8 @@ import { _YtHeader } from '../components/YtComp/_YtHeader';
 import { reagencyViewModel } from '../viewModel/PageVm/reagencyViewModel';
 import { reagencyComp } from '../components/reagencyComp';
 
+
+// 反应力训练
 @ComponentV2
 @RouterPage
 struct reagencyPage {

+ 1 - 0
features/feature/src/main/ets/viewModel/PageVm/reagencyViewModel.ets

@@ -47,6 +47,7 @@ export class reagencyViewModel{
     let now = new Date().getTime()
     if(now - this.lastTime < 800) return
     this.lastTime = now
+    console.log(`hhhhh = ${JSON.stringify('hhhhh')}`)
 
     if(this.trainStarted == 1) {
       this.toggleTrain()