Forráskód Böngészése

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

loki.wu 1 éve
szülő
commit
8e612e1a0f

+ 14 - 15
lib/pages/medical/widgets/body_bmi.dart

@@ -124,15 +124,8 @@ class _ExamBodyWeightState extends State<BodyWeight> {
     setState(() {});
   }
 
-  void _onDeviceCloseSuccess(sender, e) {
-    if (e) {
-      connect();
-    }
-  }
-
   void _onConnectFail(sender, e) {
     print('连接设备失败');
-
     isConnectFail = true;
     _connectStatus = WorkerStatus.connectionFailed;
 
@@ -141,7 +134,6 @@ class _ExamBodyWeightState extends State<BodyWeight> {
 
   void _onDisconnected(sender, e) {
     print('设备连接中断');
-
     isConnectFail = true;
     _connectStatus = WorkerStatus.disconnected;
     setState(() {});
@@ -227,9 +219,15 @@ class _ExamBodyWeightState extends State<BodyWeight> {
     ).show();
     if (result?.isNotEmpty ?? false) {
       _weight = result ?? '';
-      getBmi();
-      controller.diagnosisDataValue['BMI']?['Weight'] = _weight;
-      controller.diagnosisDataValue['BMI']?['Bmi'] = _bmi;
+      if (_height.isNotEmpty) {
+        getBmi();
+      }
+      controller.diagnosisDataValue['BMI'] = {
+        'Height': _height,
+        'Bmi': _bmi,
+        'Weight': _weight,
+      };
+
       controller.saveCachedRecord();
     }
     setState(() {});
@@ -252,13 +250,14 @@ class _ExamBodyWeightState extends State<BodyWeight> {
     if (result?.isNotEmpty ?? false) {
       _height = result ?? '';
 
-      // getBmi();
-      controller.diagnosisDataValue['BMI']?['Height'] = _height;
       if (_weight.isNotEmpty) {
         getBmi();
-        controller.diagnosisDataValue['BMI']?['Bmi'] = _bmi;
       }
-      // controller.diagnosisDataValue['BMI']?['Bmi'] = _bmi;
+      controller.diagnosisDataValue['BMI'] = {
+        'Height': _height,
+        'Bmi': _bmi,
+        'Weight': _weight,
+      };
       controller.saveCachedRecord();
     }
     setState(() {});

+ 1 - 0
lib/pages/medical/widgets/heart_rate.dart

@@ -150,6 +150,7 @@ class _HeartRateState extends State<HeartRate> {
     print(ecgPoint.toString());
     // _heart = e.toString();
     _assess = e.analysis.first;
+    _heart = e.heartRate.toString();
     controller.diagnosisDataValue['Heart']?['HEART'] = e.heartRate;
     controller.diagnosisDataValue['Heart']?['ASSESS'] = e.analysis.first;