Przeglądaj źródła

我的页面添加退出

daxu0403 7 lat temu
rodzic
commit
aa6f2902f1

BIN
android/.gradle/4.10.2/fileHashes/fileHashes.bin


BIN
android/.gradle/4.10.2/fileHashes/fileHashes.lock


BIN
android/.gradle/4.10.2/taskHistory/taskHistory.bin


BIN
android/.gradle/4.10.2/taskHistory/taskHistory.lock


BIN
android/.gradle/buildOutputCleanup/buildOutputCleanup.lock


+ 60 - 7
lib/pages/my_page.dart

@@ -3,6 +3,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
 import 'my_page/revise_password_page.dart';
 import 'package:flutter_picker/flutter_picker.dart';
 import 'dart:convert';
+import '../showDialog.dart';
+import '../login_page.dart';
 
 class MyPage extends StatefulWidget {
   final Widget child;
@@ -41,13 +43,18 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
             ), ),
           centerTitle: true,
           backgroundColor: Color.fromRGBO(64, 98, 254, 1),
+          actions: < Widget > [
+            IconButton(
+              icon: Icon(Icons.arrow_forward, color: Colors.white, )
+            )
+          ],
         ),
         body: Container(
           color: Color.fromRGBO(246, 246, 254, 1),
           child: Column(
             children: < Widget > [
               _avatarWidget(),
-              _funWrapWidget(check, context)
+              _funWrapWidget(check, context),
             ],
           ),
         ),
@@ -86,7 +93,8 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
         children: < Widget > [
           _switchSite(context),
           _passWordWidget(),
-          _linkPrint(check)
+          _linkPrint(check),
+          _quitWidget(context)
         ],
       ),
     );
@@ -158,19 +166,19 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
       adapter: PickerDataAdapter < String > (pickerdata: new JsonDecoder().convert('["回龙观","草桥","丰台"]')),
       height: ScreenUtil.getInstance().setHeight(450),
       confirmText: '确定',
-      confirmTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30),color: Color.fromRGBO(64,98,254,1)),
+      confirmTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(64, 98, 254, 1)),
       cancelText: '取消',
-      cancelTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30),color: Color.fromRGBO(153,153,153,1)),
-      headercolor: Color.fromRGBO(245,245,245,1),
+      cancelTextStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(153, 153, 153, 1)),
+      headercolor: Color.fromRGBO(245, 245, 245, 1),
       itemExtent: ScreenUtil.getInstance().setHeight(80),
-      textStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30),color: Color.fromRGBO(42,42,42,1)),
+      textStyle: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(42, 42, 42, 1)),
       changeToFirst: true,
       hideHeader: false,
       onConfirm: (Picker picker, List value) {
         print(value.toString());
         print(picker.adapter);
         setState(() {
-          _siteName = picker.adapter.text+'站点';
+          _siteName = picker.adapter.text + '站点';
         });
       }
     ).showModal(this.context); //_scaffoldKey.currentState);
@@ -274,6 +282,51 @@ class _MyPageState extends State < MyPage > with AutomaticKeepAliveClientMixin {
       )
     );
   }
+
+  Widget _quitWidget(BuildContext context) {
+    return InkWell(
+      child: Container(
+        height: ScreenUtil.getInstance().setHeight(90),
+        color: Colors.white,
+        padding: EdgeInsets.fromLTRB(ScreenUtil.getInstance().setHeight(30), 0, 0, 0),
+        margin: EdgeInsets.only(top: ScreenUtil.getInstance().setHeight(20)),
+        child: Column(
+          children: < Widget > [
+            Expanded(
+              child: Center(
+                child: Row(
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                  children: < Widget > [
+                    Text('退出', style: TextStyle(fontSize: ScreenUtil.getInstance().setSp(30), color: Color.fromRGBO(74, 74, 74, 1)), ),
+                    Icon(Icons.keyboard_arrow_right, color: Color.fromRGBO(199, 199, 204, 1))
+                  ],
+                ),
+              ),
+            )
+          ],
+        )
+      ),
+      onTap: (){
+         showDialog < Null > (
+          context: context, //BuildContext对象
+          barrierDismissible: false,
+          builder: (BuildContext context) {
+            return new LoadingDialog( //调用对话框
+              text:'确认退出?',childCallback: (val){
+                if(val){
+                    Navigator.pushReplacement(context, MaterialPageRoute(builder: (context){
+                        return LoginPage();
+                      }));
+                }else{
+                  return;
+                }
+              },
+            );
+          });
+      },
+    );
+
+  }
 }
 
 

+ 5 - 5
lib/pages/order_taking_page.dart

@@ -147,11 +147,11 @@ class _OrderTakingPageState extends State < OrderTakingPage > with AutomaticKeep
     setState(() {
       listObj.removeAt(val);
       if(listObj.length<4){
-        // getOrderList().then((resp) {
-        //   setState(() {
-        //     listObj.addAll(resp.orderList);
-        //   });
-        // });
+        getOrderList().then((resp) {
+          setState(() {
+            listObj.addAll(resp.orderList);
+          });
+        });
       } 
     });
   }

+ 6 - 6
lib/pages/send_express_page.dart

@@ -152,8 +152,8 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
           _titleWidget(str['icon'], str['title']),
           _underLine(),
           _inputWiget('电话', 'sendPhone'),
-          _contentWiget('企业编码', str['code']),
-          _contentWiget('企业名称', str['name']),
+          _contentWiget('企业编码', str['code'],true),
+          _contentWiget('企业名称', str['name'],true),
           _cityWiget('城市/区域', str['address'], context),
           _lastContentWiget('详细地址', str['addressDetail'])
         ],
@@ -169,7 +169,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
         children: < Widget > [
           _titleWidget(str['icon'], str['title']),
           _underLine(),
-          _contentWiget('企业名称', str['name']),
+          _contentWiget('企业名称', str['name'],true),
           _inputWiget('电话', 'getPhone'),
           _cityWiget('城市/区域', str['address'], context),
           _lastContentWiget('详细地址', str['addressDetail'])
@@ -331,7 +331,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
   }
 
 
-  Widget _contentWiget(String key, String value) {
+  Widget _contentWiget(String key, String value,[bool keyboardType=false]) {//false是数字键盘
     return Padding(
       padding: EdgeInsets.only(left: ScreenUtil.getInstance().setWidth(30)),
       child: Column(
@@ -354,7 +354,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
                         SizedBox(
                           width: ScreenUtil.getInstance().setWidth(500),
                           child: TextField(
-                            keyboardType: TextInputType.number,
+                            keyboardType:keyboardType?TextInputType.text:TextInputType.number,
                             textAlign: TextAlign.end,
                             decoration: InputDecoration(
                               border: InputBorder.none
@@ -455,7 +455,7 @@ class _SendExpressPageState extends State < SendExpressPage > with AutomaticKeep
                     SizedBox(
                       width: ScreenUtil.getInstance().setWidth(500),
                       child: TextField(
-                        keyboardType: TextInputType.number,
+                        //keyboardType: TextInputType.number,
                         textAlign: TextAlign.end,
                         decoration: InputDecoration(
                           border: InputBorder.none