张延森 před 2 roky
rodič
revize
03e9bbb2b0

+ 3
- 3
lib/pages/OrderConfirmation/index.dart Zobrazit soubor

@@ -88,7 +88,7 @@ class OrderConfirmation extends BasicPage {
88 88
                   margin: EdgeInsets.fromLTRB(15, 20, 0, 0),
89 89
                   alignment: Alignment.topLeft,
90 90
                   child: Text(
91
-                    '作业面积/公顷',
91
+                    '作业面积/',
92 92
                     style: TextStyle(
93 93
                         color: Color(0xff222222),
94 94
                         fontSize: 17.sp,
@@ -113,14 +113,14 @@ class OrderConfirmation extends BasicPage {
113 113
                       ),
114 114
                     ),
115 115
                     floatingLabelBehavior: FloatingLabelBehavior.never,
116
-                    hintText: "请输入具体面积(公顷)",
116
+                    hintText: "请输入具体面积()",
117 117
                   ),
118 118
                   onChanged: (e) {
119 119
                     workingArea(int.parse(e));
120 120
                   },
121 121
                   // 校验用户名
122 122
                   validator: (v) {
123
-                    return v!.trim().isNotEmpty ? null : "作业面积/公顷不能为空";
123
+                    return v!.trim().isNotEmpty ? null : "作业面积/不能为空";
124 124
                   },
125 125
                 ),
126 126
                 Container(

+ 1
- 1
lib/pages/machinery/widgets/summary.dart Zobrazit soubor

@@ -59,7 +59,7 @@ Widget _title({required CardInfo item}) {
59 59
                     fontWeight: FontWeight.bold,
60 60
                   )),
