[baozhangchao] 3 年前
父节点
当前提交
1a6e0bab2e

二进制
images/mineBack.png 查看文件


二进制
images/userMoren.png 查看文件


+ 1
- 1
lib/models/entities/person.dart 查看文件

9
   String? phone;
9
   String? phone;
10
   String? userId;
10
   String? userId;
11
   int? status;
11
   int? status;
12
-  DateTime? createDate;
12
+  String? createDate;
13
 
13
 
14
   Person ();
14
   Person ();
15
 
15
 

+ 0
- 21
lib/pages/login/login.dart 查看文件

11
 import '../../services/user.dart';
11
 import '../../services/user.dart';
12
 import '../../widgets/Cell.dart';
12
 import '../../widgets/Cell.dart';
13
 
13
 
14
-// class Login extends GetView<User> {
15
-//
16
-//   int _countdown = 60;
17
-//
18
-//   @override
19
-//   Widget build(BuildContext context) {
20
-//     // controller.person
21
-//     return StatefulBuilder(builder: (context, setState) {
22
-//
23
-//       setState(() {
24
-//         _countdown -= 1;
25
-//       });
26
-//
27
-//       return Text("data");
28
-//     });
29
-//   }
30
-//
31
-//
32
-//
33
-// }
34
 
14
 
35
 class MyRouteLogin extends StatefulWidget {
15
 class MyRouteLogin extends StatefulWidget {
36
   @override
16
   @override
115
         } else {
95
         } else {
116
           Fluttertoast.showToast(msg: '请正确输入手机号!');
96
           Fluttertoast.showToast(msg: '请正确输入手机号!');
117
         }
97
         }
118
-        print('获取验证码按钮222222');
119
       }
98
       }
120
     });
99
     });
121
   }
100
   }

+ 39
- 0
lib/pages/main/index.dart 查看文件

1
+import 'package:farmer_client/pages/main/widgets/UserAddress.dart';
2
+import 'package:farmer_client/pages/main/widgets/UserInfo.dart';
3
+import 'package:flutter/material.dart';
4
+
5
+
6
+class MainPage extends StatefulWidget {
7
+  const MainPage({Key? key}) : super(key: key);
8
+
9
+  @override
10
+  State<MainPage> createState() => _MainPageState();
11
+}
12
+
13
+class _MainPageState extends State<MainPage> {
14
+  @override
15
+  Widget build(BuildContext context) {
16
+    return Scaffold(
17
+      resizeToAvoidBottomInset: false,
18
+      appBar:  AppBar(
19
+        title:  Text('我的'),
20
+        leading:  Icon(Icons.arrow_back_ios),
21
+        backgroundColor: Color(0xff4ceebe),
22
+        // backgroundColor: Colors.transparent,
23
+        centerTitle: true,
24
+
25
+      ),
26
+      body:Container(
27
+        alignment: Alignment.center,
28
+        child:   Column(
29
+          children: [
30
+            UserInfo(),
31
+            UserAddress()
32
+          ],
33
+        ),
34
+      )
35
+
36
+
37
+    );
38
+  }
39
+}

+ 0
- 0
lib/pages/main/widgets/OtherColumn.dart 查看文件


+ 102
- 0
lib/pages/main/widgets/UserAddress.dart 查看文件

