|
@@ -11,7 +11,6 @@ import 'LinearGradientText.dart';
|
11
|
11
|
class OrderListCard extends StatefulWidget {
|
12
|
12
|
|
13
|
13
|
final OrderListAll item;
|
14
|
|
-
|
15
|
14
|
const OrderListCard({Key? key, required this.item}) : super(key: key);
|
16
|
15
|
|
17
|
16
|
@override
|
|
@@ -19,66 +18,77 @@ class OrderListCard extends StatefulWidget {
|
19
|
18
|
}
|
20
|
19
|
|
21
|
20
|
|
|
21
|
+class StyleObj {
|
|
22
|
+ String title;
|
|
23
|
+ Color styleColor;
|
|
24
|
+ StyleObj ({ required this.title, required this.styleColor});
|
|
25
|
+}
|
|
26
|
+
|
22
|
27
|
|
23
|
28
|
|
24
|
29
|
class _OrderListCardPages extends State<OrderListCard> {
|
25
|
30
|
|
26
|
|
- final OrderListAll item;
|
27
|
31
|
|
28
|
|
- _OrderListCardPages(this.item);
|
29
|
32
|
|
|
33
|
+ @override
|
|
34
|
+ void initState() {
|
|
35
|
+ // TODO: implement initState
|
|
36
|
+ super.initState();
|
30
|
37
|
|
31
|
|
- void orderStates(item){
|
32
|
|
- // if (item.payStatus == 0) {
|
33
|
|
- // return {
|
34
|
|
- // title: '待付款',
|
35
|
|
- // styleColor: '#51D4FF'
|
36
|
|
- // };
|
37
|
|
- // } else if (item.payStatus == 1 && item.workStatus == 0 && item.dispatchStatus == 0) {
|
38
|
|
- // return {
|
39
|
|
- // title: '已付款',
|
40
|
|
- // styleColor: '#FF703B'
|
41
|
|
- // };
|
42
|
|
- // } else if (item.payStatus == 1 && item.dispatchStatus == 1 && item.workStatus == 0) {
|
43
|
|
- // return {
|
44
|
|
- // title: '待作业',
|
45
|
|
- // styleColor: '#FF703B'
|
46
|
|
- // };
|
47
|
|
- //
|
48
|
|
- // } else if (item.payStatus == 1 && (item.workStatus == 1 || item.workStatus == 2)) {
|
49
|
|
- // return {
|
50
|
|
- // title: '进行中',
|
51
|
|
- // styleColor: '#44F68B'
|
52
|
|
- // };
|
53
|
|
- // } else if (item.workStatus == 3 && item.isEvaluated == 0) {
|
54
|
|
- // return {
|
55
|
|
- // title: '待评价',
|
56
|
|
- // styleColor: '#51D4FF'
|
57
|
|
- // };
|
58
|
|
- // } if (item.workStatus == 3 && item.isEvaluated == 1 && item.dispatchStatus == 1) {
|
59
|
|
- // return {
|
60
|
|
- // title: '已完成',
|
61
|
|
- // styleColor: '#FF703B'
|
62
|
|
- // };
|
63
|
|
- // } else if (item.payStatus == -1 && item.workStatus == 0 && item.isRefund == 1) {
|
64
|
|
- // return {
|
65
|
|
- // title: '已退单',
|
66
|
|
- // styleColor: '#FF703B'
|
67
|
|
- // };
|
68
|
|
- // } else if (item.payStatus == 3 && (item.dispatchStatus == 1 || item.dispatchStatus == 0)) {
|
69
|
|
- // return {
|
70
|
|
- // title: '退单申请中',
|
71
|
|
- // styleColor: '#FF703B'
|
72
|
|
- // };
|
73
|
|
- // } else {
|
74
|
|
- // return {
|
75
|
|
- // title: '异常',
|
76
|
|
- // styleColor: '#FF0000'
|
77
|
|
- // };
|
78
|
|
- // }
|
|
38
|
+ }
|
79
|
39
|
|
|
40
|
+ final OrderListAll item;
|
|
41
|
+
|
|
42
|
+ _OrderListCardPages(this.item);
|
80
|
43
|
|
81
|
44
|
|
|
45
|
+ StyleObj orderStates(){
|
|
46
|
+ if (item.payStatus == 0) {
|
|
47
|
+ return StyleObj(
|
|
48
|
+ title: '待付款',
|
|
49
|
+ styleColor: Color(0xFF51D4FF)
|
|
50
|
+ );
|
|
51
|
+ } else if (item.payStatus == 1 && item.workStatus == 0 && item.dispatchStatus == 0) {
|
|
52
|
+ return StyleObj(
|
|
53
|
+ title: '已付款',
|
|
54
|
+ styleColor: Color(0xFFFF703B)
|
|
55
|
+ );
|
|
56
|
+ } else if (item.payStatus == 1 && item.dispatchStatus == 1 && item.workStatus == 0) {
|
|
57
|
+ return StyleObj(
|
|
58
|
+ title: '待作业',
|
|
59
|
+ styleColor: Color(0xFFFF703B)
|
|
60
|
+ );
|
|
61
|
+ } else if (item.payStatus == 1 && (item.workStatus == 1 || item.workStatus == 2)) {
|
|
62
|
+ return StyleObj(
|
|
63
|
+ title: '进行中',
|
|
64
|
+ styleColor: Color(0xFF44F68B)
|
|
65
|
+ );
|
|
66
|
+ } else if (item.workStatus == 3 && item.isEvaluated == 0) {
|
|
67
|
+ return StyleObj(
|
|
68
|
+ title: '待评价',
|
|
69
|
+ styleColor: Color(0xFF51D4FF)
|
|
70
|
+ );
|
|
71
|
+ } if (item.workStatus == 3 && item.isEvaluated == 1 && item.dispatchStatus == 1) {
|
|
72
|
+ return StyleObj(
|
|
73
|
+ title: '已完成',
|
|
74
|
+ styleColor: Color(0xFFFF703B)
|
|
75
|
+ );
|
|
76
|
+ } else if (item.payStatus == -1 && item.workStatus == 0 && item.isRefund == 1) {
|
|
77
|
+ return StyleObj(
|
|
78
|
+ title: '已退单',
|
|
79
|
+ styleColor: Color(0xFFFF703B)
|
|
80
|
+ );
|
|
81
|
+ } else if (item.payStatus == 3 && (item.dispatchStatus == 1 || item.dispatchStatus == 0)) {
|
|
82
|
+ return StyleObj(
|
|
83
|
+ title: '退单申请中',
|
|
84
|
+ styleColor: Color(0xFFFF703B)
|
|
85
|
+ );
|
|
86
|
+ } else {
|
|
87
|
+ return StyleObj(
|
|
88
|
+ title: '异常',
|
|
89
|
+ styleColor: Color(0xFFFF0000)
|
|
90
|
+ );
|
|
91
|
+ }
|
82
|
92
|
}
|
83
|
93
|
|
84
|
94
|
|
|
@@ -252,17 +262,17 @@ class _OrderListCardPages extends State<OrderListCard> {
|
252
|
262
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
253
|
263
|
children: [
|
254
|
264
|
RichText(
|
255
|
|
- text: const TextSpan(children: <InlineSpan>[
|
|
265
|
+ text: TextSpan(children: <InlineSpan>[
|
256
|
266
|
TextSpan(
|
257
|
267
|
text: '订单状态:',
|
258
|
268
|
style: TextStyle(
|
259
|
|
- color: Color(0xff666666),
|
|
269
|
+ color:Color(0xff666666),
|
260
|
270
|
fontSize: 16,
|
261
|
271
|
fontWeight: FontWeight.bold)),
|
262
|
272
|
TextSpan(
|
263
|
|
- text: '待付款',
|
|
273
|
+ text: orderStates().title,
|
264
|
274
|
style: TextStyle(
|
265
|
|
- color: Color(0xff51D4FF),
|
|
275
|
+ color:orderStates().styleColor,
|
266
|
276
|
fontSize: 16,
|
267
|
277
|
fontWeight: FontWeight.bold)),
|
268
|
278
|
]),
|
|
@@ -315,3 +325,4 @@ class _OrderListCardPages extends State<OrderListCard> {
|
315
|
325
|
);
|
316
|
326
|
}
|
317
|
327
|
}
|
|
328
|
+
|