yangyang hace 2 años
padre
commit
6286d07b91

+ 4 - 2
android/app/src/main/AndroidManifest.xml

@@ -17,9 +17,11 @@
                  while the Flutter UI initializes. After that, this theme continues
                  while the Flutter UI initializes. After that, this theme continues
                  to determine the Window background behind the Flutter UI. -->
                  to determine the Window background behind the Flutter UI. -->
             <meta-data
             <meta-data
+                android:name="io.flutter.embedding.android.SplashScreenDrawable"
+                android:resource="@drawable/launch_background" />
+            <meta-data
               android:name="io.flutter.embedding.android.NormalTheme"
               android:name="io.flutter.embedding.android.NormalTheme"
-              android:resource="@style/NormalTheme"
-              />
+              android:resource="@style/NormalTheme" />
             <intent-filter>
             <intent-filter>
                 <action android:name="android.intent.action.MAIN"/>
                 <action android:name="android.intent.action.MAIN"/>
                 <category android:name="android.intent.category.LAUNCHER"/>
                 <category android:name="android.intent.category.LAUNCHER"/>

+ 3 - 3
android/app/src/main/res/drawable-v21/launch_background.xml

@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <!-- Modify this file to customize your launch splash screen -->
 <!-- Modify this file to customize your launch splash screen -->
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:drawable="?android:colorBackground" />
+    <item android:drawable="@mipmap/bg" />
 
 
     <!-- You can insert your own image assets here -->
     <!-- You can insert your own image assets here -->
-    <!-- <item>
+   <item>
         <bitmap
         <bitmap
             android:gravity="center"
             android:gravity="center"
             android:src="@mipmap/launch_image" />
             android:src="@mipmap/launch_image" />
-    </item> -->
+    </item>
 </layer-list>
 </layer-list>

+ 5 - 3
android/app/src/main/res/drawable/launch_background.xml

@@ -1,12 +1,14 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <!-- Modify this file to customize your launch splash screen -->
 <!-- Modify this file to customize your launch splash screen -->
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
 <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
-    <item android:drawable="@android:color/white" />
+    <item
+        android:drawable="@mipmap/bg"
+        />
 
 
     <!-- You can insert your own image assets here -->
     <!-- You can insert your own image assets here -->
-    <!-- <item>
+    <item>
         <bitmap
         <bitmap
             android:gravity="center"
             android:gravity="center"
             android:src="@mipmap/launch_image" />
             android:src="@mipmap/launch_image" />
-    </item> -->
+    </item>
 </layer-list>
 </layer-list>

BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-xhdpi/bg.png


BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-xhdpi/launch_image.png


BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-xxhdpi/launch_image.png


BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png


BIN
android/app/src/main/res/mipmap-xxxhdpi/launch_image.png


+ 3 - 1
android/app/src/main/res/values/styles.xml

@@ -4,7 +4,8 @@
     <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
     <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
         <!-- Show a splash screen on the activity. Automatically removed when
         <!-- Show a splash screen on the activity. Automatically removed when
              the Flutter engine draws its first frame -->
              the Flutter engine draws its first frame -->
-        <item name="android:windowBackground">@drawable/launch_background</item>
+        <item name="android:windowBackground">?android:colorBackground</item>
+        <item name="android:windowTranslucentNavigation">true</item>
     </style>
     </style>
     <!-- Theme applied to the Android Window as soon as the process has started.
     <!-- Theme applied to the Android Window as soon as the process has started.
          This theme determines the color of the Android Window while your
          This theme determines the color of the Android Window while your
@@ -14,5 +15,6 @@
          This Theme is only used starting with V2 of Flutter's Android embedding. -->
          This Theme is only used starting with V2 of Flutter's Android embedding. -->
     <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
     <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
         <item name="android:windowBackground">?android:colorBackground</item>
         <item name="android:windowBackground">?android:colorBackground</item>
+        <item name="android:windowTranslucentNavigation">true</item>
     </style>
     </style>
 </resources>
 </resources>

BIN
images/login_bg.png


BIN
images/login_bg_write.png


+ 1 - 1
lib/common/style/gsy_style.dart

@@ -50,7 +50,7 @@ class GSYConstant {
   static const String app_default_share_url =
   static const String app_default_share_url =
       "https://github.com/CarGuo/gsy_github_app_flutter";
       "https://github.com/CarGuo/gsy_github_app_flutter";
 
 
-  static const lagerTextSize = 30.0;
+  static const lagerTextSize = 39.0;
   static const bigTextSize = 20.0;
   static const bigTextSize = 20.0;
   static const normalTextSize = 18.0;
   static const normalTextSize = 18.0;
   static const middleTextWhiteSize = 16.0;
   static const middleTextWhiteSize = 16.0;

+ 2 - 2
lib/model/equipment_info_entity.dart

@@ -24,7 +24,7 @@ class EquipmentInfoData with JsonConvert<EquipmentInfoData> {
 	late int connectionProtocol;
 	late int connectionProtocol;
 	late String ip;
 	late String ip;
 	late dynamic lastUpdateOn;
 	late dynamic lastUpdateOn;
-	late String activationOn;
+	late String activationOn='';
 	late dynamic positionId;
 	late dynamic positionId;
 	late dynamic number;
 	late dynamic number;
 	late String speedA;
 	late String speedA;
@@ -35,7 +35,7 @@ class EquipmentInfoData with JsonConvert<EquipmentInfoData> {
 	late String holeCountB;
 	late String holeCountB;
 	late dynamic activePeriod;
 	late dynamic activePeriod;
 	late String createdOn;
 	late String createdOn;
-	late String lastOnlineOn;
+	late String lastOnlineOn='';
 	late String iotId;
 	late String iotId;
 	late dynamic description;
 	late dynamic description;
 	late String customerId;
 	late String customerId;

+ 6 - 1
lib/page/device/device_manage_update_page.dart

@@ -1,3 +1,4 @@
+import 'package:deus_app/common/dialog/CloseTaskDialog.dart';
 import 'package:deus_app/common/style/TitleBar.dart';
 import 'package:deus_app/common/style/TitleBar.dart';
 import 'package:deus_app/common/style/gsy_style.dart';
 import 'package:deus_app/common/style/gsy_style.dart';
 import 'package:deus_app/common/utils/ConstantString.dart';
 import 'package:deus_app/common/utils/ConstantString.dart';
@@ -291,7 +292,11 @@ class _DeviceManageUpdatePage extends State<DeviceManageUpdatePage>{
         color: Color(0xFF4875EC),
         color: Color(0xFF4875EC),
         textColor: GSYColors.textWhite,
         textColor: GSYColors.textWhite,
         fontSize: 16,
         fontSize: 16,
-        onPress: parameter,
+        onPress: (){
+          CloseTaskDialog.showAlertDialog(context, () {
+            parameter();
+          }, '您确认修改参数?');
+        },
       ),
       ),
     );
     );
   }
   }

