李志伟 před 3 roky
rodič
revize
299c07b9f0

+ 134
- 0
lib/pages/home/index.dart Zobrazit soubor

@@ -0,0 +1,134 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+import './widgets/home/index.dart';
5
+
6
+class Home extends StatefulWidget {
7
+  const Home({Key? key}) : super(key: key);
8
+
9
+  @override
10
+  _Home createState() => _Home();
11
+}
12
+
13
+class _Home extends State<Home> {
14
+  //下标   当前tab
15
+  int _tabIndex = 0;
16
+
17
+  final List _titles = ['首页', '订单', '资讯','我的'];
18
+  final tabTextStyleSelected = TextStyle(
19
+      color: const Color(0xFFFF703B),
20
+      fontSize: 15.sp,
21
+      fontWeight: FontWeight.bold); //选线卡选中字体颜色
22
+  final tabTextStyleNormal = TextStyle(
23
+      color: const Color(0xFF323232),
24
+      fontSize: 15.sp,
25
+      fontWeight: FontWeight.bold); //选项卡未选中字体颜色
26
+
27
+  TextStyle getTabTextStyle(int curIndex) {
28
+    //设置tabbar 选中和未选中的状态文本
29
+    if (curIndex == _tabIndex) {
30
+      return tabTextStyleSelected;
31
+    }
32
+    return tabTextStyleNormal;
33
+  }
34
+
35
+  // 切换底部选项卡,标题的变化设置
36
+  Text getTabTitle(int curIndex) {
37
+    return Text(_titles[curIndex], style: getTabTextStyle(curIndex));
38
+  }
39
+
40
+  List images = [
41
+    ['images/index/HomesOFFImgaes.png', 'images/index/HomesNOImgaes.png'],
42
+    ['images/index/OrdersOFFImgaes.png', 'images/index/OrdersNOImgaes.png'],
43
+    ['images/index/newsONImages.png', 'images/index/newsOFFImages.png'],
44
+    ['images/index/MineOFFImgaes.png', 'images/index/MineNOImgaes.png'],
45
+  ];
46
+  Image getTabIcon(int curIndex) {
47
+    //设置tabbar选中和未选中的状态图标
48
+    if (curIndex == _tabIndex) {
49
+      return Image.asset(
50
+        images[curIndex][1],
51
+        width: 22.w,
52
+        height: 22.w,
53
+      );
54
+    }
55
+    return Image.asset(
56
+      images[curIndex][0],
57
+      width: 22.w,
58
+      height: 22.w,
59
+    );
60
+  }
61
+
62
+  Image getTabImage(path) {
63
+    return Image.asset(path, width: 22.w, height: 22.w);
64
+  }
65
+
66
+  Widget tabBar(index) {
67
+    return GestureDetector(
68
+      behavior: HitTestBehavior.opaque,
69
+      onTap: () {
70
+        if(index!=_tabIndex){
71
+          if(index==0){
72
+            Get.offNamed('/');
73
+          }else if(index==1){
74
+            Get.offNamed('/order');
75
+          }else if(index==2){
76
+            Get.offNamed('/infomation');
77
+          }else{
78
+            Get.offNamed('/main');
79
+          }
80
+        }
81
+      },
82
+      child: Container(
83
+        width: 93.w,
84
+        height: 65.h,
85
+        child: Column(
86
+          children: [
87
+            getTabIcon(index),
88
+            Padding(
89
+              padding: EdgeInsets.fromLTRB(0, 6.h, 0, 0),
90
+              child: getTabTitle(index),
91
+            )
92
+          ],
93
+        ),
94
+      ),
95
+    );
96
+  }
97
+
98
+  @override
99
+  Widget build(BuildContext context) {
100
+    return Scaffold(
101
+      backgroundColor: Colors.white,
102
+      appBar: AppBar(
103
+        elevation: 0,
104
+        centerTitle: true,
105
+        backgroundColor: Colors.white,
106
+        title: Text(
107
+          '首页',
108
+          style: TextStyle(
109
+              color: Colors.black,
110
+              fontSize: 17.sp,
111
+              letterSpacing: 2,
112
+              fontWeight: FontWeight.bold),
113
+        ),
114
+      ),
115
+      body: HomePage(),
116
+      bottomNavigationBar: Container(
117
+        padding: EdgeInsets.fromLTRB(0, 7.h, 0, 7.h),
118
+        decoration: BoxDecoration(
119
+          color: const Color(0xFFFFFFFF),
120
+          boxShadow: [
121
+            BoxShadow(
122
+              color: const Color(0x14000000),
123
+              offset: Offset(0, -2.w),
124
+              blurRadius: 3.w,
125
+            ),
126
+          ],
127
+        ),
128
+        child: Row(
129
+          children:_titles.asMap().keys.map((index) =>tabBar(index)).toList(),
130
+        ),
131
+      ),
132
+    );
133
+  }
134
+}

+ 127
- 0
lib/pages/home/widgets/home/index.dart Zobrazit soubor

