[baozhangchao] 3 年之前
父節點
當前提交
212c74e328

+ 97
- 5
lib/pages/MoreCars/index.dart 查看文件

@@ -1,6 +1,11 @@
1
+
1 2
 import 'package:flutter/material.dart';
2 3
 import 'package:flutter_screenutil/flutter_screenutil.dart';
3 4
 
5
+import '../../widgets/CarsCard.dart';
6
+import '../../widgets/Search.dart';
7
+import '../TabBar/widgets/home/widgets/headers.dart';
8
+
4 9
 
5 10
 class MoreCars extends StatefulWidget {
6 11
   const MoreCars({Key? key}) : super(key: key);
@@ -9,16 +14,33 @@ class MoreCars extends StatefulWidget {
9 14
   State<MoreCars> createState() => _MoreCarsState();
10 15
 }
11 16
 
12
-class _MoreCarsState extends State<MoreCars> {
17
+class _MoreCarsState extends State<MoreCars> with TickerProviderStateMixin  {
18
+
19
+  late TabController _controller = TabController(length: tabText.length, vsync: this);
20
+   List<String> tabText= [
21
+     '全部',
22
+     '播种机',
23
+     '收割机',
24
+     '挺长名字的农机选项分类',
25
+  ];
26
+
27
+
28
+
29
+  @override
30
+  void initState() {
31
+    // TODO: implement initState
32
+    super.initState();
33
+  }
13 34
   @override
14 35
   Widget build(BuildContext context) {
36
+    // _controller=TabController(length: tabText.length, vsync: this);
15 37
     return Scaffold(
16 38
       resizeToAvoidBottomInset: false,
17 39
       appBar: AppBar(
18 40
         elevation: 0,
19 41
         centerTitle: true,
20 42
         backgroundColor: Colors.white,
21
-        title: Text(
43
+        title:Text(
22 44
           '更多',
23 45
           style: TextStyle(
24 46
               color: Colors.black,
@@ -26,11 +48,81 @@ class _MoreCarsState extends State<MoreCars> {
26 48
               letterSpacing: 2,
27 49
               fontWeight: FontWeight.bold),
28 50
         ),
51
+
29 52
       ),
30
-      body: Container(
31
-        child: Text('wwwwwwwwwww'),
32
-      ),
53
+      body: ListView(
54
+          children: [Column(
55
+          children: [
56
+            Container(
57
+              padding: EdgeInsets.fromLTRB(20, 15, 20, 15),
58
+
59
+              decoration: BoxDecoration(
60
+                color: Colors.white
61
+              ),
62
+              // child:Search(),
63
+              child:          Container(
64
+                  height: 32.w,
65
+                  decoration: const BoxDecoration(
66
+                      color: Colors.white
67
+                  ),
68
+                  child: GestureDetector(
69
+                      onTap: (){
70
+                        print('点击了搜索');
71
+                      },
72
+                      child: Container(
73
+                        decoration: const BoxDecoration(
74
+                          // color: Colors.red,
75
+                          color: Color(0x30cccccc),
76
+                          borderRadius: BorderRadius.all(Radius.circular(25)),
77
+                        ),
78
+                        child: Row(
79
+                          children: [
80
+                            Padding(padding: EdgeInsets.fromLTRB(15, 0, 5, 0),
81
+                              child: Icon(Icons.search,size: 19,color:Color(0xff666666) ,),
82
+                            ),
83
+                            Text('请输入关键字查询',style: TextStyle(color: Color(0xff666666),fontSize: 14),)
84
+                          ],
85
+                        ),
86
+                      )
87
+                    // Search(),
88
+                  )
89
+              ),
90
+            ),
91
+            
92
+            TabBar(
93
+              labelStyle: TextStyle(fontSize: ScreenUtil().setSp(19),fontWeight: FontWeight.bold), //选中的样式
94
+              unselectedLabelStyle: TextStyle(fontSize:ScreenUtil().setSp(16)), //未选中的样式
95
+              controller: _controller,
96
+              isScrollable: true, //可滚动
97
+              indicatorColor: Colors.black, //指示器的颜色
98
+              labelColor: Colors.black, //选中文字颜色
99
+              unselectedLabelColor: Color(0xffadadad),
100
+              // indicatorSize: TabBarIndicatorSize.label, //指示器与文字等宽
101
+              tabs: tabText.map((e) => Tab(text: e)).toList(),
102
+              onTap: (int i) {
103
+                print('当前+${i}');
104
+              },
105
+
106
+            ),
107
+            Container(
108
+              child: Column(
109
+                children: [
110
+                  CarsCard(),
111
+                  CarsCard(),
112
+                  CarsCard(),
113
+                  CarsCard(),
114
+                ],
115
+              )
116
+              ,
117
+            )
118
+
119
+
120
+          ],
121
+        )]
122
+
123
+      )
33 124
 
34 125
     );
35 126
   }
36 127
 }
128
+

+ 0
- 4
lib/pages/machinery/widgets/summary.dart 查看文件

@@ -60,10 +60,6 @@ Widget _title() {
60 60
                 ]
61 61
             ),
62 62
           ),
63
-
64
-
65
-
66
-
67 63
         ),
68 64
       )
