[baozhangchao] 3 years ago
parent
commit
5ba7bb2c02

BIN
images/ordersLeft.png View File


+ 0
- 1
lib/components/UI/Banner.dart View File

@@ -1 +0,0 @@
1
-import 'package:flutter/material.dart';

+ 5
- 6
lib/main.dart View File

@@ -1,15 +1,13 @@
1 1
 import 'dart:async';
2 2
 
3 3
 import 'package:farmer_client/models/Store.dart';
4
-import 'package:farmer_client/pages/TabBar/index_page.dart';
5 4
 import 'package:farmer_client/pages/login/login.dart';
6 5
 import 'package:flutter/material.dart';
7 6
 import 'package:get/get.dart';
8 7
 import 'package:flutter_screenutil/flutter_screenutil.dart';
9
-import 'components/UI/Banner.dart';
10
-import 'components/UI/CarsCard.dart';
11
-import 'components/UI/DefaultButton.dart';
12
-import 'components/UI/Search.dart';
8
+
9
+import 'widgets/OrderListCard.dart';
10
+
13 11
 
14 12
 void main() {
15 13
   Store().init();
@@ -138,7 +136,8 @@ class _MyHomePageState extends State<MyHomePage> {
138 136
             //   distance:8.8,
139 137
             //   price:270.6,
140 138
             // )),
141
-            Search()
139
+            // Search()
140
+            OrderListCard()
142 141
           ],
143 142
         ),
144 143
       ),

+ 0
- 11
lib/pages/TabBar/Information_page.dart View File

@@ -1,11 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-
3
-class InformationPage extends StatelessWidget {
4
-  @override
5
-  Widget build(BuildContext context) {
6
-    // TODO: implement build
7
-    return Scaffold(
8
-      body: Center(child: Text('资讯')),
9
-    );
10
-  }
11
-}

+ 0
- 11
lib/pages/TabBar/Mine_page.dart View File

@@ -1,11 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-
3
-class MinePage extends StatelessWidget {
4
-  @override
5
-  Widget build(BuildContext context) {
6
-    // TODO: implement build
7
-    return Scaffold(
8
-      body: Center(child: Text('我的')),
9
-    );
10
-  }
11
-}

+ 0
- 11
lib/pages/TabBar/Orders_page.dart View File

@@ -1,11 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-
3
-class OrdersPage extends StatelessWidget {
4
-  @override
5
-  Widget build(BuildContext context) {
6
-    // TODO: implement build
7
-    return Scaffold(
8
-      body: Center(child: Text('订单')),
9
-    );
10
-  }
11
-}

+ 0
- 10
lib/pages/TabBar/home_page.dart View File

@@ -1,10 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-
3
-class HomePage extends StatelessWidget {
4
-  @override
5
-  Widget build(BuildContext context) {
6
-    return Scaffold(
7
-      body: Center(child: Text('首页')),
8
-    );
9
-  }
10
-}

+ 0
- 92
lib/pages/TabBar/index_page.dart View File

@@ -1,92 +0,0 @@
1
-// import 'package:flutter/material.dart';
2
-// import 'package:flutter/cupertino.dart';
3
-// import 'home_page.dart';
4
-// import 'Information_page.dart';
5
-// import 'Mine_page.dart';
6
-// import 'Orders_page.dart';
7
-//
8
-// class IndexPage extends StatefulWidget {
9
-//   const IndexPage({Key? key}) : super(key: key);
10
-//
11
-//   @override
12
-//   _IndexPageState createState() => _IndexPageState();
13
-// }
14
-//
15
-// class _IndexPageState extends State<IndexPage> {
16
-//   List bottom_icons = [
17
-//     'assets/images/HomesNOImgaes.png',
18
-//     "assets/images/MineNOImgaes.png",
19
-//     "assets/images/newsOFFImages.png",
20
-//     "assets/images/OrdersNOImgaes.png",
21
-//   ];
22
-//   List bottom_select_icons = [
23
-//     'assets/images/HomesOFFImgaes.png',
24
-//     "assets/images/MineOFFImgaes.png",
25
-//     "assets/images/newsONImages.png",
26
-//     "assets/images/OrdersOFFImgaes.png",
27
-//   ];
28
-//
29
-//
30
-//
31
-//
32
-//
33
-//   final List<BottomNavigationBarItem> bottomTabs = [
34
-//      BottomNavigationBarItem(
35
-//       icon: Icon(CupertinoIcons.home),
36
-//        label:'首页',
37
-//     ),
38
-//      BottomNavigationBarItem(
39
-//       icon: Icon(CupertinoIcons.search),
40
-//        label: '资讯',
41
-//
42
-//     ),
43
-//      BottomNavigationBarItem(
44
-//       icon: Icon(CupertinoIcons.shopping_cart),
45
-//        label: '订单',
46
-//
47
-//     ),
48
-//      BottomNavigationBarItem(
49
-//       icon: Icon(CupertinoIcons.profile_circled),
50
-//        label: '我的',
51
-//     ),
52
-//   ];
53
-//
54
-//   final List tabBodies = [
55
-//     HomePage(),
56
-//     InformationPage(),
57
-//     OrdersPage(),
58
-//     MinePage(),
59
-//   ];
60
-//
61
-//   int currentIndex = 0;
62
-//   var currentPage;
63
-//
64
-//   @override
65
-//   void initState() {
66
-//     super.initState();
67
-//     currentPage = tabBodies[currentIndex];
68
-//
69
-//   }
70
-//
71
-//   @override
72
-//   Widget build(BuildContext context) {
73
-//     // TODO: implement build
74
-//     return Scaffold(
75
-//       backgroundColor: Color.fromRGBO(244, 245, 245, 1),
76
-//       bottomNavigationBar: BottomNavigationBar(
77
-//         type: BottomNavigationBarType.fixed,
78
-//         currentIndex: currentIndex,
79
-//         items: bottomTabs,
80
-//         onTap: (index){
81
-//           setState(() {
82
-//             currentIndex = index;
83
-//             currentPage = tabBodies[currentIndex];
84
-//           });
85
-//         },
86
-//       ),
87
-//       body: currentPage,
88
-//     );
89
-//   }
90
-// }
91
-
92
-