@@ -0,0 +1,127 @@
1
+import 'package:carousel_slider/carousel_slider.dart';
2
+import 'package:farmer_client/pages/TabBar/widgets/home/widgets/headers.dart';
3
+import 'package:flutter/material.dart';
4
+import 'package:flutter_screenutil/flutter_screenutil.dart';
5
+import 'package:get/get.dart';
6
+import 'package:get/get_core/src/get_main.dart';
7
+import '../../../../models/app.dart';
8
+import '../../../../models/entities/banner.dart';
9
+import '../../../../services/homeAPI.dart';
10
+import '../../../../widgets/CarsCard.dart';
11
+import 'package:farmer_client/models/app.dart';
12
+import '../../../MoreCars/index.dart';
13
+
14
+class HomePage extends StatefulWidget {
15
+  const HomePage({Key? key}) : super(key: key);
16
+
17
+  @override
18
+  State<HomePage> createState() => _HomePageState();
19
+}
20
+
21
+
22
+class _HomePageState extends State<HomePage> {
23
+  final CarouselController _controller = CarouselController();
24
+  List<banner> BannerList = [];
25
+
26
+  @override
27
+  void initState() {
28
+    super.initState();
29
+    final location = AppController.t.location;
30
+    print('location+$location');
31
+
32
+    getHomeBanner('banner').then((value) {
33
+      setState(() {
34
+        value.forEach((item) {
35
+          BannerList.add(banner.fromJson(item));
36
+        });
37
+      });
38
+    });
39
+
40
+    // getMachinery(location.value!.longitude.toString()).then((value) {
41
+    //   print('$value');
42
+    // });
43
+  }
44
+
45
+  @override
46
+  Widget build(BuildContext context) {
47
+    return Container(
48
+      alignment: Alignment.center,
49
+      padding: EdgeInsets.fromLTRB(15.w, 0, 15.w, 0),
50
+      child: ListView(
51
+        children: [
52
+          Container(
53
+            width: 20.w,
54
+            child: TypeHeader(
55
+              type: true,
56
+            ),
57
+          ),
58
+          Container(
59
+            margin: EdgeInsets.fromLTRB(0, 15, 0, 0),
60
+            child:
61
+                // Text('asdasdas')
62
+                CarouselSlider(
63
+              items: BannerList.map((item) => Container(
64
+                    child: Center(
65
+                        child: Image.network(item.thumb.toString(),
66
+                            fit: BoxFit.cover, width: 350.w)),
67
+                  )).toList(),
68
+              options: CarouselOptions(
69
+                autoPlay: true,
70
+                enlargeCenterPage: false, //图片中心放大
71
+                viewportFraction: 1, //每个页面应占据的视口部分。默认为 0.8,这意味着每个页面填充 80% 的轮播。
72
+                // aspectRatio: 1.6,//纵横比
73
+                height: 214.w,
74
+                initialPage: 1, //初始页
75
+              ),
76
+            ),
77
+          ),
78
+          Container(
79
+              margin: EdgeInsets.fromLTRB(0, 20, 0, 20),
80
+              child: Column(
81
+                children: [
82
+                  Row(
83
+                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
84
+                    children: [
85
+                      Container(
86
+                        child: Row(
87
+                          children: [
88
+                            Padding(
89
+                              padding: EdgeInsets.fromLTRB(0, 0, 8, 0),
90
+                              child: Image(
91
+                                image:
92
+                                    AssetImage('images/icons/carsListImga.png'),
93
+                                fit: BoxFit.cover,
94
+                                width: 20.w,
95
+                              ),
96
+                            ),
97
+                            Text(
98
+                              '农机列表',
99
+                              style: TextStyle(
100
+                                  color: Color(0xff222222),
101
+                                  fontSize: 20.sp,
102
+                                  fontWeight: FontWeight.bold),
103
+                            )
104
+                          ],
105
+                        ),
106
+                      ),
107
+                      Container(
108
+                        child: GestureDetector(
109
+                          child: Text('更多 >>'),
110
+                          onTap: () {
111
+                            print('点我进入农机搜索/更多页');
112
+                            Get.to(MoreCars());
113
+                          },
114
+                        ),
115
+                      )
116
+                    ],
117
+                  ),
118
+                  CarsCard(),
119
+                  CarsCard(),
120
+                  CarsCard(),
121
+                ],
122
+              )),
123
+        ],
124
+      ),
125
+    );
126
+  }
127
+}

+ 103
- 0
lib/pages/home/widgets/home/widgets/headers.dart Zobrazit soubor

@@ -0,0 +1,103 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+
5
+class TypeHeader extends StatefulWidget {
6
+  TypeHeader({Key? key, required this.type}) : super(key: key);
7
+
8
+  final bool type;
9
+
10
+  @override
11
+  State<TypeHeader> createState() => _TypeHeaderState();
12
+}
13
+
14
+
15
+class _TypeHeaderState extends State<TypeHeader> {
16
+  @override
17
+  Widget build(BuildContext context) {
18
+    if (widget.type) {
19
+      return Container(
20
+        child: Row(
21
+          // mainAxisAlignment: MainAxisAlignment.start,
22
+          children: [
23
+            Container(
24
+              height: 32.w,
25
+              decoration: BoxDecoration(color: Colors.white),
26
+              child: Row(
27
+                children: [
28
+                  Image(
29
+                    image: AssetImage('images/gpsImgae.png'),
30
+                    fit: BoxFit.cover,
31
+                    width: 14.w,
32
+                    height: 17.h,
33
+                  ),
34
+                  Padding(
35
+                    padding: EdgeInsets.fromLTRB(5, 0, 0, 0),
36
+                    child: Text(
37
+                      '邓州市',
38
+                      style: TextStyle(
39
+                        color: Color(0xff202020),
40
+                        fontSize: 16.sp,
41
+                        fontWeight: FontWeight.bold,
42
+                      ),
43
+                    ),
44
+                  ),
45
+                  Container(
46
+                    padding: EdgeInsets.fromLTRB(0, 0, 10, 0),
47
+                    child: Icon(Icons.arrow_drop_down),
48
+                  ),
49
+                  _initWidget(),
50
+                ],
51
+              ),
52
+            ),
53
+          ],
54
+        ),
55
+      );
56
+    } else {
57
+      return _initWidget();
58
+    }
59
+  }
60
+}
61
+//
62
+
63
+class _initWidget extends StatelessWidget {
64
+  const _initWidget({Key? key}) : super(key: key);
65
+
66
+  @override
67
+  Widget build(BuildContext context) {
68
+    return Container(
69
+        width: 255.w,
70
+        height: 32.w,
71
+        decoration: const BoxDecoration(color: Colors.white),
72
+        child: GestureDetector(
73
+            onTap: () {
74
+              print('点击了搜索');
75
+              Get.toNamed('/searchPage');
76
+            },
77
+            child: Container(
78
+              decoration: const BoxDecoration(
79
+                // color: Colors.red,
80
+                color: Color(0x30cccccc),
81
+                borderRadius: BorderRadius.all(Radius.circular(25)),
82
+              ),
83
+              child: Row(
84
+                children: const [
85
+                  Padding(
86
+                    padding: EdgeInsets.fromLTRB(5, 0, 5, 0),
87
+                    child: Icon(
88
+                      Icons.search,
89
+                      size: 19,
90
+                      color: Color(0xff666666),
91
+                    ),
92
+                  ),
93
+                  Text(
94
+                    '请输入关键字查询',
95
+                    style: TextStyle(color: Color(0xff666666), fontSize: 14),
96
+                  )
97
+                ],
98
+              ),
99
+            )
100
+            // Search(),
101
+            ));
102
+  }
103
+}

+ 1
- 1
lib/pages/index.dart Zobrazit soubor

@@ -1,5 +1,5 @@
1 1
 
2
-export 'TabBar/index.dart';
2
+// export 'TabBar/index.dart';
3 3
 export 'splash/splash.dart';
4 4
 export 'login/login.dart';
5 5
 export 'machinery/map/index.dart';

+ 134
- 0
lib/pages/infomation/index.dart Zobrazit soubor