69 65
     ],

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

@@ -6,13 +6,14 @@ import 'package:farmer_client/pages/addressList/index.dart';
6 6
 import 'package:farmer_client/pages/agreement/index.dart';
7 7
 import 'package:farmer_client/pages/userInfo/index.dart';
8 8
 import 'package:get/get.dart';
9
+import '../pages/MoreCars/index.dart';
9 10
 import '../pages/index.dart';
10 11
 
11 12
 
12 13
 List<GetPage> pages = [
13 14
   GetPage(name: '/', page: () =>  Home()),
14 15
   GetPage(name: '/ArticleInfo', page: () =>  ArticleInfo()),//资讯详情
15
-  GetPage(name: '/splash', page: () => MachineryDetailPage()),//SplashScreen
16
+  GetPage(name: '/splash', page: () => SplashScreen()),//SplashScreen
16 17
   GetPage(name: '/login', page: () =>  MyRouteLogin()),
17 18
   GetPage(name: '/addressList', page: () =>  AddressList()),
18 19
   GetPage(name: '/addAddress', page: () =>  AddAddress()),

+ 43
- 20
lib/widgets/CarsCard.dart 查看文件

@@ -5,7 +5,9 @@ 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/detail/index.dart';
8 9
 import '../pages/machinery/map/index.dart';
10
+import 'LinearGradientText.dart';
9 11
 
10 12
 // class CarItem {
11 13
 //   late String name;
@@ -33,12 +35,19 @@ class CarsCard extends StatelessWidget {
33 35
       // height: 389.h,
34 36
       child: Column(
35 37
         children: [
36
-          Image.network(
37
-            "http://yz-shigongli.oss-accelerate.aliyuncs.com/2022-03/1648094119154-7b280bbf63105a8e90299e2d79c8c6ee.jpeg",
38
-            width: 345.w,
39
-            height: 230.h,
40
-            fit: BoxFit.cover,
38
+          GestureDetector(
39
+            onTap: (){
40
+              Get.to(MachineryDetailPage());
41
+
42
+            },
43
+            child:Image.network(
44
+              "http://yz-shigongli.oss-accelerate.aliyuncs.com/2022-03/1648094119154-7b280bbf63105a8e90299e2d79c8c6ee.jpeg",
45
+              width: 345.w,
46
+              height: 230.h,
47
+              fit: BoxFit.cover,
48
+            ),
41 49
           ),
50
+
42 51
           Container(
43 52
             padding: EdgeInsets.fromLTRB(15, 20, 0, 0),
44 53
             child: Row(
@@ -62,21 +71,35 @@ class CarsCard extends StatelessWidget {
62 71
               mainAxisAlignment: MainAxisAlignment.spaceBetween,
63 72
               children: <Widget>[
64 73
                 Container(
65
-                  child: RichText(
66
-                    text: const TextSpan(children: <InlineSpan>[
67
-                      TextSpan(
68
-                          text: '8555元/',
69
-                          style: TextStyle(
70
-                              color: Color(0xffce3800),
71
-                              fontSize: 22,
72
-                              fontWeight: FontWeight.bold)),
73
-                      TextSpan(
74
-                          text: '公顷',
75
-                          style: TextStyle(
76
-                              color: Color(0xffce3800),
77
-                              fontSize: 10,
78
-                              fontWeight: FontWeight.bold)),
79
-                    ]),
74
+                  child: LinearGradientText(
75
+                    colors: const <Color>[
76
+                      Color(0xFFFA7878),
77
+                      Color(0xFFB61515),
78
+                    ],
79
+                    child: RichText(
80
+                      text: TextSpan(
81
+                          children: <InlineSpan>[
82
+                            TextSpan(
83
+                                text: "4508",
84
+                                style: TextStyle(
85
+                                  fontSize: 22,
86
+                                  fontWeight: FontWeight.bold,
87
+                                )),
88
+                            TextSpan(
89
+                                text: "元/",
90
+                                style: TextStyle(
91
+                                  fontSize: 22,
92
+                                  fontWeight: FontWeight.bold,
93
+                                )),
94
+                            TextSpan(
95
+                                text: "公顷",
96
+                                style: TextStyle(
97
+                                  fontSize: 12,
98
+                                  fontWeight: FontWeight.bold,
99
+                                )),
100
+                          ]
101
+                      ),
102
+                    ),
80 103
                   ),
81 104
                 ),
82 105
                 Align(

+ 20
- 10
lib/widgets/OrderInfoCard.dart 查看文件

@@ -1,6 +1,8 @@
1 1
 import 'package:flutter/material.dart';
2 2
 import 'package:flutter_screenutil/flutter_screenutil.dart';
3 3
 
4
+import 'LinearGradientText.dart';
5
+
4 6
 class OrderInfoCard extends StatelessWidget {
5 7
   const OrderInfoCard({Key? key}) : super(key: key);
6 8
 
@@ -136,7 +138,7 @@ class OrderInfoCard extends StatelessWidget {
136 138
                     Padding(
137 139
                       padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
138 140
                       child: RichText(
139
-                        text: TextSpan(children: <InlineSpan>[
141
+                        text: const TextSpan(children: <InlineSpan>[
140 142
                           TextSpan(
141 143
                               text: '订单状态:',
142 144
                               style: TextStyle(
@@ -165,25 +167,33 @@ class OrderInfoCard extends StatelessWidget {
165 167
                           children: [
166 168
                             Row(
167 169
                               mainAxisAlignment: MainAxisAlignment.spaceBetween,
168
-                              children: [
169
-                                Text('费用:',
170
+                              children:  [
171
+                                const Text('费用:',
170 172
                                     style: TextStyle(
171 173
                                         color: Color(0xff666666),
172 174
                                         fontSize: 16,
173 175
                                         fontWeight: FontWeight.bold)),
174
-                                Text('8880',
175
-                                    style: TextStyle(
176
-                                        color: Color(0xffB61515),
177
-                                        fontSize: 16,
178
-                                        fontWeight: FontWeight.bold)),
176
+                                LinearGradientText(
177
+                                  colors: const <Color>[
178
+                                    Color(0xFFFA7878),
179
+                                    Color(0xFFB61515),
180
+                                  ],
181
+                                  child: const Text('8880',
182
+                                      style: TextStyle(
183
+                                          color: Color(0xffB61515),
184
+                                          fontSize: 16,
185
+                                          fontWeight: FontWeight.bold)),
186
+                                ),
187
+
188
+
179 189
                               ],
180 190
                             ),
181 191
                             Padding(
182 192
                               padding: EdgeInsets.fromLTRB(0, 30, 0, 0),
183 193
                               child: Row(
184 194
                                 mainAxisAlignment:
185
-                                    MainAxisAlignment.spaceBetween,
186
-                                children: [
195
+                                MainAxisAlignment.spaceBetween,
196
+                                children: const [
187 197
                                   Text('状态:',
188 198
                                       style: TextStyle(
189 199
                                           color: Color(0xff666666),

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

@@ -4,6 +4,7 @@ import 'package:get/get.dart';
4 4
 
5 5
 import '../pages/OrderConfirmation/index.dart';
6 6
 import '../pages/orderInfo/index.dart';
7
+import 'LinearGradientText.dart';
7 8
 import 'OrderInfoCard.dart';
8 9
 
9 10
 class OrderListCard extends StatelessWidget {
@@ -194,22 +195,43 @@ class OrderListCard extends StatelessWidget {
194 195
                                   fontWeight: FontWeight.bold)),
195 196
                         ]),
196 197
                       ),
197
-                      RichText(
198
-                        text: const TextSpan(children: <InlineSpan>[
199
-                          TextSpan(
200
-                              text: '费用:',
201
-                              style: TextStyle(
202
-                                  color: Color(0xff666666),
203
-                                  fontSize: 16,
204
-                                  fontWeight: FontWeight.bold)),
205
-                          TextSpan(
206
-                              text: '850元',
207
-                              style: TextStyle(
208
-                                  color: Color(0xffB61515),
209
-                                  fontSize: 16,
210
-                                  fontWeight: FontWeight.bold)),
211
-                        ]),
198
+                      Container(
199
+                        child: Row(
200
+                          children: [
201
+                            const Text('费用:',style: TextStyle(
202
+                                color: Color(0xff666666),
203
+                                fontSize: 16,
204
+                                fontWeight: FontWeight.bold)),
205
+                            LinearGradientText(
206
+                              colors: const <Color>[
207
+                                Color(0xFFFA7878),
208
+                                Color(0xFFB61515),
209
+                              ],
210
+                              child: RichText(
211
+                                text: const TextSpan(
212
+                                    children: <InlineSpan>[
213
+                                      TextSpan(
214
+                                          text: "8808",
215
+                                          style: TextStyle(
216
+                                            fontSize: 16,
217
+                                            fontWeight: FontWeight.bold,
218
+                                          )),
219
+                                      TextSpan(
220
+                                          text: "元",
221
+                                          style: TextStyle(
222
+                                            fontSize: 16,
223
+                                            fontWeight: FontWeight.bold,
224
+                                          )),
225
+
226
+                                    ]
227
+                                ),
228
+                              ),
229
+                            ),
230
+
231
+                          ],
232
+                        ),
212 233
                       ),
234
+
213 235
                     ],
214 236
                   ),
215 237
                 ),