+ 0
- 1
lib/pages/TabBar/member_page.dart View File

@@ -1 +0,0 @@
1
-// TODO Implement this library.

lib/components/UI/CarsCard.dart → lib/widgets/CarsCard.dart View File


lib/components/UI/DefaultButton.dart → lib/widgets/DefaultButton.dart View File


+ 216
- 0
lib/widgets/OrderListCard.dart View File

@@ -0,0 +1,216 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+
4
+class OrderListCard extends StatelessWidget {
5
+  const OrderListCard({Key? key}) : super(key: key);
6
+
7
+  @override
8
+  Widget build(BuildContext context) {
9
+    return Container(
10
+      width: 375.w,
11
+      height: 345.h,
12
+      decoration: const BoxDecoration(color: Colors.white, boxShadow: [
13
+        BoxShadow(
14
+            color: Colors.black12,
15
+            offset: Offset(0.0, 15.0), //阴影xy轴偏移量
16
+            blurRadius: 15.0, //阴影模糊程度
17
+            spreadRadius: 1.0 //阴影扩散程度
18
+            )
19
+      ]),
20
+      child: Row(
21
+        crossAxisAlignment: CrossAxisAlignment.start,
22
+        mainAxisAlignment: MainAxisAlignment.spaceBetween,
23
+        children: [
24
+          Container(
25
+            margin: EdgeInsets.fromLTRB(15, 20, 15, 0),
26
+            width: 18.0,
27
+            height: 275.h,
28
+            child: Image(
29
+              image: AssetImage('images/ordersLeft.png'),
30
+            ),
31
+          ),
32
+          Expanded(
33
+            child: Column(
34
+              crossAxisAlignment: CrossAxisAlignment.start,
35
+              children: [
36
+                Container(
37
+                  width: 320.w,
38
+                  margin: EdgeInsets.fromLTRB(0, 10, 0, 15),
39
+                  padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
40
+                  decoration: const BoxDecoration(
41
+                      border: Border(
42
+                          bottom:
43
+                              BorderSide(width: 0.5, color: Color(0x20000000)
44
+                                  // 0x17000000
45
+                                  ))),
46
+                  child: Row(
47
+                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
48
+                    children: [
49
+                      Container(
50
+                        child: RichText(
51
+                          text: const TextSpan(children: <InlineSpan>[
52
+                            TextSpan(
53
+                                text: '订单编号:',
54
+                                style: TextStyle(
55
+                                    color: Color(0xff666666),
56
+                                    fontSize: 16,
57
+                                    fontWeight: FontWeight.bold)),
58
+                            TextSpan(
59
+                                text: 'XUHUI12345',
60
+                                style: TextStyle(
61
+                                    color: Color(0xff222222),
62
+                                    fontSize: 16,
63
+                                    fontWeight: FontWeight.bold)),
64
+                          ]),
65
+                        ),
66
+                      ),
67
+                      GestureDetector(
68
+                        child: const Text('详情 >>',
69
+                            style: TextStyle(
70
+                              color: Color(0xff222222),
71
+                              fontSize: 16,
72
+                              fontWeight: FontWeight.bold,
73
+                            )),
74
+                        onTap: () {
75
+                          print('进入详情');
76
+                        },
77
+                      )
78
+                    ],
79
+                  ),
80
+                ),
81
+                Expanded(
82
+                    child: Column(
83
+                  crossAxisAlignment: CrossAxisAlignment.start,
84
+                  children: [
85
+                    Padding(
86
+                      padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
87
+                      child: RichText(
88
+                        text: const TextSpan(children: <InlineSpan>[
89
+                          TextSpan(
90
+                              text: '农机名称:',
91
+                              style: TextStyle(
92
+                                  color: Color(0xff666666),
93
+                                  fontSize: 16,
94
+                                  fontWeight: FontWeight.bold)),
95
+                          TextSpan(
96
+                              text: '老李家收割机MVGV-005',
97
+                              style: TextStyle(
98
+                                  color: Color(0xff222222),
99
+                                  fontSize: 16,
100
+                                  fontWeight: FontWeight.bold)),
101
+                        ]),
102
+                      ),
103
+                    ),
104
+                    Padding(
105
+                      padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
106
+                      child: RichText(
107
+                        text: const TextSpan(children: <InlineSpan>[
108
+                          TextSpan(
109
+                              text: '需求数量:',
110
+                              style: TextStyle(
111
+                                  color: Color(0xff666666),
112
+                                  fontSize: 16,
113
+                                  fontWeight: FontWeight.bold)),
114
+                          TextSpan(
115
+                              text: '2辆',
116
+                              style: TextStyle(
117
+                                  color: Color(0xff222222),
118
+                                  fontSize: 16,
119
+                                  fontWeight: FontWeight.bold)),
120
+                        ]),
121
+                      ),
122
+                    ),
123
+                    Padding(
124
+                      padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
125
+                      child: RichText(
126
+                        text: const TextSpan(children: <InlineSpan>[
127
+                          TextSpan(
128
+                              text: '需求时间:',
129
+                              style: TextStyle(
130
+                                  color: Color(0xff666666),
131
+                                  fontSize: 16,
132
+                                  fontWeight: FontWeight.bold)),
133
+                          TextSpan(
134
+                              text: '2018-08-21',
135
+                              style: TextStyle(
136
+                                  color: Color(0xff222222),
137
+                                  fontSize: 16,
138
+                                  fontWeight: FontWeight.bold)),
139
+                        ]),
140
+                      ),
141
+                    ),
142
+                    Padding(
143
+                      padding: EdgeInsets.fromLTRB(0, 0, 0, 4),
144
+                      child: RichText(
145
+                        text: const TextSpan(children: <InlineSpan>[
146
+                          TextSpan(
147
+                              text: '下单时间:',
148
+                              style: TextStyle(
149
+                                  color: Color(0xff666666),
150
+                                  fontSize: 16,
151
+                                  fontWeight: FontWeight.bold)),
152
+                          TextSpan(
153
+                              text: '2022-04-13',
154
+                              style: TextStyle(
155
+                                  color: Color(0xff222222),
156
+                                  fontSize: 16,
157
+                                  fontWeight: FontWeight.bold)),
158
+                        ]),
159
+                      ),
160
+                    ),
161
+                  ],
162
+                )),
163
+                Container(
164
+                  margin: EdgeInsets.fromLTRB(0, 0, 0, 30),
165
+                  padding: EdgeInsets.fromLTRB(0, 20, 0, 0),
166
+                  decoration: const BoxDecoration(
167
+                      border: Border(
168
+                          top: BorderSide(
169
+                              width: 0.5, color: Color(0x20000000)))),
170
+                  width: 320.w,
171
+                  child: Row(
172
+                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
173
+                    children: [
174
+                      RichText(
175
+                        text: const TextSpan(children: <InlineSpan>[
176
+                          TextSpan(
177
+                              text: '订单状态:',
178
+                              style: TextStyle(
179
+                                  color: Color(0xff666666),
180
+                                  fontSize: 16,
181
+                                  fontWeight: FontWeight.bold)),
182
+                          TextSpan(
183
+                              text: '待付款',
184
+                              style: TextStyle(
185
+                                  color: Color(0xff51D4FF),
186
+                                  fontSize: 16,
187
+                                  fontWeight: FontWeight.bold)),
188
+                        ]),
189
+                      ),
190
+                      RichText(
191
+                        text: const TextSpan(children: <InlineSpan>[
192
+                          TextSpan(
193
+                              text: '费用:',
194
+                              style: TextStyle(
195
+                                  color: Color(0xff666666),
196
+                                  fontSize: 16,
197
+                                  fontWeight: FontWeight.bold)),
198
+                          TextSpan(
199
+                              text: '850元',
200
+                              style: TextStyle(
201
+                                  color: Color(0xffB61515),
202
+                                  fontSize: 16,
203
+                                  fontWeight: FontWeight.bold)),
204
+                        ]),
205
+                      ),
206
+                    ],
207
+                  ),
208
+                ),
209
+              ],
210
+            ),
211
+          ),
212
+        ],
213
+      ),
214
+    );
215
+  }
216
+}

lib/components/UI/Search.dart → lib/widgets/Search.dart View File


+ 1
- 0
pubspec.yaml View File

@@ -76,6 +76,7 @@ flutter:
76 76
     - images/OrdersOFFImgaes.png
77 77
     - images/cars.png
78 78
     - images/gpsImgae.png
79
+    - images/ordersLeft.png
79 80
 
80 81
   # An image asset can refer to one or more resolution-specific "variants", see
81 82
   # https://flutter.dev/assets-and-images/#resolution-aware.