李志伟 2 years ago
parent
commit
615c17c019

+ 0
- 1
lib/pages/order/index.dart View File

1
 import 'package:farmer_client/pages/order/widgets/index.dart';
1
 import 'package:farmer_client/pages/order/widgets/index.dart';
2
 import 'package:flutter/material.dart';
2
 import 'package:flutter/material.dart';
3
 import 'package:get/get.dart';
3
 import 'package:get/get.dart';
4
-import 'package:get/get_rx/src/rx_types/rx_types.dart';
5
 import 'package:farmer_client/models/entities/OrderInfoModel.dart';
4
 import 'package:farmer_client/models/entities/OrderInfoModel.dart';
6
 import 'package:farmer_client/services/orderAPI.dart';
5
 import 'package:farmer_client/services/orderAPI.dart';
7
 import 'package:farmer_client/widgets/OrderListCard.dart';
6
 import 'package:farmer_client/widgets/OrderListCard.dart';

+ 16
- 24
lib/pages/order/widgets/index.dart View File

7
   @override
7
   @override
8
   Widget build(BuildContext context) {
8
   Widget build(BuildContext context) {
9
     return Container(
9
     return Container(
10
-      padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
10
+      padding: const EdgeInsets.fromLTRB(15, 0, 15, 0),
11
       height: 55.w,
11
       height: 55.w,
12
-      decoration: BoxDecoration(color: Colors.white),
12
+      decoration: const BoxDecoration(color: Colors.white),
13
       child: Row(
13
       child: Row(
14
-        mainAxisAlignment: MainAxisAlignment.spaceBetween,
15
         children: [
14
         children: [
16
-          Row(
17
-            children: [
18
-              Padding(
19
-                padding: EdgeInsets.fromLTRB(0, 0, 8, 0),
20
-                child: Image(
21
-                  image: AssetImage('images/ordersListImga.png'),
22
-                  fit: BoxFit.cover,
23
-                  width: 18.w,
24
-                ),
25
-              ),
26
-              Text(
27
-                '订单列表',
28
-                style: TextStyle(
29
-                    color: Color(0xff222222),
30
-                    fontSize: 20.sp,
31
-                    fontWeight: FontWeight.bold),
32
-              )
33
-            ],
15
+          Padding(
16
+            padding: const EdgeInsets.fromLTRB(0, 0, 8, 0),
17
+            child: Image(
18
+              image: const AssetImage('images/ordersListImga.png'),
19
+              fit: BoxFit.cover,
20
+              width: 18.w,
21
+            ),
34
           ),
22
           ),
23
+          Text(
24
+            '订单列表',
25
+            style: TextStyle(
26
+                color: const Color(0xff222222),
27
+                fontSize: 20.sp,
28
+                fontWeight: FontWeight.bold),
29
+          )
35
         ],
30
         ],
36
       ),
31
       ),
37
     );
32
     );
38
-
39
   }
33
   }
40
 }
34
 }
41
-
42
-

+ 2
- 2
lib/pages/orderInfo/index.dart View File

210
 
210
 
211
   // 评价
211
   // 评价
