Browse Source

1、新增诊疗展示页面

guanxinyi 1 year ago
parent
commit
bae3b207ae
34 changed files with 1437 additions and 69 deletions
  1. 2 1
      lib/components/cell.dart
  2. 2 1
      lib/components/checkbox_cell/drawer.dart
  3. 2 1
      lib/components/dynamic_drawer.dart
  4. 2 1
      lib/components/panel.dart
  5. 2 1
      lib/components/radio_cell/drawer.dart
  6. 1 1
      lib/components/side_nav/side_bar.dart
  7. 3 2
      lib/pages/check/follow_up/widgets/follow_up_from.dart
  8. 5 4
      lib/pages/check/follow_up_record/view.dart
  9. 9 6
      lib/pages/check/healthCheckRecord/view.dart
  10. 13 3
      lib/pages/check/widgets/check_category_widget.dart
  11. 2 2
      lib/pages/check/widgets/exam_configurable/exam_body_temperature.dart
  12. 5 8
      lib/pages/check/widgets/exam_configurable/exam_card.dart
  13. 2 1
      lib/pages/check/widgets/exam_configurable/exam_check_box.dart
  14. 5 4
      lib/pages/contract/contract_records/view.dart
  15. 3 1
      lib/pages/contract/package_list/widgets/capture_portrait.dart
  16. 2 2
      lib/pages/dashboard/demo.dart
  17. 2 1
      lib/pages/from_page/widgets/menus.dart
  18. 0 0
      lib/pages/medical/controller.dart
  19. 0 0
      lib/pages/medical/state.dart
  20. 165 0
      lib/pages/medical/view.dart
  21. 137 0
      lib/pages/medical/widgets/blood_oxygen.dart
  22. 137 0
      lib/pages/medical/widgets/blood_pressure.dart
  23. 137 0
      lib/pages/medical/widgets/blood_sugar.dart
  24. 379 0
      lib/pages/medical/widgets/body_temperature.dart
  25. 379 0
      lib/pages/medical/widgets/body_weight.dart
  26. 0 14
      lib/pages/patient/create/view.dart
  27. 4 0
      lib/pages/patient/detail/controller.dart
  28. 2 2
      lib/pages/patient/detail/widgets/base_info.dart
  29. 16 1
      lib/pages/patient/detail/widgets/functions_panel.dart
  30. 6 5
      lib/pages/patient/detail/widgets/tag_cards.dart
  31. 2 2
      lib/pages/patient/info/view.dart
  32. 4 3
      lib/pages/patient/list/view.dart
  33. 6 1
      lib/routes/routes.dart
  34. 1 1
      pubspec.yaml

+ 2 - 1
lib/components/cell.dart

@@ -1,4 +1,5 @@
 import 'package:flutter/material.dart';