1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+
4
+class UserAddress extends StatelessWidget {
5
+  const UserAddress({Key? key}) : super(key: key);
6
+
7
+  @override
8
+  Widget build(BuildContext context) {
9
+    return Container(
10
+        alignment: Alignment.center,
11
+        height: 123.w,
12
+        width: 345.w,
13
+        margin: EdgeInsets.fromLTRB(0, 15.w, 0, 15.w),
14
+        decoration: BoxDecoration(
15
+          borderRadius: BorderRadius.circular(30),
16
+          color: Colors.white,
17
+          boxShadow: [
18
+            BoxShadow(
19
+              blurRadius: 10, //阴影范围
20
+              spreadRadius: 0.1, //阴影浓度
21
+              color: Colors.grey.withOpacity(0.2), //阴影颜色
22
+            ),
23
+          ],
24
+        ),
25
+        child: Column(
26
+          children: [
27
+            Container(
28
+                margin: EdgeInsets.fromLTRB(0, 30.w, 0, 20.w),
29
+                alignment: Alignment.topLeft,
30
+                decoration: const BoxDecoration(
31
+                    border: Border(
32
+                        left: BorderSide(width: 5, color: Color(0xff000000)
33
+                            // 0x17000000
34
+                            ))),
35
+                child: Padding(
36
+                  padding: EdgeInsets.fromLTRB(12.w, 0, 0, 0),
37
+                  child: Text(
38
+                    '地址信息',
39
+                    style: TextStyle(
40
+                      color: Color(0xff333333),
41
+                      fontWeight: FontWeight.bold,
42
+                      fontSize: 17.sp,
43
+                    ),
44
+                  ),
45
+                )),
46
+            Row(
47
+              mainAxisAlignment: MainAxisAlignment.spaceBetween,
48
+
49
+              children: [
50
+                Container(
51
+                  child: Row(
52
+                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
53
+                    children: [
54
+                      Padding(padding: EdgeInsets.fromLTRB(17.w, 0, 10.w, 0),
55
+                      child:  Image(
56
+                        image: AssetImage('images/gpsImgae.png'),
57
+                        width: 12.w,
58
+                      ),
59
+                      ),
60
+                      Container(
61
+                        width: 260,
62
+                        child:  Text('请填写详细地址请填写详细地址请填写详细地址',
63
+                          softWrap: true,
64
+                          maxLines: 1,
65
+                          textAlign: TextAlign.left,
66
+                          overflow: TextOverflow.ellipsis,
67
+                          style: TextStyle(
68
+                            fontWeight: FontWeight.bold,
69
+                            fontSize: 17,
70
+                          ),),
71
+
72
+                      )
73
+
74
+
75
+                    ],
76
+                  ),
77
+                ),
78
+                Container(
79
+                  alignment: Alignment.center,
80
+                  padding: EdgeInsets.fromLTRB(0, 0, 30.w, 0),
81
+                  child: GestureDetector(
82
+                    child: const Text(
83
+                      '>>',
84
+                      style: TextStyle(
85
+                        fontWeight: FontWeight.bold,
86
+                        fontSize: 17,
87
+                      ),
88
+                    ),
89
+                    onTap: () {
90
+                      print('修改个人信息');
91
+                    },
92
+                  ),
93
+                ),
94
+
95
+
96
+
97
+              ],
98
+            ),
99
+          ],
100
+        ));
101
+  }
102
+}

+ 109
- 0
lib/pages/main/widgets/UserInfo.dart 查看文件