@@ -0,0 +1,134 @@
1
+import 'package:farmer_client/pages/infomation/widgets/Information/index.dart';
2
+import 'package:flutter/material.dart';
3
+import 'package:flutter_screenutil/flutter_screenutil.dart';
4
+import 'package:get/get.dart';
5
+
6
+class Infomation extends StatefulWidget {
7
+  const Infomation({Key? key}) : super(key: key);
8
+
9
+  @override
10
+  _Infomation createState() => _Infomation();
11
+}
12
+
13
+class _Infomation extends State<Infomation> {
14
+  //下标   当前tab
15
+  int _tabIndex = 2;
16
+
17
+  final List _titles = ['首页', '订单', '资讯','我的'];
18
+  final tabTextStyleSelected = TextStyle(
19
+      color: const Color(0xFFFF703B),
20
+      fontSize: 15.sp,
21
+      fontWeight: FontWeight.bold); //选线卡选中字体颜色
22
+  final tabTextStyleNormal = TextStyle(
23
+      color: const Color(0xFF323232),
24
+      fontSize: 15.sp,
25
+      fontWeight: FontWeight.bold); //选项卡未选中字体颜色
26
+
27
+  TextStyle getTabTextStyle(int curIndex) {
28
+    //设置tabbar 选中和未选中的状态文本
29
+    if (curIndex == _tabIndex) {
30
+      return tabTextStyleSelected;
31
+    }
32
+    return tabTextStyleNormal;
33
+  }
34
+
35
+  // 切换底部选项卡,标题的变化设置
36
+  Text getTabTitle(int curIndex) {
37
+    return Text(_titles[curIndex], style: getTabTextStyle(curIndex));
38
+  }
39
+
40
+  List images = [
41
+    ['images/index/HomesOFFImgaes.png', 'images/index/HomesNOImgaes.png'],
42
+    ['images/index/OrdersOFFImgaes.png', 'images/index/OrdersNOImgaes.png'],
43
+    ['images/index/newsONImages.png', 'images/index/newsOFFImages.png'],
44
+    ['images/index/MineOFFImgaes.png', 'images/index/MineNOImgaes.png'],
45
+  ];
46
+  Image getTabIcon(int curIndex) {
47
+    //设置tabbar选中和未选中的状态图标
48
+    if (curIndex == _tabIndex) {
49
+      return Image.asset(
50
+        images[curIndex][1],
51
+        width: 22.w,
52
+        height: 22.w,
53
+      );
54
+    }
55
+    return Image.asset(
56
+      images[curIndex][0],
57
+      width: 22.w,
58
+      height: 22.w,
59
+    );
60
+  }
61
+
62
+  Image getTabImage(path) {
63
+    return Image.asset(path, width: 22.w, height: 22.w);
64
+  }
65
+
66
+  Widget tabBar(index) {
67
+    return GestureDetector(
68
+      behavior: HitTestBehavior.opaque,
69
+      onTap: () {
70
+        if(index!=_tabIndex){
71
+          if(index==0){
72
+            Get.offNamed('/');
73
+          }else if(index==1){
74
+            Get.offNamed('/order');
75
+          }else if(index==2){
76
+            Get.offNamed('/infomation');
77
+          }else{
78
+            Get.offNamed('/main');
79
+          }
80
+        }
81
+      },
82
+      child: Container(
83
+        width: 93.w,
84
+        height: 65.h,
85
+        child: Column(
86
+          children: [
87
+            getTabIcon(index),
88
+            Padding(
89
+              padding: EdgeInsets.fromLTRB(0, 6.h, 0, 0),
90
+              child: getTabTitle(index),
91
+            )
92
+          ],
93
+        ),
94
+      ),
95
+    );
96
+  }
97
+
98
+  @override
99
+  Widget build(BuildContext context) {
100
+    return Scaffold(
101
+      backgroundColor: Colors.white,
102
+      appBar: AppBar(
103
+        elevation: 0,
104
+        centerTitle: true,
105
+        backgroundColor: Colors.white,
106
+        title: Text(
107
+          '资讯',
108
+          style: TextStyle(
109
+              color: Colors.black,
110
+              fontSize: 17.sp,
111
+              letterSpacing: 2,
112
+              fontWeight: FontWeight.bold),
113
+        ),
114
+      ),
115
+      body: Information(),
116
+      bottomNavigationBar: Container(
117
+        padding: EdgeInsets.fromLTRB(0, 7.h, 0, 7.h),
118
+        decoration: BoxDecoration(
119
+          color: const Color(0xFFFFFFFF),
120
+          boxShadow: [
121
+            BoxShadow(
122
+              color: const Color(0x14000000),
123
+              offset: Offset(0, -2.w),
124
+              blurRadius: 3.w,
125
+            ),
126
+          ],
127
+        ),
128
+        child: Row(
129
+          children:_titles.asMap().keys.map((index) =>tabBar(index)).toList(),
130
+        ),
131
+      ),
132
+    );
133
+  }
134
+}

+ 125
- 0
lib/pages/infomation/widgets/Information/index.dart Zobrazit soubor

