Переглянути джерело

Merge branch 'master' of http://git.ius.plus/Project-Vital/VitalApp

loki.wu 10 місяців тому
батько
коміт
14303011ac

+ 6 - 16
lib/pages/consultation_record_view/widgets/capture_page.dart

@@ -33,11 +33,11 @@ class _CapturePageState extends State<CapturePage> {
   }
 
   void onRecord(Object sender, bool e) {
-    if (isRecording == e) {
-      return;
-    }
-    if (isRecording) {
+    if (!e) {
+      _cancelTimer();
       PromptBox.toast('采集成功');
+    } else {
+      _startTimer();
     }
     setState(() {
       isRecording = e;
@@ -89,7 +89,7 @@ class _CapturePageState extends State<CapturePage> {
                       child: Text("截图"),
                       onTap: () {
                         rpc.platform.keypadPressF1();
-                        PromptBox.toast('采集成功');
+                        // PromptBox.toast('采集成功');
                       },
                     ),
                   ),
@@ -103,15 +103,6 @@ class _CapturePageState extends State<CapturePage> {
                       child: Text(isRecording ? "结束录制" : "开始录制"),
                       onTap: () {
                         rpc.platform.keypadPressF2();
-                        if (isRecording) {
-                          _cancelTimer();
-                          PromptBox.toast('采集成功');
-                        } else {
-                          _startTimer();
-                        }
-                        setState(() {
-                          isRecording = !isRecording;
-                        });
                       },
                     ),
                   ),
@@ -144,9 +135,8 @@ class _CapturePageState extends State<CapturePage> {
     }
     // 创建一个延迟30秒执行的任务
     _timer = Timer(Duration(seconds: 30), () {
-      PromptBox.toast('采集成功');
       setState(() {
-        isRecording = false;
+        rpc.platform.keypadPressF2();
       });
     });
   }