1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+
4
+class UserInfo extends StatelessWidget {
5
+  const UserInfo({Key? key}) : super(key: key);
6
+
7
+  @override
8
+  Widget build(BuildContext context) {
9
+    return Container(
10
+      alignment: Alignment.center,
11
+      height: 173.w,
12
+      width: 345.w,
13
+      decoration: BoxDecoration(
14
+        image: const DecorationImage(
15
+          image: AssetImage("images/mineBack.png"),
16
+          fit: BoxFit.cover,
17
+        ),
18
+        borderRadius: BorderRadius.circular(10),
19
+      ),
20
+      child: Stack(
21
+        fit: StackFit.expand,
22
+        children: [
23
+          Positioned(
24
+            top: 0,
25
+            right: 0,
26
+            child: Container(
27
+                alignment: Alignment.center,
28
+                height: 24.w,
29
+                width: 90.w,
30
+                decoration: const BoxDecoration(
31
+                  borderRadius: BorderRadius.only(
32
+                      bottomLeft: Radius.circular(20),
33
+                      topRight: Radius.circular(20)),
34
+                  color: Color(0x30000000),
35
+                ),
36
+                child: GestureDetector(
37
+                  child: const Text(
38
+                    '修改个人信息',
39
+                    style: TextStyle(color: Colors.white),
40
+                  ),
41
+                  onTap: () {
42
+                    print('修改个人信息');
43
+                  },
44
+                )),
45
+          ),
46
+          Row(
47
+            children: [
48
+              Column(
49
+                mainAxisAlignment: MainAxisAlignment.center,
50
+                children: [
51
+                  Container(
52
+                    decoration: BoxDecoration(
53
+                      shape: BoxShape.circle,
54
+                      border: Border.all(
55
+                        color: Colors.white,
56
+                        width: 2,
57
+                      ),
58
+                    ),
59
+                    margin: EdgeInsets.fromLTRB(30, 0, 15, 0),
60
+                    alignment: Alignment.center,
61
+                    child: Image.asset(
62
+                      "images/userMoren.png",
63
+                      width: 63.w,
64
+                    ),
65
+                  ),
66
+                ],
67
+              ),
68
+              Container(
69
+                child: Column(
70
+                  mainAxisAlignment: MainAxisAlignment.center,
71
+                  crossAxisAlignment: CrossAxisAlignment.start,
72
+                  children: [
73
+                    Container(
74
+                      margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
75
+                      child: Text(
76
+                        '符西西',
77
+                        style: TextStyle(
78
+                          color: Colors.white,
79
+                          fontSize: 17,
80
+                        ),
81
+                      ),
82
+                    ),
83
+                    Container(
84
+                      margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
85
+                      child: Text(
86
+                        '17775000245',
87
+                        style: TextStyle(
88
+                          color: Colors.white,
89
+                          fontSize: 17,
90
+                        ),
91
+                      ),
92
+                    ),
93
+                    // const Text(
94
+                    //      '点击登陆',
95
+                    //      style: TextStyle(
96
+                    //        color: Colors.white,
97
+                    //        fontSize: 17,
98
+                    //      ),
99
+                    //    ),
100
+                  ],
101
+                ),
102
+              ),
103
+            ],
104
+          ),
105
+        ],
106
+      ),
107
+    );
108
+  }
109
+}

+ 70
- 0
lib/pages/order/index.dart 查看文件

1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+
4
+import '../../widgets/OrderInfoCard.dart';
5
+
6
+
7
+
8
+
9
+
10
+class OrderPage extends StatefulWidget {
11
+  const OrderPage({Key? key}) : super(key: key);
12
+
13
+  @override
14
+  State<OrderPage> createState() => _OrderPageState();
15
+}
16
+
17
+class _OrderPageState extends State<OrderPage> {
18
+  @override
19
+  Widget build(BuildContext context) {
20
+    return Scaffold(
21
+      resizeToAvoidBottomInset: false,
22
+      appBar:  AppBar(
23
+        title:  Text('订单'),
24
+        leading:  Icon(Icons.arrow_back_ios),
25
+        backgroundColor: Color(0xff2b9270),
26
+        // backgroundColor: Colors.transparent,
27
+        centerTitle: true,
28
+
29
+      ),
30
+      body:      Column(
31
+        children: [
32
+          OrderInfoCard(),
33
+
34
+          Container(
35
+            height: 130.h,
36
+            margin: EdgeInsets.only(top: 20.0, bottom: 0.0),
37
+            alignment: Alignment.bottomCenter,
38
+            child: SizedBox(
39
+              width: 315.w,
40
+              height: 49.h,
41
+              child: ElevatedButton(
42
+                onPressed: () {
43
+                  // _handelSubmit();
44
+                  print('用户点击了支付啊阿松大撒地方');
45
+                },
46
+                child: const Text(
47
+                  "支付",
48
+                  style: TextStyle(
49
+                      fontSize: 18,
50
+                      color: Colors.white,
51
+                      fontWeight: FontWeight.bold),
52
+                ),
53
+                style: ButtonStyle(
54
+                  elevation: MaterialStateProperty.all(0),
55
+                  backgroundColor:
56
+                  MaterialStateProperty.all(const Color(0xFFFF703B)),
57
+                  shape: MaterialStateProperty.all(
58
+                      const RoundedRectangleBorder(
59
+                          borderRadius:
60
+                          BorderRadius.all(Radius.circular(24.4)))),
61
+                ),
62
+              ),
63
+            ),
64
+          ),
65
+        ],
66
+      ),
67
+    );
68
+
69
+  }
70
+}