@@ -0,0 +1,125 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+import 'package:get/get_core/src/get_main.dart';
5
+
6
+import '../../../ArticleInfo/ArticleInfo.dart';
7
+
8
+class Information extends StatefulWidget {
9
+  const Information({Key? key}) : super(key: key);
10
+
11
+  @override
12
+  State<Information> createState() => _InformationState();
13
+}
14
+
15
+class _InformationState extends State<Information> {
16
+  @override
17
+  Widget build(BuildContext context) {
18
+    return ListView(
19
+      children: [
20
+        // ListTile用不好
21
+
22
+        GestureDetector(
23
+          child: Container(
24
+              padding: EdgeInsets.fromLTRB(0, 30, 0, 30),
25
+              width: 310.w,
26
+              decoration: const BoxDecoration(
27
+                  border: Border(
28
+                      bottom: BorderSide(width: 0.5, color: Color(0x20000000)
29
+                          // 0x17000000
30
+                          ))),
31
+              child: Row(
32
+                children: [
33
+                  Container(
34
+                    margin: EdgeInsets.fromLTRB(15, 0, 11, 0),
35
+                    width: 100,
36
+                    height: 100,
37
+                    decoration: BoxDecoration(
38
+                      image: DecorationImage(
39
+                        image: AssetImage('images/cars.png'),
40
+                        fit: BoxFit.cover,
41
+                      ),
42
+                      borderRadius: BorderRadius.circular(12),
43
+                    ),
44
+                  ),
45
+                  Column(
46
+                    crossAxisAlignment: CrossAxisAlignment.start,
47
+                    children: [
48
+                      Container(
49
+                        width: 240.w,
50
+                        padding: EdgeInsets.fromLTRB(0, 0, 0, 30),
51
+                        child: Text("我我就是一个标题,什阿三大苏打333萨达萨达萨达v么特不是",
52
+                            softWrap: true,
53
+                            maxLines: 2,
54
+                            textAlign: TextAlign.left,
55
+                            overflow: TextOverflow.ellipsis,
56
+                            style: TextStyle(
57
+                              fontSize: 17.sp,
58
+                              fontWeight: FontWeight.bold,
59
+                            )),
60
+                      ),
61
+                      Container(
62
+                        child: Text('2022-02-09'),
63
+                      )
64
+                    ],
65
+                  )
66
+                ],
67
+              )),
68
+          onTap: () {
69
+            Get.to(ArticleInfo());
70
+          },
71
+        ),
72
+        GestureDetector(
73
+          child: Container(
74
+              padding: EdgeInsets.fromLTRB(0, 30, 0, 30),
75
+              width: 310.w,
76
+              decoration: const BoxDecoration(
77
+                  border: Border(
78
+                      bottom: BorderSide(width: 0.5, color: Color(0x20000000)
79
+                          // 0x17000000
80
+                          ))),
81
+              child: Row(
82
+                children: [
83
+                  Container(
84
+                    margin: EdgeInsets.fromLTRB(15, 0, 11, 0),
85
+                    width: 100,
86
+                    height: 100,
87
+                    decoration: BoxDecoration(
88
+                      image: DecorationImage(
89
+                        image: AssetImage('images/cars.png'),
90
+                        fit: BoxFit.cover,
91
+                      ),
92
+                      borderRadius: BorderRadius.circular(12),
93
+                    ),
94
+                  ),
95
+                  Column(
96
+                    crossAxisAlignment: CrossAxisAlignment.start,
97
+                    children: [
98
+                      Container(
99
+                        width: 240.w,
100
+                        padding: EdgeInsets.fromLTRB(0, 0, 0, 30),
101
+                        child: Text("我我就是一个标题,什阿三大苏打333萨达萨达萨达v么特不是",
102
+                            softWrap: true,
103
+                            maxLines: 2,
104
+                            textAlign: TextAlign.left,
105
+                            overflow: TextOverflow.ellipsis,
106
+                            style: TextStyle(
107
+                              fontSize: 17.sp,
108
+                              fontWeight: FontWeight.bold,
109
+                            )),
110
+                      ),
111
+                      Container(
112
+                        child: Text('2022-02-09'),
113
+                      )
114
+                    ],
115
+                  )
116
+                ],
117
+              )),
118
+          onTap: () {
119
+            print('进入资讯详情');
120
+          },
121
+        )
122
+      ],
123
+    );
124
+  }
125
+}

+ 134
- 0
lib/pages/main/index.dart Zobrazit soubor

@@ -0,0 +1,134 @@
1
+import 'package:farmer_client/pages/main/widgets/main/index.dart';
2
+import 'package:flutter/material.dart';
3
+import 'package:flutter_screenutil/flutter_screenutil.dart';
4
+import 'package:get/get.dart';
5
+
6
+class Main extends StatefulWidget {
7
+  const Main({Key? key}) : super(key: key);
8
+
9
+  @override
10
+  _Main createState() => _Main();
11
+}
12
+
13
+class _Main extends State<Main> {
14
+  //下标   当前tab
15
+  int _tabIndex = 3;
16
+
17
+  final List _titles = ['首页', '订单', '资讯','我的'];
18
+  final tabTextStyleSelected = TextStyle(
19
+      color: const Color(0xFFFF703B),
20
+      fontSize: 15.sp,
21
+      fontWeight: FontWeight.bold); //选线卡选中字体颜色
22
+  final tabTextStyleNormal = TextStyle(
23
+      color: const Color(0xFF323232),
24
+      fontSize: 15.sp,
25
+      fontWeight: FontWeight.bold); //选项卡未选中字体颜色
26
+
27
+  TextStyle getTabTextStyle(int curIndex) {
28
+    //设置tabbar 选中和未选中的状态文本
29
+    if (curIndex == _tabIndex) {
30
+      return tabTextStyleSelected;
31
+    }
32
+    return tabTextStyleNormal;
33
+  }
34
+
35
+  // 切换底部选项卡,标题的变化设置
36
+  Text getTabTitle(int curIndex) {
37
+    return Text(_titles[curIndex], style: getTabTextStyle(curIndex));
38
+  }
39
+
40
+  List images = [
41
+    ['images/index/HomesOFFImgaes.png', 'images/index/HomesNOImgaes.png'],
42
+    ['images/index/OrdersOFFImgaes.png', 'images/index/OrdersNOImgaes.png'],
43
+    ['images/index/newsONImages.png', 'images/index/newsOFFImages.png'],
44
+    ['images/index/MineOFFImgaes.png', 'images/index/MineNOImgaes.png'],
45
+  ];
46
+  Image getTabIcon(int curIndex) {
47
+    //设置tabbar选中和未选中的状态图标
48
+    if (curIndex == _tabIndex) {
49
+      return Image.asset(
50
+        images[curIndex][1],
51
+        width: 22.w,
52
+        height: 22.w,
53
+      );
54
+    }
55
+    return Image.asset(
56
+      images[curIndex][0],
57
+      width: 22.w,
58
+      height: 22.w,
59
+    );
60
+  }
61
+
62
+  Image getTabImage(path) {
63
+    return Image.asset(path, width: 22.w, height: 22.w);
64
+  }
65
+
66
+  Widget tabBar(index) {
67
+    return GestureDetector(
68
+      behavior: HitTestBehavior.opaque,
69
+      onTap: () {
70
+        if(index!=_tabIndex){
71
+          if(index==0){
72
+            Get.offNamed('/');
73
+          }else if(index==1){
74
+            Get.offNamed('/order');
75
+          }else if(index==2){
76
+            Get.offNamed('/infomation');
77
+          }else{
78
+            Get.offNamed('/main');
79
+          }
80
+        }
81
+      },
82
+      child: Container(
83
+        width: 93.w,
84
+        height: 65.h,
85
+        child: Column(
86
+          children: [
87
+            getTabIcon(index),
88
+            Padding(
89
+              padding: EdgeInsets.fromLTRB(0, 6.h, 0, 0),
90
+              child: getTabTitle(index),
91
+            )
92
+          ],
93
+        ),
94
+      ),
95
+    );
96
+  }
97
+
98
+  @override
99
+  Widget build(BuildContext context) {
100
+    return Scaffold(
101
+      backgroundColor: Colors.white,
102
+      appBar: AppBar(
103
+        elevation: 0,
104
+        centerTitle: true,
105
+        backgroundColor: Colors.white,
106
+        title: Text(
107
+          '我的',
108
+          style: TextStyle(
109
+              color: Colors.black,
110
+              fontSize: 17.sp,
111
+              letterSpacing: 2,
112
+              fontWeight: FontWeight.bold),
113
+        ),
114
+      ),
115
+      body: MainPage(),
116
+      bottomNavigationBar: Container(
117
+        padding: EdgeInsets.fromLTRB(0, 7.h, 0, 7.h),
118
+        decoration: BoxDecoration(
119
+          color: const Color(0xFFFFFFFF),
120
+          boxShadow: [
121
+            BoxShadow(
122
+              color: const Color(0x14000000),
123
+              offset: Offset(0, -2.w),
124
+              blurRadius: 3.w,
125
+            ),
126
+          ],
127
+        ),
128
+        child: Row(
129
+          children:_titles.asMap().keys.map((index) =>tabBar(index)).toList(),
130
+        ),
131
+      ),
132
+    );
133
+  }
134
+}

