[baozhangchao] 3 vuotta sitten
vanhempi
commit
6e5e95db91
39 muutettua tiedostoa jossa 194 lisäystä ja 1298 poistoa
  1. BIN
      images/HomesNOImgaes.png
  2. BIN
      images/HomesOFFImgaes.png
  3. BIN
      images/MineNOImgaes.png
  4. BIN
      images/MineOFFImgaes.png
  5. BIN
      images/OrdersNOImgaes.png
  6. BIN
      images/OrdersOFFImgaes.png
  7. BIN
      images/cars.png
  8. BIN
      images/icons/ListBack.png
  9. BIN
      images/icons/deletes.png
  10. BIN
      images/newsOFFImages.png
  11. BIN
      images/newsONImages.png
  12. 1
    1
      lib/models/entities/CardInfo.dart
  13. 63
    11
      lib/pages/OrderConfirmation/index.dart
  14. 0
    11
      lib/pages/TabBar/Information_page.dart
  15. 0
    11
      lib/pages/TabBar/Mine_page.dart
  16. 0
    11
      lib/pages/TabBar/Orders_page.dart
  17. 0
    10
      lib/pages/TabBar/home_page.dart
  18. 0
    133
      lib/pages/TabBar/index.dart
  19. 0
    71
      lib/pages/TabBar/index_page.dart
  20. 0
    1
      lib/pages/TabBar/member_page.dart
  21. 0
    125
      lib/pages/TabBar/widgets/Information/index.dart
  22. 0
    116
      lib/pages/TabBar/widgets/home/index.dart
  23. 0
    103
      lib/pages/TabBar/widgets/home/widgets/headers.dart
  24. 0
    95
      lib/pages/TabBar/widgets/main/index.dart
  25. 0
    161
      lib/pages/TabBar/widgets/main/widgets/OtherColumn.dart
  26. 0
    99
      lib/pages/TabBar/widgets/main/widgets/UserAddress.dart
  27. 0
    112
      lib/pages/TabBar/widgets/main/widgets/UserInfo.dart
  28. 0
    61
      lib/pages/TabBar/widgets/order/index.dart
  29. 6
    3
      lib/pages/machinery/detail/index.dart
  30. 4
    18
      lib/pages/machinery/detail/widgets/detail.dart
  31. 17
    2
      lib/pages/machinery/map/index.dart
  32. 8
    7
      lib/pages/machinery/map/widgets/detail.dart
  33. 4
    4
      lib/pages/machinery/widgets/summary.dart
  34. 32
    21
      lib/pages/orderInfo/index.dart
  35. 0
    87
      lib/pages/search/index.jsx.dart
  36. 15
    0
      lib/services/orderAPI.dart
  37. 36
    6
      lib/widgets/CarsCard.dart
  38. 2
    12
      lib/widgets/ExtendContentList.dart
  39. 6
    6
      lib/widgets/OrderInfoCard.dart

BIN
images/HomesNOImgaes.png Näytä tiedosto


BIN
images/HomesOFFImgaes.png Näytä tiedosto


BIN
images/MineNOImgaes.png Näytä tiedosto


BIN
images/MineOFFImgaes.png Näytä tiedosto


BIN
images/OrdersNOImgaes.png Näytä tiedosto


BIN
images/OrdersOFFImgaes.png Näytä tiedosto


BIN
images/cars.png Näytä tiedosto


BIN
images/icons/ListBack.png Näytä tiedosto


BIN
images/icons/deletes.png Näytä tiedosto


BIN
images/newsOFFImages.png Näytä tiedosto


BIN
images/newsONImages.png Näytä tiedosto


+ 1
- 1
lib/models/entities/CardInfo.dart Näytä tiedosto

