[baozhangchao] 3 лет назад
Родитель
Сommit
df34d8cc59

+ 9
- 9
lib/pages/home/widgets/home/index.dart Просмотреть файл

@@ -69,12 +69,12 @@ class _HomePageState extends State<HomePage> {
69 69
           Container(
70 70
             margin: EdgeInsets.fromLTRB(0, 15, 0, 0),
71 71
             child:
72
-                CarouselSlider(
72
+            CarouselSlider(
73 73
               items: bannerList.map((item) => Container(
74
-                    child: Center(
75
-                        child: Image.network(item.thumb.toString(),
76
-                            fit: BoxFit.cover, width: 350.w)),
77
-                  )).toList(),
74
+                child: Center(
75
+                    child: Image.network(item.thumb.toString(),
76
+                        fit: BoxFit.cover, width: 350.w)),
77
+              )).toList(),
78 78
               options: CarouselOptions(
79 79
                 autoPlay: true,
80 80
                 enlargeCenterPage: false, //图片中心放大
@@ -99,7 +99,7 @@ class _HomePageState extends State<HomePage> {
99 99
                               padding: EdgeInsets.fromLTRB(0, 0, 8, 0),
100 100
                               child: Image(
101 101
                                 image:
102
-                                    AssetImage('images/icons/carsListImga.png'),
102
+                                AssetImage('images/icons/carsListImga.png'),
103 103
                                 fit: BoxFit.cover,
104 104
                                 width: 20.w,
105 105
                               ),
@@ -125,9 +125,9 @@ class _HomePageState extends State<HomePage> {
125 125
                       )
126 126
                     ],
127 127
                   ),
128
-            Column(
129
-              children: machineryLists.map((item) =>CarsCard(item:item)).toList(),
130
-            )
128
+                  Column(
129
+                    children: machineryLists.map((item) =>CarsCard(item:item)).toList(),
130
+                  )
131 131
 
132 132
 
133 133
 

+ 37
- 24
lib/pages/order/widgets/order/index.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 '../../../../models/entities/OrderListAll.dart';
5
+import '../../../../services/orderAPI.dart';
4 6
 import '../../../../widgets/OrderListCard.dart';
5 7
 import '../../../orderInfo/index.dart';
6 8
 
@@ -12,6 +14,22 @@ class OrderPage extends StatefulWidget {
12 14
 }
13 15
 
14 16
 class _OrderPageState extends State<OrderPage> {
17
+  List<OrderListAll> orderListItem = [];
18
+
19
+  @override
20
+  void initState() {
21
+    // TODO: implement initState
22
+    super.initState();
23
+
24
+    getOrderList(true).then((value) {
25
+      setState(() {
26
+        value['records'].forEach((item) {
27
+          orderListItem.add(OrderListAll.fromJson(item));
28
+        });
29
+      });
30
+    });
31
+  }
32
+
15 33
   @override
16 34
   Widget build(BuildContext context) {
17 35
     return ListView(
@@ -19,43 +37,38 @@ class _OrderPageState extends State<OrderPage> {
19 37
         Container(
20 38
           padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
21 39
           height: 55.w,
22
-          decoration: BoxDecoration(
23
-            color: Colors.white
24
-          ),
40
+          decoration: BoxDecoration(color: Colors.white),
25 41
           child: Row(
26 42
             mainAxisAlignment: MainAxisAlignment.spaceBetween,
27
-
28 43
             children: [
29 44
               Row(
30 45
                 children: [
31
-                  Padding(padding: EdgeInsets.fromLTRB(0, 0, 8, 0),
32
-                  child:Image(image: AssetImage('images/ordersListImga.png'),fit: BoxFit.cover,width: 18.w,),
46
+                  Padding(
47
+                    padding: EdgeInsets.fromLTRB(0, 0, 8, 0),
48
+                    child: Image(
49
+                      image: AssetImage('images/ordersListImga.png'),
50
+                      fit: BoxFit.cover,
51
+                      width: 18.w,
52
+                    ),
33 53
                   ),
34
-                  Text('订单列表',
54
+                  Text(
55
+                    '订单列表',
35 56
                     style: TextStyle(
36
-                      color: Color(0xff222222),
37
-                      fontSize: 20.sp,
38
-                      fontWeight: FontWeight.bold
39
-                    ),
57
+                        color: Color(0xff222222),
58
+                        fontSize: 20.sp,
59
+                        fontWeight: FontWeight.bold),
40 60
                   )
41 61
                 ],
42 62
               ),
43 63
             ],
44 64
           ),
45 65
         ),
46
- Column(
47
-        mainAxisSize: MainAxisSize.min,
48
-        children: [
49
-          // OrderListCard(),
50
-          // OrderListCard(),
51
-          // OrderListCard(),
52
-          // OrderListCard(),
53
-
54
-
55
-        ],
56
-      ),
57
-
58
-    ],
66
+        Column(
67
+          mainAxisSize: MainAxisSize.min,
68
+          children:
69
+          orderListItem.map((item) => OrderListCard(item: item)).toList(),
70
+        ),
71
+      ],
59 72
     );
60 73
   }
61 74
 }

+ 54
- 0
lib/widgets/OrderListCard.dart Просмотреть файл

@@ -28,6 +28,60 @@ class _OrderListCardPages extends State<OrderListCard> {
28 28
   _OrderListCardPages(this.item);
29 29
 
30 30
 
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
+    // }
79
+
80
+
81
+
82
+  }
83
+
84
+
31 85
   @override
32 86
   Widget build(BuildContext context) {
33 87
     return Container(