浏览代码

Merge branch 'master' of http://git.ycjcjy.com/nanyang/farmer_client

张延森 3 年前
父节点
当前提交
cf1f80165e

+ 0
- 89
lib/components/UI/DefaultButton.dart 查看文件

@@ -1,89 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-
3
-
4
-
5
-class DefaultButton extends StatefulWidget {
6
-  //点击回调
7
-  final GestureTapCallback onPressed;
8
-  final String text;
9
-  final EdgeInsetsGeometry margin;
10
-  final double width;
11
-  final double height;
12
-  final double? fontSize;
13
-  final Color backColor;
14
-  final Color color;
15
-
16
-  EdgeInsetsGeometry marginDefault =
17
-  const EdgeInsets.fromLTRB(0, 90.0, 0, 30); //按钮默认的margin值
18
-
19
-  DefaultButton({
20
-    Key? key,
21
-    required this.onPressed,
22
-    required this.text,
23
-    required this.margin,
24
-    required this.width,
25
-    required this.height,
26
-    this.fontSize,
27
-    required this.backColor,
28
-    required this.color,
29
-  }) : super(key: key);
30
-
31
-  @override
32
-  State createState() {
33
-    if (margin == null) {
34
-      return _DefaultButtonState(onPressed, text, marginDefault,width,height,fontSize,backColor,color);
35
-    }
36
-    return _DefaultButtonState(onPressed, text, margin,width,height,fontSize,backColor,color);
37
-  }
38
-}
39
-
40
-class _DefaultButtonState extends State<DefaultButton> {
41
-  //点击回调
42
-  final GestureTapCallback onPressed;
43
-  final String text;
44
-  final EdgeInsetsGeometry margin;
45
-  final double width;
46
-  final double height;
47
-  final double? fontSize;
48
-  final Color backColor;
49
-  final Color color;
50
-  _DefaultButtonState(
51
-      this.onPressed,
52
-      this.text,
53
-      this.margin,
54
-      this.width,
55
-      this.height,
56
-      this.fontSize,
57
-      this.backColor,
58
-      this.color
59
-      );
60
-
61
-  @override
62
-  Widget build(BuildContext context) {
63
-    Widget _SectionBtn = Container(
64
-      margin: margin,
65
-      child: SizedBox(
66
-        width: width,
67
-        height: height,
68
-        child: RaisedButton(
69
-          color: backColor,
70
-          disabledColor: const Color(0xF5F6F7ff),
71
-          disabledTextColor: const Color(0xF5F6F7ff),
72
-          colorBrightness: Brightness.dark,
73
-          shape:
74
-          RoundedRectangleBorder(borderRadius: BorderRadius.circular(5.0)),
75
-          child: Text(text,style:  TextStyle(
76
-              fontSize: fontSize,
77
-              color: color,
78
-          ),),
79
-          textColor: Colors.white,
80
-          onPressed: onPressed,
81
-        ),
82
-      ),
83
-    );
84
-
85
-    return _SectionBtn;
86
-  }
87
-
88
-}
89
-

+ 25
- 31
lib/pages/MoreCars/index.dart 查看文件

