Просмотр исходного кода

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

张延森 3 лет назад
Родитель
Сommit
bd26313912

Двоичные данные
images/icons/feedbackIcon.png Просмотреть файл


+ 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
+

+ 32
- 27
lib/pages/TabBar/widgets/main/widgets/OtherColumn.dart Просмотреть файл

@@ -117,33 +117,38 @@ class OtherColumn extends StatelessWidget {
117 117
                       ),
118 118
                     ),
119 119
                   ),
120
-                  Container(
121
-                    margin: EdgeInsets.fromLTRB(0, 10.w, 0, 20.w),
122
-                    width: 310.w,
123
-                    height: 45.w,
124
-                    decoration: const BoxDecoration(
125
-                        border: Border(
126
-                            bottom:
127
-                                BorderSide(width: 0.5, color: Color(0x20000000)
128
-                                    // 0x17000000
129
-                                    ))),
130
-                    child: ListTile(
131
-                      contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
132
-                      leading: Image(
133
-                        image: AssetImage('images/feedbacks.png'),
134
-                        width: 18.w,
135
-                        height: 21.w,
136
-                      ),
137
-                      title: Transform(
138
-                        transform: Matrix4.translationValues(-20, 0.0, 0.0),
139
-                        child: Text("意见反馈",
140
-                            style: TextStyle(
141
-                                fontSize: 17.sp, color: Color(0xff333333))),
142
-                      ),
143
-                      trailing: Image(
144
-                        image: AssetImage('images/userRight.png'),
145
-                        width: 10.w,
146
-                        height: 18.w,
120
+                  GestureDetector(
121
+                    onTap: () {
122
+                      Get.toNamed('/feedback');
123
+                    },
124
+                    child: Container(
125
+                      margin: EdgeInsets.fromLTRB(0, 10.w, 0, 20.w),
126
+                      width: 310.w,
127
+                      height: 45.w,
128
+                      decoration: const BoxDecoration(
129
+                          border: Border(
130
+                              bottom: BorderSide(
131
+                                  width: 0.5, color: Color(0x20000000)
132
+                                  // 0x17000000
133
+                                  ))),
134
+                      child: ListTile(
135
+                        contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
136
+                        leading: Image(
137
+                          image: AssetImage('images/feedbacks.png'),
138
+                          width: 18.w,
139
+                          height: 21.w,
140
+                        ),
141
+                        title: Transform(
142
+                          transform: Matrix4.translationValues(-20, 0.0, 0.0),
143
+                          child: Text("意见反馈",
144
+                              style: TextStyle(
145
+                                  fontSize: 17.sp, color: Color(0xff333333))),
146
+                        ),
147
+                        trailing: Image(
148
+                          image: AssetImage('images/userRight.png'),
149
+                          width: 10.w,
150
+                          height: 18.w,
151
+                        ),
147 152
                       ),
148 153
                     ),
149 154
                   ),

+ 117
- 0
lib/pages/feedback/index.dart Просмотреть файл

@@ -0,0 +1,117 @@
1
+import 'package:farmer_client/models/entities/Address.dart';
2
+import 'package:farmer_client/widgets/DefaultButton.dart';
3
+import 'package:flutter/material.dart';
4
+import 'package:flutter_screenutil/flutter_screenutil.dart';
5
+import 'package:fluttertoast/fluttertoast.dart';
6
+import 'package:get/get.dart';
7
+
8
+class Feedback extends StatefulWidget {
9
+  const Feedback({Key? key}) : super(key: key);
10
+
11
+  @override
12
+  _Feedback createState() => _Feedback();
13
+}
14
+
15
+class _Feedback extends State<Feedback> {
16
+  String text = '';
17
+  bool isEdit=false;
18
+  @override
19
+  Widget build(BuildContext context) {
20
+    return Scaffold(
21
+      resizeToAvoidBottomInset: false,
22
+      appBar: AppBar(
23
+        elevation: 0,
24
+        centerTitle: true,
25
+        backgroundColor: Colors.white,
26
+        title: Text(
27
+          '意见反馈',
28
+          style: TextStyle(
29
+              color: Colors.black,
30
+              fontSize: 17.sp,
31
+              letterSpacing: 2,
32
+              fontWeight: FontWeight.bold),
33
+        ),
34
+      ),
35
+      body: Container(
36
+        height: 700.h,
37
+        padding: EdgeInsets.all(15.w),
38
+        child: Stack(
39
+          children: [
40
+            Container(
41
+              margin: EdgeInsets.fromLTRB(0, 0, 0, 50.h),
42
+              padding: EdgeInsets.symmetric(vertical: 5.w, horizontal: 18.5.w),
43
+              decoration: BoxDecoration(
44
+                  color: const Color(0xFFfefefe),
45
+                  borderRadius: BorderRadius.all(Radius.circular(10.w)),
46
+                  border: Border.all(
47
+                      color: const Color(0xcc000000),
48
+                      width: 1.h,
49
+                      style: BorderStyle.solid)),
50
+              child: TextFormField(
51
+                minLines: 6,
52
+                maxLines: 6,
53
+                style: TextStyle(fontSize: 17.sp, height: 1.5),
54
+                decoration: const InputDecoration(
55
+                  isCollapsed: true,
56
+                  border: InputBorder.none,
57
+                  counterText: '', //去掉计数
58
+                  floatingLabelBehavior: FloatingLabelBehavior.never,
59
+                ),
60
+                onTap: () {
61
+                  setState(() {
62
+                    isEdit=true;
63
+                  });
64
+                },
65
+                onChanged: (e) {
66
+                  setState(() {
67
+                    text = e;
68
+                  });
69
+                },
70
+              ),
71
+            ),
72
+            if(!isEdit) Positioned(
73
+              left: 20.w,
74
+              top: 5.w,
75
+              child: Row(
76
+                children: [
77
+                  Image.asset(
78
+                    'images/icons/feedbackIcon.png',
79
+                    width: 15.w,
80
+                  ),
81
+                  Text(
82
+                    '请留下您宝贵的意见和建议!',
83
+                    style: TextStyle(
84
+                        fontSize: 17.sp,
85
+                        letterSpacing: 2,
86
+                        color: Color(0xFFBEBDBD)),
87
+                  ),
88
+                ],
89
+              ),
90
+            ),
91
+            Positioned(
92
+              bottom: 25.h,
93
+              child: DefaultButton(
94
+                color: const Color(0xffffffff),
95
+                backColor: const Color(0xFFFF703B),
96
+                width: 345.w,
97
+                height: 49.h,
98
+                text: '提交',
99
+                onPressed: () {
100
+                  if (text == '') {
101
+                    Fluttertoast.showToast(msg: '请输入内容哦');
102
+                  } else {
103
+                    Fluttertoast.showToast(msg: '提交成功!');
104
+                    Get.back();
105
+                  }
106
+                },
107
+                margin: const EdgeInsets.all(0),
108
+                fontSize: 20.sp,
109
+                radius: 24.5.w,
110
+              ),
111
+            ),
112
+          ],
113
+        ),
114
+      ),
115
+    );
116
+  }
117
+}

+ 1
- 1
lib/pages/login/login.dart Просмотреть файл

@@ -289,7 +289,7 @@ class _RouteLogin extends State<MyRouteLogin> {
289 289
                             recognizer:
290 290
                             TapGestureRecognizer() //踩坑。。。recognizer 是手势交互 除了我现在些的是 点击交互,其他一般都是抽象类。
291 291
                               ..onTap = () {
292
-                                print('阅读已同意!!!');
292
+                                Get.toNamed('/agreement');
293 293
                               },
294 294
                           ),
295 295
                           const TextSpan(

+ 2
- 1
lib/routes/middleWares.dart Просмотреть файл

@@ -8,7 +8,8 @@ void routingCallback (routing) {
8 8
   bool isLogin = box.hasData('token');
9 9
   bool isSplashScreen = routing?.current == '/splash';
10 10
   bool isLoginPage = routing?.current == '/login';
11
-  if (!isLogin && !isSplashScreen && !isLoginPage) {
11
+  bool isAgreementPage = routing?.current == '/agreement';
12
+  if (!isLogin && !isSplashScreen && !isLoginPage&&!isAgreementPage) {
12 13
     // addPostFrameCallback 作用是等当前帧绘制完成之后再加载
13 14
     // https://github.com/jonataslaw/getx/issues/262
14 15
     SchedulerBinding.instance?.addPostFrameCallback((_) => Get.offNamed('/login'));

+ 4
- 1
lib/routes/pages.dart Просмотреть файл

@@ -4,15 +4,17 @@ import 'package:farmer_client/pages/aboutUs/index.dart';
4 4
 import 'package:farmer_client/pages/addAddress/index.dart';
5 5
 import 'package:farmer_client/pages/addressList/index.dart';
6 6
 import 'package:farmer_client/pages/agreement/index.dart';
7
+import 'package:farmer_client/pages/feedback/index.dart';
7 8
 import 'package:farmer_client/pages/userInfo/index.dart';
8 9
 import 'package:get/get.dart';
10
+import '../pages/MoreCars/index.dart';
9 11
 import '../pages/index.dart';
10 12
 
11 13
 
12 14
 List<GetPage> pages = [
13 15
   GetPage(name: '/', page: () =>  Home()),
14 16
   GetPage(name: '/ArticleInfo', page: () =>  ArticleInfo()),//资讯详情
15
-  GetPage(name: '/splash', page: () => MachineryDetailPage()),//SplashScreen
17
+  GetPage(name: '/splash', page: () => SplashScreen()),//SplashScreen
16 18
   GetPage(name: '/login', page: () =>  MyRouteLogin()),
17 19
   GetPage(name: '/addressList', page: () =>  AddressList()),
18 20
   GetPage(name: '/addAddress', page: () =>  AddAddress()),
@@ -21,4 +23,5 @@ List<GetPage> pages = [
21 23
   GetPage(name: '/machineryDetail', page: () =>  MachineryDetailPage()),
22 24
   GetPage(name: '/aboutUs', page: () =>  AboutUs()),
23 25
   GetPage(name: '/agreement', page: () =>  Agreement()),
26
+  GetPage(name: '/feedback', page: () =>  Feedback()),
24 27
 ];

+ 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
                 ),