61 61
               TextSpan(
62
-                  text: "公顷",
62
+                  text: "",
63 63
                   style: TextStyle(
64 64
                     fontSize: 12.sp,
65 65
                     fontWeight: FontWeight.bold,

+ 48
- 55
lib/pages/order/index.dart Zobrazit soubor

@@ -3,14 +3,10 @@ import 'package:farmer_client/widgets/layout/BasicPage.dart';
3 3
 import 'package:flutter/material.dart';
4 4
 import 'package:flutter_easyrefresh/easy_refresh.dart';
5 5
 import 'package:farmer_client/widgets/NullCard.dart';
6
-import 'package:flutter/material.dart';
7
-import 'package:flutter_easyloading/flutter_easyloading.dart';
8
-import 'package:flutter_easyrefresh/easy_refresh.dart';
9
-import 'package:flutter_screenutil/flutter_screenutil.dart';
10 6
 import 'package:fluttertoast/fluttertoast.dart';
11 7
 import 'package:get/get.dart';
12 8
 import 'package:get/get_rx/src/rx_types/rx_types.dart';
13
-import '../../models/entities/OrderListAll.dart';
9
+import '../../models/entities/OrderInfoModel.dart';
14 10
 import '../../services/orderAPI.dart';
15 11
 import '../../widgets/OrderListCard.dart';
16 12
 
@@ -21,8 +17,8 @@ class OrderPage extends BasicPage {
21 17
   }
22 18
   EasyRefreshController _controller = EasyRefreshController();
23 19
 
24
-  final orderListItem = Rx<List<OrderListAll>>([]);
25
-  final newOrderList = Rx<List<OrderListAll>>([]);
20
+  final orderListItem = Rx<List<OrderInfoModel>>([]);
21
+  final newOrderList = Rx<List<OrderInfoModel>>([]);
26 22
   var pageIndex = 1; //页数
27 23
   var count = 10; //每页10条
28 24
   late int maxSum; //最多条数
@@ -35,9 +31,9 @@ class OrderPage extends BasicPage {
35 31
     print(params['pageNum']);
36 32
     getOrderList(params).then((value) {
37 33
       maxSum = value['total'];
38
-      List<OrderListAll> list = [];
34
+      List<OrderInfoModel> list = [];
39 35
       value['records'].forEach((item) {
40
-        list.add(OrderListAll.fromJson(item));
36
+        list.add(OrderInfoModel.fromJson(item));
41 37
       });
42 38
       orderListItem(list);
43 39
       newOrderList(list);
@@ -51,10 +47,10 @@ class OrderPage extends BasicPage {
51 47
     print(params['pageNum']);
52 48
     getOrderList(params).then((value) {
53 49
       maxSum = value['total'];
54
-      List<OrderListAll> list = [];
55
-      List<OrderListAll> Newlist = [];
50
+      List<OrderInfoModel> list = [];
51
+      List<OrderInfoModel> Newlist = [];
56 52
       value['records'].forEach((item) {
57
-        list.add(OrderListAll.fromJson(item));
53
+        list.add(OrderInfoModel.fromJson(item));
58 54
       });
59 55
       newOrderList.value.addAll(list);
60 56
       Newlist.addAll(newOrderList.value);
@@ -71,51 +67,48 @@ class OrderPage extends BasicPage {
71 67
   }
72 68
   @override
73 69
   Widget builder(BuildContext context) {
74
-    return Container(
75
-      // padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
76
-      child:Column(
77
-        children:  [
78
-          OrderHead(),
79
-          Expanded(
80
-            child:
81
-            (
82
-      EasyRefresh(
83
-        controller: _controller,
84
-        firstRefresh: true,
85
-        header: ClassicalHeader(refreshingText:'刷新中...',refreshedText: '刷新成功',refreshFailedText:'异常'),
86
-        onRefresh: () async {
87
-          await Future.delayed(Duration(seconds: 1), () {
88
-            print("下拉刷新-----");
89
-            getNewData();
90
-            _controller.resetLoadState();
91
-          });
92
-        },
93
-        onLoad: () async {
94
-          await Future.delayed(Duration(seconds: 1), () {
95
-            if (_count == maxSum) {
96
-              Fluttertoast.showToast(msg: '暂无更多数据哦');
97
-            } else {
98
-              getMoreData();
99
-            }
100
-            _controller.finishLoad(noMore: _count >= maxSum);
70
+    return Column(
71
+      children:  [
72
+        const OrderHead(),
73
+        Expanded(
74
+          child:
75
+          (
76
+    EasyRefresh(
77
+      controller: _controller,
78
+      firstRefresh: true,
79
+      header: ClassicalHeader(refreshingText:'刷新中...',refreshedText: '刷新成功',refreshFailedText:'异常'),
80
+      onRefresh: () async {
81
+        await Future.delayed(const Duration(seconds: 1), () {
82
+          print("下拉刷新-----");
83
+          getNewData();
84
+          _controller.resetLoadState();
85
+        });
86
+      },
87
+      onLoad: () async {
88
+        await Future.delayed(const Duration(seconds: 1), () {
89
+          if (_count == maxSum) {
90
+            Fluttertoast.showToast(msg: '暂无更多数据哦');
91
+          } else {
92
+            getMoreData();
93
+          }
94
+          _controller.finishLoad(noMore: _count >= maxSum);
101 95
 
102
-          });
103
-        },
104
-        child: Obx(
105
-              () => orderListItem.value.length > 0
106
-              ?
107
-          Column(
108
-            mainAxisSize: MainAxisSize.min,
109
-            children: orderListItem.value
110
-                .map((item) => OrderListCard(item: item))
111
-                .toList(),
112
-          ): NullCard(text: '您还没有新的订单!'),
113
-        ),
114
-      )
115
-            ),
96
+        });
97
+      },
98
+      child: Obx(
99
+            () => orderListItem.value.isNotEmpty
100
+            ?
101
+        Column(
102
+          mainAxisSize: MainAxisSize.min,
103
+          children: orderListItem.value
104
+              .map((item) => OrderListCard(item: item))
105
+              .toList(),
106
+        ): const NullCard(text: '您还没有新的订单!'),
107
+      ),
108
+    )
109
+          ),
116 110
   )
117
-        ],
118
-      ) ,
111
+      ],
119 112
     );
120 113
   }
121 114
 }

+ 217
- 360
lib/pages/orderInfo/index.dart Zobrazit soubor

@@ -1,26 +1,22 @@
1
-import 'package:farmer_client/pages/orderInfo/widgets/star.dart';
2
-import 'package:farmer_client/services/pay.dart';
3
-import 'package:farmer_client/widgets/DefaultButton.dart';
4 1
 import 'package:ff_stars/ff_stars.dart';
5 2
 import 'package:flutter/material.dart';
6 3
 import 'package:flutter_easyloading/flutter_easyloading.dart';
7 4
 import 'package:flutter_screenutil/flutter_screenutil.dart';
8 5
 import 'package:fluttertoast/fluttertoast.dart';
9 6
 import 'package:get/get.dart';
10
-import 'package:farmer_client/widgets/Modal.dart' as modal;
11 7
 import 'package:fluwx/fluwx.dart' as fluwx;
12 8
 import 'package:tobias/tobias.dart' as tobias;
9
+import 'package:farmer_client/services/pay.dart';
10
+import 'package:farmer_client/services/orderAPI.dart';
11
+import 'package:farmer_client/utils/processStatus.dart';
12
+import 'package:farmer_client/widgets/DefaultButton.dart';
13
+import 'package:farmer_client/widgets/Bold.dart';
14
+import 'package:farmer_client/widgets/OrderInfoCard.dart';
15
+import 'package:farmer_client/widgets/layout/BasicPage.dart';
16
+import 'package:farmer_client/widgets/Modal.dart' as modal;
17
+import 'package:farmer_client/models/entities/OrderInfoModel.dart';
13 18
 
14
-import '../../models/entities/OrderInfoModel.dart';
15
-import '../../services/orderAPI.dart';
16
-import '../../widgets/OrderInfoCard.dart';
17
-import '../../widgets/layout/BasicPage.dart';
18
-
19
-// class OrderContentInfo {
20
-//   String title;
21
-//   Color styleColor;
22
-//   StyleObj ({ required this.title, required this.styleColor});
23
-// }
19
+import './widgets/PayItem.dart';
24 20
 
25 21
 class OrderPageInfo extends BasicPage {
26 22
   final id = Rx<String>('');
@@ -29,6 +25,7 @@ class OrderPageInfo extends BasicPage {
29 25
   final orderInfoContent = Rx<OrderInfoModel>(OrderInfoModel());
30 26
   final evalText = Rx<String>('');
31 27
   final evalStars = Rx<num>(-1);
28
+  var processStatus;
32 29
 
33 30
   // orderStates
34 31
   @override
@@ -37,17 +34,16 @@ class OrderPageInfo extends BasicPage {
37 34
     super.beforeShow();
38 35
     if (Get.arguments['id'] != null) {
39 36
       id(Get.arguments['id']);
40
-      print(Get.arguments);
41
-
42
-      orderStateText(Get.arguments['title']);
43
-      orderStateColor(Get.arguments['styleColor']);
44 37
 
45 38
       orderInfo(id()).then((value) {
46 39
         EasyLoading.show(status: '数据加载中...');
47
-
48
-        orderInfoContent(OrderInfoModel.fromJson(value));
40
+        OrderInfoModel orderInfo = OrderInfoModel.fromJson(value);
41
+        processStatus = getProcessStatus(orderInfo);
42
+        ProcessSign processSign = getProcessSign(processStatus);
43
+        orderStateText(processSign.label);
44
+        orderStateColor(processSign.color);
45
+        orderInfoContent(orderInfo);
49 46
         EasyLoading.dismiss();
50
-
51 47
       });
52 48
     }
53 49
   }
@@ -64,233 +60,153 @@ class OrderPageInfo extends BasicPage {
64 60
               orderStateText: orderStateText(),
65 61
               orderStateColor: orderStateColor()),
66 62
         ),
67
-        // Obx(() => _BottomWidget(id: id())),
68
-
69 63
         Obx(
70 64
           () => Container(
71 65
               padding: EdgeInsets.fromLTRB(15, 50.w, 15, 0),
72
-              child: _bottomJudgment(id.value)),
66
+              child: _action(context, id.value)),
73 67
         ),
74 68
       ],
75 69
     );
76 70
   }
77 71
 
78
-  Widget _bottomJudgment(String id) {
79
-    return orderStateText.value == '已完成'
80
-        ? Text('')
81
-        : orderStateText.value == '进行中'
82
-            ? Text('')
83
-            : orderStateText.value == '待评价'
84
-                ? DefaultButton(
85
-                    color: const Color(0xffffffff),
86
-                    backColor: const Color(0xFFFF703B),
87
-                    width: 300.w,
88
-                    height: 49.h,
89
-                    text: '评价',
90
-                    onPressed: () {
91
-                      modal.showDialog(
92
-                          title: '评价此订单',
93
-                          content: Container(
94
-                              alignment: Alignment.center,
95
-                              child: Container(
96
-                                margin:
97
-                                    const EdgeInsets.fromLTRB(15, 20, 15, 20),
98
-                                child: Column(
99
-                                  children: [
100
-                                    Container(
101
-                                      padding: const EdgeInsets.fromLTRB(
102
-                                          0, 0, 0, 10),
103
-                                      decoration: const BoxDecoration(
104
-                                          border: Border(
105
-                                              bottom: BorderSide(
106
-                                                  width: 0.8,
107
-                                                  color: Color(0x20000000)
108
-                                                  // 0x17000000
109
-                                                  ))),
110
-                                      child: Row(
111
-                                        children: [
112
-                                          Text(
113
-                                            '满意度:',
114
-                                            style: TextStyle(
115
-                                                fontSize: 17.sp,
116
-                                                fontWeight: FontWeight.bold),
117
-                                          ),
118
-                                          FFStars(
119
-                                            //https://pub.dev/packages/ff_stars
120
-                                            normalStar: Image.asset(
121
-                                                'images/icons/starOff.png'),
122
-                                            selectedStar: Image.asset(
123
-                                                'images/icons/starOn.png'),
124
-                                            starsChanged:
125
-                                                (realStars, selectedStars) {
126
-                                              evalStars(realStars);
127
-                                              print(
128
-                                                  "real: $selectedStars, final: $realStars");
129
-                                            },
130
-                                            step: 1,
131
-                                            defaultStars: 0,
132
-                                          ),
133
-                                        ],
134
-                                      ),
135
-                                    ),
136
-                                    Container(
137
-                                      margin: const EdgeInsets.fromLTRB(
138
-                                          0, 20, 0, 0),
139
-                                      width: 300.w,
140
-                                      height: 100.w,
141
-                                      decoration: BoxDecoration(
142
-                                        border: Border.all(
143
-                                          color: Color(0x20000000),
144
-                                          width: 0.8,
145
-                                        ),
146
-                                      ),
147
-                                      child: TextField(
148
-                                        minLines: 6,
149
-                                        maxLines: 6,
150
-                                        style: TextStyle(
151
-                                            fontSize: 17.sp, height: 1.5),
152
-                                        decoration: const InputDecoration(
153
-                                          isCollapsed: true,
154
-                                          border: InputBorder.none,
155
-                                          counterText: '',
156
-                                          hintText: '请输入评价内容',
157
-                                          floatingLabelBehavior:
158
-                                              FloatingLabelBehavior.never,
159
-                                        ),
160
-                                        onChanged: (e) {
161
-                                          evalText(e);
162
-                                        },
163
-                                      ),
164
-                                    )
165
-                                  ],
166
-                                ),
167
-                              )),
168
-                          onCancel: () => true,
169
-                          onConfirm: () {
170
-                            if (evalStars.value != -1 && evalText.value != '') {
171
-                              orderEvaluation(
172
-                                      id, evalStars.value, evalText.value)
173
-                                  .then((value) {
174
-                                Fluttertoast.showToast(msg: '评价成功!');
175
-                                Get.offAllNamed('/order');
176
-                              });
177
-                            } else {
178
-                              Fluttertoast.showToast(msg: '请完整选择评分或输入评价内容');
179
-                              return false;
180
-                            }
181
-                          });
182
-                    },
183
-                    margin: const EdgeInsets.all(0),
184
-                    fontSize: 20.sp,
185
-                    radius: 24.5.w,
186
-                  )
187
-                : orderStateText.value == '待作业'
188
-                    ? DefaultButton(
189
-                        color: const Color(0xffffffff),
190
-                        backColor: const Color(0xFFFF703B),
191
-                        width: 300.w,
192
-                        height: 49.h,
193
-                        text: '退单',
194
-                        onPressed: () {
195
-                          modal.showDialog(
196
-                              title: '提示',
197
-                              content: Container(
198
-                                alignment: Alignment.center,
199
-                                child: Text('确定要申请退单吗?'),
200
-                              ),
201
-                              onCancel: () => true,
202
-                              onConfirm: () => {
203
-                                    orderRefund(id).then((value) {
204
-                                      Fluttertoast.showToast(msg: '退单成功!');
205
-                                      Get.offAllNamed('/order');
206
-                                    }),
207
-                                  });
208
-                        },
209
-                        margin: const EdgeInsets.all(0),
210
-                        fontSize: 20.sp,
211
-                        radius: 24.5.w,
212
-                      )
213
-                    : orderStateText.value == '已付款'
214
-                        ? DefaultButton(
215
-                            color: const Color(0xffffffff),
216
-                            backColor: const Color(0xFFFF703B),
217
-                            width: 300.w,
218
-                            height: 49.h,
219
-                            text: '退单',
220
-                            onPressed: () {
221
-                              modal.showDialog(
222
-                                  title: '提示',
223
-                                  content: Container(
224
-                                    alignment: Alignment.center,
225
-                                    child: Text('确定要申请退单吗?'),
226
-                                  ),
227
-                                  onCancel: () => true,
228
-                                  onConfirm: () => {
229
-                                        orderRefund(id).then((value) {
230
-                                          Fluttertoast.showToast(msg: '退单成功!');
231
-                                          Get.offAllNamed('/order');
232
-                                        }),
233
-                                      });
234
-                            },
235
-                            margin: const EdgeInsets.all(0),
236
-                            fontSize: 20.sp,
237
-                            radius: 24.5.w,
238
-                          )
239
-                        : orderStateText.value == '待付款'
240
-                            ? _BottomWidget(
241
-                                id: id,
242
-                              )
243
-                            : orderStateText.value == '已退单'
244
-                                ? Text('')
245
-                                : orderStateText.value == '退单申请中'
246
-                                    ? Text(orderStateText.value)
247
-                                    : Text('');
248
-  }
249
-}
250
-
251
-class _BottomWidget extends StatelessWidget {
252
-  final id;
253
-  final resultMessage = Rx<String>('---');
254
-
255
-  _BottomWidget({Key? key, required this.id}) : super(key: key);
256
-
257
-
258
-  void _orderDeletels() {
72
+  // 取消订单
73
+  _cancelOrder(String orderId) {
259 74
     modal.showDialog(
260 75
         title: '提示',
261 76
         content: Container(
262 77
           alignment: Alignment.center,
263
-          child: Text('确定要取消此订单吗?'),
78
+          child: const Text('确定要取消此订单吗?'),
264 79
         ),
265 80
         onCancel: () => true,
266 81
         onConfirm: () => {
267
-              orderDelete(id).then((value) {
268
-                Fluttertoast.showToast(msg: '订单取消成功!');
269
-                Get.offAllNamed('/order');
270
-              })
271
-            });
82
+          orderDelete(orderId).then((value) {
83
+            Fluttertoast.showToast(msg: '订单取消成功!');
84
+            Get.offAllNamed('/order');
85
+          })
86
+        });
272 87
   }
273 88
 
89
+  // 满意度表单
90
+  Widget _evaluateWidget(Function onEvaluate) {
91
+    double star = -1;
92
+    String desc = '';
93
+
94
+    return Container(
95
+        alignment: Alignment.center,
96
+        child: Container(
97
+          margin:
98
+          const EdgeInsets.fromLTRB(15, 20, 15, 20),
99
+          child: Column(
100
+            children: [
101
+              Container(
102
+                padding: const EdgeInsets.fromLTRB(
103
+                    0, 0, 0, 10),
104
+                decoration: const BoxDecoration(
105
+                    border: Border(
106
+                        bottom: BorderSide(
107
+                            width: 0.8,
108
+                            color: Color(0x20000000)
109
+                          // 0x17000000
110
+                        ))),
111
+                child: Row(
112
+                  children: [
113
+                    Text(
114
+                      '满意度:',
115
+                      style: TextStyle(
116
+                          fontSize: 17.sp,
117
+                          fontWeight: FontWeight.bold),
118
+                    ),
119
+                    FFStars(
120
+                      //https://pub.dev/packages/ff_stars
121
+                      normalStar: Image.asset(
122
+                          'images/icons/starOff.png'),
123
+                      selectedStar: Image.asset(
124
+                          'images/icons/starOn.png'),
125
+                      starsChanged:
126
+                          (realStars, selectedStars) {
127
+                            star = realStars;
128
+                            onEvaluate(star, desc);
129
+                      },
130
+                      step: 1,
131
+                      defaultStars: 0,
132
+                    ),
133
+                  ],
134
+                ),
135
+              ),
136
+              Container(
137
+                margin: const EdgeInsets.fromLTRB(
138
+                    0, 20, 0, 0),
139
+                width: 300.w,
140
+                height: 100.w,
141
+                decoration: BoxDecoration(
142
+                  border: Border.all(
143
+                    color: const Color(0x20000000),
144
+                    width: 0.8,
145
+                  ),
146
+                ),
147
+                child: TextField(
148
+                  minLines: 6,
149
+                  maxLines: 6,
150
+                  style: TextStyle(
151
+                      fontSize: 17.sp, height: 1.5),
152
+                  decoration: const InputDecoration(
153
+                    isCollapsed: true,
154
+                    border: InputBorder.none,
155
+                    counterText: '',
156
+                    hintText: '请输入评价内容',
157
+                    floatingLabelBehavior:
158
+                    FloatingLabelBehavior.never,
159
+                  ),
160
+                  onChanged: (e) {
161
+                    desc = e;
162
+                    onEvaluate(star, desc);
163
+                  },
164
+                ),
165
+              )
166
+            ],
167
+          ),
168
+        ));
169
+  }
170
+
171
+  // 评价
172
+  _fnEvaluate(String orderId) {
173
+    int evalStars = -1;
174
+    String evalText = '';
175
+
176
+    onEvaluate(int val1, String val2) {
177
+      evalStars = val1;
178
+      evalText = val2;
179
+    }
180
+
181
+    modal.showDialog(
182
+      title: '评价此订单',
183
+      content: _evaluateWidget(onEvaluate),
184
+      onCancel: () => true,
185
+      onConfirm: () {
186
+        if (evalStars != -1 && evalText != '') {
187
+          orderEvaluation(
188
+              orderId, evalStars, evalText)
189
+              .then((value) {
190
+            Fluttertoast.showToast(msg: '评价成功!');
191
+            Get.offAllNamed('/order');
192
+          });
193
+        } else {
194
+          Fluttertoast.showToast(msg: '请完整选择评分或输入评价内容');
195
+          return false;
196
+        }
197
+      },
198
+    );
199
+  }
274 200
 
275
-Future<void> payMoney (String payType) async {
201
+  // 调用支付接口
202
+  Future<void> payMoney (String payType) async {
276 203
     if(payType=='wxPay'){
277 204
       final isInstall=await fluwx.isWeChatInstalled;
278 205
       if(!isInstall){
279 206
         EasyLoading.showError('请先安装微信');
280
-        print('isInstall--------$isInstall');
281 207
         return;
282 208
       }
283
-      createOrder(id, "wx").then((value) {
284
-        print('--------------微信支付-----------------');
285
-        print('result--------$value');
286
-        print('-------------------------------');
287
-        print("appid--------${value['appid']}");
288
-        print("partnerId--------${value['partnerId']}");
289
-        print("prepayId--------${value['prepayId']}");
290
-        print("packageValue--------${value['packageValue']}");
291
-        print("noncestr--------${value['noncestr']}");
292
-        print("timestamp--------${value['timestamp']}");
293
-        print("sign--------${value['sign']}");
209
+      createOrder(id.value, "wx").then((value) {
294 210
         fluwx.payWithWeChat(
295 211
           appId: value['appid'].toString(),
296 212
           partnerId: value['partnerId'].toString(),
@@ -301,20 +217,18 @@ Future<void> payMoney (String payType) async {
301 217
           sign: value['sign'].toString(),
302 218
         ).then((res) {
303 219
           print("payWithWeChat--------${res}");
304
-        })
305
-        .catchError((onError){
220
+        }).catchError((onError){
306 221
           print("payWithWeChat错误--------${onError}");
307 222
         });
308 223
       });
309 224
 
310
-// 监听支付结果
225
+      // 监听支付结果
311 226
       fluwx.weChatResponseEventHandler.listen((event) async {
312 227
         print(event.errCode);
313 228
         // 支付成功
314 229
         if (event.errCode == 0) {
315 230
           // EasyLoading.showSuccess('支付成功');
316 231
           Get.snackbar('提示', "支付成功");
317
-
318 232
           Get.offAllNamed('/order');
319 233
         }else{
320 234
 
@@ -322,19 +236,15 @@ Future<void> payMoney (String payType) async {
322 236
         }
323 237
         // 关闭弹窗
324 238
       });
325
-
326
-
327 239
       return;
328
-    }else if(payType=='aliPay'){
329
-      print('--------------支付宝支付-----------------');
240
+    } else if(payType=='aliPay'){
330 241
       final isInstall=await tobias.isAliPayInstalled();
331 242
       if(!isInstall){
332 243
         EasyLoading.showError('请先安装支付宝');
333
-        print('isInstall------支付宝--$isInstall');
334 244
         return;
335 245
       }
336 246
       // map["paySign"]
337
-      createOrder(id, "aliPay").then((value) {
247
+      createOrder(id.value, "aliPay").then((value) {
338 248
         tobias.aliPay(value).then((payResult) {
339 249
           print("支付宝:" + payResult.toString());
340 250
 
@@ -343,152 +253,99 @@ Future<void> payMoney (String payType) async {
343 253
             Get.offAllNamed('/order');
344 254
           } else {
345 255
             EasyLoading.showError('支付失败');
346
-
347 256
           }
348 257
         });
349
-
350
-        });
351
-
352
-
353
-
354
-
258
+      });
355 259
     }
260
+  }
356 261
 
357
-
358
-}
359
-  //显示底部弹框的功能
360
-  void showBottomSheet(context) {
262
+  // 支付 sheet
263
+  _bottomSheet(BuildContext context) {
361 264
     //用于在底部打开弹框的效果
362 265
     showModalBottomSheet(
363 266
         context: context,
364 267
         isScrollControlled: false,
365 268
         backgroundColor: Colors.white,
366
-        shape: RoundedRectangleBorder(
269
+        shape: const RoundedRectangleBorder(
367 270
             borderRadius: BorderRadius.all(Radius.circular(10))),
368 271
         builder: (BuildContext context) {
369
-          return Container(
272
+          return SizedBox(
370 273
             height: 200.w, //对话框高度就是此高度
371 274
             child: Center(
372 275
                 child: Column(
373
-              children: [
374
-                Padding(
375
-                  padding: EdgeInsets.fromLTRB(0, 25.w, 0, 34.w),
376
-                  child: Text(
377
-                    "支付方式",
378
-                    style:
379
-                        TextStyle(fontSize: 17.sp, fontWeight: FontWeight.bold),
380
-                  ),
381
-                ),
382
-                Padding(
383
-                  padding: EdgeInsets.fromLTRB(15.w, 0, 15.w, 0),
384
-                  child: ListTile(
385
-                    onTap: (){
386
-                      payMoney('aliPay');
387
-                    },
388
-                    contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
389
-                    // 这边使用了contentPadding
390
-                    leading: Image(
391
-                      image: AssetImage('images/alipay.png'),
392
-                      width: 30.w,
393
-                      height: 30.w,
276
+                  children: [
277
+                    Padding(
278
+                      padding: EdgeInsets.fromLTRB(0, 25.w, 0, 34.w),
279
+                      child: Bold(text: "支付方式", fontSize: 17.sp),
394 280
                     ),
395
-                    title: Transform(
396
-                      transform: Matrix4.translationValues(-15, 0.0, 0.0),
397
-                      child: Text("支付宝",
398
-                          style: TextStyle(
399
-                              fontSize: 18.sp, color: Color(0xff333333))),
281
+                    PayItem(
282
+                      label: "支付宝",
283
+                      icon: const AssetImage('images/alipay.png'),
284
+                      onPress: () {
285
+                        payMoney('aliPay');
286
+                      },
400 287
                     ),
401
-                    trailing: Image(
402
-                      image: AssetImage('images/userRight.png'),
403
-                      width: 10.w,
404
-                      height: 18.w,
288
+                    PayItem(
289
+                      label: "微信",
290
+                      icon: const AssetImage('images/weChatPay.png'),
291
+                      onPress: () {
292
+                        payMoney('wxPay');
293
+                      },
405 294
                     ),
406
-                  ),
407
-                ),
408
-                Padding(
409
-                  padding: EdgeInsets.fromLTRB(15.w, 0, 15.w, 0),
410
-                  child: ListTile(
411
-                    onTap: () {
412
-                      payMoney('wxPay');
413
-                    },
414
-                    contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
415
-                    // 这边使用了contentPadding
416
-                    leading: Image(
417
-                      image: AssetImage('images/weChatPay.png'),
418
-                      width: 30.w,
419
-                      height: 30.w,
420
-                    ),
421
-                    title: Transform(
422
-                      transform: Matrix4.translationValues(-15, 0.0, 0.0),
423
-                      child: Text("微信",
424
-                          style: TextStyle(
425
-                              fontSize: 18.sp, color: Color(0xff333333))),
426
-                    ),
427
-                    trailing: Image(
428
-                      image: AssetImage('images/userRight.png'),
429
-                      width: 10.w,
430
-                      height: 18.w,
431
-                    ),
432
-                  ),
433
-                ),
434
-              ],
435
-            )),
295
+                  ],
296
+                )),
436 297
           );
437 298
         });
438 299
   }
439 300
 
440
-  @override
441
-  Widget build(BuildContext context) {
442
-    return Container(
443
-      alignment: Alignment.bottomCenter,
444
-      child: Row(
445
-        mainAxisAlignment: MainAxisAlignment.spaceBetween,
446
-        children: [
447
-          SizedBox(
448
-            width: 150.w,
449
-            height: 49.h,
450
-            child: ElevatedButton(
451
-              onPressed: () {
452
-                _orderDeletels();
453
-              },
454
-              child: const Text(
455
-                "取消",
456
-                style: TextStyle(
457
-                    fontSize: 18,
458
-                    color: Color(0xFFFF703B),
459
-                    fontWeight: FontWeight.bold),
460
-              ),
461
-              style: ButtonStyle(
462
-                side: MaterialStateProperty.all(
463
-                    BorderSide(width: 1, color: Color(0xFFFF703B))), //边框
464
-                elevation: MaterialStateProperty.all(0),
465
-                backgroundColor: MaterialStateProperty.all(Colors.white),
466
-                shape: MaterialStateProperty.all(
467
-                  RoundedRectangleBorder(
468
-                      borderRadius: BorderRadius.all(Radius.circular(24.4))),
469
-                ),
470
-              ),
471
-            ),
472
-          ),
473
-          SizedBox(
474
-            child: DefaultButton(
475
-              color: const Color(0xffffffff),
476
-              backColor: const Color(0xFFFF703B),
477
-              width: 150.w,
478
-              height: 49.h,
479
-              text: '支付',
480
-              onPressed: () {
481
-                showBottomSheet(context);
482
-                // Fluttertoast.showToast(msg: '支付成功!');
483
-                // Get.offAllNamed('/');
484
-              },
485
-              margin: const EdgeInsets.all(0),
486
-              fontSize: 20.sp,
487
-              radius: 24.5.w,
488
-            ),
489
-          ),
490
-        ],
491
-      ),
492
-    );
301
+  Widget _action(BuildContext context, String orderId) {
302
+    bool mustAction = false;
303
+    var btnLabel;
304
+    var btnFunction;
305
+
306
+    switch (processStatus) {
307
+      case 1:
308
+      case 2:
309
+        mustAction = true;
310
+        btnLabel = '取消';
311
+        btnFunction = () {
312
+          _cancelOrder(orderId);
313
+        };
314
+        break;
315
+      case 4:
316
+        mustAction = true;
317
+        btnLabel = '支付';
318
+        btnFunction = () {
319
+          _bottomSheet(context);
320
+        };
321
+        break;
322
+      case 5:
323
+        mustAction = true;
324
+        btnLabel = '评价';
325
+        btnFunction = () {
326
+          _fnEvaluate(orderId);
327
+        };
328
+        break;
329
+      case 3:
330
+      case 6:
331
+      default:
332
+        break;
333
+    }
334
+
335
+    if (mustAction) {
336
+      return DefaultButton(
337
+        color: const Color(0xffffffff),
338
+        backColor: const Color(0xFFFF703B),
339
+        width: 300.w,
340
+        height: 49.h,
341
+        text: btnLabel,
342
+        margin: const EdgeInsets.all(0),
343
+        fontSize: 20.sp,
344
+        radius: 24.5.w,
345
+        onPressed: btnFunction,
346
+      );
347
+    } else {
348
+      return const Text('');
349
+    }
493 350
   }
494 351
 }

+ 42
- 0
lib/pages/orderInfo/widgets/PayItem.dart Zobrazit soubor

@@ -0,0 +1,42 @@
1
+
2
+import 'package:flutter/material.dart';
3
+import 'package:flutter/widgets.dart';
4
+import 'package:flutter_screenutil/flutter_screenutil.dart';
5
+
6
+class PayItem extends StatelessWidget {
7
+  String label;
8
+  ImageProvider icon;
9
+  Function() onPress;
10
+
11
+  PayItem({Key? key, required this.label, required this.icon, required this.onPress }) : super(key: key);
12
+
13
+  @override
14
+  Widget build(BuildContext context) {
15
+    return Padding(
16
+      padding: EdgeInsets.fromLTRB(15.w, 0, 15.w, 0),
17
+      child: ListTile(
18
+        onTap: () {
19
+          onPress();
20
+        },
21
+        contentPadding: const EdgeInsets.symmetric(horizontal: 0.0),
22
+        // 这边使用了contentPadding
23
+        leading: Image(
24
+          image: icon,
25
+          width: 30.w,
26
+          height: 30.w,
27
+        ),
28
+        title: Transform(
29
+          transform: Matrix4.translationValues(-15, 0.0, 0.0),
30
+          child: Text(label,
31
+              style: TextStyle(
32
+                  fontSize: 18.sp, color: const Color(0xff333333))),
33
+        ),
34
+        trailing: Image(
35
+          image: const AssetImage('images/userRight.png'),
36
+          width: 10.w,
37
+          height: 18.w,
38
+        ),
39
+      ),
40
+    );
41
+  }
42
+}

+ 5
- 2
lib/utils/Request.dart Zobrazit soubor

@@ -28,9 +28,12 @@ class Response {
28 28
 final client = GetPlatform.isAndroid ? 'android' : 'ios';
29 29
 
30 30
 Dio createRequest() {
31
+  const isProd = bool.fromEnvironment('dart.vm.product');
32
+  const host = isProd ? 'https://machine.njyunzhi.com' : 'http://192.168.89.147:7080';
33
+  final baseUrl = '$host/api/$client/farmer';
34
+
31 35
   var options = BaseOptions(
32
-    baseUrl: 'https://machine.njyunzhi.com/api/' + client + '/farmer',
33
-    // baseUrl: 'http://192.168.89.147:7080/api/' + client + '/farmer',
36
+    baseUrl: baseUrl,
34 37
     connectTimeout: 5000,
35 38
     receiveTimeout: 3000,
36 39
   );

+ 63
- 0
lib/utils/processStatus.dart Zobrazit soubor

@@ -0,0 +1,63 @@
1
+
2
+import 'dart:ui';
3
+
4
+import 'package:farmer_client/models/entities/OrderInfoModel.dart';
5
+
6
+int getProcessStatus(OrderInfoModel orderInfo) {
7
+  // 订单完成
8
+  if (orderInfo.isEvaluated == 1) {
9
+    return 6;
10
+  }
11
+
12
+  // 待支付
13
+  if (orderInfo.workStatus == 3 && orderInfo.charges! > 0 && orderInfo.payStatus != 1) {
14
+    return 4;
15
+  }
16
+
17
+  // 待评价
18
+  if (orderInfo.workStatus == 3 && orderInfo.isEvaluated == 0) {
19
+    return 5;
20
+  }
21
+
22
+  // 工作中
23
+  if (orderInfo.workStatus! > 0 && orderInfo.workStatus! < 3 && orderInfo.dispatchStatus == 1) {
24
+    return 3;
25
+  }
26
+
27
+  // 待接单
28
+  if (orderInfo.workStatus == 0 && orderInfo.dispatchStatus == 1) {
29
+    return 2;
30
+  }
31
+
32
+  // 待分配
33
+  if (orderInfo.status == 1 && orderInfo.dispatchStatus == 0) {
34
+    return 1;
35
+  }
36
+
37
+  return -1;
38
+}
39
+
40
+class ProcessSign {
41
+  String label;
42
+  Color color;
43
+  ProcessSign({ required this.label, required this.color });
44
+}
45
+
46
+ProcessSign getProcessSign(int processStatus) {
47
+  switch (processStatus) {
48
+    case 1:
49
+      return ProcessSign(label: '待分配', color: const Color(0xFFFF703B));
50
+    case 2:
51
+      return ProcessSign(label: '待作业', color: const Color(0xFFFF703B));
52
+    case 3:
53
+      return ProcessSign(label: '进行中', color: const Color(0xFF44F68B));
54
+    case 4:
55
+      return ProcessSign(label: '待付款', color: const Color(0xFF51D4FF));
56
+    case 5:
57
+      return ProcessSign(label: '待评价', color: const Color(0xFF51D4FF));
58
+    case 6:
59
+      return ProcessSign(label: '已完成', color: const Color(0xFFFF703B));
60
+    default:
61
+      return ProcessSign(label: '未知', color: const Color(0xFFFF0000));
62
+  }
63
+}

+ 29
- 0
lib/widgets/Bold.dart Zobrazit soubor

@@ -0,0 +1,29 @@
1
+
2
+import 'package:flutter/widgets.dart';
3
+
4
+class Bold extends StatelessWidget {
5
+  String text;
6
+  double fontSize;
7
+  Color? color;
8
+  double? letterSpacing;
9
+  TextAlign? textAlign;
10
+
11
+  Bold({Key? key,
12
+    required this.text,
13
+    required this.fontSize,
14
+    this.color,
15
+    this.letterSpacing,
16
+    this.textAlign,
17
+  }) : super(key: key);
18
+
19
+  @override
20
+  Widget build(BuildContext context) {
21
+    var textStyle = TextStyle(color: color, fontSize: fontSize, fontWeight: FontWeight.bold, letterSpacing: letterSpacing);
22
+
23
+    return Text(
24
+      text,
25
+      style: textStyle,
26
+      textAlign: textAlign,
27
+    );
28
+  }
29
+}

+ 1
- 1
lib/widgets/CarsCard.dart Zobrazit soubor

@@ -113,7 +113,7 @@ class _CarsCardPage extends State<CarsCard> {
113 113
                               fontWeight: FontWeight.bold,
114 114
                             )),
115 115
                         TextSpan(
116
-                            text: "公顷",
116
+                            text: "",
117 117
                             style: TextStyle(
118 118
                               fontSize: 12,
119 119
                               fontWeight: FontWeight.bold,

+ 113
- 214
lib/widgets/OrderListCard.dart Zobrazit soubor

@@ -1,63 +1,47 @@
1
+import 'package:farmer_client/utils/processStatus.dart';
2
+import 'package:farmer_client/widgets/Bold.dart';
1 3
 import 'package:flutter/material.dart';
2 4
 import 'package:flutter_screenutil/flutter_screenutil.dart';
3 5
 import 'package:get/get.dart';
4 6
 
5
-import '../models/entities/OrderListAll.dart';
6
-import '../pages/OrderConfirmation/index.dart';
7
-import '../pages/orderInfo/index.dart';
7
+import '../models/entities/OrderInfoModel.dart';
8 8
 import 'package:intl/intl.dart';
9 9
 import 'LinearGradientText.dart';
10 10
 
11
-class OrderListCard extends StatefulWidget {
12
-  final OrderListAll item;
13
-  const OrderListCard({Key? key, required this.item}) : super(key: key);
11
+class TextCell extends StatelessWidget {
12
+  String title;
13
+  String? value;
14
+
15
+  TextCell({Key? key, required this.title, this.value}):super(key: key);
14 16
 
15 17
   @override
16
-  _OrderListCardPages createState() => _OrderListCardPages(item);
17
-}
18
+  Widget build(BuildContext context) {
19
+    return RichText(
20
+      text: TextSpan(children: <InlineSpan>[
21
+        TextSpan(
22
+            text: title,
23
+            style: const TextStyle(
24
+                color: Color(0xff666666),
25
+                fontSize: 16,
26
+                fontWeight: FontWeight.bold)),
27
+        TextSpan(
28
+            text: value,
29
+            style: const TextStyle(
30
+                color: Color(0xff222222),
31
+                fontSize: 16,
32
+                fontWeight: FontWeight.bold)),
33
+      ]),
34
+    );
35
+  }
18 36
 
19
-class StyleObj {
20
-  String title;
21
-  Color styleColor;
22
-  StyleObj({required this.title, required this.styleColor});
23 37
 }
24 38
 
25
-class _OrderListCardPages extends State<OrderListCard> {
26
-  final OrderListAll item;
39
+class OrderListCard extends StatelessWidget {
40
+  final OrderInfoModel item;
41
+  late ProcessSign processSign;
27 42
 
28
-  _OrderListCardPages(this.item);
29
-
30
-  StyleObj orderStates() {
31
-    if (item.payStatus == 0) {
32
-      return StyleObj(title: '待付款', styleColor: Color(0xFF51D4FF));
33
-    } else if (item.payStatus == 1 &&
34
-        item.workStatus == 0 &&
35
-        item.dispatchStatus == 0) {
36
-      return StyleObj(title: '已付款', styleColor: Color(0xFFFF703B));
37
-    } else if (item.payStatus == 1 &&
38
-        item.dispatchStatus == 1 &&
39
-        item.workStatus == 0) {
40
-      return StyleObj(title: '待作业', styleColor: Color(0xFFFF703B));
41
-    } else if (item.payStatus == 1 &&
42
-        (item.workStatus == 1 || item.workStatus == 2)) {
43
-      return StyleObj(title: '进行中', styleColor: Color(0xFF44F68B));
44
-    } else if (item.workStatus == 3 && item.isEvaluated == 0) {
45
-      return StyleObj(title: '待评价', styleColor: Color(0xFF51D4FF));
46
-    }
47
-    if (item.workStatus == 3 &&
48
-        item.isEvaluated == 1 &&
49
-        item.dispatchStatus == 1) {
50
-      return StyleObj(title: '已完成', styleColor: Color(0xFFFF703B));
51
-    } else if (item.payStatus == -1 &&
52
-        item.workStatus == 0 &&
53
-        item.isRefund == 1) {
54
-      return StyleObj(title: '已退单', styleColor: Color(0xFFFF703B));
55
-    } else if (item.payStatus == 3 &&
56
-        (item.dispatchStatus == 1 || item.dispatchStatus == 0)) {
57
-      return StyleObj(title: '退单申请中', styleColor: Color(0xFFFF703B));
58
-    } else {
59
-      return StyleObj(title: '异常', styleColor: Color(0xFFFF0000));
60
-    }
43
+  OrderListCard({Key? key, required this.item}) : super(key: key) {
44
+    processSign = getProcessSign(getProcessStatus(item));
61 45
   }
62 46
 
63 47
   @override
@@ -65,24 +49,24 @@ class _OrderListCardPages extends State<OrderListCard> {
65 49
     return Container(
66 50
       width: 375.w,
67 51
       height: 345.h,
68
-      margin: EdgeInsets.fromLTRB(0, 0, 0, 20),
52
+      margin: const EdgeInsets.fromLTRB(0, 0, 0, 20),
69 53
       decoration: const BoxDecoration(color: Colors.white, boxShadow: [
70 54
         BoxShadow(
71 55
             color: Colors.black12,
72 56
             offset: Offset(0.0, 15.0), //阴影xy轴偏移量
73 57
             blurRadius: 15.0, //阴影模糊程度
74 58
             spreadRadius: 1.0 //阴影扩散程度
75
-            )
59
+        )
76 60
       ]),
77 61
       child: Row(
78 62
         crossAxisAlignment: CrossAxisAlignment.start,
79 63
         mainAxisAlignment: MainAxisAlignment.spaceBetween,
80 64
         children: [
81 65
           Container(
82
-            margin: EdgeInsets.fromLTRB(15, 20, 15, 0),
66
+            margin: const EdgeInsets.fromLTRB(15, 20, 15, 0),
83 67
             width: 18.0,
84 68
             height: 275.h,
85
-            child: Image(
69
+            child: const Image(
86 70
               image: AssetImage('images/ordersLeft.png'),
87 71
             ),
88 72
           ),
@@ -92,142 +76,59 @@ class _OrderListCardPages extends State<OrderListCard> {
92 76
               children: [
93 77
                 Container(
94 78
                   width: 320.w,
95
-                  margin: EdgeInsets.fromLTRB(0, 10, 0, 15),
96
-                  padding: EdgeInsets.fromLTRB(0, 0, 0, 20),
79
+                  margin: const EdgeInsets.fromLTRB(0, 10, 0, 15),
80
+                  padding: const EdgeInsets.fromLTRB(0, 0, 0, 20),
97 81
                   decoration: const BoxDecoration(
98 82
                       border: Border(
99 83
                           bottom:
100
-                              BorderSide(width: 0.5, color: Color(0x20000000)
101
-                                  // 0x17000000
102
-                                  ))),
103
-                  child: Row(
104
-                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
105
-                    children: [
106
-                      Container(
107
-                        child: RichText(
108
-                          text: TextSpan(children: <InlineSpan>[
109
-                            TextSpan(
110
-                                text: '订单编号:',
111
-                                style: TextStyle(
112
-                                    color: Color(0xff666666),
113
-                                    fontSize: 16,
114
-                                    fontWeight: FontWeight.bold)),
115
-                            TextSpan(
116
-                                text: item.orderNo,
117
-                                style: TextStyle(
118
-                                    color: Color(0xff222222),
119
-                                    fontSize: 16,
120
-                                    fontWeight: FontWeight.bold)),
121
-                          ]),
122
-                        ),
123
-                      ),
124
-                      GestureDetector(
125
-                        child: const Text('详情 >>',
126
-                            style: TextStyle(
127
-                              color: Color(0xff222222),
128
-                              fontSize: 16,
129
-                              fontWeight: FontWeight.bold,
130
-                            )),
131
-                        onTap: () {
132
-                          print('进入详情');
133
-                          Get.toNamed('/orderPageInfo', arguments: {
134
-                            'id': item.orderId,
135
-                            'title': orderStates().title,
136
-                            'styleColor': orderStates().styleColor
137
-                          });
138
-                        },
139
-                      )
140
-                    ],
84
+                          BorderSide(width: 0.5, color: Color(0x20000000)
85
+                            // 0x17000000
86
+                          ))),
87
+                  child: GestureDetector(
88
+                    child:
89
+                    Row(
90
+                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
91
+                      children: [
92
+                        TextCell(title: '订单编号:', value: item.orderNo),
93
+                        Bold(text: "详情 >>", fontSize: 16.sp, color: const Color(0xff222222)),
94
+                      ],
95
+                    ),
96
+                    onTap: () {
97
+                      Get.toNamed('/orderPageInfo', arguments: {
98
+                        'id': item.orderId,
99
+                        'title': processSign.label,
100
+                        'styleColor': processSign.color
101
+                      });
102
+                    },
141 103
                   ),
142 104
                 ),
143 105
                 Expanded(
144 106
                     child: Column(
145
-                  crossAxisAlignment: CrossAxisAlignment.start,
146
-                  children: [
147
-                    Padding(
148
-                      padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
149
-                      child: RichText(
150
-                        text: TextSpan(children: <InlineSpan>[
151
-                          TextSpan(
152
-                              text: '农机名称:',
153
-                              style: TextStyle(
154
-                                  color: Color(0xff666666),
155
-                                  fontSize: 16,
156
-                                  fontWeight: FontWeight.bold)),
157
-                          TextSpan(
158
-                              text: item.machineryName,
159
-                              style: TextStyle(
160
-                                  color: Color(0xff222222),
161
-                                  fontSize: 16,
162
-                                  fontWeight: FontWeight.bold)),
163
-                        ]),
164
-                      ),
165
-                    ),
166
-                    Padding(
167
-                      padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
168
-                      child: RichText(
169
-                        text: TextSpan(children: <InlineSpan>[
170
-                          TextSpan(
171
-                              text: '作业面积:',
172
-                              style: TextStyle(
173
-                                  color: Color(0xff666666),
174
-                                  fontSize: 16,
175
-                                  fontWeight: FontWeight.bold)),
176
-                          TextSpan(
177
-                              text: item.amount.toString(),
178
-                              style: TextStyle(
179
-                                  color: Color(0xff222222),
180
-                                  fontSize: 16,
181
-                                  fontWeight: FontWeight.bold)),
182
-                        ]),
183
-                      ),
184
-                    ),
185
-                    Padding(
186
-                      padding: EdgeInsets.fromLTRB(0, 0, 0, 15),
187
-                      child: RichText(
188
-                        text: TextSpan(children: <InlineSpan>[
189
-                          TextSpan(
190
-                              text: '需求时间:',
191
-                              style: TextStyle(
192
-                                  color: Color(0xff666666),
193
-                                  fontSize: 16,
194
-                                  fontWeight: FontWeight.bold)),
195
-                          TextSpan(
196
-                              text: DateFormat("yyyy-MM-dd").format(
197
-                                  DateTime.parse(
198
-                                      item.appointmentDate.toString())),
199
-                              style: TextStyle(
200
-                                  color: Color(0xff222222),
201
-                                  fontSize: 16,
202
-                                  fontWeight: FontWeight.bold)),
203
-                        ]),
204
-                      ),
205
-                    ),
206
-                    Padding(
207
-                      padding: EdgeInsets.fromLTRB(0, 0, 0, 4),
208
-                      child: RichText(
209
-                        text: TextSpan(children: <InlineSpan>[
210
-                          TextSpan(
211
-                              text: '下单时间:',
212
-                              style: TextStyle(
213
-                                  color: Color(0xff666666),
214
-                                  fontSize: 16,
215
-                                  fontWeight: FontWeight.bold)),
216
-                          TextSpan(
217
-                              text: DateFormat("yyyy-MM-dd").format(
218
-                                  DateTime.parse(item.createDate.toString())),
219
-                              style: TextStyle(
220
-                                  color: Color(0xff222222),
221
-                                  fontSize: 16,
222
-                                  fontWeight: FontWeight.bold)),
223
-                        ]),
224
-                      ),
225
-                    ),
226
-                  ],
227
-                )),
107
+                      crossAxisAlignment: CrossAxisAlignment.start,
108
+                      children: [
109
+                        Padding(
110
+                          padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
111
+                          child: TextCell(title: '农机名称:', value: item.machineryName),
112
+                        ),
113
+                        Padding(
114
+                          padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
115
+                          child: TextCell(title: '作业面积:', value: item.amount.toString()),
116
+                        ),
117
+                        Padding(
118
+                          padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
119
+                          child: TextCell(title: '需求时间:', value: DateFormat("yyyy-MM-dd").format(
120
+                              DateTime.parse(item.appointmentDate.toString()))),
121
+                        ),
122
+                        Padding(
123
+                          padding: const EdgeInsets.fromLTRB(0, 0, 0, 15),
124
+                          child: TextCell(title: '需求时间:', value: DateFormat("yyyy-MM-dd").format(
125
+                              DateTime.parse(item.createDate.toString()))),
126
+                        ),
127
+                      ],
128
+                    )),
228 129
                 Container(
229
-                  margin: EdgeInsets.fromLTRB(0, 0, 0, 30),
230
-                  padding: EdgeInsets.fromLTRB(0, 20, 0, 0),
130
+                  margin: const EdgeInsets.fromLTRB(0, 0, 0, 30),
131
+                  padding: const EdgeInsets.fromLTRB(0, 20, 0, 0),
231 132
                   decoration: const BoxDecoration(
232 133
                       border: Border(
233 134
                           top: BorderSide(
@@ -238,53 +139,51 @@ class _OrderListCardPages extends State<OrderListCard> {
238 139
                     children: [
239 140
                       RichText(
240 141
                         text: TextSpan(children: <InlineSpan>[
241
-                          TextSpan(
142
+                          const TextSpan(
242 143
                               text: '订单状态:',
243 144
                               style: TextStyle(
244 145
                                   color: Color(0xff666666),
245 146
                                   fontSize: 16,
246 147
                                   fontWeight: FontWeight.bold)),
247 148
                           TextSpan(
248
-                              text: orderStates().title,
149
+                              text: processSign.label,
249 150
                               style: TextStyle(
250
-                                  color: orderStates().styleColor,
151
+                                  color: processSign.color,
251 152
                                   fontSize: 16,
252 153
                                   fontWeight: FontWeight.bold)),
253 154
                         ]),
254 155
                       ),
255
-                      Container(
256
-                        child: Row(
257
-                          children: [
258
-                            const Text('费用:',
259
-                                style: TextStyle(
260
-                                    color: Color(0xff666666),
261
-                                    fontSize: 16,
262
-                                    fontWeight: FontWeight.bold)),
263
-                            LinearGradientText(
264
-                              colors: const <Color>[
265
-                                Color(0xFFFA7878),
266
-                                Color(0xFFB61515),
267
-                              ],
268
-                              child: RichText(
269
-                                text: TextSpan(children: <InlineSpan>[
270
-                                  TextSpan(
271
-                                      text: ((item.charges ?? 0) / 100)
272
-                                          .toString(),
273
-                                      style: TextStyle(
274
-                                        fontSize: 16,
275
-                                        fontWeight: FontWeight.bold,
276
-                                      )),
277
-                                  TextSpan(
278
-                                      text: "元",
279
-                                      style: TextStyle(
280
-                                        fontSize: 16,
281
-                                        fontWeight: FontWeight.bold,
282
-                                      )),
283
-                                ]),
284
-                              ),
156
+                      Row(
157
+                        children: [
158
+                          const Text('费用:',
159
+                              style: TextStyle(
160
+                                  color: Color(0xff666666),
161
+                                  fontSize: 16,
162
+                                  fontWeight: FontWeight.bold)),
163
+                          LinearGradientText(
164
+                            colors: const <Color>[
165
+                              Color(0xFFFA7878),
166
+                              Color(0xFFB61515),
167
+                            ],
168
+                            child: RichText(
169
+                              text: TextSpan(children: <InlineSpan>[
170
+                                TextSpan(
171
+                                    text: ((item.charges ?? 0) / 100)
172
+                                        .toString(),
173
+                                    style: const TextStyle(
174
+                                      fontSize: 16,
175
+                                      fontWeight: FontWeight.bold,
176
+                                    )),
177
+                                const TextSpan(
178
+                                    text: "元",
179
+                                    style: TextStyle(
180
+                                      fontSize: 16,
181
+                                      fontWeight: FontWeight.bold,
182
+                                    )),
183
+                              ]),
285 184
                             ),
286
-                          ],
287
-                        ),
185
+                          ),
186
+                        ],
288 187
                       ),
289 188
                     ],
290 189
                   ),