+ 95
- 0
lib/pages/main/widgets/main/index.dart Zobrazit soubor

@@ -0,0 +1,95 @@
1
+import 'package:get/get.dart';
2
+import 'package:get_storage/get_storage.dart';
3
+
4
+import './widgets/OtherColumn.dart';
5
+import './widgets/UserAddress.dart';
6
+import './widgets/UserInfo.dart';
7
+import 'package:flutter/material.dart';
8
+import 'package:flutter_screenutil/flutter_screenutil.dart';
9
+
10
+class MainPage extends StatefulWidget {
11
+  const MainPage({Key? key}) : super(key: key);
12
+
13
+  @override
14
+  State<MainPage> createState() => _MainPageState();
15
+}
16
+
17
+class _MainPageState extends State<MainPage> {
18
+  GetStorage box = GetStorage();
19
+  @override
20
+  Widget build(BuildContext context) {
21
+    return Container(
22
+      alignment: Alignment.center,
23
+      child: ListView(
24
+        children: [
25
+          Column(
26
+            children: [
27
+              UserInfo(), //头部,头像手机号姓名
28
+              UserAddress(), //用户地址
29
+              OtherColumn(), //功能菜单栏
30
+              Container(
31
+                height: 70.h,
32
+                margin: EdgeInsets.only(top: 0, bottom: 40.0),
33
+                alignment: Alignment.bottomCenter,
34
+                decoration: BoxDecoration(
35
+                  boxShadow: [
36
+                    BoxShadow(
37
+                      blurRadius: 10, //阴影范围
38
+                      spreadRadius: 0.1, //阴影浓度
39
+                      color: Colors.grey.withOpacity(0.2), //阴影颜色
40
+                    ),
41
+                  ],
42
+                ),
43
+                child: SizedBox(
44
+                  width: 315.w,
45
+                  height: 49.h,
46
+                  child: ElevatedButton(
47
+                    onPressed: () {
48
+                      showDialog(
49
+                          context: context,
50
+                          builder: (context) {
51
+                            return AlertDialog(
52
+                                content: Text("您确定退出登录吗?"),
53
+                                actions: <Widget>[
54
+                                  TextButton(
55
+                                    child: Text("取消"),
56
+                                    onPressed: () {
57
+                                      Navigator.pop(context, 'Cancle');
58
+                                    },
59
+                                  ),
60
+                                  TextButton(
61
+                                      child: Text("确定"),
62
+                                      onPressed: () {
63
+                                        Navigator.pop(context, "Ok");
64
+                                        box.remove('token');
65
+                                        Get.offNamed('/login');
66
+                                      })
67
+                                ]);
68
+                          });
69
+                    },
70
+                    child: const Text(
71
+                      "退出登陆",
72
+                      style: TextStyle(
73
+                          fontSize: 18,
74
+                          color: Colors.black,
75
+                          fontWeight: FontWeight.bold),
76
+                    ),
77
+                    style: ButtonStyle(
78
+                      elevation: MaterialStateProperty.all(0),
79
+                      backgroundColor:
80
+                          MaterialStateProperty.all(const Color(0xFFFFFFFF)),
81
+                      shape: MaterialStateProperty.all(
82
+                          const RoundedRectangleBorder(
83
+                              borderRadius:
84
+                                  BorderRadius.all(Radius.circular(24.4)))),
85
+                    ),
86
+                  ),
87
+                ),
88
+              ),
89
+            ],
90
+          ),
91
+        ],
92
+      ),
93
+    );
94
+  }
95
+}

+ 161
- 0
lib/pages/main/widgets/main/widgets/OtherColumn.dart Zobrazit soubor