@@ -24,7 +24,7 @@ class CardInfo {
24 24
   // @ApiModelProperty(value = "类型名称")
25 25
   String? typeName;
26 26
   // @ApiModelProperty(value = "农机价格")
27
-  num? price;
27
+  int? price;
28 28
   // @ApiModelProperty(value = "主图")
29 29
   String? thumb;
30 30
 

+ 63
- 11
lib/pages/OrderConfirmation/index.dart Näytä tiedosto

@@ -1,18 +1,70 @@
1 1
 import 'package:farmer_client/models/addressController.dart';
2
+import 'package:farmer_client/models/entities/CardInfo.dart';
2 3
 import 'package:farmer_client/widgets/layout/BasicPage.dart';
3 4
 import 'package:flutter/material.dart';
4 5
 import 'package:flutter/services.dart';
5 6
 import 'package:flutter_screenutil/flutter_screenutil.dart';
7
+import 'package:fluttertoast/fluttertoast.dart';
6 8
 import 'package:get/get.dart';
7 9
 import 'package:intl/intl.dart';
8 10
 
11
+import '../../models/entities/OrderInfoModel.dart';
12
+import '../../services/orderAPI.dart';
13
+
9 14
 class OrderConfirmation extends BasicPage {
10 15
   TextEditingController _unameController = TextEditingController();
11 16
   GlobalKey _formKey = GlobalKey<FormState>();
12 17
 
13 18
   final selectDate = Rx<DateTime>(DateTime.now()); //选择的时间
14
-  final workingArea = Rxn(0);
19
+  final workingArea = Rx<int>(0);
15 20
   AddressController addressController = AddressController.t;
21
+  final item = Rx<CardInfo>(CardInfo());//全部详情
22
+  final orderInfo = Rx<OrderInfoModel>(OrderInfoModel());//全部详情
23
+
24
+  @override
25
+  void beforeShow() {
26
+    // TODO: implement beforeShow
27
+    super.beforeShow();
28
+    if(Get.arguments['item']!=null){
29
+      item.value=Get.arguments['item'];
30
+    }else{
31
+      return;
32
+    }
33
+  }
34
+
35
+
36
+  Map<String, dynamic> data = {
37
+
38
+  };
39
+
40
+  void _orderSubmit (){
41
+
42
+    if ((_formKey.currentState as FormState).validate()) {
43
+          data = {
44
+        'charges': item.value.price! * workingArea.value,
45
+        'price':  item.value.price,
46
+        'amount': workingArea.value,
47
+        'machineryId':  item.value.machineryId,
48
+        'machineryName':  item.value.name,
49
+        'machineryType':  item.value.typeId,
50
+        'typeName':  item.value.typeName,
51
+        'address': addressController.address.value.address,
52
+        'orgId':  item.value.orgId,
53
+        'appointmentDate': '${DateFormat("yyyy-MM-dd").format(selectDate.value)} 08:00:00',
54
+      };
55
+      generateOrder(data).then((value) {
56
+        orderInfo.value=OrderInfoModel.fromJson(value);
57
+        Fluttertoast.showToast(
58
+            msg: '预约成功'
59
+        );
60
+        Get.to('/OrderInfoCard',arguments: {'id':orderInfo.value.orderId});
61
+
62
+
63
+      });
64
+      //验证通过提交数据
65
+    }
66
+
67
+  }
16 68
 
17 69
   @override
18 70
   Widget builder(BuildContext context) {
@@ -56,7 +108,7 @@ class OrderConfirmation extends BasicPage {
56 108
                 hintText: "请输入具体面积(公顷)",
57 109
               ),
58 110
               onChanged: (e) {
59
-                workingArea.value = e as int?;
111
+                workingArea.value = int.parse(e);
60 112
               },
61 113
               // 校验用户名
62 114
               validator: (v) {
@@ -109,9 +161,12 @@ class OrderConfirmation extends BasicPage {
109 161
                           selectDate.value = handleChnage!;
110 162
                           print('${selectDate}+');
111 163
                         },
112
-                        child: Text(selectDate == null
113
-                            ? '请选择日期'
114
-                            : '${DateFormat("yyyy-MM-dd").format(selectDate.value)}'),
164
+                        child: Obx(()=>
165
+                            Text(selectDate == null
166
+                                ? '请选择日期'
167
+                                : '${DateFormat("yyyy-MM-dd").format(selectDate.value)}'),
168
+                        )
169
+
115 170
                       ),
116 171
                     )
117 172
                   ],
@@ -175,12 +230,9 @@ class OrderConfirmation extends BasicPage {
175 230
                 height: 49.h,
176 231
                 child: ElevatedButton(
177 232
                   onPressed: () {
178
-                    if ((_formKey.currentState as FormState).validate()) {
179
-                      var a = {selectDate, workingArea};
180
-                      print('我确定了$a');
181
-                      //验证通过提交数据
182
-                      Get.toNamed('/orderPageInfo');
183
-                    }
233
+                    _orderSubmit();
234
+
235
+
184 236
                   },
185 237
                   child: const Text(
186 238
                     "确定",

+ 0
- 11
lib/pages/TabBar/Information_page.dart Näytä tiedosto

@@ -1,11 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-
3
-class InformationPage extends StatelessWidget {
4
-  @override
5
-  Widget build(BuildContext context) {
6
-    // TODO: implement build
7
-    return Scaffold(
8
-      body: Center(child: Text('资讯')),
9
-    );
10
-  }
11
-}

+ 0
- 11
lib/pages/TabBar/Mine_page.dart Näytä tiedosto

@@ -1,11 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-
3
-class MinePage extends StatelessWidget {
4
-  @override
5
-  Widget build(BuildContext context) {
6
-    // TODO: implement build
7
-    return Scaffold(
8
-      body: Center(child: Text('我的')),
9
-    );
10
-  }
11
-}

+ 0
- 11
lib/pages/TabBar/Orders_page.dart Näytä tiedosto

@@ -1,11 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-
3
-class OrdersPage extends StatelessWidget {
4
-  @override
5
-  Widget build(BuildContext context) {
6
-    // TODO: implement build
7
-    return Scaffold(
8
-      body: Center(child: Text('订单')),
9
-    );
10
-  }
11
-}

+ 0
- 10
lib/pages/TabBar/home_page.dart Näytä tiedosto

@@ -1,10 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-
3
-class HomePage extends StatelessWidget {
4
-  @override
5
-  Widget build(BuildContext context) {
6
-    return Scaffold(
7
-      body: Center(child: Text('首页')),
8
-    );
9
-  }
10
-}

+ 0
- 133
lib/pages/TabBar/index.dart Näytä tiedosto

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

+ 0
- 71
lib/pages/TabBar/index_page.dart Näytä tiedosto

@@ -1,71 +0,0 @@
1
-import 'package:flutter/material.dart';
2
-import 'package:flutter/cupertino.dart';
3
-import 'home_page.dart';
4
-import 'Information_page.dart';
5
-import 'Mine_page.dart';
6
-import 'Orders_page.dart';
7
-
8
-class IndexPage extends StatefulWidget {
9
-  _IndexPageState createState() => _IndexPageState();
10
-}
11
-
12
-class _IndexPageState extends State<IndexPage> {
13
-
14
-
15
-  final List<BottomNavigationBarItem> bottomTabs = [
16
-     BottomNavigationBarItem(
17
-      icon: Icon(CupertinoIcons.home),
18
-      title: Text('首页'),
19
-    ),
20
-     BottomNavigationBarItem(
21
-      icon: Icon(CupertinoIcons.search),
22
-      title: Text('资讯'),
23
-
24
-    ),
25
-     BottomNavigationBarItem(
26
-      icon: Icon(CupertinoIcons.shopping_cart),
27
-      title: Text('订单'),
28
-
29
-    ),
30
-     BottomNavigationBarItem(
31
-      icon: Icon(CupertinoIcons.profile_circled),
32
-      title: Text('我的'),
33
-    ),
34
-  ];
35
-
36
-  final List tabBodies = [
37
-    HomePage(),
38
-    InformationPage(),
39
-    OrdersPage(),
40
-    MinePage(),
41
-  ];
42
-
43
-  int currentIndex = 0;
44
-  var currentPage;
45
-
46
-  @override
47
-  void initState() {
48
-    super.initState();
49
-    currentPage = tabBodies[currentIndex];
50
-  }
51
-
52
-  @override
53
-  Widget build(BuildContext context) {
54
-    // TODO: implement build
55
-    return Scaffold(
56
-      backgroundColor: Color.fromRGBO(244, 245, 245, 1),
57
-      bottomNavigationBar: BottomNavigationBar(
58
-        type: BottomNavigationBarType.fixed,
59
-        currentIndex: currentIndex,
60
-        items: bottomTabs,
61
-        onTap: (index){
62
-          setState(() {
63
-            currentIndex = index;
64
-            currentPage = tabBodies[currentIndex];
65
-          });
66
-        },
67
-      ),
68
-      body: currentPage,
69
-    );
70
-  }
71
-}

+ 0
- 1
lib/pages/TabBar/member_page.dart Näytä tiedosto

@@ -1 +0,0 @@
1
-// TODO Implement this library.

+ 0
- 125
lib/pages/TabBar/widgets/Information/index.dart Näytä tiedosto

@@ -1,125 +0,0 @@
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
-}

+ 0
- 116
lib/pages/TabBar/widgets/home/index.dart Näytä tiedosto

@@ -1,116 +0,0 @@
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 '../../../../widgets/layout/BasicPage.dart';
13
-import '../../../MoreCars/index.dart';
14
-
15
-
16
-
17
-class HomePage extends BasicPage {
18
-
19
-  final bannerList = Rx<List<banner>>([]);
20
-
21
-  @override
22
-  void beforeShow() {
23
-    final location = AppController.t.locationStr;
24
-
25
-    getHomeBanner('banner').then((value) {
26
-      value.forEach((item) {
27
-        bannerList.value.add(banner.fromJson(item));
28
-      });
29
-    });
30
-  }
31
-
32
-  List<Widget>? _renderList() {
33
-    return bannerList.value.map((item) => Container(
34
-      child: Center(
35
-          child: Image.network(item.thumb.toString(),
36
-              fit: BoxFit.cover, width: 350.w)),
37
-    )).toList();
38
-  }
39
-
40
-  @override
41
-  Widget builder (BuildContext context) {
42
-    return Container(
43
-      alignment: Alignment.center,
44
-      padding: EdgeInsets.fromLTRB(15.w, 0, 15.w, 0),
45
-      child: Column(
46
-        children: [
47
-          Container(
48
-            child: TypeHeader(
49
-              type: true,
50
-            ),
51
-          ),
52
-          Container(
53
-            margin: EdgeInsets.fromLTRB(0, 15, 0, 0),
54
-            child:
55
-                Obx(() => CarouselSlider(
56
-              items: _renderList(),
57
-              options: CarouselOptions(
58
-                autoPlay: true,
59
-                enlargeCenterPage: false, //图片中心放大
60
-                viewportFraction: 1, //每个页面应占据的视口部分。默认为 0.8,这意味着每个页面填充 80% 的轮播。
61
-                // aspectRatio: 1.6,//纵横比
62
-                height: 214.w,
63
-                initialPage: 1, //初始页
64
-              ),
65
-            )),
66
-          ),
67
-          Container(
68
-              margin: EdgeInsets.fromLTRB(0, 20, 0, 20),
69
-              child: Column(
70
-                children: [
71
-                  Row(
72
-                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
73
-                    children: [
74
-                      Container(
75
-                        child: Row(
76
-                          children: [
77
-                            Padding(
78
-                              padding: EdgeInsets.fromLTRB(0, 0, 8, 0),
79
-                              child: Image(
80
-                                image:
81
-                                    AssetImage('images/icons/carsListImga.png'),
82
-                                fit: BoxFit.cover,
83
-                                width: 20.w,
84
-                              ),
85
-                            ),
86
-                            Text(
87
-                              '农机列表',
88
-                              style: TextStyle(
89
-                                  color: Color(0xff222222),
90
-                                  fontSize: 20.sp,
91
-                                  fontWeight: FontWeight.bold),
92
-                            )
93
-                          ],
94
-                        ),
95
-                      ),
96
-                      Container(
97
-                        child: GestureDetector(
98
-                          child: Text('更多 >>'),
99
-                          onTap: () {
100
-                            print('点我进入农机搜索/更多页');
101
-                            Get.to(MoreCars());
102
-                          },
103
-                        ),
104
-                      )
105
-                    ],
106
-                  ),
107
-                  CarsCard(),
108
-                  CarsCard(),
109
-                  CarsCard(),
110
-                ],
111
-              )),
112
-        ],
113
-      ),
114
-    );
115
-  }
116
-}

+ 0
- 103
lib/pages/TabBar/widgets/home/widgets/headers.dart Näytä tiedosto

@@ -1,103 +0,0 @@
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
-}

+ 0
- 95
lib/pages/TabBar/widgets/main/index.dart Näytä tiedosto

@@ -1,95 +0,0 @@
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
-}

+ 0
- 161
lib/pages/TabBar/widgets/main/widgets/OtherColumn.dart Näytä tiedosto

@@ -1,161 +0,0 @@
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
-}