@@ -35,36 +35,39 @@ class _MoreCarsState extends State<MoreCars> with TickerProviderStateMixin {
35 35
     return Scaffold(
36 36
         resizeToAvoidBottomInset: false,
37 37
         appBar: AppBar(
38
-          elevation: 0,
39 38
           centerTitle: true,
40
-          backgroundColor: Colors.white,
39
+          backgroundColor: Colors.transparent,
40
+          foregroundColor: const Color(0xFF333333),
41
+          elevation: 0,
42
+          toolbarHeight: 44.w,
41 43
           title: Text(
42 44
             '更多',
43 45
             style: TextStyle(
44
-                color: Colors.black,
46
+                color: const Color(0xFF333333),
47
+                fontWeight: FontWeight.bold,
45 48
                 fontSize: 17.sp,
46
-                letterSpacing: 2,
47
-                fontWeight: FontWeight.bold),
49
+                letterSpacing: 2),
48 50
           ),
49 51
         ),
50
-
51
-
52
-      body: Container(
53
-        decoration: BoxDecoration(
54
-            color: Colors.white
55
-        ),
56
-        child:       ListView(
57
-            children: [Column(
52
+        body: SafeArea(
53
+            child: Container(
54
+          decoration: BoxDecoration(color: Colors.white),
55
+          child: ListView(children: [
56
+            Column(
58 57
               children: [
59 58
                 Container(
60 59
                   padding: EdgeInsets.fromLTRB(0, 15, 0, 15),
61 60
                   width: 350.w,
62
-                  child: TypeHeader(type: false,),
61
+                  child: TypeHeader(
62
+                    type: false,
63
+                  ),
63 64
                 ),
64
-
65 65
                 TabBar(
66
-                  labelStyle: TextStyle(fontSize: ScreenUtil().setSp(19),fontWeight: FontWeight.bold), //选中的样式
67
-                  unselectedLabelStyle: TextStyle(fontSize:ScreenUtil().setSp(16)), //未选中的样式
66
+                  labelStyle: TextStyle(
67
+                      fontSize: ScreenUtil().setSp(19),
68
+                      fontWeight: FontWeight.bold), //选中的样式
69
+                  unselectedLabelStyle:
70
+                      TextStyle(fontSize: ScreenUtil().setSp(16)), //未选中的样式
68 71
                   controller: _controller,
69 72
                   isScrollable: true, //可滚动
70 73
                   indicatorColor: Colors.black, //指示器的颜色
@@ -75,24 +78,15 @@ class _MoreCarsState extends State<MoreCars> with TickerProviderStateMixin {
75 78
                   onTap: (int i) {
76 79
                     print('当前+${i}');
77 80
                   },
78
-
79 81
                 ),
80 82
                 Container(
81 83
                   child: Column(
82
-                    children: [
83
-
84
-                    ],
85
-                  )
86
-                  ,
84
+                    children: [],
85
+                  ),
87 86
                 )
88
-
89
-
90 87
               ],
91
-            )]
92
-
93
-        ),
94
-      )
95
-
96
-    );
88
+            )
89
+          ]),
90
+        )));
97 91
   }
98 92
 }

+ 1
- 1
lib/pages/OrderConfirmation/index.dart 查看文件