+ 199 - 178
lib/page/home/home_page.dart

@@ -21,8 +21,6 @@ class HomePage extends StatefulWidget {
   _MineViewPageState createState() => _MineViewPageState();
   _MineViewPageState createState() => _MineViewPageState();
 }
 }
 
 
-
-
 class _MineViewPageState extends State<HomePage> {
 class _MineViewPageState extends State<HomePage> {
   List items = [
   List items = [
     {"name": "今日维保任务", "num": 0},
     {"name": "今日维保任务", "num": 0},
@@ -81,195 +79,218 @@ class _MineViewPageState extends State<HomePage> {
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
-    return Scaffold(
-        extendBodyBehindAppBar: true,
-        appBar: AppBar(
-          shadowColor: Colors.transparent,
-          backgroundColor: Colors.transparent,
-          systemOverlayStyle: SystemUiOverlayStyle.light
-              .copyWith(statusBarColor: Colors.transparent),
-          // title: Text(user != null ? user["nickname"] : "",style:TextStyle(color: Colors.white),),
-          centerTitle: true,
-          elevation: 0.0,
-          toolbarHeight: 0,
-        ),
-        backgroundColor: const Color(0xfff4f6ff),
-        body: Column(
-          children: [
-            Container(
-              padding: EdgeInsets.only(
-                  left: 15,
-                  right: 15,
-                  top: MediaQuery.of(context).padding.top + 10),
-              height: MediaQuery.of(context).size.width * 0.53,
-              decoration: BoxDecoration(
-                image: DecorationImage(
-                    image: AssetImage("images/home_bg.jpg"), fit: BoxFit.cover),
-              ),
-              child: Column(
-                children: [
-                  Row(
-                    mainAxisAlignment: MainAxisAlignment.end,
-                    children: [
-                      IconButton(
-                        icon: Icon(Icons.settings),
-                        color: Colors.white,
-                        onPressed: () => showToast("text"),
-                      ),
-                    ],
+
+
+    DateTime? _dateTime;//上次点击的时间
+
+    return WillPopScope(
+        child: Scaffold(
+            extendBodyBehindAppBar: true,
+            appBar: AppBar(
+              shadowColor: Colors.transparent,
+              backgroundColor: Colors.transparent,
+              systemOverlayStyle: SystemUiOverlayStyle.light
+                  .copyWith(statusBarColor: Colors.transparent),
+              // title: Text(user != null ? user["nickname"] : "",style:TextStyle(color: Colors.white),),
+              centerTitle: true,
+              elevation: 0.0,
+              toolbarHeight: 0,
+            ),
+            backgroundColor: const Color(0xfff4f6ff),
+            body: Column(
+              children: [
+                Container(
+                  padding: EdgeInsets.only(
+                      left: 15,
+                      right: 15,
+                      top: MediaQuery.of(context).padding.top),
+                  height: MediaQuery.of(context).size.width * 0.53,
+                  decoration: BoxDecoration(
+                    image: DecorationImage(
+                        image: AssetImage("images/home_bg.jpg"),
+                        fit: BoxFit.cover),
                   ),
                   ),
-                  Row(
+                  child: Column(
                     children: [
                     children: [
-                      Image.asset(
-                        "images/head.png",
-                        width: 40,
-                        height: 40,
-                      ),
-                      SizedBox(width: 10),
-                      Text(
-                        StoreHelper.getStorage(ConstantString.name),
-                        style: TextStyle(
+                      Row(
+                        mainAxisAlignment: MainAxisAlignment.end,
+                        children: [
+                          IconButton(
+                            icon: Icon(Icons.settings),
                             color: Colors.white,
                             color: Colors.white,
-                            fontWeight: FontWeight.bold,
-                            fontSize: 15),
-                      )
-                    ],
-                  ),
-                  SizedBox(height: 20),
-                  Row(
-                    children: [
-                      SizedBox(width: 50),
-                      Text(StoreHelper.getStorage(ConstantString.phone),
-                          style: TextStyle(
-                              color: Colors.white,
-                              fontWeight: FontWeight.bold,
-                              fontSize: 18))
-                    ],
-                  ),
-                  SizedBox(height: 10),
-                  Row(
-                    children: [
-                      SizedBox(width: 50),
-                      Text(StoreHelper.getStorage(ConstantString.orgName),
-                          style:
-                              TextStyle(color: Color(0xffaaaaaa), fontSize: 15))
-                    ],
-                  ),
-                ],
-              ),
-            ),
-            Container(
-              padding: EdgeInsets.all(10),
-              margin: EdgeInsets.all(15),
-              decoration: BoxDecoration(
-                  color: Colors.white, borderRadius: BorderRadius.circular(10)),
-              child: Column(
-                crossAxisAlignment: CrossAxisAlignment.start,
-                children: [
-                  SizedBox(height: 15),
-                  Container(
-                      width: double.infinity,
-                      height: 40,
-                      alignment: Alignment.center,
-                      decoration: BoxDecoration(
-                          color:
-                              alarmCount > 0 ? Colors.red : Color(0xff74b900),
-                          borderRadius: BorderRadius.circular(10)),
-                      child: Text(
-                          alarmCount > 0 ? '今日告警数量:$alarmCount' : "当前设备运行正常",
-                          style: TextStyle(
-                              color: Color(0xffffffff), fontSize: 15))),
-                  SizedBox(
-                    height: 20,
-                  ),
-                  Text("待办任务",
-                      style: TextStyle(color: Color(0xff000000), fontSize: 18)),
-                  SizedBox(
-                    height: 10,
-                  ),
-                  GridView.builder(
-                    shrinkWrap: true,
-                    padding: const EdgeInsets.only(
-                      top: 10,
-                    ),
-                    gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
-                      crossAxisCount: 1,
-                      mainAxisSpacing: 10,
-                      crossAxisSpacing: 10,
-                      childAspectRatio: MediaQuery.of(context).size.width / 30,
-                    ),
-                    itemBuilder: (context, index) {
-                      Map item = items[index];
-                      return Row(
-                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                            onPressed: () => {},
+                          ),
+                        ],
+                      ),
+                      SizedBox(width: 5),
+                      Row(
                         children: [
                         children: [
-                          Text(item["name"],
+                          Image.asset(
+                            "images/head.png",
+                            width: 35,
+                            height: 35,
+                          ),
+                          SizedBox(width: 10),
+                          Text(
+                            StoreHelper.getStorage(ConstantString.name),
+                            style: TextStyle(
+                                color: Colors.white,
+                                fontWeight: FontWeight.bold,
+                                fontSize: 15),
+                          )
+                        ],
+                      ),
+                      SizedBox(height: 5),
+                      Row(
+                        children: [
+                          SizedBox(width: 45),
+                          Text(StoreHelper.getStorage(ConstantString.phone),
                               style: TextStyle(
                               style: TextStyle(
-                                  color: Color(0xff000000), fontSize: 13)),
-                          Text(item["num"].toString(),
+                                  color: Colors.white,
+                                  fontWeight: FontWeight.bold,
+                                  fontSize: 20))
+                        ],
+                      ),
+                      SizedBox(height: 6),
+                      Row(
+                        children: [
+                          SizedBox(width: 45),
+                          Text(StoreHelper.getStorage(ConstantString.orgName),
                               style: TextStyle(
                               style: TextStyle(
-                                  color: Color(0xff000000), fontSize: 13))
+                                  color: Color(0xFFB7CAFF), fontSize: 14))
                         ],
                         ],
-                      );
-                    },
-                    itemCount: items.length,
-                  )
-                ],
-              ),
-            ),
-            Container(
-              margin: EdgeInsets.only(left: 15, right: 15),
-              decoration:
-                  BoxDecoration(borderRadius: BorderRadius.circular(10)),
-              child: Column(
-                crossAxisAlignment: CrossAxisAlignment.start,
-                children: [
-                  GridView.builder(
-                    shrinkWrap: true,
-                    padding: const EdgeInsets.only(
-                      top: 0,
-                    ),
-                    gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
-                      crossAxisCount: 3,
-                      mainAxisSpacing: 10,
-                      crossAxisSpacing: 10,
-                      childAspectRatio:
-                          (MediaQuery.of(context).size.width / 3 - 60 / 3) /
-                              120,
-                    ),
-                    itemBuilder: (context, index) {
-                      Map item = icons[index];
-                      return GestureDetector(
-                        onTap: () => Navigator.pushNamed(context, item['jump']),
-                        child: Container(
-                          padding: EdgeInsets.all(5),
+                      ),
+                    ],
+                  ),
+                ),
+                Container(
+                  padding: EdgeInsets.all(10),
+                  margin: EdgeInsets.all(15),
+                  decoration: BoxDecoration(
+                      color: Colors.white,
+                      borderRadius: BorderRadius.circular(10)),
+                  child: Column(
+                    crossAxisAlignment: CrossAxisAlignment.start,
+                    children: [
+                      SizedBox(height: 15),
+                      Container(
+                          width: double.infinity,
+                          height: 40,
+                          alignment: Alignment.center,
                           decoration: BoxDecoration(
                           decoration: BoxDecoration(
-                              color: Color(0xffffffff),
+                              color: alarmCount > 0
+                                  ? Colors.red
+                                  : Color(0xff74b900),
                               borderRadius: BorderRadius.circular(10)),
                               borderRadius: BorderRadius.circular(10)),
-                          child: Column(
-                            crossAxisAlignment: CrossAxisAlignment.center,
-                            mainAxisAlignment: MainAxisAlignment.center,
+                          child: Text(
+                              alarmCount > 0
+                                  ? '今日告警数量:$alarmCount'
+                                  : "当前设备运行正常",
+                              style: TextStyle(
+                                  color: Color(0xffffffff), fontSize: 15))),
+                      SizedBox(
+                        height: 20,
+                      ),
+                      Text("待办任务",
+                          style: TextStyle(
+                              color: Color(0xff000000), fontSize: 18)),
+                      SizedBox(
+                        height: 10,
+                      ),
+                      GridView.builder(
+                        shrinkWrap: true,
+                        padding: const EdgeInsets.only(
+                          top: 10,
+                        ),
+                        gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
+                          crossAxisCount: 1,
+                          mainAxisSpacing: 10,
+                          crossAxisSpacing: 10,
+                          childAspectRatio:
+                              MediaQuery.of(context).size.width / 30,
+                        ),
+                        itemBuilder: (context, index) {
+                          Map item = items[index];
+                          return Row(
+                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                             children: [
                             children: [
-                              Image.asset(
-                                item["image"],
-                                width: 60,
-                                height: 60,
-                              ),
-                              SizedBox(height: 10),
-                              Text(item["name"].toString(),
+                              Text(item["name"],
+                                  style: TextStyle(
+                                      color: Color(0xff000000), fontSize: 13)),
+                              Text(item["num"].toString(),
                                   style: TextStyle(
                                   style: TextStyle(
                                       color: Color(0xff000000), fontSize: 13))
                                       color: Color(0xff000000), fontSize: 13))
                             ],
                             ],
-                          ),
+                          );
+                        },
+                        itemCount: items.length,
+                      )
+                    ],
+                  ),
+                ),
+                Container(
+                  margin: EdgeInsets.only(left: 15, right: 15),
+                  decoration:
+                      BoxDecoration(borderRadius: BorderRadius.circular(10)),
+                  child: Column(
+                    crossAxisAlignment: CrossAxisAlignment.start,
+                    children: [
+                      GridView.builder(
+                        shrinkWrap: true,
+                        padding: const EdgeInsets.only(
+                          top: 0,
                         ),
                         ),
-                      );
-                    },
-                    itemCount: icons.length,
-                  )
-                ],
-              ),
-            ),
-          ],
-        ));
+                        gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
+                          crossAxisCount: 3,
+                          mainAxisSpacing: 10,
+                          crossAxisSpacing: 10,
+                          childAspectRatio:
+                              (MediaQuery.of(context).size.width / 3 - 60 / 3) /
+                                  120,
+                        ),
+                        itemBuilder: (context, index) {
+                          Map item = icons[index];
+                          return GestureDetector(
+                            onTap: () =>
+                                Navigator.pushNamed(context, item['jump']),
+                            child: Container(
+                              padding: EdgeInsets.all(5),
+                              decoration: BoxDecoration(
+                                  color: Color(0xffffffff),
+                                  borderRadius: BorderRadius.circular(10)),
+                              child: Column(
+                                crossAxisAlignment: CrossAxisAlignment.center,
+                                mainAxisAlignment: MainAxisAlignment.center,
+                                children: [
+                                  Image.asset(
+                                    item["image"],
+                                    width: 60,
+                                    height: 60,
+                                  ),
+                                  SizedBox(height: 10),
+                                  Text(item["name"].toString(),
+                                      style: TextStyle(
+                                          color: Color(0xff000000),
+                                          fontSize: 13))
+                                ],
+                              ),
+                            ),
+                          );
+                        },
+                        itemCount: icons.length,
+                      )
+                    ],
+                  ),
+                ),
+              ],
+            )),
+        onWillPop: () async{
+          if(_dateTime == null || DateTime.now().difference(_dateTime!) > const Duration(seconds: 1)){
+            _dateTime = DateTime.now();
+            showToast('再按一次退出');
+            return false;
+          }
+          return true;
+        });
   }
   }
 }
 }