+ 0
- 99
lib/pages/TabBar/widgets/main/widgets/UserAddress.dart Näytä tiedosto

@@ -1,99 +0,0 @@
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
-}

+ 0
- 112
lib/pages/TabBar/widgets/main/widgets/UserInfo.dart Näytä tiedosto

@@ -1,112 +0,0 @@
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
-}

+ 0
- 61
lib/pages/TabBar/widgets/order/index.dart Näytä tiedosto

@@ -1,61 +0,0 @@
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
-}

+ 6
- 3
lib/pages/machinery/detail/index.dart Näytä tiedosto

@@ -7,26 +7,29 @@ import 'widgets/detail.dart';
7 7
 
8 8
 class MachineryDetailPage extends BasicPage {
9 9
   String markId = '';
10
+  String marKm = '';
10 11
   final machineryInfoContent = Rx<CardInfo>(CardInfo());//全部详情
11 12
   final machineryListBanner = Rx<List<BannerImageList>>([]);//banner轮播
12 13
   final machineryListContent= Rx<List<ContentImageList>>([]);//图文详情
13 14
   // 响应预约事件
14 15
   void handleClick() {
15
-    Get.toNamed('/orderConfirmation');
16
+    Get.toNamed('/orderConfirmation',arguments: {'item':machineryInfoContent.value});
16 17
   }
17 18
 
19
+
18 20
   @override
19 21
   void beforeShow() {
20 22
     // TODO: implement onMounted
21 23
     super.beforeShow();
22 24
     if (Get.arguments['id'] != null) {
23 25
      markId = Get.arguments['id'];
26
+     marKm = Get.arguments['km'];
27
+     print(marKm);
24 28
       getMachineryInfo(markId, '122.08400000000002,37.421998333333335', true).then((value) {
25 29
         machineryInfoContent.value=CardInfo.fromJson(value);
26 30
         machineryListBanner.value=machineryInfoContent.value.imagesList!;
27 31
         machineryListContent.value=machineryInfoContent.value.contentList!;
28 32
 
29
-        print('222222222222222222+$value');
30 33
       });
31 34
 
32 35
     }
@@ -43,6 +46,6 @@ class MachineryDetailPage extends BasicPage {
43 46
   @override
44 47
   Widget builder(BuildContext context) {
45 48
     naviTitle = "查看详情";
46
-    return Obx(()=>page(context: context, handleClick: handleClick,item:machineryInfoContent.value,bnnerItem:machineryListBanner.value,contentItem:machineryListContent.value));
49
+    return Obx(()=>page(context: context, handleClick: handleClick,km:marKm,item:machineryInfoContent.value,bnnerItem:machineryListBanner.value,contentItem:machineryListContent.value));
47 50
   }
48 51
 }

+ 4
- 18
lib/pages/machinery/detail/widgets/detail.dart Näytä tiedosto

@@ -11,23 +11,9 @@ import 'package:get/get.dart';
11 11
 import '../../../../models/entities/CardInfo.dart';
12 12
 import '../../widgets/summary.dart';
13 13
 
14
-Widget page({ required BuildContext context, VoidCallback? handleClick,required CardInfo item,required List<BannerImageList> bnnerItem,required List<ContentImageList> contentItem}) {
15
-  print('88888888888888+$item');
14
+Widget page({ required BuildContext context, VoidCallback? handleClick,required String km,required CardInfo item,required List<BannerImageList> bnnerItem,required List<ContentImageList> contentItem}) {
16 15
 
17 16
 
18
-
19
-  final img = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg';
20
-
21
-  final list = <ExtendContent>[
22
-    ExtendContent.simple(content: img, contentType: "image" ),
23
-    ExtendContent.simple(content: "有时,你可能想要创建一个水平滑动(而不是竖直滑动)的列表。 ListView widget 本身就支持水平列表的创建。我们将会使用标准的 ListView 构造方法,通过指定 scrollDirection 的值为水平方向,来覆盖默认的竖直方向。", contentType: "text" ),
24
-    ExtendContent.simple(content: img, contentType: "image" ),
25
-    ExtendContent.simple(content: "有时,你可能想要创建一个水平滑动(而不是竖直滑动)的列表。 ListView widget 本身就支持水平列表的创建。我们将会使用标准的 ListView 构造方法,通过指定 scrollDirection 的值为水平方向,来覆盖默认的竖直方向。", contentType: "text" ),
26
-    ExtendContent.simple(content: img, contentType: "image" ),
27
-    ExtendContent.simple(content: "有时,你可能想要创建一个水平滑动(而不是竖直滑动)的列表。 ListView widget 本身就支持水平列表的创建。我们将会使用标准的 ListView 构造方法,通过指定 scrollDirection 的值为水平方向,来覆盖默认的竖直方向。", contentType: "text" ),
28
-    ExtendContent.simple(content: img, contentType: "image" ),
29
-  ];
30
-
31 17
   return DefLayout(
32 18
       head: CarouselSlider(
33 19
         items: bnnerItem
@@ -50,16 +36,16 @@ Widget page({ required BuildContext context, VoidCallback? handleClick,required
50 36
         DefLayout.card(
51 37
           top: DefLayout.headHeight - DefLayout.offset,
52 38
           padding: EdgeInsets.only(top: 45.w, left: 15.w, right: 15.w, bottom: 20.w),
53
-          child: _content(context, handleClick,item,contentItem),
39
+          child: _content(context, handleClick,item,contentItem,km),
54 40
         )
55 41
       ]
56 42
   );
57 43
 }
58 44
 
59
-Widget _content(BuildContext context, VoidCallback? handleClick, CardInfo item,List<ContentImageList> contentItem) {
45
+Widget _content(BuildContext context, VoidCallback? handleClick, CardInfo item,List<ContentImageList> contentItem, String km) {
60 46
   return Column(
61 47
     children: [
62
-     summary(item: item),
48
+     summary(item: item,km:km),
63 49
       _sectionHead('农机详情'),
64 50
       ExtendContentList(item: contentItem,),
65 51
       SizedBox(height: 20.w,),

+ 17
- 2
lib/pages/machinery/map/index.dart Näytä tiedosto

@@ -4,8 +4,13 @@ import 'package:farmer_client/widgets/layout/BasicPage.dart';
4 4
 import 'package:flutter/material.dart';
5 5
 import 'package:get/get.dart';
6 6
 
7
-class MachineryMapPage extends BasicPage {
7
+import '../../../models/entities/CardInfo.dart';
8
+import '../../../services/homeAPI.dart';
8 9
 
10
+class MachineryMapPage extends BasicPage {
11
+  String markId = '';
12
+  String marKm = '';
13
+  final machineryInfoContent = Rx<CardInfo>(CardInfo());//全部详情
9 14
   // 响应预约事件
10 15
   void handleClick() {
11 16
     Get.toNamed("/machineryDetail");
@@ -15,6 +20,16 @@ class MachineryMapPage extends BasicPage {
15 20
   void beforeShow() {
16 21
     // TODO: implement onMounted
17 22
     super.beforeShow();
23
+    if (Get.arguments['id'] != null) {
24
+      markId = Get.arguments['id'];
25
+      marKm = Get.arguments['km'];
26
+      print(marKm);
27
+      getMachineryInfo(markId, '122.08400000000002,37.421998333333335', true).then((value) {
28
+        machineryInfoContent.value=CardInfo.fromJson(value);
29
+
30
+      });
31
+
32
+    }
18 33
     print("----show----map page--------------");
19 34
   }
20 35
 
@@ -28,7 +43,7 @@ class MachineryMapPage extends BasicPage {
28 43
   @override
29 44
   Widget builder(BuildContext context) {
30 45
     naviTitle = "查看地图";
31
-    return page(context: context, handleClick: handleClick);
46
+    return Obx(()=>page(context: context, handleClick: handleClick,item: machineryInfoContent.value,km: marKm));
32 47
   }
33 48
   
34 49
 }

+ 8
- 7
lib/pages/machinery/map/widgets/detail.dart Näytä tiedosto

@@ -7,16 +7,16 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
7 7
 import 'package:amap_flutter_base/amap_flutter_base.dart';
8 8
 import 'package:farmer_client/widgets/amap/amap.dart';
9 9
 
10
+import '../../../../models/entities/CardInfo.dart';
10 11
 import '../../widgets/summary.dart';
11 12
 
12
-Widget page({ required BuildContext context, VoidCallback? handleClick}) {
13
+Widget page({required CardInfo item,required String km, required BuildContext context, VoidCallback? handleClick}) {
13 14
   final _offset = 20.w;
14 15
   final width = MediaQuery.of(context).size.width;
15 16
   final mapHeight = 226.5.w;
16 17
   final cardHeight = 250.w;
17 18
 
18 19
 
19
-  final img = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon19.jpg';
20 20
   final LatLng position = LatLng(32.690712, 112.091892);
21 21
 
22 22
   return DefLayout(
@@ -25,21 +25,22 @@ Widget page({ required BuildContext context, VoidCallback? handleClick}) {
25 25
         DefLayout.card(
26 26
             top: DefLayout.headHeight - DefLayout.offset,
27 27
             height: DefLayout.headHeight,
28
-            child: Image.network(img, fit: BoxFit.cover)
28
+            child: Image.network(item.thumb.toString(), fit: BoxFit.cover)
29 29
         ),
30 30
         DefLayout.card(
31 31
             top: (DefLayout.headHeight - DefLayout.offset) * 2,
32 32
             padding: EdgeInsets.only(top: 45.w, left: 15.w, right: 15.w, bottom: 20.w),
33
-            child: _content(context, handleClick)
33
+            child: _content(context, handleClick,item,km)
34 34
         ),
35 35
       ]
36 36
   );
37 37
 }
38 38
 
39
-Widget _content(BuildContext context, VoidCallback? handleClick) {
40
-  return Column(
39
+Widget _content(BuildContext context, VoidCallback? handleClick,CardInfo item,String km) {
40
+  return
41
+    Column(
41 42
     children: [
42
-      // summary(),
43
+      summary(item: item,km:km),
43 44
       RoundButton(text: "预约", onPressed: handleClick,),
44 45
     ],
45 46
   );

+ 4
- 4
lib/pages/machinery/widgets/summary.dart Näytä tiedosto

@@ -6,13 +6,13 @@ import 'package:farmer_client/widgets/LinearGradientText.dart';
6 6
 
7 7
 import '../../../models/entities/CardInfo.dart';
8 8
 
9
-Widget summary({required CardInfo item}) {
9
+Widget summary({required CardInfo item,required String km}) {
10 10
 
11 11
   return Column(
12 12
     children: [
13 13
       _title(item: item),
14 14
       SizedBox(height: 20.w,),
15
-      _desc(item: item),
15
+      _desc(item: item,km: km),
16 16
       SizedBox(height: 20.w,),
17 17
       _detail(item: item),
18 18
       SizedBox(height: 20.w,),
@@ -70,13 +70,13 @@ Widget _title({required CardInfo item}) {
70 70
   );
71 71
 }
72 72
 
73
-Widget _desc({required CardInfo item}) {
73
+Widget _desc({required CardInfo item,required String km}) {
74 74
   return Row(
75 75
     children: [
76 76
       Icon(Icons.location_on_outlined, size: 16.sp,),
77 77
       Expanded(
78 78
         flex: 1,
79
-        child: Text("距离当前位置2.3公里 >>", style: TextStyle(color: const Color(0xFF222222), fontSize: 15.sp),),
79
+        child: Text("距离当前位置$km >>", style: TextStyle(color: const Color(0xFF222222), fontSize: 15.sp),),
80 80
       ),
81 81
     ],
82 82
   );

+ 32
- 21
lib/pages/orderInfo/index.dart Näytä tiedosto

@@ -122,33 +122,43 @@ class _BottomWidget extends StatelessWidget {
122 122
       child: Row(
123 123
         mainAxisAlignment: MainAxisAlignment.spaceBetween,
124 124
         children: [
125
-          GestureDetector(
126
-            onTap: () {
127
-              // onCancel();
128
-            },
129
-            child: Container(
130
-              width: 150.w,
131
-              height: 49.h,
132
-              decoration: BoxDecoration(
133
-                  color: const Color(0xffffffff),
134
-                  border: Border.all(
135
-                      color: const Color(0xFFFF703B),
136
-                      width: 1.w,
137
-                      style: BorderStyle.solid),
138
-                  borderRadius:
139
-                  BorderRadius.all(Radius.circular(24.5.w))),
140
-              child: Center(
141
-                child: Text(
142
-                  '取消',
125
+          Container(
126
+            width: 150.w,
127
+            height: 49.h,
128
+            margin: EdgeInsets.fromLTRB(0, 30.w, 0, 30.w),
129
+            alignment: Alignment.bottomCenter,
130
+            child: SizedBox(
131
+                  width: 150.w,
132
+                  height: 49.h,
133
+              child: ElevatedButton(
134
+                onPressed: () {
135
+                  Get.back();
136
+                },
137
+                child: const Text(
138
+                  "取消",
143 139
                   style: TextStyle(
144
-                      fontSize: 20.sp,
145
-                      color: const Color(0xFFFF703B),
140
+                      fontSize: 18,
141
+                      color: Color(0xFFFF703B),
146 142
                       fontWeight: FontWeight.bold),
147 143
                 ),
144
+                style: ButtonStyle(
145
+                  side: MaterialStateProperty.all(
146
+                      BorderSide(width: 1, color: Color(0xFFFF703B))), //边框
147
+                  elevation: MaterialStateProperty.all(0),
148
+                  backgroundColor: MaterialStateProperty.all(Colors.white),
149
+                  shape: MaterialStateProperty.all(
150
+                    RoundedRectangleBorder(
151
+                        borderRadius:
152
+                        BorderRadius.all(Radius.circular(24.4))),
153
+                  ),
154
+                ),
148 155
               ),
149 156
             ),
150 157
           ),
151
-          DefaultButton(
158
+      Container(
159
+        margin: EdgeInsets.fromLTRB(0, 30.w, 0, 30.w),
160
+        alignment: Alignment.bottomCenter,
161
+        child: DefaultButton(
152 162
             color: const Color(0xffffffff),
153 163
             backColor: const Color(0xFFFF703B),
154 164
             width: 150.w,
@@ -162,6 +172,7 @@ class _BottomWidget extends StatelessWidget {
162 172
             fontSize: 20.sp,
163 173
             radius: 24.5.w,
164 174
           ),
175
+      ),
165 176
         ],
166 177
       ),
167 178
     );

+ 0
- 87
lib/pages/search/index.jsx.dart Näytä tiedosto

@@ -1,87 +0,0 @@
1
-import 'package:farmer_client/widgets/NullCard.dart';
2
-import 'package:flutter/material.dart';
3
-import 'package:flutter_screenutil/flutter_screenutil.dart';
4
-import '../../widgets/CarsCard.dart';
5
-
6
-class SearchPage extends StatefulWidget {
7
-  const SearchPage({Key? key}) : super(key: key);
8
-
9
-  @override
10
-  State<SearchPage> createState() => _SearchPage();
11
-}
12
-
13
-class _SearchPage extends State<SearchPage> {
14
-  @override
15
-  Widget build(BuildContext context) {
16
-    return Scaffold(
17
-      resizeToAvoidBottomInset: false,
18
-      appBar: AppBar(
19
-        elevation: 0,
20
-        centerTitle: true,
21
-        backgroundColor: Colors.white,
22
-        title: Text(
23
-          '搜索',
24
-          style: TextStyle(
25
-              color: Colors.black,
26
-              fontSize: 17.sp,
27
-              letterSpacing: 2,
28
-              fontWeight: FontWeight.bold),
29
-        ),
30
-      ),
31
-      body: Container(
32
-          decoration: const BoxDecoration(
33
-            color: Colors.white,
34
-          ),
35
-          child: ListView(children: [
36
-            Container(
37
-              width: 345.w,
38
-              height: 34.h,
39
-              margin: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.w),
40
-              padding: EdgeInsets.symmetric(vertical: 0, horizontal: 10.w),
41
-              decoration: BoxDecoration(
42
-                  color: Color(0xFFf8f8f8),
43
-                  borderRadius: BorderRadius.all(Radius.circular(17.w))),
44
-              child: Row(
45
-                mainAxisAlignment: MainAxisAlignment.center,
46
-                children: [
47
-                  Image.asset(
48
-                    'images/icons/search.png',
49
-                    width: 15.w,
50
-                    height: 15.w,
51
-                  ),
52
-                  Container(
53
-                    width: 300.w,
54
-                    margin: EdgeInsets.fromLTRB(5.w, 0, 0, 0),
55
-                    child: TextField(
56
-                      style: TextStyle(fontSize: 14.sp),
57
-                      decoration: const InputDecoration(
58
-                        isCollapsed: true,
59
-                        hintText: '搜索关键字查询',
60
-                        border: InputBorder.none,
61
-                        counterText: '', //去掉计数
62
-                        floatingLabelBehavior: FloatingLabelBehavior.never,
63
-                      ),
64
-                      onChanged: (e) {
65
-                        print(999);
66
-                        setState(() {});
67
-                      },
68
-                    ),
69
-                  ),
70
-                ],
71
-              ),
72
-            ),
73
-            Container(
74
-              child: Column(
75
-                children: [
76
-                  // NullCard(text: '暂无农机信息'),
77
-                  CarsCard(),
78
-                  CarsCard(),
79
-                  CarsCard(),
80
-                  CarsCard(),
81
-                ],
82
-              ),
83
-            )
84
-          ])),
85
-    );
86
-  }
87
-}

+ 15
- 0
lib/services/orderAPI.dart Näytä tiedosto

@@ -33,3 +33,18 @@ Future orderInfo(String id)async{
33 33
 }
34 34
 
35 35
 
36
+/**
37
+ * 生成订单
38
+ * @param {*} data
39
+ * @returns
40
+ */
41
+
42
+Future generateOrder(item)async{
43
+  return request('/order',options: Options(method: 'POST'),data: item).catchError((error) =>
44
+  { Fluttertoast.showToast(
45
+      msg: error.error['message']
46
+  ),});
47
+
48
+}
49
+
50
+

+ 36
- 6
lib/widgets/CarsCard.dart Näytä tiedosto

@@ -20,9 +20,24 @@ class CarsCard extends StatefulWidget {
20 20
   _CarsCardPage createState() => _CarsCardPage(item);
21 21
 }
22 22
 
23
+
23 24
 class _CarsCardPage extends State<CarsCard> {
24 25
   final CardListModel item;
25 26
   _CarsCardPage(this.item);
27
+  setMorKm () {
28
+    String n = '';
29
+
30
+    if (item.distance !=null) {
31
+      if ((item.distance??0) >= 1000) {
32
+        n = ((item.distance??0) / 1000).toStringAsFixed(2).toString() + '公里';
33
+      } else {
34
+        n = item.distance.toString() + '米';
35
+      }
36
+    } else {
37
+      n = '0m';
38
+    }
39
+    return n;
40
+}
26 41
 
27 42
   @override
28 43
   Widget build(BuildContext context) {
@@ -37,7 +52,7 @@ class _CarsCardPage extends State<CarsCard> {
37 52
         children: [
38 53
           GestureDetector(
39 54
             onTap: () {
40
-              Get.to(MachineryDetailPage(),arguments: {'id':item.machineryId});
55
+              Get.to(MachineryDetailPage(),arguments: {'id':item.machineryId,'km':setMorKm().toString()});
41 56
             },
42 57
             child: Image.network(
43 58
               item.thumb.toString(),
@@ -155,11 +170,24 @@ class _CarsCardPage extends State<CarsCard> {
155 170
                       child: Row(
156 171
                         mainAxisAlignment: MainAxisAlignment.spaceBetween,
157 172
                         children: [
158
-                          Text(
159
-                            '距离当前位置2.6公里',
160
-                            style: TextStyle(
161
-                                fontSize: 15, fontWeight: FontWeight.bold),
173
+                          Container(
174
+                            child: Row(
175
+                              children: [
176
+                                Text(
177
+                                  '距离当前位置',
178
+                                  style: TextStyle(
179
+                                      fontSize: 15, fontWeight: FontWeight.bold),
180
+                                ),
181
+                                Text(
182
+                                  setMorKm().toString(),
183
+                                  style: TextStyle(
184
+                                      fontSize: 15, fontWeight: FontWeight.bold),
185
+                                ),
186
+
187
+                              ],
188
+                            ),
162 189
                           ),
190
+
163 191
                           GestureDetector(
164 192
                             child: Text(
165 193
                               '进入地图 >>',
@@ -169,7 +197,7 @@ class _CarsCardPage extends State<CarsCard> {
169 197
                             onTap: () {
170 198
                               print('进入地图');
171 199
                               Get.toNamed('/machineryMap',
172
-                                  arguments: {'machineryId': item.machineryId});
200
+                                  arguments: {'id':item.machineryId,'km':setMorKm().toString()});
173 201
                             },
174 202
                           )
175 203
                         ],
@@ -181,3 +209,5 @@ class _CarsCardPage extends State<CarsCard> {
181 209
     );
182 210
   }
183 211
 }
212
+
213
+

+ 2
- 12
lib/widgets/ExtendContentList.dart Näytä tiedosto

@@ -43,25 +43,15 @@ class ExtendContentList extends StatelessWidget {
43 43
       child:  Column(
44 44
         children:  item.map((item) {
45 45
           if (item.contentType != 'image') {
46
-
47 46
             return Container(
48 47
               padding: EdgeInsets.fromLTRB(0, 20, 0, 10),
49 48
               width: 344.w,
50
-              child: Text(
51
-                item.content.toString(),
52
-                style: TextStyle(fontSize: 14.sp),
53
-              ),
49
+              child: _text(item.content)
54 50
             );
55 51
           } else {
56 52
             return Container(
57 53
               padding: EdgeInsets.fromLTRB(0, 10, 0, 10),
58
-              child: Image(
59
-                image: NetworkImage(item.content.toString()),
60
-                width: 320.w,
61
-                height: 260.w,
62
-                fit: BoxFit.cover,
63
-              ),
64
-
54
+              child: _image(item.content),
65 55
             );
66 56
           }
67 57
         }).toList(),

+ 6
- 6
lib/widgets/OrderInfoCard.dart Näytä tiedosto

@@ -9,8 +9,8 @@ import 'LinearGradientText.dart';
9 9
 
10 10
 class OrderInfoCard extends StatelessWidget {
11 11
   final OrderInfoModel item;
12
-  final String orderStateText;
13
-  final Color orderStateColor;
12
+  final String? orderStateText;
13
+  final Color? orderStateColor;
14 14
 
15 15
  // final  DateTime timeNew=item.appointmentDate;
16 16
 
@@ -161,9 +161,9 @@ class OrderInfoCard extends StatelessWidget {
161 161
                                   fontSize: 16,
162 162
                                   fontWeight: FontWeight.bold)),
163 163
                           TextSpan(
164
-                              text: orderStateText,
164
+                              text: orderStateText??'未支付',
165 165
                               style: TextStyle(
166
-                                  color:orderStateColor,
166
+                                  color:orderStateColor??Colors.black,
167 167
                                   fontSize: 16,
168 168
                                   fontWeight: FontWeight.bold)),
169 169
                         ]),
@@ -213,9 +213,9 @@ class OrderInfoCard extends StatelessWidget {
213 213
                                           color: Color(0xff666666),
214 214
                                           fontSize: 16,
215 215
                                           fontWeight: FontWeight.bold)),
216
-                                  Text(orderStateText,
216
+                                  Text(orderStateText??'未支付',
217 217
                                       style: TextStyle(
218
-                                          color: orderStateColor,
218
+                                          color: orderStateColor??Colors.black,
219 219
                                           fontSize: 16,
220 220
                                           fontWeight: FontWeight.bold)),
221 221
                                 ],