212
   _fnEvaluate(String orderId) {
212
   _fnEvaluate(String orderId) {
213
-    int evalStars = -1;
213
+    double evalStars = -1;
214
     String evalText = '';
214
     String evalText = '';
215
 
215
 
216
-    onEvaluate(int val1, String val2) {
216
+    onEvaluate(double val1, String val2) {
217
       evalStars = val1;
217
       evalStars = val1;
218
       evalText = val2;
218
       evalText = val2;
219
     }
219
     }

+ 1
- 1
lib/utils/Request.dart View File

29
 
29
 
30
 Dio createRequest() {
30
 Dio createRequest() {
31
   const isProd = bool.fromEnvironment('dart.vm.product');
31
   const isProd = bool.fromEnvironment('dart.vm.product');
32
-  const host = isProd ? 'https://machine.njyunzhi.com' : 'http://192.168.89.147:7080';
32
+  const host = isProd ? 'https://machine.njyunzhi.com' : 'http://192.168.89.25:7080';
33
   final baseUrl = '$host/api/$client/farmer';
33
   final baseUrl = '$host/api/$client/farmer';
34
 
34
 
35
   var options = BaseOptions(
35
   var options = BaseOptions(

+ 131
- 129
lib/widgets/OrderListCard.dart View File

20
       text: TextSpan(children: <InlineSpan>[
20
       text: TextSpan(children: <InlineSpan>[
21
         TextSpan(
21
         TextSpan(
22
             text: title,
22
             text: title,
23
-            style: const TextStyle(
24
-                color: Color(0xff666666),
25
-                fontSize: 16,
23
+            style: TextStyle(
24
+                color: const Color(0xff666666),
25
+                fontSize: 16.sp,
26
                 fontWeight: FontWeight.bold)),
26
                 fontWeight: FontWeight.bold)),
27
         TextSpan(
27
         TextSpan(
28
             text: value,
28
             text: value,
29
-            style: const TextStyle(
30
-                color: Color(0xff222222),
31
-                fontSize: 16,
29
+            style: TextStyle(
30
+                color: const Color(0xff222222),
31
+                fontSize: 16.sp,
32
                 fontWeight: FontWeight.bold)),
32
                 fontWeight: FontWeight.bold)),
33
       ]),
33
       ]),
34
     );
34
     );
47
   Widget build(BuildContext context) {
47
   Widget build(BuildContext context) {
48
     return Container(
48
     return Container(
49
       width: 375.w,
49
       width: 375.w,
50
-      height: 345.h,
51
-      margin: const EdgeInsets.fromLTRB(0, 0, 0, 20),
50
+      margin: EdgeInsets.only(bottom: 20.h),
51
+      padding: EdgeInsets.symmetric(vertical: 30.h, horizontal: 15.w),
52
       decoration: const BoxDecoration(color: Colors.white, boxShadow: [
52
       decoration: const BoxDecoration(color: Colors.white, boxShadow: [
53
         BoxShadow(
53
         BoxShadow(
54
             color: Colors.black12,
54
             color: Colors.black12,
58
             )
58
             )
59
       ]),
59
       ]),
60
       child: Row(
60
       child: Row(
61
-        crossAxisAlignment: CrossAxisAlignment.start,
62
-        mainAxisAlignment: MainAxisAlignment.spaceBetween,
63
         children: [
61
         children: [
64
           Container(
62
           Container(
65
-            margin: const EdgeInsets.fromLTRB(15, 20, 15, 0),
66
-            width: 18.0,
67
-            height: 275.h,
63
+            margin: EdgeInsets.only(right: 15.w),
64
+            width: 17.w,
65
+            height: 320.h,
68
             child: const Image(
66
             child: const Image(
69
               image: AssetImage('images/ordersLeft.png'),
67
               image: AssetImage('images/ordersLeft.png'),
70
             ),
68
             ),
71
           ),
69
           ),
72
-          Expanded(
73
-            child: Column(
74
-              crossAxisAlignment: CrossAxisAlignment.start,
75
-              children: [
76
-                Container(
77
-                  width: 320.w,
78
-                  margin: const EdgeInsets.fromLTRB(0, 10, 0, 15),
79
-                  padding: const EdgeInsets.fromLTRB(0, 0, 0, 20),
80
-                  decoration: const BoxDecoration(
81
-                      border: Border(
82
-                          bottom:
83
-                              BorderSide(width: 0.5, color: Color(0x20000000)
84
-                                  // 0x17000000
85
-                                  ))),
86
-                  child: GestureDetector(
87
-                    child: Row(
88
-                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
89
-                      children: [
90
-                        TextCell(title: '订单编号:', value: item.orderNo),
91
-                        Bold(
92
-                            text: "详情 >>",
93
-                            fontSize: 16.sp,
94
-                            color: const Color(0xff222222)),
95
-                      ],
70
+          Column(
71
+            crossAxisAlignment: CrossAxisAlignment.start,
72
+            children: [
73
+              Container(
74
+                width: 313.w,
75
+                margin: EdgeInsets.only(bottom: 20.h),
76
+                padding: EdgeInsets.only(bottom: 20.h),
77
+                decoration: const BoxDecoration(
78
+                  border: Border(
79
+                    bottom: BorderSide(
80
+                      width: 0.5,
81
+                      color: Color(0x20000000),
96
                     ),
82
                     ),
97
-                    onTap: () {
98
-                      Get.toNamed('/orderPageInfo', arguments: {
99
-                        'orderId': item.orderId,
100
-                        'title': processSign.label,
101
-                        'styleColor': processSign.color
102
-                      });
103
-                    },
104
                   ),
83
                   ),
105
                 ),
84
                 ),
106
-                Expanded(
107
-                    child: Column(
108
-                  crossAxisAlignment: CrossAxisAlignment.start,
109
-                  children: [
110
-                    Padding(
111
-                      padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
112
-                      child:
113
-                          TextCell(title: '农机名称:', value: item.machineryName),
114
-                    ),
115
-                    Padding(
116
-                      padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
117
-                      child: TextCell(
118
-                          title: '作业面积:', value: item.amount.toString()),
119
-                    ),
120
-                    Padding(
121
-                      padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
122
-                      child: TextCell(
123
-                          title: '需求时间:',
124
-                          value: DateFormat("yyyy-MM-dd").format(
125
-                              DateTime.parse(item.appointmentDate.toString()))),
126
-                    ),
127
-                    Padding(
128
-                      padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
129
-                      child: TextCell(
130
-                          title: '需求时间:',
131
-                          value: DateFormat("yyyy-MM-dd").format(
132
-                              DateTime.parse(item.createDate.toString()))),
133
-                    ),
134
-                  ],
135
-                )),
136
-                Container(
137
-                  margin: const EdgeInsets.fromLTRB(0, 0, 0, 30),
138
-                  padding: const EdgeInsets.fromLTRB(0, 20, 0, 0),
139
-                  decoration: const BoxDecoration(
140
-                      border: Border(
141
-                          top: BorderSide(
142
-                              width: 0.5, color: Color(0x20000000)))),
143
-                  width: 320.w,
85
+                child: GestureDetector(
144
                   child: Row(
86
                   child: Row(
145
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
87
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
146
                     children: [
88
                     children: [
147
-                      RichText(
148
-                        text: TextSpan(children: <InlineSpan>[
149
-                          const TextSpan(
150
-                              text: '订单状态:',
151
-                              style: TextStyle(
152
-                                  color: Color(0xff666666),
153
-                                  fontSize: 16,
154
-                                  fontWeight: FontWeight.bold)),
89
+                      TextCell(title: '订单编号:', value: item.orderNo),
90
+                      Bold(
91
+                        text: "详情 >>",
92
+                        fontSize: 16.sp,
93
+                        color: const Color(0xff222222),
94
+                      ),
95
+                    ],
96
+                  ),
97
+                  onTap: () {
98
+                    Get.toNamed('/orderPageInfo', arguments: {
99
+                      'orderId': item.orderId,
100
+                      'title': processSign.label,
101
+                      'styleColor': processSign.color
102
+                    });
103
+                  },
104
+                ),
105
+              ),
106
+              Padding(
107
+                padding: EdgeInsets.only(bottom: 30.h),
108
+                child: TextCell(title: '农机名称:', value: item.machineryName),
109
+              ),
110
+              Padding(
111
+                padding: EdgeInsets.only(bottom: 30.h),
112
+                child: TextCell(title: '作业面积:', value: item.amount.toString()),
113
+              ),
114
+              Padding(
115
+                padding: EdgeInsets.only(bottom: 30.h),
116
+                child: TextCell(
117
+                    title: '需求时间:',
118
+                    value: DateFormat("yyyy-MM-dd").format(
119
+                        DateTime.parse(item.appointmentDate.toString()))),
120
+              ),
121
+              TextCell(
122
+                title: '下单时间:',
123
+                value: DateFormat("yyyy-MM-dd")
124
+                    .format(DateTime.parse(item.createDate.toString())),
125
+              ),
126
+              Container(
127
+                margin: EdgeInsets.only(top: 22.h),
128
+                padding: EdgeInsets.only(top: 30.h),
129
+                decoration: const BoxDecoration(
130
+                  border: Border(
131
+                    top: BorderSide(
132
+                      width: 0.5,
133
+                      color: Color(0x20000000),
134
+                    ),
135
+                  ),
136
+                ),
137
+                width: 313.w,
138
+                child: Row(
139
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
140
+                  children: [
141
+                    RichText(
142
+                      text: TextSpan(
143
+                        children: <InlineSpan>[
155
                           TextSpan(
144
                           TextSpan(
156
-                              text: processSign.label,
157
-                              style: TextStyle(
158
-                                  color: processSign.color,
159
-                                  fontSize: 16,
160
-                                  fontWeight: FontWeight.bold)),
161
-                        ]),
145
+                            text: '订单状态:',
146
+                            style: TextStyle(
147
+                                color: const Color(0xff666666),
148
+                                fontSize: 16.sp,
149
+                                fontWeight: FontWeight.bold),
150
+                          ),
151
+                          TextSpan(
152
+                            text: processSign.label,
153
+                            style: TextStyle(
154
+                                color: processSign.color,
155
+                                fontSize: 16.sp,
156
+                                fontWeight: FontWeight.bold),
157
+                          ),
158
+                        ],
162
                       ),
159
                       ),
163
-                      Row(
164
-                        children: [
165
-                          const Text('费用:',
166
-                              style: TextStyle(
167
-                                  color: Color(0xff666666),
168
-                                  fontSize: 16,
169
-                                  fontWeight: FontWeight.bold)),
170
-                          LinearGradientText(
171
-                            colors: const <Color>[
172
-                              Color(0xFFFA7878),
173
-                              Color(0xFFB61515),
174
-                            ],
175
-                            child: RichText(
176
-                              text: TextSpan(children: <InlineSpan>[
160
+                    ),
161
+                    Row(
162
+                      children: [
163
+                        Text(
164
+                          '费用:',
165
+                          style: TextStyle(
166
+                              color: const Color(0xff666666),
167
+                              fontSize: 16.sp,
168
+                              fontWeight: FontWeight.bold),
169
+                        ),
170
+                        LinearGradientText(
171
+                          colors: const <Color>[
172
+                            Color(0xFFFA7878),
173
+                            Color(0xFFB61515),
174
+                          ],
175
+                          child: RichText(
176
+                            text: TextSpan(
177
+                              children: <InlineSpan>[
177
                                 TextSpan(
178
                                 TextSpan(
178
-                                    text:
179
-                                        ((item.charges ?? 0) / 100).toString(),
180
-                                    style: const TextStyle(
181
-                                      fontSize: 16,
182
-                                      fontWeight: FontWeight.bold,
183
-                                    )),
184
-                                const TextSpan(
185
-                                    text: "元",
186
-                                    style: TextStyle(
187
-                                      fontSize: 16,
188
-                                      fontWeight: FontWeight.bold,
189
-                                    )),
190
-                              ]),
179
+                                  text: ((item.charges ?? 0) / 100).toString(),
180
+                                  style: TextStyle(
181
+                                    fontSize: 16.sp,
182
+                                    fontWeight: FontWeight.bold,
183
+                                  ),
184
+                                ),
185
+                                TextSpan(
186
+                                  text: "元",
187
+                                  style: TextStyle(
188
+                                    fontSize: 16.sp,
189
+                                    fontWeight: FontWeight.bold,
190
+                                  ),
191
+                                ),
192
+                              ],
191
                             ),
193
                             ),
192
                           ),
194
                           ),
193
-                        ],
194
-                      ),
195
-                    ],
196
-                  ),
195
+                        ),
196
+                      ],
197
+                    ),
198
+                  ],
197
                 ),
199
                 ),
198
-              ],
199
-            ),
200
+              ),
201
+            ],
200
           ),
202
           ),
201
         ],
203
         ],
202
       ),
204
       ),

+ 9
- 9
pubspec.lock View File

112
       name: collection
112
       name: collection
113
       url: "https://pub.flutter-io.cn"
113
       url: "https://pub.flutter-io.cn"
114
     source: hosted
114
     source: hosted
115
-    version: "1.16.0"
115
+    version: "1.15.0"
116
   convert:
116
   convert:
117
     dependency: transitive
117
     dependency: transitive
118
     description:
118
     description:
154
       name: fake_async
154
       name: fake_async
155
       url: "https://pub.flutter-io.cn"
155
       url: "https://pub.flutter-io.cn"
156
     source: hosted
156
     source: hosted
157
-    version: "1.3.0"
157
+    version: "1.2.0"
158
   ff_stars:
158
   ff_stars:
159
     dependency: "direct main"
159
     dependency: "direct main"
160
     description:
160
     description:
293
       name: js
293
       name: js
294
       url: "https://pub.flutter-io.cn"
294
       url: "https://pub.flutter-io.cn"
295
     source: hosted
295
     source: hosted
296
-    version: "0.6.4"
296
+    version: "0.6.3"
297
   json_annotation:
297
   json_annotation:
298
     dependency: transitive
298
     dependency: transitive
299
     description:
299
     description:
335
       name: material_color_utilities
335
       name: material_color_utilities
336
       url: "https://pub.flutter-io.cn"
336
       url: "https://pub.flutter-io.cn"
337
     source: hosted
337
     source: hosted
338
-    version: "0.1.4"
338
+    version: "0.1.3"
339
   meta:
339
   meta:
340
     dependency: transitive
340
     dependency: transitive
341
     description:
341
     description:
356
       name: path
356
       name: path
357
       url: "https://pub.flutter-io.cn"
357
       url: "https://pub.flutter-io.cn"
358
     source: hosted
358
     source: hosted
359
-    version: "1.8.1"
359
+    version: "1.8.0"
360
   path_provider:
360
   path_provider:
361
     dependency: transitive
361
     dependency: transitive
362
     description:
362
     description:
501
       name: source_span
501
       name: source_span
502
       url: "https://pub.flutter-io.cn"
502
       url: "https://pub.flutter-io.cn"
503
     source: hosted
503
     source: hosted
504
-    version: "1.8.2"
504
+    version: "1.8.1"
505
   stack_trace:
505
   stack_trace:
506
     dependency: transitive
506
     dependency: transitive
507
     description:
507
     description:
543
       name: test_api
543
       name: test_api
544
       url: "https://pub.flutter-io.cn"
544
       url: "https://pub.flutter-io.cn"
545
     source: hosted
545
     source: hosted
546
-    version: "0.4.9"
546
+    version: "0.4.8"
547
   tobias:
547
   tobias:
548
     dependency: "direct main"
548
     dependency: "direct main"
549
     description:
549
     description:
564
       name: vector_math
564
       name: vector_math
565
       url: "https://pub.flutter-io.cn"
565
       url: "https://pub.flutter-io.cn"
566
     source: hosted
566
     source: hosted
567
-    version: "2.1.2"
567
+    version: "2.1.1"
568
   watcher:
568
   watcher:
569
     dependency: transitive
569
     dependency: transitive
570
     description:
570
     description:
594
     source: hosted
594
     source: hosted
595
     version: "3.1.1"
595
     version: "3.1.1"
596
 sdks:
596
 sdks:
597
-  dart: ">=2.17.0-0 <3.0.0"
597
+  dart: ">=2.16.1 <3.0.0"
598
   flutter: ">=2.8.1"
598
   flutter: ">=2.8.1"