+ 118 - 54
lib/page/login/login_page.dart

@@ -14,11 +14,6 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
 import '../../common/utils/ConstantString.dart';
 import '../../common/utils/ConstantString.dart';
 import '../../generated/json/login_response_entity_helper.dart';
 import '../../generated/json/login_response_entity_helper.dart';
 
 
-// import 'package:deus_app/common/utils/common_utils.dart';
-// import 'package:deus_app/widget/animated_background.dart';
-// import 'package:deus_app/widget/gsy_flex_button.dart';
-// import 'package:deus_app/widget/gsy_input_widget.dart';
-// import 'package:deus_app/widget/particle/particle_widget.dart';
 
 
 /// 登录页
 /// 登录页
 /// Created by Ocean
 /// Created by Ocean
@@ -43,26 +38,75 @@ class _LoginPageState extends State<LoginPage> {
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
     StoreHelper.init();
     StoreHelper.init();
     return Scaffold(
     return Scaffold(
-      appBar: AppBar(
-        centerTitle: true,
-        backgroundColor: Color(0xFF4875EC),
-        title: const Text(ConstantString.loginText,style: TextStyle(fontSize: 16)),
-      ),
-      body: Center(
+      resizeToAvoidBottomInset: false,
+      body: Container(
+        decoration: const BoxDecoration(
+          image: DecorationImage(
+            fit: BoxFit.cover,
+            image: AssetImage("images/login_bg.png"),
+          ),
+        ),
+
         child: Column(
         child: Column(
-          crossAxisAlignment: CrossAxisAlignment.center,
-          mainAxisAlignment: MainAxisAlignment.center,
+          crossAxisAlignment: CrossAxisAlignment.start,
+          mainAxisAlignment: MainAxisAlignment.start,
           children: <Widget>[
           children: <Widget>[
-            //   _getRoundImage('images/logo.png', 100.0),
-            //   SizedBox(
-            //     height: 60,
-            //   ),
-            _getUsernameInput(),
-            _getPasswordInput(),
             SizedBox(
             SizedBox(
-              height: 10,
+              height: MediaQuery.of(context).size.height / 6,
+            ),
+            Container(
+              margin: EdgeInsets.only(left: 30),
+              child: const Text('鑫森科技',
+                  style: TextStyle(
+                    color: Colors.white,
+                    fontSize: GSYConstant.lagerTextSize,
+                    fontWeight: FontWeight.bold,
+                  )),
             ),
             ),
-            _getLoginButton(),
+            Container(
+              padding:  EdgeInsets.only(left: 40,right: 40,top: 60),
+              margin: EdgeInsets.only(top: 40),
+
+              decoration: const BoxDecoration(
+                image: DecorationImage(
+                  image: AssetImage("images/login_bg_write.png"),
+                  fit: BoxFit.fill,
+                ),
+              ),
+              child:Column(
+                crossAxisAlignment: CrossAxisAlignment.start,
+                mainAxisAlignment: MainAxisAlignment.start,
+                children: [
+                  Text('输入手机号',style: TextStyle(
+                    color: Color(0xFF999999),
+                    fontSize: GSYConstant.smallTextSize
+                  )),
+                  SizedBox(
+                    height: 10,
+                  ),
+                  _getUsernameInput(),
+                  SizedBox(
+                    height: 20,
+                  ),
+                  Text('输入密码',style: TextStyle(
+                      color: Color(0xFF999999),
+                      fontSize: GSYConstant.smallTextSize
+                  )),
+                  SizedBox(
+                    height: 10,
+                  ),
+                  _getPasswordInput(),
+                  SizedBox(
+                    height:50,
+                  ),
+                  _getLoginButton(),
+                  SizedBox(
+                    height: 45,
+                  ),
+                ],
+              ),
+            ),
+
           ],
           ],
         ),
         ),
       ),
       ),
@@ -74,16 +118,26 @@ class _LoginPageState extends State<LoginPage> {
       TextInputType.number,
       TextInputType.number,
       controller: _usernameController,
       controller: _usernameController,
       decoration: InputDecoration(
       decoration: InputDecoration(
-        hintText: "输入手机号",
-        icon: Icon(
+          border: OutlineInputBorder(
+            ///设置边框四个角的弧度
+            borderRadius: BorderRadius.all(Radius.circular(5)),
+            ///用来配置边框的样式
+            borderSide: BorderSide(
+              ///设置边框的颜色
+              color: Colors.red,
+              ///设置边框的粗细
+              width: 1.0,
+            ),
+          ),
+        prefixIcon: Icon(
           Icons.mobile_friendly_rounded,
           Icons.mobile_friendly_rounded,
-          size: 20.0,
+          size: 18.0,
         ),
         ),
-        border: InputBorder.none,
+        contentPadding: EdgeInsets.only(left: 15,right: 15,top: 0,bottom: 0),
         //使用 GestureDetector 实现手势识别
         //使用 GestureDetector 实现手势识别
         suffixIcon: GestureDetector(
         suffixIcon: GestureDetector(
           child: Offstage(
           child: Offstage(
-            child: Icon(Icons.clear),
+            child: Icon(Icons.clear,size: 18.0),
             offstage: _username == '',
             offstage: _username == '',
           ),
           ),
           //点击清除文本框内容
           //点击清除文本框内容
@@ -110,15 +164,15 @@ class _LoginPageState extends State<LoginPage> {
       obscureText: true,
       obscureText: true,
       controller: _passwordController,
       controller: _passwordController,
       decoration: InputDecoration(
       decoration: InputDecoration(
-        hintText: "输入密码",
-        icon: Icon(
+        prefixIcon: Icon(
           Icons.lock_open,
           Icons.lock_open,
-          size: 20.0,
+          size: 18.0,
         ),
         ),
         suffixIcon: GestureDetector(
         suffixIcon: GestureDetector(
           child: Offstage(
           child: Offstage(
-            child: Icon(Icons.clear),
+            child: Icon(Icons.clear,size: 18.0),
             offstage: _password == '',
             offstage: _password == '',
+
           ),
           ),
           onTap: () {
           onTap: () {
             this.setState(() {
             this.setState(() {
@@ -127,7 +181,18 @@ class _LoginPageState extends State<LoginPage> {
             });
             });
           },
           },
         ),
         ),
-        border: InputBorder.none,
+        contentPadding: EdgeInsets.only(left: 15,right: 15,top: 0,bottom: 0),
+        border: OutlineInputBorder(
+          ///设置边框四个角的弧度
+          borderRadius: BorderRadius.all(Radius.circular(5)),
+          ///用来配置边框的样式
+          borderSide: BorderSide(
+            ///设置边框的颜色
+            color: Colors.red,
+            ///设置边框的粗细
+            width: 1.0,
+          ),
+        ),
       ),
       ),
       onChanged: (value) {
       onChanged: (value) {
         this.setState(() {
         this.setState(() {
@@ -145,11 +210,10 @@ class _LoginPageState extends State<LoginPage> {
     onChanged: Function,
     onChanged: Function,
     InputDecoration? decoration,
     InputDecoration? decoration,
     bool obscureText = false,
     bool obscureText = false,
-    height = 50.0,
+    height = 52.0,
   }) {
   }) {
     return Container(
     return Container(
       height: height,
       height: height,
-      margin: EdgeInsets.all(10.0),
       child: Column(
       child: Column(
         children: [
         children: [
           TextField(
           TextField(
@@ -159,27 +223,24 @@ class _LoginPageState extends State<LoginPage> {
             controller: controller,
             controller: controller,
             decoration: decoration,
             decoration: decoration,
             onChanged: onChanged,
             onChanged: onChanged,
+            style: const TextStyle(fontSize: GSYConstant.TextSize15),
           ),
           ),
-          Divider(
-            height: 1.0,
-            color: Colors.grey[400],
-          ),
+          // Divider(
+          //   height: 1.0,
+          //   color: Colors.grey[400],
+          // ),
         ],
         ],
       ),
       ),
     );
     );
   }
   }
 
 
   Widget _getLoginButton() {
   Widget _getLoginButton() {
-    return Container(
+    return SizedBox(
       height: 50,
       height: 50,
       width: double.infinity,
       width: double.infinity,
-      margin: EdgeInsets.all(10),
-      decoration: BoxDecoration(
-        borderRadius: BorderRadius.circular(4.0),
-      ),
       child: GSYFlexButton(
       child: GSYFlexButton(
         text: ConstantString.loginText,
         text: ConstantString.loginText,
-        color: Color(0xFF4875EC),
+        color: Color(0xFF215CFF),
         textColor: GSYColors.textWhite,
         textColor: GSYColors.textWhite,
         fontSize: 16,
         fontSize: 16,
         onPress: login,
         onPress: login,
@@ -199,7 +260,8 @@ class _LoginPageState extends State<LoginPage> {
       LoginResponseEntity loginResponseEntity =
       LoginResponseEntity loginResponseEntity =
           loginResponseEntityFromJson(LoginResponseEntity(), result);
           loginResponseEntityFromJson(LoginResponseEntity(), result);
       if (0 == loginResponseEntity.code) {
       if (0 == loginResponseEntity.code) {
-        StoreHelper.putStorage(ConstantString.token, loginResponseEntity.data.token);
+        StoreHelper.putStorage(
+            ConstantString.token, loginResponseEntity.data.token);
         debugPrint(loginResponseEntity.data.token);
         debugPrint(loginResponseEntity.data.token);
         getInfo();
         getInfo();
       } else {
       } else {
@@ -208,21 +270,23 @@ class _LoginPageState extends State<LoginPage> {
       }
       }
     }
     }
   }
   }
-  getInfo() async{
-    var result = await DioUtil().request('user/current-user',
-        method: DioMethod.post);
+
+  getInfo() async {
+    var result =
+        await DioUtil().request('user/current-user', method: DioMethod.post);
     // LoadingDialogHelper.dismissLoading(context);
     // LoadingDialogHelper.dismissLoading(context);
-    UserResponseEntity entity=userResponseEntityFromJson(UserResponseEntity(), result);
-    if(entity.code==0){
+    UserResponseEntity entity =
+        userResponseEntityFromJson(UserResponseEntity(), result);
+    if (entity.code == 0) {
       StoreHelper.putStorage(ConstantString.name, entity.data.name);
       StoreHelper.putStorage(ConstantString.name, entity.data.name);
       StoreHelper.putStorage(ConstantString.orgName, entity.data.orgName);
       StoreHelper.putStorage(ConstantString.orgName, entity.data.orgName);
       StoreHelper.putStorage(ConstantString.phone, entity.data.phone);
       StoreHelper.putStorage(ConstantString.phone, entity.data.phone);
-      Navigator.pushAndRemoveUntil(context, MaterialPageRoute(
-          builder: (context) =>
-              HomePage()), (route) => false);
-    }else{
+      Navigator.pushAndRemoveUntil(
+          context,
+          MaterialPageRoute(builder: (context) => HomePage()),
+          (route) => false);
+    } else {
       showToast(entity.msg);
       showToast(entity.msg);
     }
     }
-
   }
   }
 }
 }

+ 1 - 28
lib/page/maint/maint_job_detail.dart

@@ -166,7 +166,7 @@ class _MaintJobDetail extends State<MaintJobDetail> {
     ws.add(_maintJobDetail(maintJobDetail));
     ws.add(_maintJobDetail(maintJobDetail));
     ws.add(_device());
     ws.add(_device());
     ws.add(_item());
     ws.add(_item());
-    if (null != maintJobDetail.remarks) {
+    if ('' != maintJobDetail.remarks) {
       ws.add(_remark());
       ws.add(_remark());
     }
     }
     ws.add(_url());
     ws.add(_url());
@@ -246,12 +246,6 @@ class _MaintJobDetail extends State<MaintJobDetail> {
             ),
             ),
           ),
           ),
         ),
         ),
-        // Divider(
-        //   height: 0.8,
-        //   indent: 5.0,
-        //   endIndent: 5.0,
-        //   color: Colors.grey,
-        // ),
         Container(
         Container(
           decoration: BoxDecoration(color: Colors.white),
           decoration: BoxDecoration(color: Colors.white),
           child: Column(
           child: Column(
@@ -465,27 +459,6 @@ class _MaintJobDetail extends State<MaintJobDetail> {
                       ),
                       ),
                     ]),
                     ]),
               ),
               ),
-              Container(
-                margin: const EdgeInsets.only(top: 10),
-                // padding: const EdgeInsets.fromLTRB(30.0, 0.0, 0.0, 10.0),
-                // alignment: Alignment.centerLeft,
-                child: Row(
-                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
-                    children: [
-                      new Text(
-                        '维保完成时间:',
-                        style: GSYConstant.smallTextLight,
-                      ),
-                      Container(
-                        child: Text(
-                          "",
-                          // device.itemCompleteTime,
-                          style: GSYConstant.smallTextLight,
-                          textAlign: TextAlign.right,
-                        ),
-                      ),
-                    ]),
-              ),
               // Divider(
               // Divider(
               //   height: 0.8,
               //   height: 0.8,
               //   indent: 10.0,
               //   indent: 10.0,

+ 8 - 5
lib/page/maint/maint_job_edit.dart

@@ -1,6 +1,7 @@
 import 'dart:io';
 import 'dart:io';
 
 
 import 'package:deus_app/PhotoTool.dart';
 import 'package:deus_app/PhotoTool.dart';
+import 'package:deus_app/common/dialog/CloseTaskDialog.dart';
 import 'package:deus_app/common/event/RefreshMaintDetail.dart';
 import 'package:deus_app/common/event/RefreshMaintDetail.dart';
 import 'package:deus_app/common/event/RefreshMaintEdit.dart';
 import 'package:deus_app/common/event/RefreshMaintEdit.dart';
 import 'package:deus_app/common/event/RefreshMaintPage.dart';
 import 'package:deus_app/common/event/RefreshMaintPage.dart';
@@ -92,11 +93,13 @@ class _MairintJobEdit extends State<MairintJobEdit> {
                         height: 50,
                         height: 50,
                         child: TextButton(
                         child: TextButton(
                           onPressed: () {
                           onPressed: () {
-                            if(imageFiles.isNotEmpty){
-                              uploadList();
-                            }else{
-                              patrolJobRemark();
-                            }
+                            CloseTaskDialog.showAlertDialog(context, () {
+                              if(imageFiles.isNotEmpty){
+                                uploadList();
+                              }else{
+                                patrolJobRemark();
+                              }
+                            }, '您确认完成维保?');
                           },
                           },
                           child: Text(ConstantString.complete),
                           child: Text(ConstantString.complete),
                           style: ButtonStyle(
                           style: ButtonStyle(

+ 9 - 2
lib/page/maint/maint_job_list.dart

@@ -1,8 +1,10 @@
+import 'package:deus_app/common/event/RefreshPatrolEdit.dart';
 import 'package:deus_app/common/style/TitleBar.dart';
 import 'package:deus_app/common/style/TitleBar.dart';
 import 'package:deus_app/common/style/gsy_style.dart';
 import 'package:deus_app/common/style/gsy_style.dart';
 import 'package:deus_app/common/utils/ConstantString.dart';
 import 'package:deus_app/common/utils/ConstantString.dart';
 import 'package:deus_app/common/utils/DioUtil.dart';
 import 'package:deus_app/common/utils/DioUtil.dart';
 import 'package:deus_app/common/utils/ToastUtils.dart';
 import 'package:deus_app/common/utils/ToastUtils.dart';
+import 'package:deus_app/main.dart';
 import 'package:deus_app/model/maint_job_detail_response.dart';
 import 'package:deus_app/model/maint_job_detail_response.dart';
 import 'package:deus_app/page/maint/maint_job_edit.dart';
 import 'package:deus_app/page/maint/maint_job_edit.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
@@ -25,7 +27,7 @@ class _MaintlJobList extends State<MaintlJobList> {
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
-    return Scaffold(
+    return WillPopScope(child: Scaffold(
         appBar: TitleBar().backAppbar("维保设备详情"),
         appBar: TitleBar().backAppbar("维保设备详情"),
         backgroundColor: const Color(0xfff2f2f2),
         backgroundColor: const Color(0xfff2f2f2),
         body: Stack(
         body: Stack(
@@ -144,7 +146,11 @@ class _MaintlJobList extends State<MaintlJobList> {
               ),
               ),
             )
             )
           ],
           ],
-        ));
+        ))
+        , onWillPop: () async{
+          eventBus.fire(RefreshPatrolEdit());
+          return true;
+        });
   }
   }
 
 
   completeEquipment(int index) async {
   completeEquipment(int index) async {
@@ -155,6 +161,7 @@ class _MaintlJobList extends State<MaintlJobList> {
       if (result['code'] == 0) {
       if (result['code'] == 0) {
         setState(() {
         setState(() {
           responseData.deviceList![index].isMainted = 1;
           responseData.deviceList![index].isMainted = 1;
+          responseData.deviceList![index].finishTime=result['data'];
         });
         });
       } else {
       } else {
         showToast(result['msg']);
         showToast(result['msg']);

+ 22 - 11
lib/page/patrol/patrol_job_detail.dart

@@ -179,7 +179,9 @@ class _PatrolJobDetail extends State<PatrolJobDetail> {
     ws.add(_patrolJobDetail(responseData));
     ws.add(_patrolJobDetail(responseData));
     ws.add(_device());
     ws.add(_device());
     ws.add(_item());
     ws.add(_item());
-    ws.add(_remark());
+    if ('' != responseData.remarks) {
+      ws.add(_remark());
+    }
     ws.add(_url());
     ws.add(_url());
     return ws;
     return ws;
   }
   }
@@ -511,7 +513,7 @@ class _PatrolJobDetail extends State<PatrolJobDetail> {
           style: GSYConstant.normalTextActionWhiteBold,
           style: GSYConstant.normalTextActionWhiteBold,
         )),
         )),
         children: patrolItemVOS.map((e) => _buildItem(e)).toList(),
         children: patrolItemVOS.map((e) => _buildItem(e)).toList(),
-        initiallyExpanded: true);
+        initiallyExpanded: false);
   }
   }
 
 
   Widget _buildItem(PatrolJobDetailResponseDataPatrolItemVOS item) {
   Widget _buildItem(PatrolJobDetailResponseDataPatrolItemVOS item) {
@@ -561,7 +563,7 @@ class _PatrolJobDetail extends State<PatrolJobDetail> {
           style: GSYConstant.normalTextActionWhiteBold,
           style: GSYConstant.normalTextActionWhiteBold,
         )),
         )),
         children: [_buildRemark(responseData)],
         children: [_buildRemark(responseData)],
-        initiallyExpanded: true);
+        initiallyExpanded: false);
   }
   }
 
 
   Widget _buildRemark(PatrolJobDetailResponseData patrolJobDetailData) {
   Widget _buildRemark(PatrolJobDetailResponseData patrolJobDetailData) {
@@ -590,19 +592,28 @@ class _PatrolJobDetail extends State<PatrolJobDetail> {
           style: GSYConstant.normalTextActionWhiteBold,
           style: GSYConstant.normalTextActionWhiteBold,
         )),
         )),
         children: [
         children: [
-          Wrap(children: fileUrls.map((e) => _buildImage(e)).toList()),
+          Container(
+            width: double.infinity,
+            margin: EdgeInsets.only(bottom: 5),
+            padding: fileUrls.isNotEmpty?EdgeInsets.only(right: 12, top: 10):EdgeInsets.only(right: 0, top: 0),
+            color: Colors.white,
+            child: Wrap(children: fileUrls.map((e) => _buildImage(e)).toList()),
+            alignment: Alignment.centerLeft,
+          )
         ],
         ],