+import 'package:vnoteapp/consts/styles.dart';
 
 class VListFormCellGroup extends StatelessWidget {
   final List<Widget> children;
@@ -29,7 +30,7 @@ class VListFormCellGroup extends StatelessWidget {
       padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 20),
       decoration: BoxDecoration(
         color: Colors.white,
-        borderRadius: BorderRadius.circular(8),
+        borderRadius: GlobalStyles.borderRadius,
       ),
       child: Column(
         mainAxisSize: MainAxisSize.min,

+ 2 - 1
lib/components/checkbox_cell/drawer.dart

@@ -1,4 +1,5 @@
 import 'package:flutter/material.dart';
+import 'package:vnoteapp/consts/styles.dart';
 import '../dynamic_drawer.dart';
 
 import 'group.dart';
@@ -46,7 +47,7 @@ class _DrawerGroupState<T, TValue>
       shadowColor: Colors.black.withOpacity(.1),
       backgroundColor: Colors.white,
       shape: RoundedRectangleBorder(
-        borderRadius: BorderRadius.circular(8),
+        borderRadius: GlobalStyles.borderRadius,
       ),
       elevation: 0,
       width: 520,

+ 2 - 1
lib/components/dynamic_drawer.dart

@@ -1,4 +1,5 @@
 import 'package:flutter/material.dart';
+import 'package:vnoteapp/consts/styles.dart';
 
 final _builderMap = <GlobalKey<ScaffoldState>, WidgetBuilder>{};
 
@@ -24,7 +25,7 @@ class VDrawer extends StatelessWidget {
       shadowColor: Colors.black.withOpacity(.1),
       backgroundColor: Colors.white,
       shape: RoundedRectangleBorder(
-        borderRadius: BorderRadius.circular(8),
+        borderRadius: GlobalStyles.borderRadius,
       ),
       elevation: 0,
       width: width,

+ 2 - 1
lib/components/panel.dart

@@ -1,7 +1,8 @@
 import 'package:flutter/material.dart';
+import 'package:vnoteapp/consts/styles.dart';
 
 class VPanel extends StatelessWidget {
-  static const _borderRadius = Radius.circular(8);
+  static const _borderRadius = GlobalStyles.borderRadiusValue;
 
   final Widget child;
 

+ 2 - 1
lib/components/radio_cell/drawer.dart

@@ -1,5 +1,6 @@
 import 'package:flutter/material.dart';
 import 'package:get/get.dart';
+import 'package:vnoteapp/consts/styles.dart';
 import '../dynamic_drawer.dart';
 
 import 'group.dart';
@@ -48,7 +49,7 @@ class _DrawerGroupState<T, TValue>
       shadowColor: Colors.black.withOpacity(.1),
       backgroundColor: Colors.white,
       shape: RoundedRectangleBorder(
-        borderRadius: BorderRadius.circular(8),
+        borderRadius: GlobalStyles.borderRadius,
       ),
       elevation: 0,
       width: 520,

+ 1 - 1
lib/components/side_nav/side_bar.dart

@@ -115,7 +115,7 @@ class _SideBarState extends State<_SideBar> {
             Positioned.fill(
               child: Container(
                 decoration: BoxDecoration(
-                  borderRadius: BorderRadius.circular(8),
+                  borderRadius: GlobalStyles.borderRadius,
                   color: Theme.of(context).primaryColor.withOpacity(.2),
                 ),
               ),

+ 3 - 2
lib/pages/check/follow_up/widgets/follow_up_from.dart

@@ -6,6 +6,7 @@ import 'package:vnoteapp/components/cell.dart';
 import 'package:vnoteapp/components/dialog_date.dart';
 import 'package:vnoteapp/components/dialog_select.dart';
 import 'package:vnoteapp/consts/rpc_enum_labels.dart';
+import 'package:vnoteapp/consts/styles.dart';
 import 'package:vnoteapp/pages/check/follow_up/controller.dart';
 import 'package:vnoteapp/store/store.dart';
 
@@ -23,13 +24,13 @@ class FollowUpFrom extends GetView<FollowUpController> {
     return Card(
       elevation: 6,
       shape: RoundedRectangleBorder(
-        borderRadius: BorderRadius.circular(8),
+        borderRadius: GlobalStyles.borderRadius,
       ),
       margin: const EdgeInsets.all(16),
       child: Material(
         color: Colors.white,
         borderRadius: const BorderRadius.all(
-          Radius.circular(8),
+          GlobalStyles.borderRadiusValue,
         ),
         child: Container(
             padding: const EdgeInsets.symmetric(horizontal: 16),

+ 5 - 4
lib/pages/check/follow_up_record/view.dart

@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
 import 'package:get/get.dart';
 import 'package:intl/intl.dart';
 import 'package:vnoteapp/components/appbar.dart';
+import 'package:vnoteapp/consts/styles.dart';
 import 'package:vnoteapp/pages/check/follow_up_record/controller.dart';
 import 'package:vnoteapp/pages/patient/list/widgets/status.dart';
 import 'package:vnoteapp/pages/widgets/record_common_item.dart';
@@ -50,7 +51,7 @@ class FollowUpRecordPage extends GetView<FollowUpRecordController> {
             border: Border.all(
               color: Colors.white,
             ),
-            borderRadius: BorderRadius.circular(8),
+            borderRadius: GlobalStyles.borderRadius,
           ),
           child: Image.asset(
             'assets/images/exam/normalMeasurementChart.png',
@@ -223,14 +224,14 @@ class _followUpRecordCard extends StatelessWidget {
       ],
     );
     return Material(
-      borderRadius: BorderRadius.circular(8),
+      borderRadius: GlobalStyles.borderRadius,
       child: Ink(
         decoration: BoxDecoration(
           color: Colors.white,
-          borderRadius: BorderRadius.circular(8),
+          borderRadius: GlobalStyles.borderRadius,
         ),
         child: InkWell(
-          borderRadius: BorderRadius.circular(8),
+          borderRadius: GlobalStyles.borderRadius,
           onTap: () {
             controller.toCheckPage(dataDto); //跳转到随访页面
           },

+ 9 - 6
lib/pages/check/healthCheckRecord/view.dart

@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
 import 'package:get/get.dart';
 import 'package:intl/intl.dart';
 import 'package:vnoteapp/components/appbar.dart';
+import 'package:vnoteapp/consts/styles.dart';
 import 'package:vnoteapp/pages/check/healthCheckRecord/controller.dart';
 import 'package:vnoteapp/pages/patient/list/widgets/status.dart';
 import 'package:vnoteapp/pages/widgets/record_common_item.dart';
@@ -50,7 +51,7 @@ class HealthCheckRecordPage extends GetView<HealthCheckRecordController> {
             border: Border.all(
               color: Colors.white,
             ),
-            borderRadius: BorderRadius.circular(8),
+            borderRadius: GlobalStyles.borderRadius,
           ),
           child: Image.asset(
             'assets/images/exam/normalMeasurementChart.png',
@@ -93,8 +94,10 @@ class HealthCheckRecordPage extends GetView<HealthCheckRecordController> {
                                   fit: BoxFit.cover,
                                 ),
                               ),
-                              const Text("暂无数据,先看看别的吧",
-                                style: TextStyle(fontSize: 18),),
+                              const Text(
+                                "暂无数据,先看看别的吧",
+                                style: TextStyle(fontSize: 18),
+                              ),
                             ],
                           ),
                         )
@@ -208,14 +211,14 @@ class _ExamRecordCard extends StatelessWidget {
       ],
     );
     return Material(
-      borderRadius: BorderRadius.circular(8),
+      borderRadius: GlobalStyles.borderRadius,
       child: Ink(
         decoration: BoxDecoration(
           color: Colors.white,
-          borderRadius: BorderRadius.circular(8),
+          borderRadius: GlobalStyles.borderRadius,
         ),
         child: InkWell(
-          borderRadius: BorderRadius.circular(8),
+          borderRadius: GlobalStyles.borderRadius,
           onTap: () {
             controller.toCheckPage(dataDto); //跳转到检查页面
           },

+ 13 - 3
lib/pages/check/widgets/check_category_widget.dart

@@ -1,4 +1,14 @@
+/*
+ * @Descripttion: 
+ * @version: 
+ * @Author: guanxiaoxin
+ * @Date: 2023-10-08 17:08:45
+ * @LastEditors: guanxiaoxin
+ * @LastEditTime: 2023-10-18 20:20:22
+ * @FilePath: \VNoteApp\lib\pages\check\widgets\check_category_widget.dart
+ */
 import 'package:flutter/material.dart';
+import 'package:vnoteapp/consts/styles.dart';
 
 class CheckCategoryWidget extends StatelessWidget {
   final String label;
@@ -15,16 +25,16 @@ class CheckCategoryWidget extends StatelessWidget {
   @override
   Widget build(BuildContext context) {
     return Material(
-      borderRadius: BorderRadius.circular(8),
+      borderRadius: GlobalStyles.borderRadius,
       child: Ink(
         child: InkWell(
-          borderRadius: BorderRadius.circular(8),
+          borderRadius: GlobalStyles.borderRadius,
           onTap: () {
             onTap?.call();
           },
           child: Container(
             decoration: BoxDecoration(
-              borderRadius: BorderRadius.circular(8),
+              borderRadius: GlobalStyles.borderRadius,
               image: DecorationImage(
                 image:
                     AssetImage('assets/images/exam/$assetName'), // 替换为你的背景图路径

+ 2 - 2
lib/pages/check/widgets/exam_configurable/exam_body_temperature.dart

@@ -115,8 +115,8 @@ class Temperature extends StatefulWidget {
 
 class _TemperatureState extends State<Temperature> {
   late final TempDeviceWorker worker = TempDeviceWorker(
-    mac: '44:A6:E5:16:62:33',
-    model: 'DT-8836',
+    mac: 'D0:05:00:00:00:67',
+    model: 'YHW-6',
   );
   late TextEditingController specialInputController =
       TextEditingController(text: widget.temperature ?? '00.0');

+ 5 - 8
lib/pages/check/widgets/exam_configurable/exam_card.dart

@@ -4,10 +4,11 @@
  * @Author: guanxiaoxin
  * @Date: 2023-09-28 09:37:17
  * @LastEditors: guanxiaoxin
- * @LastEditTime: 2023-10-08 13:25:59
+ * @LastEditTime: 2023-10-18 20:33:47
  * @FilePath: \VNoteApp\lib\pages\check\widgets\exam_configurable\exam_card.dart
  */
 import 'package:flutter/material.dart';
+import 'package:vnoteapp/consts/styles.dart';
 
 /// 检查小卡片
 class ExamCard extends StatelessWidget {
@@ -27,17 +28,13 @@ class ExamCard extends StatelessWidget {
     return Card(
       elevation: 6,
       shape: RoundedRectangleBorder(
-        borderRadius: BorderRadius.circular(8),
+        borderRadius: GlobalStyles.borderRadius,
       ),
       child: Material(
         color: Colors.white,
-        borderRadius: const BorderRadius.all(
-          Radius.circular(16),
-        ),
+        borderRadius: GlobalStyles.borderRadius,
         child: InkWell(
-          borderRadius: const BorderRadius.all(
-            Radius.circular(16),
-          ),
+          borderRadius: GlobalStyles.borderRadius,
           onTap: clickCard != null ? () => clickCard!.call() : null,
           child: Column(
             crossAxisAlignment: CrossAxisAlignment.start,

+ 2 - 1
lib/pages/check/widgets/exam_configurable/exam_check_box.dart

@@ -1,4 +1,5 @@
 import 'package:flutter/material.dart';
+import 'package:vnoteapp/consts/styles.dart';
 import 'package:vnoteapp/pages/check/models/form.dart';
 import 'package:vnoteapp/pages/check/widgets/exam_configurable/exam_card.dart';
 
@@ -42,7 +43,7 @@ class ExamCheckBox extends StatelessWidget {
                   padding: const EdgeInsets.all(8),
                   child: InkWell(
                     onTap: () => selectCheckBoxChange(e),
-                    borderRadius: BorderRadius.circular(8),
+                    borderRadius: GlobalStyles.borderRadius,
                     child: Ink(
                       decoration: BoxDecoration(
                         border: Border.all(

+ 5 - 4
lib/pages/contract/contract_records/view.dart

@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
 import 'package:get/get.dart';
 import 'package:intl/intl.dart';
 import 'package:vnoteapp/components/appbar.dart';
+import 'package:vnoteapp/consts/styles.dart';
 import 'package:vnoteapp/managers/contract/index.dart';
 import 'package:vnoteapp/pages/patient/list/widgets/status.dart';
 import 'package:vnoteapp/pages/widgets/record_common_item.dart';
@@ -98,7 +99,7 @@ class ContractRecordsPage extends GetView<ContractRecordsController> {
             border: Border.all(
               color: Colors.white,
             ),
-            borderRadius: BorderRadius.circular(8),
+            borderRadius: GlobalStyles.borderRadius,
           ),
           child: Image.asset(
             'assets/images/exam/normalMeasurementChart.png',
@@ -237,14 +238,14 @@ class _ContractRecordCard extends StatelessWidget {
       ],
     );
     return Material(
-      borderRadius: BorderRadius.circular(8),
+      borderRadius: GlobalStyles.borderRadius,
       child: Ink(
           decoration: BoxDecoration(
             color: Colors.white,
-            borderRadius: BorderRadius.circular(8),
+            borderRadius: GlobalStyles.borderRadius,
           ),
           child: InkWell(
-            borderRadius: BorderRadius.circular(8),
+            borderRadius: GlobalStyles.borderRadius,
             onTap: () {
               Get.toNamed(
                 "/contract/contract_record_html",

+ 3 - 1
lib/pages/contract/package_list/widgets/capture_portrait.dart

@@ -6,6 +6,8 @@ import 'package:get/get.dart';
 import 'package:image_picker/image_picker.dart';
 import 'package:vnoteapp/pages/contract/package_list/controller.dart';
 
+import '../../../../consts/styles.dart';
+
 class CapturePortraitPage extends GetView<ServicePackageContractController> {
   const CapturePortraitPage({super.key});
   Future<String> convertImageToBase64(XFile image) async {
@@ -32,7 +34,7 @@ class CapturePortraitPage extends GetView<ServicePackageContractController> {
             border: Border.all(
               color: Colors.grey,
             ),
-            borderRadius: BorderRadius.circular(8),
+            borderRadius: GlobalStyles.borderRadius,
           ),
           child: controller.state.userImage != null
               ? Image.file(

+ 2 - 2
lib/pages/dashboard/demo.dart

@@ -1,11 +1,12 @@
 import 'package:flutter/material.dart';
+import 'package:vnoteapp/consts/styles.dart';
 
 class DashboardDemoView extends StatelessWidget {
   const DashboardDemoView({super.key});
 
   @override
   Widget build(BuildContext context) {
-    const borderRadius = Radius.circular(8);
+    const borderRadius = GlobalStyles.borderRadiusValue;
     return ListView(
       children: [
         Container(
@@ -175,7 +176,6 @@ class _CountCircleWidget extends StatelessWidget {
   final Color color;
 
   const _CountCircleWidget({
-    super.key,
     required this.count,
     required this.title,
     required this.color,

+ 2 - 1
lib/pages/from_page/widgets/menus.dart

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
 import 'package:get/get.dart';
 import 'package:vnoteapp/components/cell.dart';
 import 'package:vnoteapp/components/panel.dart';
+import 'package:vnoteapp/consts/styles.dart';
 import 'package:vnoteapp/pages/from_page/controller.dart';
 import 'package:vnoteapp/pages/from_page/models/menu.dart';
 
@@ -68,7 +69,7 @@ class FromItemWidget extends StatelessWidget {
       child: Container(
         padding: const EdgeInsets.all(16),
         decoration: BoxDecoration(
-          borderRadius: BorderRadius.circular(8),
+          borderRadius: GlobalStyles.borderRadius,
           color: data.isSelected ? Colors.red : Colors.white,
         ),
         child: Row(

+ 0 - 0
lib/pages/medical/controller.dart


+ 0 - 0
lib/pages/medical/state.dart


+ 165 - 0
lib/pages/medical/view.dart

@@ -0,0 +1,165 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import 'package:vnoteapp/components/appbar.dart';
+import 'package:vnoteapp/components/floating_window/floating_window.dart';
+import 'package:vnoteapp/components/side_nav/defines.dart';
+import 'package:vnoteapp/components/side_nav/side_nav.dart';
+import 'package:vnoteapp/pages/medical/widgets/blood_oxygen.dart';
+import 'package:vnoteapp/pages/medical/widgets/blood_pressure.dart';
+import 'package:vnoteapp/pages/medical/widgets/blood_sugar.dart';
+import 'package:vnoteapp/pages/medical/widgets/body_temperature.dart';
+import 'package:vnoteapp/pages/medical/widgets/body_weight.dart';
+import 'package:vnoteapp/pages/patient/create/controller.dart';
+import 'package:vnoteapp/routes/nav_ids.dart';
+import 'package:vnoteapp/routes/route_setting.dart';
+
+class MedicalPage extends GetView<CreatePatientController> {
+  const MedicalPage({super.key});
+
+  @override
+  Widget build(BuildContext context) {
+    return Scaffold(
+      backgroundColor: Colors.white,
+      appBar: VAppBar(
+        titleWidget: const Text(
+          "诊疗展示",
+          style: TextStyle(fontSize: 24),
+        ),
+      ),
+      body: Stack(
+        children: [
+          VSideNavView(
+            navId: NavIds.CREATE,
+            items: _buildItems(),
+          ),
+          const Positioned(
+            bottom: 8,
+            left: 200,
+            right: 200,
+            child: Row(
+              mainAxisAlignment: MainAxisAlignment.spaceAround,
+              children: [],
+            ),
+          ),
+          const FloatingWindow(),
+        ],
+      ),
+    );
+  }
+
+  List<VSideNavMenuItem> _buildItems() {
+    final items = <VSideNavMenuItem>[];
+    items.add(_buildBodyTemperatureItem());
+    items.add(_buildBodyWeightItem());
+    items.add(_buildBloodPressureItem());
+    items.add(_buildBloodSugarItem());
+    items.add(_buildBloodOxygenItem());
+    return items;
+  }
+
+  VSideNavMenuItem _buildBodyTemperatureItem() {
+    return VSideNavMenuItem(
+      title: "体温",
+      icon: Icon(Icons.edit_document, color: Colors.grey.shade700),
+      // onTap: () {}
+      route: VRouteSetting(
+        "/body_temperature",
+        () => const Column(
+          children: [
+            BodyTemperature(),
+          ],
+        ),
+        binding: BindingsBuilder(
+          () {
+            // Get.lazyPut(() => CreatePatientController());
+          },
+        ),
+      ),
+    );
+  }
+
+  VSideNavMenuItem _buildBodyWeightItem() {
+    return VSideNavMenuItem(
+      title: "体重",
+      icon: Icon(Icons.info_outline, color: Colors.grey.shade700),
+      route: VRouteSetting(
+        "/body_weight",
+        () => const Column(
+          children: [
+            BodyWeight(),
+          ],
+        ),
+        binding: BindingsBuilder(
+          () {
+            // Get.lazyPut(() => CrowdLabelsController());
+            // Get.lazyPut(() => CreatePatientController());
+          },
+        ),
+      ),
+      // route: VRouteSetting("/about", () => const AboutPage()),
+    );
+  }
+
+  VSideNavMenuItem _buildBloodPressureItem() {
+    return VSideNavMenuItem(
+      title: "血压",
+      icon: Icon(Icons.exit_to_app, color: Colors.grey.shade700),
+      route: VRouteSetting(
+        "/blood_pressure",
+        () => const Column(
+          children: [
+            BloodPressure(),
+          ],
+        ),
+        binding: BindingsBuilder(
+          () {
+            Get.lazyPut(() => CreatePatientController());
+          },
+        ),
+      ),
+      // shouldRearrage: true, // TODO: 调整样式后启用
+    );
+  }
+
+  VSideNavMenuItem _buildBloodSugarItem() {
+    return VSideNavMenuItem(
+      title: "血糖",
+      icon: Icon(Icons.exit_to_app, color: Colors.grey.shade700),
+      route: VRouteSetting(
+        "/blood_sugar",
+        () => const Column(
+          children: [
+            BloodSugar(),
+          ],
+        ),
+        binding: BindingsBuilder(
+          () {
+            Get.lazyPut(() => CreatePatientController());
+          },
+        ),
+      ),
+      // shouldRearrage: true, // TODO: 调整样式后启用
+    );
+  }
+
+  VSideNavMenuItem _buildBloodOxygenItem() {
+    return VSideNavMenuItem(
+      title: "血氧",
+      icon: Icon(Icons.exit_to_app, color: Colors.grey.shade700),
+      route: VRouteSetting(
+        "/blood_oxygen",
+        () => const Column(
+          children: [
+            BloodOxygen(),
+          ],
+        ),
+        binding: BindingsBuilder(
+          () {
+            Get.lazyPut(() => CreatePatientController());
+          },
+        ),
+      ),
+      // shouldRearrage: true, // TODO: 调整样式后启用
+    );
+  }
+}

+ 137 - 0
lib/pages/medical/widgets/blood_oxygen.dart

@@ -0,0 +1,137 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import 'package:vnote_device_plugin/devices/weight.dart';
+import 'package:vnoteapp/managers/interfaces/permission.dart';
+import 'package:vnoteapp/pages/check/widgets/exam_configurable/exam_card.dart';
+
+class BloodOxygen extends StatefulWidget {
+  const BloodOxygen({
+    super.key,
+  });
+
+  @override
+  State<BloodOxygen> createState() => _BloodOxygenState();
+}
+
+class _BloodOxygenState extends State<BloodOxygen> {
+  var permissionManager = Get.find<IPermissionManager>();
+
+  late final WeightDeviceWorker worker = WeightDeviceWorker(
+    mac: 'CF:E4:2C:22:01:39',
+    model: 'CF398BLE',
+  );
+  late String bodyTemperature = '0';
+  bool connectFailState = false;
+  bool connectSuccessState = false;
+  bool isConnect = false;
+  @override
+  void initState() {
+    getPermission();
+    connect();
+
+    worker.successEvent.addListener(_onSuccess);
+    worker.connectErrorEvent.addListener(_onConnectFail);
+    worker.connectedEvent.addListener(_onConnectSuccess);
+
+    super.initState();
+  }
+
+  Future<void> connect() async {
+    connectFailState = false;
+    isConnect = true;
+    connectSuccessState = false;
+    setState(() {});
+    await worker.connect();
+  }
+
+  Future<void> disconnect() async {
+    worker.connectErrorEvent.removeListener(_onConnectFail);
+    worker.connectedEvent.removeListener(_onConnectSuccess);
+    worker.successEvent.removeListener(_onSuccess);
+    await worker.disconnect();
+  }
+
+  @override
+  void dispose() {
+    super.dispose();
+  }
+
+  void _onSuccess(_, double e) {
+    setState(() {
+      bodyTemperature = e.toString();
+      // connectFailState = false;
+      // connectSuccessState = false;
+      isConnect = false;
+      // disconnect();
+    });
+  }
+
+  void _onConnectFail(sender, e) {
+    print('连接设备失败');
+    connectFailState = true;
+    connectSuccessState = false;
+    isConnect = false;
+    disconnect();
+    setState(() {});
+  }
+
+  void _onConnectSuccess(sender, e) {
+    connectSuccessState = true;
+    connectFailState = false;
+    isConnect = false;
+    setState(() {});
+  }
+
+  // @override
+  // void initState() {
+  //   getPermission();
+  //   super.initState();
+  // }
+
+  Future<void> getPermission() async {
+    await permissionManager.requestLocationPermission();
+    await permissionManager.requestBluetoothConnectPermission();
+    await permissionManager.requestBluetoothAdvertisePermission();
+    await permissionManager.requestBluetoothScanPermission();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return ExamCard(
+      title: '血氧',
+      clickCard: () {},
+      content: Container(
+        alignment: Alignment.bottomRight,
+        padding: const EdgeInsets.only(
+          bottom: 20,
+          right: 30,
+          left: 40,
+        ),
+        // constraints: const BoxConstraints(maxHeight: 150),
+        child: FittedBox(
+          child: Row(
+            mainAxisAlignment: MainAxisAlignment.end,
+            crossAxisAlignment: CrossAxisAlignment.end,
+            children: [
+              RichText(
+                text: TextSpan(
+                  text: bodyTemperature,
+                  style: const TextStyle(
+                    fontSize: 80,
+                    color: Colors.black,
+                  ),
+                  children: const [
+                    TextSpan(
+                      text: '%',
+                      style: TextStyle(fontSize: 25),
+                    )
+                  ],
+                ),
+              ),
+            ],
+          ),
+        ),
+      ),
+    );
+  }
+}

+ 137 - 0
lib/pages/medical/widgets/blood_pressure.dart

@@ -0,0 +1,137 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import 'package:vnote_device_plugin/devices/weight.dart';
+import 'package:vnoteapp/managers/interfaces/permission.dart';
+import 'package:vnoteapp/pages/check/widgets/exam_configurable/exam_card.dart';
+
+class BloodPressure extends StatefulWidget {
+  const BloodPressure({
+    super.key,
+  });
+
+  @override
+  State<BloodPressure> createState() => _BloodPressureState();
+}
+
+class _BloodPressureState extends State<BloodPressure> {
+  var permissionManager = Get.find<IPermissionManager>();
+
+  late final WeightDeviceWorker worker = WeightDeviceWorker(
+    mac: 'CF:E4:2C:22:01:39',
+    model: 'CF398BLE',
+  );
+  late String bodyTemperature = '0';
+  bool connectFailState = false;
+  bool connectSuccessState = false;
+  bool isConnect = false;
+  @override
+  void initState() {
+    getPermission();
+    connect();
+
+    worker.successEvent.addListener(_onSuccess);
+    worker.connectErrorEvent.addListener(_onConnectFail);
+    worker.connectedEvent.addListener(_onConnectSuccess);
+
+    super.initState();
+  }
+
+  Future<void> connect() async {
+    connectFailState = false;
+    isConnect = true;
+    connectSuccessState = false;
+    setState(() {});
+    await worker.connect();
+  }
+
+  Future<void> disconnect() async {
+    worker.connectErrorEvent.removeListener(_onConnectFail);
+    worker.connectedEvent.removeListener(_onConnectSuccess);
+    worker.successEvent.removeListener(_onSuccess);
+    await worker.disconnect();
+  }
+
+  @override
+  void dispose() {
+    super.dispose();
+  }
+
+  void _onSuccess(_, double e) {
+    setState(() {
+      bodyTemperature = e.toString();
+      // connectFailState = false;
+      // connectSuccessState = false;
+      isConnect = false;
+      // disconnect();
+    });
+  }
+
+  void _onConnectFail(sender, e) {
+    print('连接设备失败');
+    connectFailState = true;
+    connectSuccessState = false;
+    isConnect = false;
+    disconnect();
+    setState(() {});
+  }
+
+  void _onConnectSuccess(sender, e) {
+    connectSuccessState = true;
+    connectFailState = false;
+    isConnect = false;
+    setState(() {});
+  }
+
+  // @override
+  // void initState() {
+  //   getPermission();
+  //   super.initState();
+  // }
+
+  Future<void> getPermission() async {
+    await permissionManager.requestLocationPermission();
+    await permissionManager.requestBluetoothConnectPermission();
+    await permissionManager.requestBluetoothAdvertisePermission();
+    await permissionManager.requestBluetoothScanPermission();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return ExamCard(
+      title: '血压',
+      clickCard: () {},
+      content: Container(
+        alignment: Alignment.bottomRight,
+        padding: const EdgeInsets.only(
+          bottom: 20,
+          right: 30,
+          left: 40,
+        ),
+        // constraints: const BoxConstraints(maxHeight: 150),
+        child: FittedBox(
+          child: Row(
+            mainAxisAlignment: MainAxisAlignment.end,
+            crossAxisAlignment: CrossAxisAlignment.end,
+            children: [
+              RichText(
+                text: TextSpan(
+                  text: bodyTemperature,
+                  style: const TextStyle(
+                    fontSize: 80,
+                    color: Colors.black,
+                  ),
+                  children: const [
+                    TextSpan(
+                      text: 'mmHg',
+                      style: TextStyle(fontSize: 25),
+                    )
+                  ],
+                ),
+              ),
+            ],
+          ),
+        ),
+      ),
+    );
+  }
+}

+ 137 - 0
lib/pages/medical/widgets/blood_sugar.dart

@@ -0,0 +1,137 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import 'package:vnote_device_plugin/devices/temp.dart';
+import 'package:vnoteapp/managers/interfaces/permission.dart';
+import 'package:vnoteapp/pages/check/widgets/exam_configurable/exam_card.dart';
+
+class BloodSugar extends StatefulWidget {
+  const BloodSugar({
+    super.key,
+  });
+
+  @override
+  State<BloodSugar> createState() => _BloodSugarState();
+}
+
+class _BloodSugarState extends State<BloodSugar> {
+  var permissionManager = Get.find<IPermissionManager>();
+
+  late final TempDeviceWorker worker = TempDeviceWorker(
+    mac: 'D0:05:00:00:00:67',
+    model: 'YHW-6',
+  );
+  late String bodyTemperature = '00.0';
+  bool connectFailState = false;
+  bool connectSuccessState = false;
+  bool isConnect = false;
+  @override
+  void initState() {
+    getPermission();
+    connect();
+
+    worker.successEvent.addListener(_onSuccess);
+    worker.connectErrorEvent.addListener(_onConnectFail);
+    worker.connectedEvent.addListener(_onConnectSuccess);
+
+    super.initState();
+  }
+
+  Future<void> connect() async {
+    connectFailState = false;
+    isConnect = true;
+    connectSuccessState = false;
+    setState(() {});
+    await worker.connect();
+  }
+
+  Future<void> disconnect() async {
+    worker.connectErrorEvent.removeListener(_onConnectFail);
+    worker.connectedEvent.removeListener(_onConnectSuccess);
+    worker.successEvent.removeListener(_onSuccess);
+    await worker.disconnect();
+  }
+
+  @override
+  void dispose() {
+    super.dispose();
+  }
+
+  void _onSuccess(_, double e) {
+    setState(() {
+      bodyTemperature = e.toString();
+      // connectFailState = false;
+      // connectSuccessState = false;
+      isConnect = false;
+      // disconnect();
+    });
+  }
+
+  void _onConnectFail(sender, e) {
+    print('连接设备失败');
+    connectFailState = true;
+    connectSuccessState = false;
+    isConnect = false;
+    disconnect();
+    setState(() {});
+  }
+
+  void _onConnectSuccess(sender, e) {
+    connectSuccessState = true;
+    connectFailState = false;
+    isConnect = false;
+    setState(() {});
+  }
+
+  // @override
+  // void initState() {
+  //   getPermission();
+  //   super.initState();
+  // }
+
+  Future<void> getPermission() async {
+    await permissionManager.requestLocationPermission();
+    await permissionManager.requestBluetoothConnectPermission();
+    await permissionManager.requestBluetoothAdvertisePermission();
+    await permissionManager.requestBluetoothScanPermission();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return ExamCard(
+      title: '血糖',
+      clickCard: () {},
+      content: Container(
+        alignment: Alignment.bottomRight,
+        padding: const EdgeInsets.only(
+          bottom: 20,
+          right: 30,
+          left: 40,
+        ),
+        // constraints: const BoxConstraints(maxHeight: 150),
+        child: FittedBox(
+          child: Row(
+            mainAxisAlignment: MainAxisAlignment.end,
+            crossAxisAlignment: CrossAxisAlignment.end,
+            children: [
+              RichText(
+                text: TextSpan(
+                  text: bodyTemperature,
+                  style: const TextStyle(
+                    fontSize: 80,
+                    color: Colors.black,
+                  ),
+                  children: const [
+                    TextSpan(
+                      text: 'mmol/L',
+                      style: TextStyle(fontSize: 25),
+                    )
+                  ],
+                ),
+              ),
+            ],
+          ),
+        ),
+      ),
+    );
+  }
+}

+ 379 - 0
lib/pages/medical/widgets/body_temperature.dart

@@ -0,0 +1,379 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import 'package:vnote_device_plugin/devices/temp.dart';
+import 'package:vnoteapp/managers/interfaces/permission.dart';
+import 'package:vnoteapp/pages/check/widgets/exam_configurable/exam_card.dart';
+
+class BodyTemperature extends StatefulWidget {
+  const BodyTemperature({
+    super.key,
+  });
+
+  @override
+  State<BodyTemperature> createState() => _BodyTemperatureState();
+}
+
+class _BodyTemperatureState extends State<BodyTemperature> {
+  var permissionManager = Get.find<IPermissionManager>();
+
+  late final TempDeviceWorker worker = TempDeviceWorker(
+    mac: 'D0:05:00:00:00:67',
+    model: 'YHW-6',
+  );
+  late String bodyTemperature = '00.0';
+  bool connectFailState = false;
+  bool connectSuccessState = false;
+  bool isConnect = false;
+  @override
+  void initState() {
+    getPermission();
+    connect();
+
+    worker.successEvent.addListener(_onSuccess);
+    worker.connectErrorEvent.addListener(_onConnectFail);
+    worker.connectedEvent.addListener(_onConnectSuccess);
+
+    super.initState();
+  }
+
+  Future<void> connect() async {
+    connectFailState = false;
+    isConnect = true;
+    connectSuccessState = false;
+    setState(() {});
+    await worker.connect();
+  }
+
+  Future<void> disconnect() async {
+    worker.connectErrorEvent.removeListener(_onConnectFail);
+    worker.connectedEvent.removeListener(_onConnectSuccess);
+    worker.successEvent.removeListener(_onSuccess);
+    await worker.disconnect();
+  }
+
+  @override
+  void dispose() {
+    super.dispose();
+  }
+
+  void _onSuccess(_, double e) {
+    setState(() {
+      bodyTemperature = e.toString();
+      // connectFailState = false;
+      // connectSuccessState = false;
+      isConnect = false;
+      // disconnect();
+    });
+  }
+
+  void _onConnectFail(sender, e) {
+    print('连接设备失败');
+    connectFailState = true;
+    connectSuccessState = false;
+    isConnect = false;
+    disconnect();
+    setState(() {});
+  }
+
+  void _onConnectSuccess(sender, e) {
+    connectSuccessState = true;
+    connectFailState = false;
+    isConnect = false;
+    setState(() {});
+  }
+
+  // @override
+  // void initState() {
+  //   getPermission();
+  //   super.initState();
+  // }
+
+  Future<void> getPermission() async {
+    await permissionManager.requestLocationPermission();
+    await permissionManager.requestBluetoothConnectPermission();
+    await permissionManager.requestBluetoothAdvertisePermission();
+    await permissionManager.requestBluetoothScanPermission();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return ExamCard(
+      title: '体温',
+      clickCard: () {},
+      content: Container(
+        alignment: Alignment.bottomRight,
+        padding: const EdgeInsets.only(
+          bottom: 20,
+          right: 30,
+          left: 40,
+        ),
+        // constraints: const BoxConstraints(maxHeight: 150),
+        child: FittedBox(
+          child: Row(
+            mainAxisAlignment: MainAxisAlignment.end,
+            crossAxisAlignment: CrossAxisAlignment.end,
+            children: [
+              RichText(
+                text: TextSpan(
+                  text: bodyTemperature,
+                  style: const TextStyle(
+                    fontSize: 80,
+                    color: Colors.black,
+                  ),
+                  children: const [
+                    TextSpan(
+                      text: '°C',
+                      style: TextStyle(fontSize: 25),
+                    )
+                  ],
+                ),
+              ),
+            ],
+          ),
+        ),
+      ),
+    );
+  }
+
+  // Future<void> _buildTempertureInput(FormObject currentFormObject) async {
+  //   // Future.delayed(const Duration(milliseconds: 3000), () {
+  //   //   specialInputController.text = generateRandomNumber().toString();
+  //   //   widget.specialInput?.call(specialInputController.text);
+  //   //   setState(() {});
+  //   // });
+
+  //   final result = await Get.dialog(
+  //     Temperature(
+  //       currentFormObject: widget.currentFormObject,
+  //       temperature: widget.currentInputValue,
+  //     ),
+  //     barrierDismissible: false,
+  //   );
+  //   widget.specialInput?.call(result);
+  //   print(result);
+  // }
+}
+
+// class Temperature extends StatefulWidget {
+//   const Temperature({
+//     super.key,
+//     required this.currentFormObject,
+//     this.temperature,
+//   });
+//   final FormObject currentFormObject;
+//   final String? temperature;
+
+//   @override
+//   State<Temperature> createState() => _TemperatureState();
+// }
+
+// class _TemperatureState extends State<Temperature> {
+//   late final TempDeviceWorker worker = TempDeviceWorker(
+//     mac: 'D0:05:00:00:00:67',
+//     model: 'YHW-6',
+//   );
+//   late TextEditingController specialInputController =
+//       TextEditingController(text: widget.temperature ?? '00.0');
+//   bool connectFailState = false;
+//   bool connectSuccessState = false;
+//   bool isConnect = false;
+//   @override
+//   void initState() {
+//     connect();
+
+//     worker.successEvent.addListener(_onSuccess);
+//     worker.connectErrorEvent.addListener(_onConnectFail);
+//     worker.connectedEvent.addListener(_onConnectSuccess);
+
+//     super.initState();
+//   }
+
+//   Future<void> connect() async {
+//     connectFailState = false;
+//     isConnect = true;
+//     connectSuccessState = false;
+//     setState(() {});
+//     await worker.connect();
+//   }
+
+//   Future<void> disconnect() async {
+//     worker.connectErrorEvent.removeListener(_onConnectFail);
+//     worker.connectedEvent.removeListener(_onConnectSuccess);
+//     worker.successEvent.removeListener(_onSuccess);
+//     await worker.disconnect();
+//   }
+
+//   @override
+//   void dispose() {
+//     super.dispose();
+//   }
+
+//   void _onSuccess(_, double e) {
+//     setState(() {
+//       specialInputController.text = e.toString();
+//       // connectFailState = false;
+//       // connectSuccessState = false;
+//       isConnect = false;
+//       // disconnect();
+//     });
+//   }
+
+//   void _onConnectFail(sender, e) {
+//     print('连接设备失败');
+//     connectFailState = true;
+//     connectSuccessState = false;
+//     isConnect = false;
+//     disconnect();
+//     setState(() {});
+//   }
+
+//   void _onConnectSuccess(sender, e) {
+//     connectSuccessState = true;
+//     connectFailState = false;
+//     isConnect = false;
+//     setState(() {});
+//   }
+
+//   @override
+//   Widget build(BuildContext context) {
+//     return VAlertDialog(
+//       title: widget.currentFormObject.label ?? '',
+//       width: 600,
+//       contentPadding: const EdgeInsets.symmetric(vertical: 12, horizontal: 24),
+//       content: buildMainWidget(),
+//       showCancel: true,
+//       onConfirm: () {
+//         disconnect();
+//         Get.back(result: specialInputController.text);
+//       },
+//       onCanceled: () {
+//         disconnect();
+//       },
+//     );
+//   }
+
+//   Widget buildInputField() {
+//     return Container(
+//       width: 350,
+//       padding: const EdgeInsets.only(left: 15),
+//       child: TextFormField(
+//         keyboardType: TextInputType.number,
+//         style: const TextStyle(
+//           fontSize: 100,
+//         ),
+//         showCursor: false,
+//         controller: specialInputController,
+//         decoration: const InputDecoration(
+//           labelStyle: TextStyle(
+//             fontSize: 100,
+//           ),
+//         ),
+//       ),
+//     );
+//   }
+
+//   Widget buildConnectFailText() {
+//     return const Text(
+//       '设备连接失败',
+//       style: TextStyle(
+//         color: Colors.red,
+//         fontSize: 25,
+//       ),
+//       textAlign: TextAlign.left,
+//     );
+//   }
+
+//   Widget buildConnectSuccessText() {
+//     return const Text(
+//       '设备连接成功',
+//       style: TextStyle(
+//         color: Colors.green,
+//         fontSize: 25,
+//       ),
+//       textAlign: TextAlign.left,
+//     );
+//   }
+
+//   Widget buildConnectingText() {
+//     return const Row(
+//       children: [
+//         Expanded(
+//           child: Text(
+//             '设备连接中',
+//             style: TextStyle(
+//               fontSize: 40,
+//               color: Colors.blue,
+//             ),
+//           ),
+//         ),
+//         CircularProgressIndicator(
+//           valueColor: AlwaysStoppedAnimation(
+//             Colors.blue,
+//           ),
+//         ),
+//         SizedBox(
+//           width: 20,
+//         ),
+//       ],
+//     );
+//   }
+
+//   Widget buildReconnectButton() {
+//     return Container(
+//       margin: const EdgeInsets.only(top: 4),
+//       width: 134,
+//       child: VButton(
+//         onTap: () async {
+//           /// TODO
+//           await connect();
+//           worker.connectErrorEvent.addListener(_onConnectFail);
+//           worker.connectedEvent.addListener(_onConnectSuccess);
+
+//           /// TODO 后面需要改,这边暂时演示用
+//           Future.delayed(const Duration(milliseconds: 8000), () {
+//             if (!connectSuccessState) {
+//               connectFailState = true;
+//             }
+//           });
+//         },
+//         child: const Row(
+//           mainAxisAlignment: MainAxisAlignment.center,
+//           children: [
+//             Icon(Icons.connected_tv_rounded, size: 24),
+//             SizedBox(
+//               width: 8,
+//             ),
+//             Text("重连", style: TextStyle(fontSize: 20)),
+//           ],
+//         ),
+//       ),
+//     );
+//   }
+
+//   Widget buildConnectStateWidgets() {
+//     return Column(
+//       children: [
+//         if (connectFailState) buildConnectFailText(),
+//         if (connectSuccessState) buildConnectSuccessText(),
+//         if (isConnect)
+//           buildConnectingText()
+//         else if (connectFailState)
+//           buildReconnectButton(),
+//       ],
+//     );
+//   }
+
+//   Widget buildMainWidget() {
+//     return SizedBox(
+//       height: 100,
+//       child: Row(
+//         children: [
+//           buildInputField(),
+//           Expanded(
+//             child: buildConnectStateWidgets(),
+//           ),
+//         ],
+//       ),
+//     );
+//   }
+// }

+ 379 - 0
lib/pages/medical/widgets/body_weight.dart

@@ -0,0 +1,379 @@
+import 'package:flutter/material.dart';
+import 'package:get/get.dart';
+import 'package:vnote_device_plugin/devices/weight.dart';
+import 'package:vnoteapp/managers/interfaces/permission.dart';
+import 'package:vnoteapp/pages/check/widgets/exam_configurable/exam_card.dart';
+
+class BodyWeight extends StatefulWidget {
+  const BodyWeight({
+    super.key,
+  });
+
+  @override
+  State<BodyWeight> createState() => _BodyWeightState();
+}
+
+class _BodyWeightState extends State<BodyWeight> {
+  var permissionManager = Get.find<IPermissionManager>();
+
+  late final WeightDeviceWorker worker = WeightDeviceWorker(
+    mac: 'CF:E4:2C:22:01:39',
+    model: 'CF398BLE',
+  );
+  late String bodyTemperature = '0';
+  bool connectFailState = false;
+  bool connectSuccessState = false;
+  bool isConnect = false;
+  @override
+  void initState() {
+    getPermission();
+    connect();
+
+    worker.successEvent.addListener(_onSuccess);
+    worker.connectErrorEvent.addListener(_onConnectFail);
+    worker.connectedEvent.addListener(_onConnectSuccess);
+
+    super.initState();
+  }
+
+  Future<void> connect() async {
+    connectFailState = false;
+    isConnect = true;
+    connectSuccessState = false;
+    setState(() {});
+    await worker.connect();
+  }
+
+  Future<void> disconnect() async {
+    worker.connectErrorEvent.removeListener(_onConnectFail);
+    worker.connectedEvent.removeListener(_onConnectSuccess);
+    worker.successEvent.removeListener(_onSuccess);
+    await worker.disconnect();
+  }
+
+  @override
+  void dispose() {
+    super.dispose();
+  }
+
+  void _onSuccess(_, double e) {
+    setState(() {
+      bodyTemperature = e.toString();
+      // connectFailState = false;
+      // connectSuccessState = false;
+      isConnect = false;
+      // disconnect();
+    });
+  }
+
+  void _onConnectFail(sender, e) {
+    print('连接设备失败');
+    connectFailState = true;
+    connectSuccessState = false;
+    isConnect = false;
+    disconnect();
+    setState(() {});
+  }
+
+  void _onConnectSuccess(sender, e) {
+    connectSuccessState = true;
+    connectFailState = false;
+    isConnect = false;
+    setState(() {});
+  }
+
+  // @override
+  // void initState() {
+  //   getPermission();
+  //   super.initState();
+  // }
+
+  Future<void> getPermission() async {
+    await permissionManager.requestLocationPermission();
+    await permissionManager.requestBluetoothConnectPermission();
+    await permissionManager.requestBluetoothAdvertisePermission();
+    await permissionManager.requestBluetoothScanPermission();
+  }
+
+  @override
+  Widget build(BuildContext context) {
+    return ExamCard(
+      title: '体重',
+      clickCard: () {},
+      content: Container(
+        alignment: Alignment.bottomRight,
+        padding: const EdgeInsets.only(
+          bottom: 20,
+          right: 30,
+          left: 40,
+        ),
+        // constraints: const BoxConstraints(maxHeight: 150),
+        child: FittedBox(
+          child: Row(
+            mainAxisAlignment: MainAxisAlignment.end,
+            crossAxisAlignment: CrossAxisAlignment.end,
+            children: [
+              RichText(
+                text: TextSpan(
+                  text: bodyTemperature,
+                  style: const TextStyle(
+                    fontSize: 80,
+                    color: Colors.black,
+                  ),
+                  children: const [
+                    TextSpan(
+                      text: 'kg',
+                      style: TextStyle(fontSize: 25),
+                    )
+                  ],
+                ),
+              ),
+            ],
+          ),
+        ),
+      ),
+    );
+  }
+
+  // Future<void> _buildTempertureInput(FormObject currentFormObject) async {
+  //   // Future.delayed(const Duration(milliseconds: 3000), () {
+  //   //   specialInputController.text = generateRandomNumber().toString();
+  //   //   widget.specialInput?.call(specialInputController.text);
+  //   //   setState(() {});
+  //   // });
+
+  //   final result = await Get.dialog(
+  //     Temperature(
+  //       currentFormObject: widget.currentFormObject,
+  //       temperature: widget.currentInputValue,
+  //     ),
+  //     barrierDismissible: false,
+  //   );
+  //   widget.specialInput?.call(result);
+  //   print(result);
+  // }
+}
+
+// class Temperature extends StatefulWidget {
+//   const Temperature({
+//     super.key,
+//     required this.currentFormObject,
+//     this.temperature,
+//   });
+//   final FormObject currentFormObject;
+//   final String? temperature;
+
+//   @override
+//   State<Temperature> createState() => _TemperatureState();
+// }
+
+// class _TemperatureState extends State<Temperature> {
+//   late final TempDeviceWorker worker = TempDeviceWorker(
+//     mac: 'D0:05:00:00:00:67',
+//     model: 'YHW-6',
+//   );
+//   late TextEditingController specialInputController =
+//       TextEditingController(text: widget.temperature ?? '00.0');
+//   bool connectFailState = false;
+//   bool connectSuccessState = false;
+//   bool isConnect = false;
+//   @override
+//   void initState() {
+//     connect();
+
+//     worker.successEvent.addListener(_onSuccess);
+//     worker.connectErrorEvent.addListener(_onConnectFail);
+//     worker.connectedEvent.addListener(_onConnectSuccess);
+
+//     super.initState();
+//   }
+
+//   Future<void> connect() async {
+//     connectFailState = false;
+//     isConnect = true;
+//     connectSuccessState = false;
+//     setState(() {});
+//     await worker.connect();
+//   }
+
+//   Future<void> disconnect() async {
+//     worker.connectErrorEvent.removeListener(_onConnectFail);
+//     worker.connectedEvent.removeListener(_onConnectSuccess);
+//     worker.successEvent.removeListener(_onSuccess);
+//     await worker.disconnect();
+//   }
+
+//   @override
+//   void dispose() {
+//     super.dispose();
+//   }
+
+//   void _onSuccess(_, double e) {
+//     setState(() {
+//       specialInputController.text = e.toString();
+//       // connectFailState = false;
+//       // connectSuccessState = false;
+//       isConnect = false;
+//       // disconnect();
+//     });
+//   }
+
+//   void _onConnectFail(sender, e) {
+//     print('连接设备失败');
+//     connectFailState = true;
+//     connectSuccessState = false;
+//     isConnect = false;
+//     disconnect();
+//     setState(() {});
+//   }
+
+//   void _onConnectSuccess(sender, e) {
+//     connectSuccessState = true;
+//     connectFailState = false;
+//     isConnect = false;
+//     setState(() {});
+//   }
+
+//   @override
+//   Widget build(BuildContext context) {
+//     return VAlertDialog(
+//       title: widget.currentFormObject.label ?? '',
+//       width: 600,
+//       contentPadding: const EdgeInsets.symmetric(vertical: 12, horizontal: 24),
+//       content: buildMainWidget(),
+//       showCancel: true,
+//       onConfirm: () {
+//         disconnect();
+//         Get.back(result: specialInputController.text);
+//       },
+//       onCanceled: () {
+//         disconnect();
+//       },
+//     );
+//   }
+
+//   Widget buildInputField() {
+//     return Container(
+//       width: 350,
+//       padding: const EdgeInsets.only(left: 15),
+//       child: TextFormField(
+//         keyboardType: TextInputType.number,
+//         style: const TextStyle(
+//           fontSize: 100,
+//         ),
+//         showCursor: false,
+//         controller: specialInputController,
+//         decoration: const InputDecoration(
+//           labelStyle: TextStyle(
+//             fontSize: 100,
+//           ),
+//         ),
+//       ),
+//     );
+//   }
+
+//   Widget buildConnectFailText() {
+//     return const Text(
+//       '设备连接失败',
+//       style: TextStyle(
+//         color: Colors.red,
+//         fontSize: 25,
+//       ),
+//       textAlign: TextAlign.left,
+//     );
+//   }
+
+//   Widget buildConnectSuccessText() {
+//     return const Text(
+//       '设备连接成功',
+//       style: TextStyle(
+//         color: Colors.green,
+//         fontSize: 25,
+//       ),
+//       textAlign: TextAlign.left,
+//     );
+//   }
+
+//   Widget buildConnectingText() {
+//     return const Row(
+//       children: [
+//         Expanded(
+//           child: Text(
+//             '设备连接中',
+//             style: TextStyle(
+//               fontSize: 40,
+//               color: Colors.blue,
+//             ),
+//           ),
+//         ),
+//         CircularProgressIndicator(
+//           valueColor: AlwaysStoppedAnimation(
+//             Colors.blue,
+//           ),
+//         ),
+//         SizedBox(
+//           width: 20,
+//         ),
+//       ],
+//     );
+//   }
+
+//   Widget buildReconnectButton() {
+//     return Container(
+//       margin: const EdgeInsets.only(top: 4),
+//       width: 134,
+//       child: VButton(
+//         onTap: () async {
+//           /// TODO
+//           await connect();
+//           worker.connectErrorEvent.addListener(_onConnectFail);
+//           worker.connectedEvent.addListener(_onConnectSuccess);
+
+//           /// TODO 后面需要改,这边暂时演示用
+//           Future.delayed(const Duration(milliseconds: 8000), () {
+//             if (!connectSuccessState) {
+//               connectFailState = true;
+//             }
+//           });
+//         },
+//         child: const Row(
+//           mainAxisAlignment: MainAxisAlignment.center,
+//           children: [
+//             Icon(Icons.connected_tv_rounded, size: 24),
+//             SizedBox(
+//               width: 8,
+//             ),
+//             Text("重连", style: TextStyle(fontSize: 20)),
+//           ],
+//         ),
+//       ),
+//     );
+//   }
+
+//   Widget buildConnectStateWidgets() {
+//     return Column(
+//       children: [
+//         if (connectFailState) buildConnectFailText(),
+//         if (connectSuccessState) buildConnectSuccessText(),
+//         if (isConnect)
+//           buildConnectingText()
+//         else if (connectFailState)
+//           buildReconnectButton(),
+//       ],
+//     );
+//   }
+
+//   Widget buildMainWidget() {
+//     return SizedBox(
+//       height: 100,
+//       child: Row(
+//         children: [
+//           buildInputField(),
+//           Expanded(
+//             child: buildConnectStateWidgets(),
+//           ),
+//         ],
+//       ),
+//     );
+//   }
+// }

+ 0 - 14
lib/pages/patient/create/view.dart

@@ -94,20 +94,6 @@ class CreatePatientPage extends GetView<CreatePatientController> {
     );
   }
 
-  // Floating floating = Floating(
-  //   GestureDetector(
-  //     onTap: () {
-  //       print('You tapped the floating window!');
-  //     },
-  //     child: Container(
-  //       width: 100,
-  //       height: 100,
-  //       color: Colors.red,
-  //     ),
-  //   ),
-  //   slideType: FloatingSlideType.onRightAndBottom,
-  //   isShowLog: true,
-  // );
   VSideNavMenuItem _buildLogOutItem() {
     return VSideNavMenuItem(
       title: "个人信息",

+ 4 - 0
lib/pages/patient/detail/controller.dart

@@ -66,6 +66,10 @@ class PatientDetailController extends FControllerBase {
   /// 前往诊疗展示页
   void gotoExam() {
     //
+    Get.toNamed(
+      "/medical",
+      parameters: {"patientCode": state.code},
+    );
   }
 
   ///前往体检记录

+ 2 - 2
lib/pages/patient/detail/widgets/base_info.dart

@@ -1,6 +1,7 @@
 import 'package:fis_jsonrpc/rpc.dart';
 import 'package:flutter/material.dart';
 import 'package:get/get.dart';
+import 'package:vnoteapp/consts/styles.dart';
 
 import '../controller.dart';
 
@@ -92,7 +93,6 @@ class _InfoCardContainer extends StatelessWidget {
   final Widget child;
 
   const _InfoCardContainer({
-    super.key,
     required this.child,
   });
 
@@ -103,7 +103,7 @@ class _InfoCardContainer extends StatelessWidget {
       padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
       decoration: BoxDecoration(
         color: Colors.white,
-        borderRadius: BorderRadius.circular(8),
+        borderRadius: GlobalStyles.borderRadius,
       ),
       child: child,
     );

+ 16 - 1
lib/pages/patient/detail/widgets/functions_panel.dart

@@ -1,5 +1,15 @@
+/*
+ * @Descripttion: 
+ * @version: 
+ * @Author: guanxiaoxin
+ * @Date: 2023-10-16 13:36:49
+ * @LastEditors: guanxiaoxin
+ * @LastEditTime: 2023-10-18 17:36:22
+ * @FilePath: \VNoteApp\lib\pages\patient\detail\widgets\functions_panel.dart
+ */
 import 'package:flutter/material.dart';
 import 'package:get/get.dart';
+import 'package:vnoteapp/consts/styles.dart';
 import 'package:vnoteapp/pages/widgets/function_button.dart';
 
 import '../controller.dart';
@@ -15,7 +25,7 @@ class FunctionsPanel extends GetView<PatientDetailController> {
       margin: const EdgeInsets.all(8).copyWith(left: 0, right: 12),
       decoration: BoxDecoration(
         color: Colors.white,
-        borderRadius: BorderRadius.circular(8),
+        borderRadius: GlobalStyles.borderRadius,
       ),
       padding: const EdgeInsets.symmetric(horizontal: 0, vertical: 12)
           .copyWith(right: 0),
@@ -75,6 +85,11 @@ class FunctionsPanel extends GetView<PatientDetailController> {
             icon: _buildImgIcon("签约记录.png"),
             onTap: controller.gotoContractRecords,
           ),
+          FunctionButton(
+            label: "诊疗展示",
+            icon: _buildImgIcon("诊疗.png"),
+            onTap: controller.gotoExam,
+          ),
         ],
       ),
     );

+ 6 - 5
lib/pages/patient/detail/widgets/tag_cards.dart

@@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
 import 'package:get/get.dart';
 import 'package:vnoteapp/components/checkbox_button.dart';
 import 'package:vnoteapp/components/dynamic_drawer.dart';
+import 'package:vnoteapp/consts/styles.dart';
 import 'package:vnoteapp/managers/contract/index.dart';
 import 'package:vnoteapp/pages/controllers/crowd_labels.dart';
 
@@ -259,7 +260,7 @@ class _TitleInfoCardContainer extends StatelessWidget {
       alignment: Alignment.topLeft,
       decoration: BoxDecoration(
         color: Colors.white,
-        borderRadius: BorderRadius.circular(8),
+        borderRadius: GlobalStyles.borderRadius,
       ),
       child: Column(
         children: [
@@ -279,8 +280,8 @@ class _TitleInfoCardContainer extends StatelessWidget {
               ),
               // color: titleBgColor ?? Theme.of(context).primaryColor,
               borderRadius: const BorderRadius.only(
-                topLeft: Radius.circular(8),
-                topRight: Radius.circular(8),
+                topLeft: GlobalStyles.borderRadiusValue,
+                topRight: GlobalStyles.borderRadiusValue,
               ),
             ),
             child: titleWidget,
@@ -314,7 +315,7 @@ class _CrowdLabelTag extends StatelessWidget {
         backgroundColor ?? Theme.of(context).primaryColor.withOpacity(.6);
     return Material(
       child: InkWell(
-        borderRadius: BorderRadius.circular(8),
+        borderRadius: GlobalStyles.borderRadius,
         onTap: onTap != null ? () => onTap!.call(code) : null,
         child: IntrinsicWidth(
           child: ConstrainedBox(
@@ -324,7 +325,7 @@ class _CrowdLabelTag extends StatelessWidget {
               height: 32,
               decoration: BoxDecoration(
                 color: color,
-                borderRadius: BorderRadius.circular(8),
+                borderRadius: GlobalStyles.borderRadius,
               ),
               child: Text(
                 name,

+ 2 - 2
lib/pages/patient/info/view.dart

@@ -3,6 +3,7 @@ import 'package:get/get.dart';
 import 'package:vnoteapp/architecture/utils/prompt_box.dart';
 import 'package:vnoteapp/components/appbar.dart';
 import 'package:vnoteapp/components/button.dart';
+import 'package:vnoteapp/consts/styles.dart';
 import 'package:vnoteapp/pages/patient/info/widgets/base.dart';
 
 import 'controller.dart';
@@ -92,7 +93,6 @@ class _NavBarItemWidget extends StatelessWidget {
   final NavAnchorType anchor;
 
   const _NavBarItemWidget({
-    super.key,
     required this.anchor,
   });
 
@@ -163,7 +163,7 @@ class _NavWidget extends GetView<PatientInfoController> {
       margin: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
       decoration: BoxDecoration(
         color: Colors.white,
-        borderRadius: BorderRadius.circular(8),
+        borderRadius: GlobalStyles.borderRadius,
       ),
       child: Stack(
         children: [

+ 4 - 3
lib/pages/patient/list/view.dart

@@ -9,6 +9,7 @@ import 'package:vnoteapp/components/dynamic_drawer.dart';
 import 'package:vnoteapp/components/input.dart';
 import 'package:vnoteapp/components/search_input.dart';
 import 'package:vnoteapp/consts/rpc_enum_labels.dart';
+import 'package:vnoteapp/consts/styles.dart';
 import 'package:vnoteapp/managers/contract/index.dart';
 import 'package:vnoteapp/pages/home/controller.dart';
 import 'package:vnoteapp/pages/patient/list/widgets/status.dart';
@@ -358,14 +359,14 @@ class _PatientCard extends StatelessWidget {
       ],
     );
     return Material(
-      borderRadius: BorderRadius.circular(8),
+      borderRadius: GlobalStyles.borderRadius,
       child: Ink(
         decoration: BoxDecoration(
           color: Colors.white,
-          borderRadius: BorderRadius.circular(8),
+          borderRadius: GlobalStyles.borderRadius,
         ),
         child: InkWell(
-          borderRadius: BorderRadius.circular(8),
+          borderRadius: GlobalStyles.borderRadius,
           onTap: () {
             Get.find<PatientListController>().gotoDetail(dto.code!);
           },

+ 6 - 1
lib/routes/routes.dart

@@ -7,6 +7,7 @@ import 'package:vnoteapp/pages/contract/package_list/widgets/service_information
 import 'package:vnoteapp/pages/from_page/controller.dart';
 import 'package:vnoteapp/pages/check/follow_up_record/controller.dart';
 import 'package:vnoteapp/pages/check/follow_up_record/view.dart';
+import 'package:vnoteapp/pages/medical/view.dart';
 import 'package:vnoteapp/pages/settings/center/controller.dart';
 import 'package:vnoteapp/pages/settings/center/view.dart';
 import 'package:vnoteapp/routes/route_setting.dart';
@@ -120,7 +121,7 @@ class Routes {
       "/patient/create",
       // participatesInRootNavigator: false,
       // preventDuplicates: true,
-      () => CreatePatientPage(),
+      () => const CreatePatientPage(),
       binding: BindingsBuilder(
         () {
           Get.lazyPut(() => CrowdLabelsController());
@@ -299,5 +300,9 @@ class Routes {
         },
       ),
     ),
+    VRouteSetting('/medical', () => const MedicalPage(),
+        binding: BindingsBuilder(() {
+      Get.put(CreatePatientController());
+    }))
   ];
 }

+ 1 - 1
pubspec.yaml

@@ -49,7 +49,7 @@ dependencies:
   vnote_device_plugin:
     git:
       url: http://git.ius.plus:88/Project-VNOTE/FlutterDevicePlugin.git
-      ref: 1f44b6b7
+      ref: 4d180550
     # path: ..\FlutterDevicePlugin
   particles_flutter: 0.1.4
   cool_dropdown: 2.1.0