Browse Source

Merge branch 'master' of http://git.ycjcjy.com/nanyang/worker_client

[baozhangchao] 3 years ago
parent
commit
51a642bf21

BIN
images/machinery/date.png View File


BIN
images/machinery/greenMachinery.png View File


BIN
images/machinery/mIcon.png View File


BIN
images/machinery/micon2.png View File


BIN
images/machinery/orangeMachinery.png View File


BIN
images/machinery/repairMachinery.png View File


+ 10
- 8
lib/models/app.dart View File

@@ -2,6 +2,7 @@
2 2
 import 'dart:io';
3 3
 
4 4
 import 'package:amap_flutter_location/amap_flutter_location.dart';
5
+import 'package:get_storage/get_storage.dart';
5 6
 import 'package:worker_client/services/user.dart';
6 7
 import '/models/entities/person.dart';
7 8
 import '/widgets/Modal.dart';
@@ -11,7 +12,7 @@ import '../utils/location.dart';
11 12
 class AppController extends GetxController {
12 13
   // 有了这句, 可以直接 AppController.t 调用
13 14
   static AppController t = Get.find();
14
-
15
+  GetStorage box = GetStorage();
15 16
   final user = Rx<Person>(Person());
16 17
   final location = Rxn<Map<String, Object>>();
17 18
   final testInt = 1.obs;
@@ -35,7 +36,6 @@ class AppController extends GetxController {
35 36
   @override
36 37
   void onInit() {
37 38
     super.onInit();
38
-
39 39
     //尝试获取 location
40 40
     requireLocation(onLocationChange).then((loc) {
41 41
       _location = loc;
@@ -49,12 +49,14 @@ class AppController extends GetxController {
49 49
       );
50 50
     });
51 51
 
52
-    // // 尝试获取一次人员信息
53
-    getCurrent().then((person) {
54
-      user(Person.fromJson(person));
55
-    }).catchError((e) {
56
-      print(e);
57
-    });
52
+    if(box.read('token')!=null) {
53
+      // 尝试获取一次人员信息
54
+      getCurrent().then((person) {
55
+        user(Person.fromJson(person));
56
+      }).catchError((e) {
57
+        print(e);
58
+      });
59
+    }
58 60
   }
59 61
 
60 62
   @override

+ 16
- 61
lib/models/entities/person.dart View File

@@ -1,59 +1,15 @@
1
-// class Person {
2
-//   String? personId;
3
-//   String? appId;
4
-//   String? openid;
5
-//   String? nickName;
6
-//   String? userName;
7
-//   String? avatar;
8
-//   int? sex;
9
-//   String? phone;
10
-//   String? userId;
11
-//   int? status;
12
-//   String? createDate;
13
-//
14
-//   Person();
15
-//
16
-//   Person.fromJson(Map<String, dynamic> json)
17
-//       : personId = json["personId"],
18
-//         appId = json["appId"],
19
-//         openid = json["openid"],
20
-//         nickName = json["nickName"],
21
-//         userName = json["userName"],
22
-//         avatar = json["avatar"],
23
-//         sex = json["sex"],
24
-//         phone = json["phone"],
25
-//         userId = json["userId"],
26
-//         status = json["status"],
27
-//         createDate = json["createDate"];
28
-//
29
-//   Map<String, dynamic> toJson() => {
30
-//         'personId': personId,
31
-//         'appId': appId,
32
-//         'openid': openid,
33
-//         'nickName': nickName,
34
-//         'userName': userName,
35
-//         'avatar': avatar,
36
-//         'sex': sex,
37
-//         'phone': phone,
38
-//         'userId': userId,
39
-//         'status': status,
40
-//         'createDate': createDate,
41
-//       };
42
-// }
43
-
44
-
45 1
 class Person {
46 2
   String? personId;
47 3
   String? appId;
48 4
   String? openid;
49 5
   String? nickName;
6
+  String? userName;
50 7
   String? avatar;
51 8
   num? sex;
52 9
   String? phone;
53 10
   String? userId;
54 11
   num? status;
55 12
   String? createDate;
56
-  String? identity;
57 13
   bool? isOrgManager;
58 14
 
59 15
   Person();
@@ -63,28 +19,27 @@ class Person {
63 19
         appId = json["appId"],
64 20
         openid = json["openid"],
65 21
         nickName = json["nickName"],
22
+        userName = json["userName"],
66 23
         avatar = json["avatar"],
67 24
         sex = json["sex"],
68 25
         phone = json["phone"],
69 26
         userId = json["userId"],
70 27
         status = json["status"],
71 28
         createDate = json["createDate"],
72
-        isOrgManager = json["isOrgManager"],
73
-        identity = json["identity"];
29
+        isOrgManager = json["isOrgManager"];
74 30
 
75 31
   Map<String, dynamic> toJson() => {
76
-    'personId': personId,
77
-    'appId': appId,
78
-    'openid': openid,
79
-    'nickName': nickName,
80
-    'avatar': avatar,
81
-    'sex': sex,
82
-    'phone': phone,
83
-    'userId': userId,
84
-    'status': status,
85
-    'createDate': createDate,
86
-    'isOrgManager': isOrgManager,
87
-    'identity': identity,
88
-
89
-  };
32
+        'personId': personId,
33
+        'appId': appId,
34
+        'openid': openid,
35
+        'nickName': nickName,
36
+        'userName': userName,
37
+        'avatar': avatar,
38
+        'sex': sex,
39
+        'phone': phone,
40
+        'userId': userId,
41
+        'status': status,
42
+        'createDate': createDate,
43
+        'isOrgManager': isOrgManager,
44
+      };
90 45
 }

+ 0
- 2
lib/pages/Login/index.dart View File

@@ -85,9 +85,7 @@ class _Login extends State<Login> {
85 85
             userInfo(Person.fromJson(res['person']));
86 86
             Fluttertoast.showToast(msg: '登录成功!');
87 87
             Get.offNamed('/home');
88
-            // print(userInfo);
89 88
           }).catchError((err) {
90
-            print(err);
91 89
             Fluttertoast.showToast(msg: err);
92 90
           });
93 91
         } else {

+ 11
- 4
lib/pages/home/index.dart View File

@@ -1,3 +1,5 @@
1
+import 'dart:math';
2
+
1 3
 import 'package:carousel_slider/carousel_slider.dart';
2 4
 import 'package:flutter/material.dart';
3 5
 import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -127,10 +129,15 @@ class Home extends BasicPage {
127 129
                               itemCount: 1,
128 130
                               itemBuilder:
129 131
                                   (BuildContext context, int position) {
130
-                                jobList([
131
-                                  ...jobList.value,
132
-                                  ...GetList(data.records)
133
-                                ]);
132
+                                if (jobList.value.isNotEmpty &&
133
+                                    jobList.value[0].jobId !=
134
+                                        GetList(data.records)[0].jobId) {
135
+                                  jobList([
136
+                                    ...jobList.value,
137
+                                    ...GetList(data.records)
138
+                                  ]);
139
+                                }
140
+
134 141
                                 return Obx(() {
135 142
                                   if (jobList.value != []) {
136 143
                                     return Column(

+ 2
- 0
lib/pages/index.dart View File

@@ -6,6 +6,8 @@ export 'main/index.dart';
6 6
 export 'jobDetail/index.dart';
7 7
 export 'orderDetail/index.dart';
8 8
 export 'machineryList/index.dart';
9
+export 'machineryDetail/index.dart';
10
+export 'machineryMap/index.dart';
9 11
 export 'bankList/index.dart';
10 12
 export 'addBankCard/index.dart';
11 13
 

+ 156
- 0
lib/pages/machineryDetail/index.dart View File

@@ -0,0 +1,156 @@
1
+import 'package:carousel_slider/carousel_slider.dart';
2
+import 'package:flutter/material.dart';
3
+import 'package:flutter_screenutil/flutter_screenutil.dart';
4
+import 'package:get/get.dart';
5
+import 'package:worker_client/models/entities/Machinery.dart';
6
+import 'package:worker_client/services/machinery.dart';
7
+import 'package:worker_client/widgets/Jianbian/index.dart';
8
+import 'package:worker_client/widgets/layout/BasicPage.dart';
9
+
10
+class MachineryDetail extends BasicPage {
11
+  MachineryDetail({Key? key}) : super(key: key) {
12
+    naviTitle = '查看详情';
13
+  }
14
+  final machinery = Rx<Machinery>(Machinery());
15
+  @override
16
+  void beforeShow() {
17
+    // TODO: implement beforeShow
18
+    super.beforeShow();
19
+    if (Get.arguments != null) {
20
+      getMachineryDetail(Get.arguments['id'], {
21
+        'attached': true,
22
+        'location': '118.84002,31.95266'
23
+      }).then((res) => {machinery(Machinery.fromJson(res))});
24
+    }
25
+  }
26
+
27
+  @override
28
+  Widget builder(BuildContext context) {
29
+    return SizedBox(
30
+      width: 375.w,
31
+      child: ListView(
32
+        children: [
33
+          Obx(() => Stack(
34
+                children: [
35
+                  Positioned(
36
+                      top: 0,
37
+                      left: 0,
38
+                      child: SizedBox(
39
+                        width: 375.w,
40
+                        child: CarouselSlider(
41
+                          items: machinery.value.imagesList!
42
+                              .map((item) => Image.network(item.url.toString(),
43
+                                  fit: BoxFit.cover, width: 375.w))
44
+                              .toList(),
45
+                          options: CarouselOptions(
46
+                            autoPlay: true,
47
+                            enlargeCenterPage: false,
48
+                            //图片中心放大
49
+                            viewportFraction: 1,
50
+                            height: 187.5.w,
51
+                            initialPage: 1, //初始页
52
+                          ),
53
+                        ),
54
+                      )),
55
+                  Container(
56
+                      margin: EdgeInsets.only(top: 157.5.w),
57
+                      decoration: BoxDecoration(
58
+                          color: const Color(0xffffffff),
59
+                          borderRadius: BorderRadius.only(
60
+                              topLeft: Radius.circular(20.w),
61
+                              topRight: Radius.circular(20.w))),
62
+                      child: Column(
63
+                        children: [
64
+                          Container(
65
+                            height: 46.w,
66
+                            clipBehavior: Clip.hardEdge,
67
+                            decoration: BoxDecoration(
68
+                                borderRadius: BorderRadius.only(
69
+                                    topLeft: Radius.circular(20.w))),
70
+                            child: Stack(
71
+                              children: [
72
+                                Jianbian(
73
+                                  status: machinery.value.status,
74
+                                  type: 'machinery',
75
+                                  value: machinery.value.jobStatus,
76
+                                )
77
+                              ],
78
+                            ),
79
+                          ),
80
+                          Container(
81
+                            margin: EdgeInsets.only(
82
+                                top: 6.h, left: 15.w, right: 15.w),
83
+                            alignment: Alignment.centerLeft,
84
+                            child: Text(
85
+                              machinery.value.name.toString(),
86
+                              style: TextStyle(
87
+                                  fontSize: 18.sp,
88
+                                  fontWeight: FontWeight.bold,
89
+                                  color: const Color(0xff222222)),
90
+                            ),
91
+                          ),
92
+                          Container(
93
+                            margin: EdgeInsets.fromLTRB(15.w, 43.h, 15.w, 25.h),
94
+                            child: Row(
95
+                              mainAxisAlignment: MainAxisAlignment.center,
96
+                              children: [
97
+                                Image.asset(
98
+                                  'images/machinery/micon2.png',
99
+                                  width: 17.w,
100
+                                ),
101
+                                Container(
102
+                                  padding:
103
+                                      EdgeInsets.only(left: 15.w, right: 15.w),
104
+                                  child: Text(
105
+                                    '农机详情',
106
+                                    style: TextStyle(
107
+                                        color: const Color(0xff222222),
108
+                                        fontWeight: FontWeight.bold,
109
+                                        fontSize: 15.sp,
110
+                                        height: 1.2),
111
+                                  ),
112
+                                ),
113
+                                Image.asset(
114
+                                  'images/machinery/micon2.png',
115
+                                  width: 17.w,
116
+                                ),
117
+                              ],
118
+                            ),
119
+                          ),
120
+                          Container(
121
+                            margin: EdgeInsets.only(left: 15.w, right: 15.w),
122
+                            child: Column(
123
+                              children: machinery.value.contentList != null
124
+                                  ? machinery.value.contentList!.map((e) {
125
+                                      if (e.contentType == 'image') {
126
+                                        return Image.network(
127
+                                            e.content.toString(),
128
+                                            fit: BoxFit.cover,
129
+                                            width: 345.w);
130
+                                      } else {
131
+                                        return Container(
132
+                                          alignment: Alignment.centerLeft,
133
+                                          margin: EdgeInsets.only(
134
+                                              top: 15.h, bottom: 15.h),
135
+                                          child: Text(
136
+                                            e.content.toString(),
137
+                                            style: TextStyle(
138
+                                              fontSize: 15.sp,
139
+                                              color: const Color(0xff222222),
140
+                                            ),
141
+                                          ),
142
+                                        );
143
+                                      }
144
+                                    }).toList()
145
+                                  : [],
146
+                            ),
147
+                          )
148
+                        ],
149
+                      )),
150
+                ],
151
+              ))
152
+        ],
153
+      ),
154
+    );
155
+  }
156
+}

+ 21
- 9
lib/pages/machineryList/index.dart View File

@@ -21,20 +21,32 @@ class MachineryList extends BasicPage {
21 21
     });
22 22
   }
23 23
 
24
+  void goDetail(id) {
25
+    Get.toNamed('/machineryDetail', arguments: {'id': id});
26
+  }
27
+  void goMap(id) {
28
+    Get.toNamed('/machineryMap', arguments: {'id': id});
29
+  }
30
+
24 31
   @override
25 32
   Widget builder(BuildContext context) {
26
-    naviTitle = '我的';
33
+    naviTitle = '农机列表';
27 34
     return Container(
28 35
       padding: EdgeInsets.only(top: 15.w),
29
-      child: Obx(() => machineryList.value.length > 0
36
+      child: Obx(() => machineryList.value.isNotEmpty
30 37
           ? ListView(
31
-        children: machineryList.value
32
-            .map((e) =>
33
-            MachineryCard(machinery: e, goDetail: () {}, goMap: () {}))
34
-            .toList(),
35
-      )
38
+              children: machineryList.value
39
+                  .map((e) => MachineryCard(
40
+                      machinery: e,
41
+                      goDetail: () {
42
+                        goDetail(e.machineryId);
43
+                      },
44
+                      goMap: () {
45
+                        goMap(e.machineryId);
46
+                      }))
47
+                  .toList(),
48
+            )
36 49
           : const NullCard(text: '暂无更多农机')),
37
-    )
38
-      ;
50
+    );
39 51
   }
40 52
 }

+ 124
- 0
lib/pages/machineryMap/index.dart View File

@@ -0,0 +1,124 @@
1
+import 'package:flutter/cupertino.dart';
2
+import 'package:flutter/material.dart';
3
+import 'package:flutter_screenutil/flutter_screenutil.dart';
4
+import 'package:get/get.dart';
5
+import 'package:worker_client/models/entities/Machinery.dart';
6
+import 'package:worker_client/services/machinery.dart';
7
+import 'package:worker_client/widgets/layout/BasicPage.dart';
8
+
9
+class MachineryMap extends BasicPage {
10
+  MachineryMap({Key? key}) : super(key: key);
11
+  final machineryList = Rx<List<Machinery>>([]);
12
+  final machinery = Rx<Machinery>(Machinery());
13
+
14
+  @override
15
+  void beforeShow() {
16
+    // TODO: implement beforeShow
17
+    super.beforeShow();
18
+    if (Get.arguments != null) {
19
+      getMachineryDetail(Get.arguments['id'], {
20
+        'attached': true,
21
+        'location': '118.84002,31.95266'
22
+      }).then((res) => {machinery(Machinery.fromJson(res))});
23
+    }
24
+  }
25
+
26
+  void goBack() {
27
+    Get.back();
28
+  }
29
+  void goDetail() {
30
+    Get.toNamed('/machineryDetail',
31
+        arguments: {'id': machinery.value.machineryId});
32
+  }
33
+
34
+  @override
35
+  Widget builder(BuildContext context) {
36
+    naviTitle = '我的农机';
37
+    return Stack(
38
+      children: [
39
+        Container(
40
+          width: 375.w,
41
+          decoration: const BoxDecoration(color: Colors.greenAccent),
42
+        ),
43
+        Positioned(
44
+          bottom: 0,
45
+          child: Container(
46
+            width: 375.w,
47
+            padding: EdgeInsets.symmetric(horizontal: 15.w, vertical: 30.h),
48
+            decoration: BoxDecoration(
49
+                borderRadius: BorderRadius.only(
50
+                    topLeft: Radius.circular(20.w),
51
+                    topRight: Radius.circular(20.w)),
52
+                color: Colors.white),
53
+            child: Column(
54
+              crossAxisAlignment: CrossAxisAlignment.start,
55
+              children: [
56
+                GestureDetector(
57
+                  onTap: () {
58
+                    goBack();
59
+                  },
60
+                  child: Text(
61
+                    '<<农机列表',
62
+                    style: TextStyle(
63
+                        color: const Color(0xff666666),
64
+                        fontSize: 15.sp,
65
+                        fontWeight: FontWeight.bold),
66
+                  ),
67
+                ),
68
+                Container(
69
+                  margin: EdgeInsets.only(top: 30.h, bottom: 20.h),
70
+                  child: Row(
71
+                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
72
+                    children: [
73
+                      Text(
74
+                        '第一台收割机',
75
+                        style: TextStyle(
76
+                            color: const Color(0xff222222),
77
+                            fontSize: 18.sp,
78
+                            fontWeight: FontWeight.bold),
79
+                      ),
80
+                      GestureDetector(
81
+                        onTap: () {
82
+                          goDetail();
83
+                        },
84
+                        child: Text(
85
+                          '详情>>',
86
+                          style: TextStyle(
87
+                              color: const Color(0xff666666),
88
+                              fontSize: 15.sp,
89
+                              fontWeight: FontWeight.bold),
90
+                        ),
91
+                      )
92
+                    ],
93
+                  ),
94
+                ),
95
+                Row(
96
+                  children: [
97
+                    Container(
98
+                      margin: EdgeInsets.only(right: 8.w),
99
+                      child: Image.asset(
100
+                        'images/index/position.png',
101
+                        width: 17.w,
102
+                      ),
103
+                    ),
104
+                    Expanded(
105
+                      flex: 1,
106
+                      child: Text(
107
+                        '当前位置:  江苏省南京市南京南站城际空间站D2栋212南京云致科技服务有限公司',
108
+                        style: TextStyle(
109
+                          fontWeight: FontWeight.bold,
110
+                          fontSize: 15.sp,
111
+                          color: const Color(0xff222222),
112
+                        ),
113
+                      ),
114
+                    )
115
+                  ],
116
+                )
117
+              ],
118
+            ),
119
+          ),
120
+        )
121
+      ],
122
+    );
123
+  }
124
+}

+ 24
- 13
lib/pages/main/index.dart View File

@@ -32,21 +32,24 @@ class Main extends BasicPage {
32 32
     Get.toNamed('/machineryList');
33 33
   }
34 34
 
35
+  void goWallet() {
36
+    //钱包页面
37
+    // Get.toNamed('/bankList');
38
+  }
35 39
   void goBankPage() {
36
-    Get.toNamed('/bankList');
40
+    // if (store.user().isOrgManager==true) {
41
+      Get.toNamed('/bankList');
42
+    // }
37 43
   }
38 44
 
39 45
   @override
40 46
   Widget builder(BuildContext context) {
41
-    print(store.user);
42
-
43 47
     return Container(
44 48
       decoration: const BoxDecoration(color: Colors.white),
45 49
       child: ListView(
46 50
         children: [
47 51
           Stack(
48 52
             children: [
49
-              Obx(()=>
50 53
               Positioned(
51 54
                 top: 0,
52 55
                 child: Container(
@@ -64,10 +67,16 @@ class Main extends BasicPage {
64 67
                       Container(
65 68
                         margin: EdgeInsets.fromLTRB(40.w, 0, 10.w, 0),
66 69
                         child: store.user().avatar != null
67
-                            ? Image.network(
68
-                                store.user().avatar.toString(),
69
-                                width: 63.w,
70
-                                height: 63.w,
70
+                            ? Container(
71
+                                clipBehavior: Clip.hardEdge,
72
+                                decoration: BoxDecoration(
73
+                                    borderRadius: BorderRadius.all(
74
+                                        Radius.circular(31.5.w))),
75
+                                child: Image.network(
76
+                                  store.user().avatar.toString(),
77
+                                  width: 63.w,
78
+                                  height: 63.w,
79
+                                ),
71 80
                               )
72 81
                             : Image.asset(
73 82
                                 'images/main/defaultAvatar.png',
@@ -80,7 +89,9 @@ class Main extends BasicPage {
80 89
                         crossAxisAlignment: CrossAxisAlignment.start,
81 90
                         children: [
82 91
                           Text(
83
-                            store.user().nickName != null?store.user().nickName.toString():'',
92
+                            store.user().nickName != null
93
+                                ? store.user().nickName.toString()
94
+                                : '',
84 95
                             style: TextStyle(
85 96
                                 color: Colors.white,
86 97
                                 fontWeight: FontWeight.w500,
@@ -96,8 +107,9 @@ class Main extends BasicPage {
96 107
                           Container(
97 108
                             margin: EdgeInsets.fromLTRB(0, 19.h, 0, 0),
98 109
                             child: Text(
99
-                                store.user().nickName != null?
100
-                              store.user().phone.toString():'',
110
+                              store.user().nickName != null
111
+                                  ? store.user().phone.toString()
112
+                                  : '',
101 113
                               style: TextStyle(
102 114
                                   color: Colors.white,
103 115
                                   fontWeight: FontWeight.w500,
@@ -117,14 +129,13 @@ class Main extends BasicPage {
117 129
                   ),
118 130
                 ),
119 131
               ),
120
-              ),
121 132
               Positioned(
122 133
                 right: 0,
123 134
                 top: 0,
124 135
                 child: Container(
125 136
                   decoration: const BoxDecoration(color: Color(0xb2000000)),
126 137
                   child: Text(
127
-                    '该账号归${store.user().nickName!=null?store.user().nickName.toString():''}所属',
138
+                    '该账号归${store.user().userName != null ? store.user().nickName.toString() : ''}所属',
128 139
                     style: TextStyle(color: Colors.white, fontSize: 12.sp),
129 140
                   ),
130 141
                 ),

+ 2
- 0
lib/routes/pages.dart View File

@@ -17,6 +17,8 @@ List<GetPage> pages=[
17 17
   GetPage(name: '/jobDetail', page: () => JobDetail()),
18 18
   GetPage(name: '/orderDetail', page: () => OrderDetail()),
19 19
   GetPage(name: '/machineryList', page: () => MachineryList()),
20
+  GetPage(name: '/machineryDetail', page: () => MachineryDetail()),
21
+  GetPage(name: '/machineryMap', page: () => MachineryMap()),
20 22
   GetPage(name: '/bankList', page: () => BankListPages()),
21 23
   GetPage(name: '/addBankCard', page: () => AddBankPage()),
22 24
 ];

+ 8
- 7
lib/services/machinery.dart View File

@@ -7,17 +7,18 @@ import 'package:fluttertoast/fluttertoast.dart';
7 7
 /// @returns
8 8
 Future getMachineryList(params) async {
9 9
   return request('/machinery',
10
-      options: Options(method: 'GET'), queryParameters: params)
10
+          options: Options(method: 'GET'), queryParameters: params)
11 11
       .catchError((error) =>
12
-  {Fluttertoast.showToast(msg: error.error.toString()), print(error)});
12
+          {Fluttertoast.showToast(msg: error.error.toString()), print(error)});
13 13
 }
14 14
 
15 15
 /// 农机详情
16 16
 /// @param {*} data
17 17
 /// @returns
18
-Future getMachineryDetail(String id) async {
19
-  return request('/machinery-summary/$id', options: Options(method: 'GET'))
18
+Future getMachineryDetail(String id, params) async {
19
+  return request('/machinery-summary/$id',
20
+          options: Options(method: 'GET'), queryParameters: params)
20 21
       .catchError((error) => {
21
-    Fluttertoast.showToast(msg: error.error['message']),
22
-  });
23
-}
22
+            Fluttertoast.showToast(msg: error.error['message']),
23
+          });
24
+}

+ 3
- 2
lib/widgets/Jianbian/index.dart View File

@@ -4,12 +4,13 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
4 4
 import 'package:worker_client/widgets/MyCard/entities/ItemColor.dart';
5 5
 
6 6
 class Jianbian extends StatelessWidget {
7
-  Jianbian({Key? key,  this.type, required this.status, this.value})
7
+  Jianbian({Key? key, this.type, required this.status, this.value, this.ptop})
8 8
       : super(key: key);
9 9
 
10 10
   final String? type;
11 11
   final dynamic status;
12 12
   final dynamic? value;
13
+  final double? ptop;
13 14
 
14 15
   List<ItemColor> colors = [
15 16
     ItemColor(const Color(0xFFC7C7C7), const Color(0xFF8F8F8F),
@@ -56,7 +57,7 @@ class Jianbian extends StatelessWidget {
56 57
   @override
57 58
   Widget build(BuildContext context) {
58 59
     return Positioned(
59
-      top: -61.w,
60
+      top: ptop == null ? -61.w : ptop! - 61.w,
60 61
       left: -67.w,
61 62
       child: Transform.rotate(
62 63
         angle: pi / 6,

+ 7
- 8
lib/widgets/LoadMore.dart View File

@@ -1,4 +1,3 @@
1
-
2 1
 import 'package:flutter/widgets.dart';
3 2
 import '/models/entities/PagedResult.dart';
4 3
 
@@ -8,20 +7,20 @@ class LoadMore extends StatefulWidget {
8 7
     required this.builder,
9 8
     required this.fetch,
10 9
     this.onError,
11
-  }): super(key: key);
10
+  }) : super(key: key);
12 11
 
13 12
   Future Function(Map param) fetch;
14 13
   Function? onError;
15 14
 
16 15
   Widget Function({
17
-  required BuildContext context,
18
-  required ScrollController scrollController,
19
-  required PagedResult data,
20
-  required bool haveMore,
16
+    required BuildContext context,
17
+    required ScrollController scrollController,
18
+    required PagedResult data,
19
+    required bool haveMore,
21 20
   }) builder;
22 21
 
23 22
   @override
24
-  State<StatefulWidget> createState () => _LoadMoreState();
23
+  State<StatefulWidget> createState() => _LoadMoreState();
25 24
 }
26 25
 
27 26
 class _LoadMoreState extends State<LoadMore> {
@@ -53,7 +52,7 @@ class _LoadMoreState extends State<LoadMore> {
53 52
   Future fetchData() {
54 53
     final pageNum = result.current + 1;
55 54
     final pageSize = result.size == 0 ? 10 : result.size;
56
-    Map<String, dynamic> params = { "pageNum": pageNum, "pageSize": pageSize };
55
+    Map<String, dynamic> params = {"pageNum": pageNum, "pageSize": pageSize};
57 56
     return Future.value(widget.fetch(params).then((res) {
58 57
       setState(() {
59 58
         result = PagedResult.fromJson(res);

+ 77
- 77
pubspec.lock View File

@@ -5,175 +5,175 @@ packages:
5 5
     dependency: transitive
6 6
     description:
7 7
       name: _fe_analyzer_shared
8
-      url: "https://pub.dartlang.org"
8
+      url: "https://pub.flutter-io.cn"
9 9
     source: hosted
10 10
     version: "39.0.0"
11 11
   amap_flutter_base:
12 12
     dependency: transitive
13 13
     description:
14 14
       name: amap_flutter_base
15
-      url: "https://pub.dartlang.org"
15
+      url: "https://pub.flutter-io.cn"
16 16
     source: hosted
17 17
     version: "3.0.0"
18 18
   amap_flutter_location:
19 19
     dependency: "direct main"
20 20
     description:
21 21
       name: amap_flutter_location
22
-      url: "https://pub.dartlang.org"
22
+      url: "https://pub.flutter-io.cn"
23 23
     source: hosted
24 24
     version: "3.0.0"
25 25
   amap_flutter_map:
26 26
     dependency: "direct main"
27 27
     description:
28 28
       name: amap_flutter_map
29
-      url: "https://pub.dartlang.org"
29
+      url: "https://pub.flutter-io.cn"
30 30
     source: hosted
31 31
     version: "3.0.0"
32 32
   analyzer:
33 33
     dependency: transitive
34 34
     description:
35 35
       name: analyzer
36
-      url: "https://pub.dartlang.org"
36
+      url: "https://pub.flutter-io.cn"
37 37
     source: hosted
38 38
     version: "4.0.0"
39 39
   args:
40 40
     dependency: transitive
41 41
     description:
42 42
       name: args
43
-      url: "https://pub.dartlang.org"
43
+      url: "https://pub.flutter-io.cn"
44 44
     source: hosted
45 45
     version: "2.3.0"
46 46
   async:
47 47
     dependency: transitive
48 48
     description:
49 49
       name: async
50
-      url: "https://pub.dartlang.org"
50
+      url: "https://pub.flutter-io.cn"
51 51
     source: hosted
52 52
     version: "2.8.2"
53 53
   boolean_selector:
54 54
     dependency: transitive
55 55
     description:
56 56
       name: boolean_selector
57
-      url: "https://pub.dartlang.org"
57
+      url: "https://pub.flutter-io.cn"
58 58
     source: hosted
59 59
     version: "2.1.0"
60 60
   build:
61 61
     dependency: transitive
62 62
     description:
63 63
       name: build
64
-      url: "https://pub.dartlang.org"
64
+      url: "https://pub.flutter-io.cn"
65 65
     source: hosted
66 66
     version: "2.3.0"
67 67
   build_config:
68 68
     dependency: transitive
69 69
     description:
70 70
       name: build_config
71
-      url: "https://pub.dartlang.org"
71
+      url: "https://pub.flutter-io.cn"
72 72
     source: hosted
73 73
     version: "1.0.0"
74 74
   carousel_slider:
75 75
     dependency: "direct main"
76 76
     description:
77 77
       name: carousel_slider
78
-      url: "https://pub.dartlang.org"
78
+      url: "https://pub.flutter-io.cn"
79 79
     source: hosted
80 80
     version: "4.1.1"
81 81
   characters:
82 82
     dependency: transitive
83 83
     description:
84 84
       name: characters
85
-      url: "https://pub.dartlang.org"
85
+      url: "https://pub.flutter-io.cn"
86 86
     source: hosted
87 87
     version: "1.2.0"
88 88
   charcode:
89 89
     dependency: transitive
90 90
     description:
91 91
       name: charcode
92
-      url: "https://pub.dartlang.org"
92
+      url: "https://pub.flutter-io.cn"
93 93
     source: hosted
94 94
     version: "1.3.1"
95 95
   checked_yaml:
96 96
     dependency: transitive
97 97
     description:
98 98
       name: checked_yaml
99
-      url: "https://pub.dartlang.org"
99
+      url: "https://pub.flutter-io.cn"
100 100
     source: hosted
101 101
     version: "2.0.1"
102 102
   clock:
103 103
     dependency: transitive
104 104
     description:
105 105
       name: clock
106
-      url: "https://pub.dartlang.org"
106
+      url: "https://pub.flutter-io.cn"
107 107
     source: hosted
108 108
     version: "1.1.0"
109 109
   collection:
110 110
     dependency: transitive
111 111
     description:
112 112
       name: collection
113
-      url: "https://pub.dartlang.org"
113
+      url: "https://pub.flutter-io.cn"
114 114
     source: hosted
115 115
     version: "1.15.0"
116 116
   convert:
117 117
     dependency: transitive
118 118
     description:
119 119
       name: convert
120
-      url: "https://pub.dartlang.org"
120
+      url: "https://pub.flutter-io.cn"
121 121
     source: hosted
122 122
     version: "3.0.1"
123 123
   crypto:
124 124
     dependency: transitive
125 125
     description:
126 126
       name: crypto
127
-      url: "https://pub.dartlang.org"
127
+      url: "https://pub.flutter-io.cn"
128 128
     source: hosted
129 129
     version: "3.0.2"
130 130
   cupertino_icons:
131 131
     dependency: "direct main"
132 132
     description:
133 133
       name: cupertino_icons
134
-      url: "https://pub.dartlang.org"
134
+      url: "https://pub.flutter-io.cn"
135 135
     source: hosted
136 136
     version: "1.0.4"
137 137
   dart_style:
138 138
     dependency: transitive
139 139
     description:
140 140
       name: dart_style
141
-      url: "https://pub.dartlang.org"
141
+      url: "https://pub.flutter-io.cn"
142 142
     source: hosted
143 143
     version: "2.2.3"
144 144
   dio:
145 145
     dependency: "direct main"
146 146
     description:
147 147
       name: dio
148
-      url: "https://pub.dartlang.org"
148
+      url: "https://pub.flutter-io.cn"
149 149
     source: hosted
150 150
     version: "4.0.6"
151 151
   dotted_border:
152 152
     dependency: "direct main"
153 153
     description:
154 154
       name: dotted_border
155
-      url: "https://pub.dartlang.org"
155
+      url: "https://pub.flutter-io.cn"
156 156
     source: hosted
157 157
     version: "2.0.0+2"
158 158
   fake_async:
159 159
     dependency: transitive
160 160
     description:
161 161
       name: fake_async
162
-      url: "https://pub.dartlang.org"
162
+      url: "https://pub.flutter-io.cn"
163 163
     source: hosted
164 164
     version: "1.2.0"
165 165
   ffi:
166 166
     dependency: transitive
167 167
     description:
168 168
       name: ffi
169
-      url: "https://pub.dartlang.org"
169
+      url: "https://pub.flutter-io.cn"
170 170
     source: hosted
171 171
     version: "1.1.2"
172 172
   file:
173 173
     dependency: transitive
174 174
     description:
175 175
       name: file
176
-      url: "https://pub.dartlang.org"
176
+      url: "https://pub.flutter-io.cn"
177 177
     source: hosted
178 178
     version: "6.1.2"
179 179
   flutter:
@@ -185,7 +185,7 @@ packages:
185 185
     dependency: "direct dev"
186 186
     description:
187 187
       name: flutter_lints
188
-      url: "https://pub.dartlang.org"
188
+      url: "https://pub.flutter-io.cn"
189 189
     source: hosted
190 190
     version: "1.0.4"
191 191
   flutter_picker:
@@ -199,14 +199,14 @@ packages:
199 199
     dependency: transitive
200 200
     description:
201 201
       name: flutter_plugin_android_lifecycle
202
-      url: "https://pub.dartlang.org"
202
+      url: "https://pub.flutter-io.cn"
203 203
     source: hosted
204 204
     version: "2.0.5"
205 205
   flutter_screenutil:
206 206
     dependency: "direct main"
207 207
     description:
208 208
       name: flutter_screenutil
209
-      url: "https://pub.dartlang.org"
209
+      url: "https://pub.flutter-io.cn"
210 210
     source: hosted
211 211
     version: "5.5.2"
212 212
   flutter_test:
@@ -223,238 +223,238 @@ packages:
223 223
     dependency: "direct main"
224 224
     description:
225 225
       name: fluttertoast
226
-      url: "https://pub.dartlang.org"
226
+      url: "https://pub.flutter-io.cn"
227 227
     source: hosted
228 228
     version: "8.0.9"
229 229
   get:
230 230
     dependency: "direct main"
231 231
     description:
232 232
       name: get
233
-      url: "https://pub.dartlang.org"
233
+      url: "https://pub.flutter-io.cn"
234 234
     source: hosted
235 235
     version: "4.6.1"
236 236
   get_storage:
237 237
     dependency: "direct main"
238 238
     description:
239 239
       name: get_storage
240
-      url: "https://pub.dartlang.org"
240
+      url: "https://pub.flutter-io.cn"
241 241
     source: hosted
242 242
     version: "2.0.3"
243 243
   glob:
244 244
     dependency: transitive
245 245
     description:
246 246
       name: glob
247
-      url: "https://pub.dartlang.org"
247
+      url: "https://pub.flutter-io.cn"
248 248
     source: hosted
249 249
     version: "2.0.2"
250 250
   http_parser:
251 251
     dependency: transitive
252 252
     description:
253 253
       name: http_parser
254
-      url: "https://pub.dartlang.org"
254
+      url: "https://pub.flutter-io.cn"
255 255
     source: hosted
256 256
     version: "4.0.0"
257 257
   js:
258 258
     dependency: transitive
259 259
     description:
260 260
       name: js
261
-      url: "https://pub.dartlang.org"
261
+      url: "https://pub.flutter-io.cn"
262 262
     source: hosted
263 263
     version: "0.6.3"
264 264
   json_annotation:
265 265
     dependency: transitive
266 266
     description:
267 267
       name: json_annotation
268
-      url: "https://pub.dartlang.org"
268
+      url: "https://pub.flutter-io.cn"
269 269
     source: hosted
270 270
     version: "4.5.0"
271 271
   json_serializable:
272 272
     dependency: "direct main"
273 273
     description:
274 274
       name: json_serializable
275
-      url: "https://pub.dartlang.org"
275
+      url: "https://pub.flutter-io.cn"
276 276
     source: hosted
277 277
     version: "6.2.0"
278 278
   lints:
279 279
     dependency: transitive
280 280
     description:
281 281
       name: lints
282
-      url: "https://pub.dartlang.org"
282
+      url: "https://pub.flutter-io.cn"
283 283
     source: hosted
284 284
     version: "1.0.1"
285 285
   logging:
286 286
     dependency: transitive
287 287
     description:
288 288
       name: logging
289
-      url: "https://pub.dartlang.org"
289
+      url: "https://pub.flutter-io.cn"
290 290
     source: hosted
291 291
     version: "1.0.2"
292 292
   matcher:
293 293
     dependency: transitive
294 294
     description:
295 295
       name: matcher
296
-      url: "https://pub.dartlang.org"
296
+      url: "https://pub.flutter-io.cn"
297 297
     source: hosted
298 298
     version: "0.12.11"
299 299
   material_color_utilities:
300 300
     dependency: transitive
301 301
     description:
302 302
       name: material_color_utilities
303
-      url: "https://pub.dartlang.org"
303
+      url: "https://pub.flutter-io.cn"
304 304
     source: hosted
305 305
     version: "0.1.3"
306 306
   meta:
307 307
     dependency: transitive
308 308
     description:
309 309
       name: meta
310
-      url: "https://pub.dartlang.org"
310
+      url: "https://pub.flutter-io.cn"
311 311
     source: hosted
312 312
     version: "1.7.0"
313 313
   package_config:
314 314
     dependency: transitive
315 315
     description:
316 316
       name: package_config
317
-      url: "https://pub.dartlang.org"
317
+      url: "https://pub.flutter-io.cn"
318 318
     source: hosted
319 319
     version: "2.0.2"
320 320
   path:
321 321
     dependency: transitive
322 322
     description:
323 323
       name: path
324
-      url: "https://pub.dartlang.org"
324
+      url: "https://pub.flutter-io.cn"
325 325
     source: hosted
326 326
     version: "1.8.0"
327 327
   path_drawing:
328 328
     dependency: transitive
329 329
     description:
330 330
       name: path_drawing
331
-      url: "https://pub.dartlang.org"
331
+      url: "https://pub.flutter-io.cn"
332 332
     source: hosted
333 333
     version: "1.0.0"
334 334
   path_parsing:
335 335
     dependency: transitive
336 336
     description:
337 337
       name: path_parsing
338
-      url: "https://pub.dartlang.org"
338
+      url: "https://pub.flutter-io.cn"
339 339
     source: hosted
340 340
     version: "1.0.0"
341 341
   path_provider:
342 342
     dependency: transitive
343 343
     description:
344 344
       name: path_provider
345
-      url: "https://pub.dartlang.org"
345
+      url: "https://pub.flutter-io.cn"
346 346
     source: hosted
347 347
     version: "2.0.9"
348 348
   path_provider_android:
349 349
     dependency: transitive
350 350
     description:
351 351
       name: path_provider_android
352
-      url: "https://pub.dartlang.org"
352
+      url: "https://pub.flutter-io.cn"
353 353
     source: hosted
354 354
     version: "2.0.13"
355 355
   path_provider_ios:
356 356
     dependency: transitive
357 357
     description:
358 358
       name: path_provider_ios
359
-      url: "https://pub.dartlang.org"
359
+      url: "https://pub.flutter-io.cn"
360 360
     source: hosted
361 361
     version: "2.0.8"
362 362
   path_provider_linux:
363 363
     dependency: transitive
364 364
     description:
365 365
       name: path_provider_linux
366
-      url: "https://pub.dartlang.org"
366
+      url: "https://pub.flutter-io.cn"
367 367
     source: hosted
368 368
     version: "2.1.5"
369 369
   path_provider_macos:
370 370
     dependency: transitive
371 371
     description:
372 372
       name: path_provider_macos
373
-      url: "https://pub.dartlang.org"
373
+      url: "https://pub.flutter-io.cn"
374 374
     source: hosted
375 375
     version: "2.0.5"
376 376
   path_provider_platform_interface:
377 377
     dependency: transitive
378 378
     description:
379 379
       name: path_provider_platform_interface
380
-      url: "https://pub.dartlang.org"
380
+      url: "https://pub.flutter-io.cn"
381 381
     source: hosted
382 382
     version: "2.0.3"
383 383
   path_provider_windows:
384 384
     dependency: transitive
385 385
     description:
386 386
       name: path_provider_windows
387
-      url: "https://pub.dartlang.org"
387
+      url: "https://pub.flutter-io.cn"
388 388
     source: hosted
389 389
     version: "2.0.5"
390 390
   permission_handler:
391 391
     dependency: "direct main"
392 392
     description:
393 393
       name: permission_handler
394
-      url: "https://pub.dartlang.org"
394
+      url: "https://pub.flutter-io.cn"
395 395
     source: hosted
396 396
     version: "9.2.0"
397 397
   permission_handler_android:
398 398
     dependency: transitive
399 399
     description:
400 400
       name: permission_handler_android
401
-      url: "https://pub.dartlang.org"
401
+      url: "https://pub.flutter-io.cn"
402 402
     source: hosted
403 403
     version: "9.0.2+1"
404 404
   permission_handler_apple:
405 405
     dependency: transitive
406 406
     description:
407 407
       name: permission_handler_apple
408
-      url: "https://pub.dartlang.org"
408
+      url: "https://pub.flutter-io.cn"
409 409
     source: hosted
410 410
     version: "9.0.4"
411 411
   permission_handler_platform_interface:
412 412
     dependency: transitive
413 413
     description:
414 414
       name: permission_handler_platform_interface
415
-      url: "https://pub.dartlang.org"
415
+      url: "https://pub.flutter-io.cn"
416 416
     source: hosted
417 417
     version: "3.7.0"
418 418
   permission_handler_windows:
419 419
     dependency: transitive
420 420
     description:
421 421
       name: permission_handler_windows
422
-      url: "https://pub.dartlang.org"
422
+      url: "https://pub.flutter-io.cn"
423 423
     source: hosted
424 424
     version: "0.1.0"
425 425
   platform:
426 426
     dependency: transitive
427 427
     description:
428 428
       name: platform
429
-      url: "https://pub.dartlang.org"
429
+      url: "https://pub.flutter-io.cn"
430 430
     source: hosted
431 431
     version: "3.1.0"
432 432
   plugin_platform_interface:
433 433
     dependency: transitive
434 434
     description:
435 435
       name: plugin_platform_interface
436
-      url: "https://pub.dartlang.org"
436
+      url: "https://pub.flutter-io.cn"
437 437
     source: hosted
438 438
     version: "2.1.2"
439 439
   process:
440 440
     dependency: transitive
441 441
     description:
442 442
       name: process
443
-      url: "https://pub.dartlang.org"
443
+      url: "https://pub.flutter-io.cn"
444 444
     source: hosted
445 445
     version: "4.2.4"
446 446
   pub_semver:
447 447
     dependency: transitive
448 448
     description:
449 449
       name: pub_semver
450
-      url: "https://pub.dartlang.org"
450
+      url: "https://pub.flutter-io.cn"
451 451
     source: hosted
452 452
     version: "2.1.1"
453 453
   pubspec_parse:
454 454
     dependency: transitive
455 455
     description:
456 456
       name: pubspec_parse
457
-      url: "https://pub.dartlang.org"
457
+      url: "https://pub.flutter-io.cn"
458 458
     source: hosted
459 459
     version: "1.2.0"
460 460
   sky_engine:
@@ -466,105 +466,105 @@ packages:
466 466
     dependency: transitive
467 467
     description:
468 468
       name: source_gen
469
-      url: "https://pub.dartlang.org"
469
+      url: "https://pub.flutter-io.cn"
470 470
     source: hosted
471 471
     version: "1.2.2"
472 472
   source_helper:
473 473
     dependency: transitive
474 474
     description:
475 475
       name: source_helper
476
-      url: "https://pub.dartlang.org"
476
+      url: "https://pub.flutter-io.cn"
477 477
     source: hosted
478 478
     version: "1.3.2"
479 479
   source_span:
480 480
     dependency: transitive
481 481
     description:
482 482
       name: source_span
483
-      url: "https://pub.dartlang.org"
483
+      url: "https://pub.flutter-io.cn"
484 484
     source: hosted
485 485
     version: "1.8.1"
486 486
   stack_trace:
487 487
     dependency: transitive
488 488
     description:
489 489
       name: stack_trace
490
-      url: "https://pub.dartlang.org"
490
+      url: "https://pub.flutter-io.cn"
491 491
     source: hosted
492 492
     version: "1.10.0"
493 493
   stream_channel:
494 494
     dependency: transitive
495 495
     description:
496 496
       name: stream_channel
497
-      url: "https://pub.dartlang.org"
497
+      url: "https://pub.flutter-io.cn"
498 498
     source: hosted
499 499
     version: "2.1.0"
500 500
   stream_transform:
501 501
     dependency: transitive
502 502
     description:
503 503
       name: stream_transform
504
-      url: "https://pub.dartlang.org"
504
+      url: "https://pub.flutter-io.cn"
505 505
     source: hosted
506 506
     version: "2.0.0"
507 507
   string_scanner:
508 508
     dependency: transitive
509 509
     description:
510 510
       name: string_scanner
511
-      url: "https://pub.dartlang.org"
511
+      url: "https://pub.flutter-io.cn"
512 512
     source: hosted
513 513
     version: "1.1.0"
514 514
   term_glyph:
515 515
     dependency: transitive
516 516
     description:
517 517
       name: term_glyph
518
-      url: "https://pub.dartlang.org"
518
+      url: "https://pub.flutter-io.cn"
519 519
     source: hosted
520 520
     version: "1.2.0"
521 521
   test_api:
522 522
     dependency: transitive
523 523
     description:
524 524
       name: test_api
525
-      url: "https://pub.dartlang.org"
525
+      url: "https://pub.flutter-io.cn"
526 526
     source: hosted
527 527
     version: "0.4.8"
528 528
   typed_data:
529 529
     dependency: transitive
530 530
     description:
531 531
       name: typed_data
532
-      url: "https://pub.dartlang.org"
532
+      url: "https://pub.flutter-io.cn"
533 533
     source: hosted
534 534
     version: "1.3.0"
535 535
   vector_math:
536 536
     dependency: transitive
537 537
     description:
538 538
       name: vector_math
539
-      url: "https://pub.dartlang.org"
539
+      url: "https://pub.flutter-io.cn"
540 540
     source: hosted
541 541
     version: "2.1.1"
542 542
   watcher:
543 543
     dependency: transitive
544 544
     description:
545 545
       name: watcher
546
-      url: "https://pub.dartlang.org"
546
+      url: "https://pub.flutter-io.cn"
547 547
     source: hosted
548 548
     version: "1.0.1"
549 549
   win32:
550 550
     dependency: transitive
551 551
     description:
552 552
       name: win32
553
-      url: "https://pub.dartlang.org"
553
+      url: "https://pub.flutter-io.cn"
554 554
     source: hosted
555 555
     version: "2.5.2"
556 556
   xdg_directories:
557 557
     dependency: transitive
558 558
     description:
559 559
       name: xdg_directories
560
-      url: "https://pub.dartlang.org"
560
+      url: "https://pub.flutter-io.cn"
561 561
     source: hosted
562 562
     version: "0.2.0+1"
563 563
   yaml:
564 564
     dependency: transitive
565 565
     description:
566 566
       name: yaml
567
-      url: "https://pub.dartlang.org"
567
+      url: "https://pub.flutter-io.cn"
568 568
     source: hosted
569 569
     version: "3.1.0"
570 570
 sdks:

+ 1
- 0
pubspec.yaml View File

@@ -76,6 +76,7 @@ flutter:
76 76
     - images/login/
77 77
     - images/index/
78 78
     - images/main/
79
+    - images/machinery/
79 80
   # To add assets to your application, add an assets section, like this:
80 81
   # assets:
81 82
   #   - images/a_dot_burr.jpeg