-        initiallyExpanded: true);
+        initiallyExpanded: false);
   }
   }
 
 
+
   Widget _buildImage(String imageData) {
   Widget _buildImage(String imageData) {
     return Container(
     return Container(
-        width: MediaQuery.of(context).size.width / 2,
-        margin: EdgeInsets.only(bottom: 5),
-        padding: EdgeInsets.only(left: 12, right: 12),
-        alignment: Alignment.center,
-        decoration: BoxDecoration(color: Colors.white),
-        child: Image.network(imageData));
+        margin: EdgeInsets.only(left: 12, bottom: 10),
+        width: MediaQuery.of(context).size.width / 4,
+        height: MediaQuery.of(context).size.width / 4,
+        child: Image.network(
+          imageData!,
+          fit: BoxFit.fill,
+        ));
   }
   }
 
 
   @override
   @override

+ 8 - 5
lib/page/patrol/patrol_job_edit.dart

@@ -1,6 +1,7 @@
 import 'dart:io';
 import 'dart:io';
 
 
 import 'package:deus_app/PhotoTool.dart';
 import 'package:deus_app/PhotoTool.dart';
+import 'package:deus_app/common/dialog/CloseTaskDialog.dart';
 import 'package:deus_app/common/event/RefreshPatrolEdit.dart';
 import 'package:deus_app/common/event/RefreshPatrolEdit.dart';
 import 'package:deus_app/common/style/TitleBar.dart';
 import 'package:deus_app/common/style/TitleBar.dart';
 import 'package:deus_app/common/style/gsy_style.dart';
 import 'package:deus_app/common/style/gsy_style.dart';
