Bläddra i källkod

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

guanxinyi 1 år sedan
förälder
incheckning
8a5f639ecf
2 ändrade filer med 52 tillägg och 25 borttagningar
  1. 16 10
      lib/pages/medical/view.dart
  2. 36 15
      lib/pages/patient/list/view.dart

+ 16 - 10
lib/pages/medical/view.dart

@@ -35,6 +35,7 @@ class MedicalPage extends GetView<MedicalController> {
               )),
             ],
           ),
+          floatingActionButton: _buildSaveButton(context),
         );
       },
     );
@@ -109,7 +110,6 @@ class MedicalPage extends GetView<MedicalController> {
               ],
             ),
           ),
-          _buildSaveButton(),
         ],
       ),
     );
@@ -189,19 +189,25 @@ class MedicalPage extends GetView<MedicalController> {
     );
   }
 
-  Widget _buildSaveButton() {
+  Widget _buildSaveButton(BuildContext context) {
     return Obx(() {
       if (Store.user.currentSelectPatientInfo == null) {
         return const SizedBox();
       }
-      return Positioned(
-        bottom: 100,
-        right: 16,
-        child: VButton(
-          onTap: controller.createDiagnosis,
-          child: const Text(
-            '提交',
-            style: TextStyle(fontSize: 26),
+      return FloatingActionButton.extended(
+        backgroundColor: Theme.of(context).primaryColor,
+        onPressed: controller.createDiagnosis,
+        label: const SizedBox(
+          width: 240,
+          height: 60,
+          child: Center(
+            child: Text(
+              '提交',
+              style: TextStyle(
+                fontSize: 26,
+                color: Colors.white,
+              ),
+            ),
           ),
         ),
       );

+ 36 - 15
lib/pages/patient/list/view.dart

@@ -260,21 +260,42 @@ class PatientListPage extends GetView<PatientListController> {
           for (var i = 0; i < list.length; i++) {
             children.add(_PatientCard(dto: list[i]));
           }
-          return Scrollbar(
-            trackVisibility: true,
-            controller: scrollController,
-            child: GridView(
-              shrinkWrap: true,
-              controller: scrollController,
-              gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
-                crossAxisCount: 3,
-                mainAxisSpacing: 16,
-                crossAxisSpacing: 20,
-                childAspectRatio: 360 / 180,
-              ),
-              children: children,
-            ),
-          );
+          return children.isEmpty
+              ? Container(
+                  margin: const EdgeInsets.only(top: 80),
+                  child: Column(
+                    children: [
+                      Center(
+                        child: Image.asset(
+                          "assets/images/no_data.png",
+                          width: 300,
+                          height: 300,
+                          fit: BoxFit.cover,
+                        ),
+                      ),
+                      const Text(
+                        "暂无数据,先看看别的吧",
+                        style: TextStyle(fontSize: 18),
+                      ),
+                    ],
+                  ),
+                )
+              : Scrollbar(
+                  trackVisibility: true,
+                  controller: scrollController,
+                  child: GridView(
+                    shrinkWrap: true,
+                    controller: scrollController,
+                    gridDelegate:
+                        const SliverGridDelegateWithFixedCrossAxisCount(
+                      crossAxisCount: 3,
+                      mainAxisSpacing: 16,
+                      crossAxisSpacing: 20,
+                      childAspectRatio: 360 / 180,
+                    ),
+                    children: children,
+                  ),
+                );
         },
       ),
     );