|
@@ -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
|
}
|