@@ -0,0 +1,161 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+
5
+class OtherColumn extends StatelessWidget {
6
+  const OtherColumn({Key? key}) : super(key: key);
7
+
8
+  @override
9
+  Widget build(BuildContext context) {
10
+    return Container(
11
+        alignment: Alignment.center,
12
+        width: 345.w,
13
+        margin: EdgeInsets.fromLTRB(0, 15.w, 0, 15.w),
14
+        decoration: BoxDecoration(
15
+          borderRadius: BorderRadius.circular(30),
16
+          color: Colors.white,
17
+          boxShadow: [
18
+            BoxShadow(
19
+              blurRadius: 10, //阴影范围
20
+              spreadRadius: 0.1, //阴影浓度
21
+              color: Colors.grey.withOpacity(0.2), //阴影颜色
22
+            ),
23
+          ],
24
+        ),
25
+        child: Column(
26
+          children: [
27
+            Container(
28
+                margin: EdgeInsets.fromLTRB(0, 30.w, 0, 20.w),
29
+                alignment: Alignment.topLeft,
30
+                decoration: const BoxDecoration(
31
+                    border: Border(
32
+                        left: BorderSide(width: 5, color: Color(0xff000000)
33
+                            // 0x17000000
34
+                            ))),
35
+                child: Padding(
36
+                  padding: EdgeInsets.fromLTRB(12.w, 0, 0, 0),
37
+                  child: Text(
38
+                    '设置',
39
+                    style: TextStyle(
40
+                      color: Color(0xff333333),
41
+                      fontWeight: FontWeight.bold,
42
+                      fontSize: 17.sp,
43
+                    ),
44
+                  ),
45
+                )),
46
+            Container(
47
+              child: Column(
48
+                children: [
49
+                  GestureDetector(
50
+                    onTap: () {
51
+                      Get.toNamed('/aboutUs');
52
+                    },
53
+                    child: Container(
54
+                      height: 45.w,
55
+                      width: 310.w,
56
+                      margin: EdgeInsets.fromLTRB(0, 10.w, 0, 0),
57
+                      decoration: const BoxDecoration(
58
+                          border: Border(
59
+                              bottom: BorderSide(
60
+                                  width: 0.5, color: Color(0x20000000)
61
+                                  // 0x17000000
62
+                                  ))),
63
+                      child: ListTile(
64
+                        contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
65
+                        // 这边使用了contentPadding
66
+                        leading: Image(
67
+                          image: AssetImage('images/aboutUs.png'),
68
+                          width: 18.w,
69
+                          height: 21.w,
70
+                        ),
71
+                        title: Transform(
72
+                          transform: Matrix4.translationValues(-20, 0.0, 0.0),
73
+                          child: Text("关于我们",
74
+                              style: TextStyle(
75
+                                  fontSize: 17.sp, color: Color(0xff333333))),
76
+                        ),
77
+                        trailing: Image(
78
+                          image: AssetImage('images/userRight.png'),
79
+                          width: 10.w,
80
+                          height: 18.w,
81
+                        ),
82
+                      ),
83
+                    ),
84
+                  ),
85
+                  GestureDetector(
86
+                    onTap: () {
87
+                      Get.toNamed('/agreement');
88
+                    },
89
+                    child: Container(
90
+                      margin: EdgeInsets.fromLTRB(0, 10.w, 0, 0),
91
+                      width: 310.w,
92
+                      height: 45.w,
93
+                      decoration: const BoxDecoration(
94
+                          border: Border(
95
+                              bottom: BorderSide(
96
+                                  width: 0.5, color: Color(0x20000000)
97
+                                  // 0x17000000
98
+                                  ))),
99
+                      child: ListTile(
100
+                        contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
101
+                        leading: Image(
102
+                          image: AssetImage('images/versionUpdate.png'),
103
+                          width: 18.w,
104
+                          height: 21.w,
105
+                        ),
106
+                        title: Transform(
107
+                          transform: Matrix4.translationValues(-20, 0.0, 0.0),
108
+                          child: Text("用户协议及隐私政策",
109
+                              style: TextStyle(
110
+                                  fontSize: 17.sp, color: Color(0xff333333))),
111
+                        ),
112
+                        trailing: Image(
113
+                          image: AssetImage('images/userRight.png'),
114
+                          width: 10.w,
115
+                          height: 18.w,
116
+                        ),
117
+                      ),
118
+                    ),
119
+                  ),
120
+                  GestureDetector(
121
+                    onTap: () {
122
+                      Get.toNamed('/feedback');
123
+                    },
124
+                    child: Container(
125
+                      margin: EdgeInsets.fromLTRB(0, 10.w, 0, 20.w),
126
+                      width: 310.w,
127
+                      height: 45.w,
128
+                      decoration: const BoxDecoration(
129
+                          border: Border(
130
+                              bottom: BorderSide(
131
+                                  width: 0.5, color: Color(0x20000000)
132
+                                  // 0x17000000
133
+                                  ))),
134
+                      child: ListTile(
135
+                        contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
136
+                        leading: Image(
137
+                          image: AssetImage('images/feedbacks.png'),
138
+                          width: 18.w,
139
+                          height: 21.w,
140
+                        ),
141
+                        title: Transform(
142
+                          transform: Matrix4.translationValues(-20, 0.0, 0.0),
143
+                          child: Text("意见反馈",
144
+                              style: TextStyle(
145
+                                  fontSize: 17.sp, color: Color(0xff333333))),
146
+                        ),
147
+                        trailing: Image(
148
+                          image: AssetImage('images/userRight.png'),
149
+                          width: 10.w,
150
+                          height: 18.w,
151
+                        ),
152
+                      ),
153
+                    ),
154
+                  ),
155
+                ],
156
+              ),
157
+            )
158
+          ],
159
+        ));
160
+  }
161
+}

+ 99
- 0
lib/pages/main/widgets/main/widgets/UserAddress.dart Zobrazit soubor

@@ -0,0 +1,99 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+
5
+class UserAddress extends StatelessWidget {
6
+  const UserAddress({Key? key}) : super(key: key);
7
+
8
+  @override
9
+  Widget build(BuildContext context) {
10
+    return Container(
11
+        alignment: Alignment.center,
12
+        height: 123.w,
13
+        width: 345.w,
14
+        margin: EdgeInsets.fromLTRB(0, 15.w, 0, 15.w),
15
+        decoration: BoxDecoration(
16
+          borderRadius: BorderRadius.circular(30),
17
+          color: Colors.white,
18
+          boxShadow: [
19
+            BoxShadow(
20
+              blurRadius: 10, //阴影范围
21
+              spreadRadius: 0.1, //阴影浓度
22
+              color: Colors.grey.withOpacity(0.2), //阴影颜色
23
+            ),
24
+          ],
25
+        ),
26
+        child: Column(
27
+          children: [
28
+            Container(
29
+                margin: EdgeInsets.fromLTRB(0, 30.w, 0, 20.w),
30
+                alignment: Alignment.topLeft,
31
+                decoration: const BoxDecoration(
32
+                    border: Border(
33
+                        left: BorderSide(width: 5, color: Color(0xff000000)
34
+                            // 0x17000000
35
+                            ))),
36
+                child: Padding(
37
+                  padding: EdgeInsets.fromLTRB(12.w, 0, 0, 0),
38
+                  child: Text(
39
+                    '地址信息',
40
+                    style: TextStyle(
41
+                      color: Color(0xff333333),
42
+                      fontWeight: FontWeight.bold,
43
+                      fontSize: 17.sp,
44
+                    ),
45
+                  ),
46
+                )),
47
+            GestureDetector(
48
+              child: Row(
49
+                mainAxisAlignment: MainAxisAlignment.spaceBetween,
50
+                children: [
51
+                  Container(
52
+                    child: Row(
53
+                      mainAxisAlignment: MainAxisAlignment.spaceBetween,
54
+                      children: [
55
+                        Padding(
56
+                          padding: EdgeInsets.fromLTRB(17.w, 0, 10.w, 0),
57
+                          child: Image(
58
+                            image: AssetImage('images/gpsImgae.png'),
59
+                            width: 12.w,
60
+                          ),
61
+                        ),
62
+                        Container(
63
+                          width: 260,
64
+                          child: Text(
65
+                            '请填写详细地址请填写详细地址请填写详细地址',
66
+                            softWrap: true,
67
+                            maxLines: 1,
68
+                            textAlign: TextAlign.left,
69
+                            overflow: TextOverflow.ellipsis,
70
+                            style: TextStyle(
71
+                              fontWeight: FontWeight.bold,
72
+                              fontSize: 17,
73
+                            ),
74
+                          ),
75
+                        ),
76
+                      ],
77
+                    ),
78
+                  ),
79
+                  Container(
80
+                    alignment: Alignment.center,
81
+                    padding: EdgeInsets.fromLTRB(0, 0, 30.w, 0),
82
+                    child: Text(
83
+                      '>>',
84
+                      style: TextStyle(
85
+                        fontWeight: FontWeight.bold,
86
+                        fontSize: 17,
87
+                      ),
88
+                    ),
89
+                  ),
90
+                ],
91
+              ),
92
+              onTap: () {
93
+                Get.toNamed("/addressList");
94
+              },
95
+            ),
96
+          ],
97
+        ));
98
+  }
99
+}