+ 1
- 1
lib/routes/middleWares.dart 查看文件

11
   if (!isLogin && !isSplashScreen && !isLoginPage) {
11
   if (!isLogin && !isSplashScreen && !isLoginPage) {
12
     // addPostFrameCallback 作用是等当前帧绘制完成之后再加载
12
     // addPostFrameCallback 作用是等当前帧绘制完成之后再加载
13
     // https://github.com/jonataslaw/getx/issues/262
13
     // https://github.com/jonataslaw/getx/issues/262
14
-    SchedulerBinding.instance?.addPostFrameCallback((_) => Get.toNamed('/login'));
14
+    SchedulerBinding.instance?.addPostFrameCallback((_) => Get.offNamed('/login'));
15
   }
15
   }
16
 }
16
 }

+ 7
- 4
lib/routes/pages.dart 查看文件

1
 
1
 
2
 import 'package:get/get.dart';
2
 import 'package:get/get.dart';
3
-import '../pages/index.dart';
3
+import '../pages/index.dart';//Home
4
+import '../pages/main/index.dart';
5
+import '../pages/order/index.dart';
6
+import '../widgets/OrderInfoCard.dart';
4
 
7
 
5
 List<GetPage> pages = [
8
 List<GetPage> pages = [
6
-  GetPage(name: '/', page: () =>  Home()),
7
-  GetPage(name: '/splash', page: () => SplashScreen()),
8
-  GetPage(name: '/login', page: () =>  MyRouteLogin()),
9
+  GetPage(name: '/', page: () =>  MainPage()),
10
+  // GetPage(name: '/splash', page: () => SplashScreen()),
11
+  // GetPage(name: '/login', page: () =>  MyRouteLogin()),
9
 ];
12
 ];

+ 199
- 46
lib/widgets/OrderInfoCard.dart 查看文件

1
 import 'package:flutter/material.dart';
1
 import 'package:flutter/material.dart';
2
-
3
-
4
-
5
-
6
-
7
-class OrderPage extends StatefulWidget {
8
-  const OrderPage({Key? key}) : super(key: key);
9
-
10
-  @override
11
-  State<OrderPage> createState() => _OrderPageState();
12
-}
13
-
14
-class _OrderPageState extends State<OrderPage> {
15
-  @override
16
-  Widget build(BuildContext context) {
17
-    return Scaffold(
18
-        resizeToAvoidBottomInset: false,
19
-      appBar:  AppBar(
20
-          title:  Text('订单'),
21
-          leading:  Icon(Icons.arrow_back_ios),
22
-          backgroundColor: Color(0xff2b9270),
23
-        // backgroundColor: Colors.transparent,
24
-        centerTitle: true,
25
-
26
-      ),
27
-        body:      Column(
28
-          children: [
29
-            OrderInfoCard()
30
-          ],
31
-        ),
32
-    );
33
-
34
-  }
35
-}
36
-
37
-
38
-
39
-
40
-
41
-
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
42
 
3
 