@@ -16,7 +16,7 @@ class OrderConfirmation extends BasicPage {
16 16
 
17 17
   @override
18 18
   Widget builder(BuildContext context) {
19
-    naviTitle = '咨讯';
19
+    naviTitle = '预约';
20 20
     return Container(
21 21
       height: 700.h,
22 22
       child: Form(

+ 1
- 1
lib/pages/home/index.dart 查看文件

@@ -20,7 +20,7 @@ class Home extends BasicPage {
20 20
       //   return Modal(type: 'dialog', title: '测试', message: '这是一段 message !', onConfirm: () => print('hahahaha'),);
21 21
       // } );
22 22
       // Get.dialog(Modal(type: 'dialog', title: '测试', message: '这是一段 message !', onConfirm: () => print('hahahaha'),));
23
-      modal.showDialog(title: '测试', content: SizedBox(width: 400, height: 300,), onConfirm: () => false);
23
+      // modal.showDialog(title: '测试', content: SizedBox(width: 400, height: 300,), onConfirm: () => false);
24 24
     }, 2000);
25 25
     
26 26
     return const HomePage();

+ 3
- 0
lib/pages/home/widgets/home/index.dart 查看文件

@@ -50,6 +50,9 @@ class _HomePageState extends State<HomePage> {
50 50
   @override
51 51
   Widget build(BuildContext context) {
52 52
     return Container(
53
+      decoration: BoxDecoration(
54
+        color: Colors.white
55
+      ),
53 56
       alignment: Alignment.center,
54 57
       padding: EdgeInsets.fromLTRB(15.w, 0, 15.w, 0),
55 58
       child: Column(

+ 1
- 1
lib/pages/home/widgets/home/widgets/headers.dart 查看文件

@@ -65,7 +65,7 @@ class _initWidget extends StatelessWidget {
65 65
   @override
66 66
   Widget build(BuildContext context) {
67 67
     return Container(
68
-        width: 255.w,
68
+        width: 250.w,
69 69
         height: 32.w,
70 70
         decoration: const BoxDecoration(color: Colors.white),
71 71
         child: GestureDetector(

+ 1
- 1
lib/pages/index.dart 查看文件

@@ -11,7 +11,7 @@ export 'infomation/index.dart';
11 11
 export 'main/index.dart';
12 12
 export 'order/index.dart';
13 13
 export 'orderInfo/index.dart';
14
-export 'search/index.jsx.dart';
14
+export 'search/index.dart';
15 15
 export 'userInfo/index.dart';
16 16
 export 'splash/splash.dart';
17 17
 export 'login/login.dart';

lib/pages/search/index.jsx.dart → lib/pages/search/index.dart 查看文件

@@ -2,15 +2,15 @@ import 'package:farmer_client/widgets/layout/BasicPage.dart';
2 2
 import 'package:flutter/material.dart';
3 3
 import 'package:flutter_screenutil/flutter_screenutil.dart';
4 4
 
5
+import '../../widgets/NullCard.dart';
6
+
5 7
 class SearchPage extends BasicPage {
6 8
 
7 9
   @override
8 10
   Widget builder(BuildContext context) {
9 11
     naviTitle = '搜索';
10 12
     return Container(
11
-        decoration: const BoxDecoration(
12
-          color: Colors.white,
13
-        ),
13
+
14 14
         child: Column(children: [
15 15
           Container(
16 16
             width: 345.w,
@@ -48,12 +48,10 @@ class SearchPage extends BasicPage {
48 48
               ],
49 49
             ),
50 50
           ),
51
-          Container(
52
-            child: Column(
53
-              children: [
54
-                // NullCard(text: '暂无农机信息'),
55
-              ],
56
-            ),
51
+          Column(
52
+            children: [
53
+              NullCard(text: '暂无农机信息'),
54
+            ],
57 55
           )
58 56
         ]));
59 57
   }

+ 66
- 55
lib/widgets/OrderListCard.dart 查看文件

@@ -11,7 +11,6 @@ import 'LinearGradientText.dart';
11 11
 class OrderListCard extends StatefulWidget {
12 12
 
13 13
   final OrderListAll item;
14
-
15 14
   const OrderListCard({Key? key, required this.item}) : super(key: key);
16 15
 
17 16
   @override
@@ -19,66 +18,77 @@ class OrderListCard extends StatefulWidget {
19 18
 }
20 19
 
21 20
 
21
+class StyleObj {
22
+  String title;
23
+  Color styleColor;
24
+  StyleObj ({ required this.title, required this.styleColor});
25
+}
26
+
22 27
 
23 28
 
24 29
 class _OrderListCardPages extends State<OrderListCard> {
25 30
 
26
-  final OrderListAll item;
27 31
 
28
-  _OrderListCardPages(this.item);
29 32
 
33
+  @override
34
+  void initState() {
35
+    // TODO: implement initState
36
+    super.initState();
30 37
 
31
-  void orderStates(item){
32
-    // if (item.payStatus == 0) {
33
-    //   return {
34
-    //     title: '待付款',
35
-    //     styleColor: '#51D4FF'
36
-    //   };
37
-    // } else if (item.payStatus == 1 && item.workStatus == 0 && item.dispatchStatus == 0) {
38
-    //   return {
39
-    //     title: '已付款',
40
-    //     styleColor: '#FF703B'
41
-    //   };
42
-    // } else if (item.payStatus == 1 && item.dispatchStatus == 1 && item.workStatus == 0) {
43
-    //   return {
44
-    //     title: '待作业',
45
-    //     styleColor: '#FF703B'
46
-    //   };
47
-    //
48
-    // } else if (item.payStatus == 1 && (item.workStatus == 1 || item.workStatus == 2)) {
49
-    //   return {
50
-    //     title: '进行中',
51
-    //     styleColor: '#44F68B'
52
-    //   };
53
-    // } else if (item.workStatus == 3 && item.isEvaluated == 0) {
54
-    //   return {
55
-    //     title: '待评价',
56
-    //     styleColor: '#51D4FF'
57
-    //   };
58
-    // } if (item.workStatus == 3 && item.isEvaluated == 1 && item.dispatchStatus == 1) {
59
-    //   return {
60
-    //     title: '已完成',
61
-    //     styleColor: '#FF703B'
62
-    //   };
63
-    // } else if (item.payStatus == -1 && item.workStatus == 0 && item.isRefund == 1) {
64
-    //   return {
65
-    //     title: '已退单',
66
-    //     styleColor: '#FF703B'
67
-    //   };
68
-    // } else if (item.payStatus == 3 && (item.dispatchStatus == 1 || item.dispatchStatus == 0)) {
69
-    //   return {
70
-    //     title: '退单申请中',
71
-    //     styleColor: '#FF703B'
72
-    //   };
73
-    // } else {
74
-    //   return {
75
-    //     title: '异常',
76
-    //     styleColor: '#FF0000'
77
-    //   };
78
-    // }
38
+  }
79 39
 
40
+  final OrderListAll item;
41
+
42
+  _OrderListCardPages(this.item);
80 43
 
81 44
 
45
+  StyleObj  orderStates(){
46
+    if (item.payStatus == 0) {
47
+      return StyleObj(
48
+          title: '待付款',
49
+          styleColor: Color(0xFF51D4FF)
50
+      );
51
+    } else if (item.payStatus == 1 && item.workStatus == 0 && item.dispatchStatus == 0) {
52
+      return StyleObj(
53
+          title: '已付款',
54
+          styleColor: Color(0xFFFF703B)
55
+      );
56
+    } else if (item.payStatus == 1 && item.dispatchStatus == 1 && item.workStatus == 0) {
57
+      return StyleObj(
58
+          title: '待作业',
59
+          styleColor: Color(0xFFFF703B)
60
+      );
61
+    } else if (item.payStatus == 1 && (item.workStatus == 1 || item.workStatus == 2)) {
62
+      return StyleObj(
63
+          title: '进行中',
64
+          styleColor: Color(0xFF44F68B)
65
+      );
66
+    } else if (item.workStatus == 3 && item.isEvaluated == 0) {
67
+      return StyleObj(
68
+          title: '待评价',
69
+          styleColor: Color(0xFF51D4FF)
70
+      );
71
+    } if (item.workStatus == 3 && item.isEvaluated == 1 && item.dispatchStatus == 1) {
72
+      return StyleObj(
73
+          title: '已完成',
74
+          styleColor: Color(0xFFFF703B)
75
+      );
76
+    } else if (item.payStatus == -1 && item.workStatus == 0 && item.isRefund == 1) {
77
+      return StyleObj(
78
+          title: '已退单',
79
+          styleColor: Color(0xFFFF703B)
80
+      );
81
+    } else if (item.payStatus == 3 && (item.dispatchStatus == 1 || item.dispatchStatus == 0)) {
82
+      return StyleObj(
83
+          title: '退单申请中',
84
+          styleColor: Color(0xFFFF703B)
85
+      );
86
+    } else {
87
+      return StyleObj(
88
+          title: '异常',
89
+          styleColor: Color(0xFFFF0000)
90
+      );
91
+    }
82 92
   }
83 93
 
84 94
 
@@ -252,17 +262,17 @@ class _OrderListCardPages extends State<OrderListCard> {
252 262
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
253 263
                     children: [
254 264
                       RichText(
255
-                        text: const TextSpan(children: <InlineSpan>[
265
+                        text:  TextSpan(children: <InlineSpan>[
256 266
                           TextSpan(
257 267
                               text: '订单状态:',
258 268
                               style: TextStyle(
259
-                                  color: Color(0xff666666),
269
+                                  color:Color(0xff666666),
260 270
                                   fontSize: 16,
261 271
                                   fontWeight: FontWeight.bold)),
262 272
                           TextSpan(
263
-                              text: '待付款',
273
+                              text: orderStates().title,
264 274
                               style: TextStyle(
265
-                                  color: Color(0xff51D4FF),
275
+                                  color:orderStates().styleColor,
266 276
                                   fontSize: 16,
267 277
                                   fontWeight: FontWeight.bold)),
268 278
                         ]),
@@ -315,3 +325,4 @@ class _OrderListCardPages extends State<OrderListCard> {
315 325
     );
316 326
   }
317 327
 }
328
+