+ 112
- 0
lib/pages/main/widgets/main/widgets/UserInfo.dart Zobrazit soubor

@@ -0,0 +1,112 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+
5
+class UserInfo extends StatelessWidget {
6
+  const UserInfo({Key? key}) : super(key: key);
7
+
8
+  @override
9
+  Widget build(BuildContext context) {
10
+    return Container(
11
+      margin: EdgeInsets.only(top: 20.0, bottom: 0.0),
12
+
13
+      alignment: Alignment.center,
14
+      height: 173.w,
15
+      width: 345.w,
16
+      decoration: BoxDecoration(
17
+        image: const DecorationImage(
18
+          image: AssetImage("images/mineBack.png"),
19
+          fit: BoxFit.cover,
20
+        ),
21
+        borderRadius: BorderRadius.circular(10),
22
+      ),
23
+      child: Stack(
24
+        fit: StackFit.expand,
25
+        children: [
26
+          Positioned(
27
+            top: 0,
28
+            right: 0,
29
+            child: Container(
30
+                alignment: Alignment.center,
31
+                height: 24.w,
32
+                width: 93.w,
33
+                decoration: const BoxDecoration(
34
+                  borderRadius: BorderRadius.only(
35
+                      bottomLeft: Radius.circular(20),
36
+                      topRight: Radius.circular(20)),
37
+                  color: Color(0x30000000),
38
+                ),
39
+                child: GestureDetector(
40
+                  child: const Text(
41
+                    '修改个人信息',
42
+                    style: TextStyle(color: Colors.white),
43
+                  ),
44
+                  onTap: () {
45
+                    Get.toNamed('/userInfo');
46
+                  },
47
+                )),
48
+          ),
49
+          Row(
50
+            children: [
51
+              Column(
52
+                mainAxisAlignment: MainAxisAlignment.center,
53
+                children: [
54
+                  Container(
55
+                    decoration: BoxDecoration(
56
+                      shape: BoxShape.circle,
57
+                      border: Border.all(
58
+                        color: Colors.white,
59
+                        width: 2,
60
+                      ),
61
+                    ),
62
+                    margin: EdgeInsets.fromLTRB(30, 0, 15, 0),
63
+                    alignment: Alignment.center,
64
+                    child: Image.asset(
65
+                      "images/userMoren.png",
66
+                      width: 63.w,
67
+                    ),
68
+                  ),
69
+                ],
70
+              ),
71
+              Container(
72
+                child: Column(
73
+                  mainAxisAlignment: MainAxisAlignment.center,
74
+                  crossAxisAlignment: CrossAxisAlignment.start,
75
+                  children: [
76
+                    Container(
77
+                      margin: EdgeInsets.fromLTRB(0, 0, 0, 10),
78
+                      child: Text(
79
+                        '符西西',
80
+                        style: TextStyle(
81
+                          color: Colors.white,
82
+                          fontSize: 17,
83
+                        ),
84
+                      ),
85
+                    ),
86
+                    Container(
87
+                      margin: EdgeInsets.fromLTRB(0, 10, 0, 0),
88
+                      child: Text(
89
+                        '17775000245',
90
+                        style: TextStyle(
91
+                          color: Colors.white,
92
+                          fontSize: 17,
93
+                        ),
94
+                      ),
95
+                    ),
96
+                    // const Text(
97
+                    //      '点击登陆',
98
+                    //      style: TextStyle(
99
+                    //        color: Colors.white,
100
+                    //        fontSize: 17,
101
+                    //      ),
102
+                    //    ),
103
+                  ],
104
+                ),
105
+              ),
106
+            ],
107
+          ),
108
+        ],
109
+      ),
110
+    );
111
+  }
112
+}

+ 134
- 0
lib/pages/order/index.dart Zobrazit soubor