43
 class OrderInfoCard extends StatelessWidget {
4
 class OrderInfoCard extends StatelessWidget {
44
   const OrderInfoCard({Key? key}) : super(key: key);
5
   const OrderInfoCard({Key? key}) : super(key: key);
46
   @override
7
   @override
47
   Widget build(BuildContext context) {
8
   Widget build(BuildContext context) {
48
     return Container(
9
     return Container(
49
-          height: 100,
50
-          child: Text('55555555555555'),
51
-
52
-        );
53
-
54
-
10
+      width: 345.w,
11
+      height: 484.5.h,
12
+      margin: EdgeInsets.fromLTRB(15.w, 17.w, 15.w, 0),
13
+      decoration: BoxDecoration(
14
+        color: Colors.white,
15
+        //设置四周圆角 角度
16
+        borderRadius: BorderRadius.all(Radius.circular(2.0)),
17
+        //设置四周边框
18
+        boxShadow: [
19
+          BoxShadow(
20
+            blurRadius: 10, //阴影范围
21
+            spreadRadius: 0.1, //阴影浓度
22
+            color: Colors.grey.withOpacity(0.2), //阴影颜色
23
+          ),
24
+        ],
25
+      ),
26
+      child: Column(
27
+        crossAxisAlignment: CrossAxisAlignment.start,
28
+        children: [
29
+          Container(
30
+              margin: EdgeInsets.fromLTRB(15.w, 0, 0, 0),
31
+              child: Column(
32
+                crossAxisAlignment: CrossAxisAlignment.start,
33
+                children: [
34
+                  Container(
35
+                    padding: EdgeInsets.fromLTRB(0, 15, 0, 20),
36
+                    width: 314.w,
37
+                    decoration: const BoxDecoration(
38
+                        border: Border(
39
+                            bottom:
40
+                                BorderSide(width: 0.5, color: Color(0x20000000)
41
+                                    // 0x17000000
42
+                                    ))),
43
+                    child: RichText(
44
+                      text: const TextSpan(children: <InlineSpan>[
45
+                        TextSpan(
46
+                            text: '订单编号:',
47
+                            style: TextStyle(
48
+                                color: Color(0xff666666),
49
+                                fontSize: 16,
50
+                                fontWeight: FontWeight.bold)),
51
+                        TextSpan(
52
+                            text: 'XUHUI12345',
53
+                            style: TextStyle(
54
+                                color: Color(0xff222222),
55
+                                fontSize: 16,
56
+                                fontWeight: FontWeight.bold)),
57
+                      ]),
58
+                    ),
59
+                  ),
60
+                  Padding(
61
+                    padding: EdgeInsets.fromLTRB(0, 20, 0, 15),
62
+                    child: RichText(
63
+                      text: const TextSpan(children: <InlineSpan>[
64
+                        TextSpan(
65
+                            text: '农机名称:',
66
+                            style: TextStyle(
67
+                                color: Color(0xff666666),
68
+                                fontSize: 16,
69
+                                fontWeight: FontWeight.bold)),
70
+                        TextSpan(
71
+                            text: '老李家收割机MVGV-005',
72
+                            style: TextStyle(
73
+                                color: Color(0xff222222),
74
+                                fontSize: 16,
75
+                                fontWeight: FontWeight.bold)),
76
+                      ]),
77
+                    ),
78
+                  ),
79
+                  Padding(
80
+                    padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
81
+                    child: RichText(
82
+                      text: const TextSpan(children: <InlineSpan>[
83
+                        TextSpan(
84
+                            text: '作业面积:',
85
+                            style: TextStyle(
86
+                                color: Color(0xff666666),
87
+                                fontSize: 16,
88
+                                fontWeight: FontWeight.bold)),
89
+                        TextSpan(
90
+                            text: '1',
91
+                            style: TextStyle(
92
+                                color: Color(0xff222222),
93
+                                fontSize: 16,
94
+                                fontWeight: FontWeight.bold)),
95
+                      ]),
96
+                    ),
97
+                  ),
98
+                  Padding(
99
+                    padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
100
+                    child: RichText(
101
+                      text: const TextSpan(children: <InlineSpan>[
102
+                        TextSpan(
103
+                            text: '需求时间:',
104
+                            style: TextStyle(
105
+                                color: Color(0xff666666),
106
+                                fontSize: 16,
107
+                                fontWeight: FontWeight.bold)),
108
+                        TextSpan(
109
+                            text: '2018-08-21',
110
+                            style: TextStyle(
111
+                                color: Color(0xff222222),
112
+                                fontSize: 16,
113
+                                fontWeight: FontWeight.bold)),
114
+                      ]),
115
+                    ),
116
+                  ),
117
+                  Padding(
118
+                    padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
119
+                    child: RichText(
120
+                      text: const TextSpan(children: <InlineSpan>[
121
+                        TextSpan(
122
+                            text: '下单时间:',
123
+                            style: TextStyle(
124
+                                color: Color(0xff666666),
125
+                                fontSize: 16,
126
+                                fontWeight: FontWeight.bold)),
127
+                        TextSpan(
128
+                            text: '2022-04-13',
129
+                            style: TextStyle(
130
+                                color: Color(0xff222222),
131
+                                fontSize: 16,
132
+                                fontWeight: FontWeight.bold)),
133
+                      ]),
134
+                    ),
135
+                  ),
136
+                  Padding(
137
+                    padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
138
+                    child: RichText(
139
+                      text: TextSpan(children: <InlineSpan>[
140
+                        TextSpan(
141
+                            text: '订单状态:',
142
+                            style: TextStyle(
143
+                                color: Color(0xff666666),
144
+                                fontSize: 16,
145
+                                fontWeight: FontWeight.bold)),
146
+                        TextSpan(
147
+                            text: '待付款',
148
+                            style: TextStyle(
149
+                                color: Color(0xff51D4FF),
150
+                                fontSize: 16,
151
+                                fontWeight: FontWeight.bold)),
152
+                      ]),
153
+                    ),
154
+                  ),
155
+                  Container(
156
+                      padding: EdgeInsets.fromLTRB(0, 20, 0, 0),
157
+                      width: 314.w,
158
+                      decoration: const BoxDecoration(
159
+                          border: Border(
160
+                              top: BorderSide(
161
+                                  width: 0.8, color: Color(0x20000000)
162
+                                  // 0x17000000
163
+                                  ))),
164
+                      child: Column(
165
+                        children: [
166
+                          Row(
167
+                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
168
+                            children: [
169
+                              Text('费用:',
170
+                                  style: TextStyle(
171
+                                      color: Color(0xff666666),
172
+                                      fontSize: 16,
173
+                                      fontWeight: FontWeight.bold)),
174
+                              Text('8880',
175
+                                  style: TextStyle(
176
+                                      color: Color(0xffB61515),
177
+                                      fontSize: 16,
178
+                                      fontWeight: FontWeight.bold)),
179
+                            ],
180
+                          ),
181
+                          Padding(padding: EdgeInsets.fromLTRB(0, 30, 0, 0),
182
+                            child:  Row(
183
+                              mainAxisAlignment: MainAxisAlignment.spaceBetween,
184
+                              children: [
185
+                                Text('状态:',
186
+                                    style: TextStyle(
187
+                                        color: Color(0xff666666),
188
+                                        fontSize: 16,
189
+                                        fontWeight: FontWeight.bold)),
190
+                                Text('待付款',
191
+                                    style: TextStyle(
192
+                                        color: Color(0xff51D4FF),
193
+                                        fontSize: 16,
194
+                                        fontWeight: FontWeight.bold)),
195
+                              ],
196
+                            ),
197
+
198
+                          ),
199
+
200
+                        ],
201
+                      )),
202
+                ],
203
+              )),
204
+
205
+        ],
206
+      ),
55
 
207
 
208
+    );
56
   }
209
   }
57
 }
210
 }

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

106
                       child: RichText(
106
                       child: RichText(
107
                         text: const TextSpan(children: <InlineSpan>[
107
                         text: const TextSpan(children: <InlineSpan>[
108
                           TextSpan(
108
                           TextSpan(
109
-                              text: '需求数量:',
109
+                              text: '作业面积:',
110
                               style: TextStyle(
110
                               style: TextStyle(
111
                                   color: Color(0xff666666),
111
                                   color: Color(0xff666666),
112
                                   fontSize: 16,
112
                                   fontSize: 16,

+ 2
- 0
pubspec.yaml 查看文件

80
     - images/cars.png
80
     - images/cars.png
81
     - images/gpsImgae.png
81
     - images/gpsImgae.png
82
     - images/ordersLeft.png
82
     - images/ordersLeft.png
83
+    - images/mineBack.png
84
+    - images/userMoren.png
83
 
85
 
84
   # An image asset can refer to one or more resolution-specific "variants", see
86
   # An image asset can refer to one or more resolution-specific "variants", see
85
   # https://flutter.dev/assets-and-images/#resolution-aware.
87
   # https://flutter.dev/assets-and-images/#resolution-aware.