[baozhangchao] 3 лет назад
Родитель
Сommit
63c0dd46a6

+ 13
- 6
lib/pages/ArticleInfo/ArticleInfo.dart Просмотреть файл

@@ -7,13 +7,20 @@ class ArticleInfo extends StatelessWidget {
7 7
   @override
8 8
   Widget build(BuildContext context) {
9 9
     return Scaffold(
10
-        resizeToAvoidBottomInset: false,
11
-        appBar: AppBar(
12
-          title: Text('资讯'),
13
-          leading: Icon(Icons.arrow_back_ios),
14
-          // backgroundColor: Colors.transparent,
15
-          centerTitle: true,
10
+      resizeToAvoidBottomInset: false,
11
+      appBar: AppBar(
12
+        elevation: 0,
13
+        centerTitle: true,
14
+        backgroundColor: Colors.white,
15
+        title: Text(
16
+          '资讯详情',
17
+          style: TextStyle(
18
+              color: Colors.black,
19
+              fontSize: 17.sp,
20
+              letterSpacing: 2,
21
+              fontWeight: FontWeight.bold),
16 22
         ),
23
+      ),
17 24
         body: Container(
18 25
           padding: EdgeInsets.fromLTRB(15, 30, 15, 50),
19 26
 

+ 3
- 1
lib/pages/TabBar/widgets/Information/index.dart Просмотреть файл

@@ -3,6 +3,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
3 3
 import 'package:get/get.dart';
4 4
 import 'package:get/get_core/src/get_main.dart';
5 5
 
6
+import '../../../ArticleInfo/ArticleInfo.dart';
7
+
6 8
 class Information extends StatefulWidget {
7 9
   const Information({Key? key}) : super(key: key);
8 10
 
@@ -64,7 +66,7 @@ class _InformationState extends State<Information> {
64 66
                 ],
65 67
               )),
66 68
           onTap: () {
67
-            Get.toNamed('/ArticleInfo');
69
+            Get.to(ArticleInfo());
68 70
           },
69 71
         ),
70 72
         GestureDetector(

+ 34
- 0
lib/pages/TabBar/widgets/home/index.dart Просмотреть файл

@@ -1,3 +1,4 @@
1
+import 'package:carousel_slider/carousel_slider.dart';
1 2
 import 'package:farmer_client/pages/TabBar/widgets/home/widgets/headers.dart';
2 3
 import 'package:flutter/material.dart';
3 4
 import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -14,6 +15,16 @@ class HomePage extends StatefulWidget {
14 15
 }
15 16
 
16 17
 class _HomePageState extends State<HomePage> {
18
+  final CarouselController _controller = CarouselController();
19
+  final List<String> imgList = [
20
+    'https://images.unsplash.com/photo-1520342868574-5fa3804e551c?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=6ff92caffcdd63681a35134a6770ed3b&auto=format&fit=crop&w=1951&q=80',
21
+    'https://images.unsplash.com/photo-1522205408450-add114ad53fe?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=368f45b0888aeb0b7b08e3a1084d3ede&auto=format&fit=crop&w=1950&q=80',
22
+    'https://images.unsplash.com/photo-1519125323398-675f0ddb6308?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=94a1e718d89ca60a6337a6008341ca50&auto=format&fit=crop&w=1950&q=80',
23
+    'https://images.unsplash.com/photo-1523205771623-e0faa4d2813d?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=89719a0d55dd05e2deae4120227e6efc&auto=format&fit=crop&w=1953&q=80',
24
+    'https://images.unsplash.com/photo-1508704019882-f9cf40e475b4?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=8c6e5e3aba713b17aa1fe71ab4f0ae5b&auto=format&fit=crop&w=1352&q=80',
25
+    'https://images.unsplash.com/photo-1519985176271-adb1088fa94c?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=a0c8d632e977f94e5d312d9893258f59&auto=format&fit=crop&w=1355&q=80'
26
+  ];
27
+
17 28
   @override
18 29
   Widget build(BuildContext context) {
19 30
     return Container(
@@ -22,6 +33,29 @@ class _HomePageState extends State<HomePage> {
22 33
       child: ListView(
23 34
         children: [
24 35
           headers(),
36
+          Container(
37
+            margin: EdgeInsets.fromLTRB(0, 15, 0, 0),
38
+            child: CarouselSlider(
39
+              //API  https://pub.dev/documentation/carousel_slider/latest/carousel_options/CarouselOptions-class.html
40
+              items:imgList
41
+                  .map((item) => Container(
42
+                child: Center(
43
+                    child:
44
+                    Image.network(item, fit: BoxFit.cover, width: 350.w)),
45
+              ))
46
+                  .toList(),
47
+              options: CarouselOptions(
48
+                autoPlay: true,
49
+                enlargeCenterPage: false,//图片中心放大
50
+                viewportFraction: 1,//每个页面应占据的视口部分。默认为 0.8,这意味着每个页面填充 80% 的轮播。
51
+                // aspectRatio: 1.6,//纵横比
52
+                height: 214.w,
53
+                initialPage: 1,//初始页
54
+              ),
55
+            ),
56
+          ),
57
+          
58
+
25 59
           Container(
26 60
             margin: EdgeInsets.fromLTRB(0, 20, 0, 20),
27 61
             child: Column(

+ 2
- 2
lib/pages/TabBar/widgets/home/widgets/headers.dart Просмотреть файл

@@ -41,7 +41,7 @@ class headers extends StatelessWidget {
41 41
               padding: EdgeInsets.fromLTRB(15.w, 0, 0, 0),
42 42
               width: 260.w,
43 43
               height: 32.w,
44
-              decoration: BoxDecoration(
44
+              decoration: const BoxDecoration(
45 45
                   color: Colors.white
46 46
               ),
47 47
               child: GestureDetector(
@@ -49,7 +49,7 @@ class headers extends StatelessWidget {
49 49
                     print('点击了搜索');
50 50
                   },
51 51
                   child: Container(
52
-                    decoration: BoxDecoration(
52
+                    decoration: const BoxDecoration(
53 53
                       // color: Colors.red,
54 54
                       color: Color(0x30cccccc),
55 55
                       borderRadius: BorderRadius.all(Radius.circular(25)),

+ 3
- 0
lib/widgets/CarsCard.dart Просмотреть файл

@@ -5,6 +5,7 @@ import 'package:get/get.dart';
5 5
 import 'package:get/get_core/src/get_main.dart';
6 6
 
7 7
 import '../pages/OrderConfirmation/index.dart';
8
+import '../pages/machinery/map/index.dart';
8 9
 
9 10
 // class CarItem {
10 11
 //   late String name;
@@ -90,6 +91,7 @@ class CarsCard extends StatelessWidget {
90 91
                       onPressed: () {
91 92
                         Get.to(OrderConfirmation());
92 93
                         print('点我去预约');
94
+
93 95
                       },
94 96
                       child: const Text(
95 97
                         "预约",
@@ -143,6 +145,7 @@ class CarsCard extends StatelessWidget {
143 145
                             ),
144 146
                             onTap: () {
145 147
                               print('进入地图');
148
+                              Get.to(MachineryMapPage());
146 149
                             },
147 150
                           )
148 151
                         ],

+ 194
- 180
lib/widgets/OrderInfoCard.dart Просмотреть файл

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

+ 5
- 0
lib/widgets/OrderListCard.dart Просмотреть файл

@@ -1,5 +1,9 @@
1 1
 import 'package:flutter/material.dart';
2 2
 import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+
5
+import '../pages/OrderConfirmation/index.dart';
6
+import 'OrderInfoCard.dart';
3 7
 
4 8
 class OrderListCard extends StatelessWidget {
5 9
   const OrderListCard({Key? key}) : super(key: key);
@@ -74,6 +78,7 @@ class OrderListCard extends StatelessWidget {
74 78
                             )),
75 79
                         onTap: () {
76 80
                           print('进入详情');
81
+                          Get.to(OrderInfoCard());
77 82
                         },
78 83
                       )
79 84
                     ],

+ 7
- 0
pubspec.lock Просмотреть файл

@@ -64,6 +64,13 @@ packages:
64 64
       url: "https://pub.dartlang.org"
65 65
     source: hosted
66 66
     version: "1.0.0"
67
+  carousel_slider:
68
+    dependency: "direct main"
69
+    description:
70
+      name: carousel_slider
71
+      url: "https://pub.dartlang.org"
72
+    source: hosted
73
+    version: "4.0.0"
67 74
   characters:
68 75
     dependency: transitive
69 76
     description:

+ 1
- 0
pubspec.yaml Просмотреть файл

@@ -46,6 +46,7 @@ dependencies:
46 46
   fluttertoast: ^8.0.9
47 47
   location: ^4.3.0
48 48
   amap_flutter_map: ^3.0.0
49
+  carousel_slider: ^4.0.0
49 50
 
50 51
 
51 52