@@ -90,11 +91,13 @@ class _PatrolJobEdit extends State<PatrolJobEdit> {
                         height: 50,
                         height: 50,
                         child: TextButton(
                         child: TextButton(
                           onPressed: () {
                           onPressed: () {
-                            if(imageFiles.isNotEmpty){
-                              uploadList();
-                            }else{
-                              patrolJobRemark();
-                            }
+                            CloseTaskDialog.showAlertDialog(context, () {
+                              if(imageFiles.isNotEmpty){
+                                uploadList();
+                              }else{
+                                patrolJobRemark();
+                              }
+                            }, '您确认完成当前巡检?');
                           },
                           },
                           child: Text(ConstantString.complete),
                           child: Text(ConstantString.complete),
                           style: ButtonStyle(
                           style: ButtonStyle(

+ 6 - 7
lib/page/repair/repair_detail.dart

@@ -82,10 +82,9 @@ class _RepairDetail extends State<RepairDetail> {
                           height: 50,
                           height: 50,
                           child: TextButton(
                           child: TextButton(
                             onPressed: () {
                             onPressed: () {
-                              CloseTaskDialog.showCupertinoAlertDialog(context,
-                                      (msg) {
-                                    closeJob(msg);
-                                  });
+                              CloseTaskDialog.showAlertDialog(context, () {
+                                closeJob();
+                              }, '确认关闭申请?');
                             },
                             },
                             style: ButtonStyle(
                             style: ButtonStyle(
                               backgroundColor: MaterialStateProperty.all<Color>(
                               backgroundColor: MaterialStateProperty.all<Color>(
@@ -535,9 +534,9 @@ class _RepairDetail extends State<RepairDetail> {
     _event.cancel();
     _event.cancel();
   }
   }
 
 
-  closeJob(String msg) async {
-    var result = await DioUtil().request('patrolJob/closeJob',
-        method: DioMethod.post, data: {'id': id, 'closeReason': msg});
+  closeJob() async {
+    var result = await DioUtil().request('repair-bill/close',
+        method: DioMethod.get, params: {'id': id});
     if (0 == result['code']) {
     if (0 == result['code']) {
       setState(() {
       setState(() {
         eventBus.fire(RefreshRepairPage());
         eventBus.fire(RefreshRepairPage());

+ 15 - 10
lib/widget/gsy_flex_button.dart

@@ -27,19 +27,24 @@ class GSYFlexButton extends StatelessWidget {
 
 
   @override
   @override
   Widget build(BuildContext context) {
   Widget build(BuildContext context) {
-    return new ElevatedButton(
-        style: TextButton.styleFrom(
-            backgroundColor: color,
-            padding: new EdgeInsets.only(
-                left: 20.0, top: 10.0, right: 20.0, bottom: 10.0)),
-        child: new Flex(
+    return ElevatedButton(
+        style: ButtonStyle(
+            backgroundColor:  MaterialStateProperty.all(color),
+            shape: MaterialStateProperty.all(
+                RoundedRectangleBorder(
+                    borderRadius:
+                    BorderRadius.circular(
+                        25))),
+            padding: MaterialStateProperty.all( const EdgeInsets.only(
+                left: 20.0, top: 10.0, right: 20.0, bottom: 10.0))),
+        child: Flex(
           mainAxisAlignment: mainAxisAlignment,
           mainAxisAlignment: mainAxisAlignment,
           direction: Axis.horizontal,
           direction: Axis.horizontal,
           children: <Widget>[
           children: <Widget>[
-            new Expanded(
-              child: new Text(text!,
-                  style: new TextStyle(
-                      color: textColor, fontSize: fontSize, height: 1),
+            Expanded(
+              child: Text(text!,
+                  style: TextStyle(
+                      color: textColor, fontSize: fontSize, height: 1,fontWeight: FontWeight.bold,letterSpacing:2),
                   textAlign: TextAlign.center,
                   textAlign: TextAlign.center,
                   maxLines: maxLines,
                   maxLines: maxLines,
                   overflow: TextOverflow.ellipsis),
                   overflow: TextOverflow.ellipsis),