@@ -0,0 +1,134 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+import './widgets/order/index.dart';
5
+
6
+class Order extends StatefulWidget {
7
+  const Order({Key? key}) : super(key: key);
8
+
9
+  @override
10
+  _Order createState() => _Order();
11
+}
12
+
13
+class _Order extends State<Order> {
14
+  //下标   当前tab
15
+  final int _tabIndex = 1;
16
+
17
+  final List _titles = ['首页', '订单', '资讯','我的'];
18
+  final tabTextStyleSelected = TextStyle(
19
+      color: const Color(0xFFFF703B),
20
+      fontSize: 15.sp,
21
+      fontWeight: FontWeight.bold); //选线卡选中字体颜色
22
+  final tabTextStyleNormal = TextStyle(
23
+      color: const Color(0xFF323232),
24
+      fontSize: 15.sp,
25
+      fontWeight: FontWeight.bold); //选项卡未选中字体颜色
26
+
27
+  TextStyle getTabTextStyle(int curIndex) {
28
+    //设置tabbar 选中和未选中的状态文本
29
+    if (curIndex == _tabIndex) {
30
+      return tabTextStyleSelected;
31
+    }
32
+    return tabTextStyleNormal;
33
+  }
34
+
35
+  // 切换底部选项卡,标题的变化设置
36
+  Text getTabTitle(int curIndex) {
37
+    return Text(_titles[curIndex], style: getTabTextStyle(curIndex));
38
+  }
39
+
40
+  List images = [
41
+    ['images/index/HomesOFFImgaes.png', 'images/index/HomesNOImgaes.png'],
42
+    ['images/index/OrdersOFFImgaes.png', 'images/index/OrdersNOImgaes.png'],
43
+    ['images/index/newsONImages.png', 'images/index/newsOFFImages.png'],
44
+    ['images/index/MineOFFImgaes.png', 'images/index/MineNOImgaes.png'],
45
+  ];
46
+  Image getTabIcon(int curIndex) {
47
+    //设置tabbar选中和未选中的状态图标
48
+    if (curIndex == _tabIndex) {
49
+      return Image.asset(
50
+        images[curIndex][1],
51
+        width: 22.w,
52
+        height: 22.w,
53
+      );
54
+    }
55
+    return Image.asset(
56
+      images[curIndex][0],
57
+      width: 22.w,
58
+      height: 22.w,
59
+    );
60
+  }
61
+
62
+  Image getTabImage(path) {
63
+    return Image.asset(path, width: 22.w, height: 22.w);
64
+  }
65
+
66
+  Widget tabBar(index) {
67
+    return GestureDetector(
68
+      behavior: HitTestBehavior.opaque,
69
+      onTap: () {
70
+        if(index!=_tabIndex){
71
+          if(index==0){
72
+            Get.offNamed('/');
73
+          }else if(index==1){
74
+            Get.offNamed('/order');
75
+          }else if(index==2){
76
+            Get.offNamed('/infomation');
77
+          }else{
78
+            Get.offNamed('/main');
79
+          }
80
+        }
81
+      },
82
+      child: Container(
83
+        width: 93.w,
84
+        height: 65.h,
85
+        child: Column(
86
+          children: [
87
+            getTabIcon(index),
88
+            Padding(
89
+              padding: EdgeInsets.fromLTRB(0, 6.h, 0, 0),
90
+              child: getTabTitle(index),
91
+            )
92
+          ],
93
+        ),
94
+      ),
95
+    );
96
+  }
97
+
98
+  @override
99
+  Widget build(BuildContext context) {
100
+    return Scaffold(
101
+      backgroundColor: Colors.white,
102
+      appBar: AppBar(
103
+        elevation: 0,
104
+        centerTitle: true,
105
+        backgroundColor: Colors.white,
106
+        title: Text(
107
+          '订单',
108
+          style: TextStyle(
109
+              color: Colors.black,
110
+              fontSize: 17.sp,
111
+              letterSpacing: 2,
112
+              fontWeight: FontWeight.bold),
113
+        ),
114
+      ),
115
+      body: OrderPage(),
116
+      bottomNavigationBar: Container(
117
+        padding: EdgeInsets.fromLTRB(0, 7.h, 0, 7.h),
118
+        decoration: BoxDecoration(
119
+          color: const Color(0xFFFFFFFF),
120
+          boxShadow: [
121
+            BoxShadow(
122
+              color: const Color(0x14000000),
123
+              offset: Offset(0, -2.w),
124
+              blurRadius: 3.w,
125
+            ),
126
+          ],
127
+        ),
128
+        child: Row(
129
+          children:_titles.asMap().keys.map((index) =>tabBar(index)).toList(),
130
+        ),
131
+      ),
132
+    );
133
+  }
134
+}

+ 61
- 0
lib/pages/order/widgets/order/index.dart Zobrazit soubor

@@ -0,0 +1,61 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+
4
+import '../../../../widgets/OrderListCard.dart';
5
+import '../../../orderInfo/index.dart';
6
+
7
+class OrderPage extends StatefulWidget {
8
+  const OrderPage({Key? key}) : super(key: key);
9
+
10
+  @override
11
+  State<OrderPage> createState() => _OrderPageState();
12
+}
13
+
14
+class _OrderPageState extends State<OrderPage> {
15
+  @override
16
+  Widget build(BuildContext context) {
17
+    return ListView(
18
+      children: [
19
+        Container(
20
+          padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
21
+          height: 55.w,
22
+          decoration: BoxDecoration(
23
+            color: Colors.white
24
+          ),
25
+          child: Row(
26
+            mainAxisAlignment: MainAxisAlignment.spaceBetween,
27
+
28
+            children: [
29
+              Row(
30
+                children: [
31
+                  Padding(padding: EdgeInsets.fromLTRB(0, 0, 8, 0),
32
+                  child:Image(image: AssetImage('images/ordersListImga.png'),fit: BoxFit.cover,width: 18.w,),
33
+                  ),
34
+                  Text('订单列表',
35
+                    style: TextStyle(
36
+                      color: Color(0xff222222),
37
+                      fontSize: 20.sp,
38
+                      fontWeight: FontWeight.bold
39
+                    ),
40
+                  )
41
+                ],
42
+              ),
43
+            ],
44
+          ),
45
+        ),
46
+ Column(
47
+        mainAxisSize: MainAxisSize.min,
48
+        children: [
49
+          OrderListCard(),
50
+          OrderListCard(),
51
+          OrderListCard(),
52
+          OrderListCard(),
53
+
54
+
55
+        ],
56
+      ),
57
+
58
+    ],
59
+    );
60
+  }
61
+}

+ 8
- 1
lib/routes/pages.dart Zobrazit soubor

@@ -6,16 +6,23 @@ import 'package:farmer_client/pages/addAddress/index.dart';
6 6
 import 'package:farmer_client/pages/addressList/index.dart';
7 7
 import 'package:farmer_client/pages/agreement/index.dart';
8 8
 import 'package:farmer_client/pages/feedback/index.dart';
9
+import 'package:farmer_client/pages/infomation/index.dart';
10
+import 'package:farmer_client/pages/main/index.dart';
11
+import 'package:farmer_client/pages/order/index.dart';
9 12
 import 'package:farmer_client/pages/orderInfo/index.dart';
10 13
 import 'package:farmer_client/pages/search/index.jsx.dart';
11 14
 import 'package:farmer_client/pages/userInfo/index.dart';
12 15
 import 'package:get/get.dart';
13
-import '../pages/MoreCars/index.dart';
16
+
17
+import '../pages/home/index.dart';
14 18
 import '../pages/index.dart';
15 19
 
16 20
 
17 21
 List<GetPage> pages = [
18 22
   GetPage(name: '/', page: () =>  Home()),
23
+  GetPage(name: '/main', page: () =>  Main()),
24
+  GetPage(name: '/order', page: () =>  Order()),
25
+  GetPage(name: '/infomation', page: () =>  Infomation()),
19 26
   GetPage(name: '/ArticleInfo', page: () =>  ArticleInfo()),//资讯详情
20 27
   GetPage(name: '/splash', page: () => SplashScreen()),//SplashScreen
21 28
   GetPage(name: '/login', page: () =>  MyRouteLogin()),