李志伟 3 年之前
父節點
當前提交
8dee938216

+ 44
- 0
lib/models/entities/ExtendContent.dart 查看文件

@@ -0,0 +1,44 @@
1
+
2
+class ExtendContent {
3
+  // 租户号
4
+  String? extId;
5
+
6
+  // 扩展对象类型;message消息表 bannar轮播图 info资讯
7
+  String? targetType;
8
+
9
+  // 拓展对象Id
10
+  String? targetId;
11
+
12
+  // 内容类型;text文本 image图片
13
+  String? contentType;
14
+
15
+  // 内容
16
+  String? content;
17
+
18
+  // 排序
19
+  int? sort;
20
+
21
+  // 创建时间
22
+  String? createDate;
23
+
24
+  ExtendContent();
25
+
26
+  ExtendContent.fromJson(Map<String, dynamic> json)
27
+      : extId = json["extId"],
28
+        targetType = json["targetType"],
29
+        targetId = json["targetId"],
30
+        contentType = json["contentType"],
31
+        content = json["content"],
32
+        sort = json["sort"],
33
+        createDate = json["createDate"];
34
+
35
+  Map<String, dynamic> toJson() => {
36
+    'extId' : extId,
37
+    'targetType' : targetType,
38
+    'targetId' : targetId,
39
+    'contentType' : contentType,
40
+    'content' : content,
41
+    'sort' : sort,
42
+    'createDate' : createDate,
43
+  };
44
+}

+ 116
- 0
lib/models/entities/Machinery.dart 查看文件

@@ -0,0 +1,116 @@
1
+import 'package:worker_client/models/entities/ExtendContent.dart';
2
+import 'package:worker_client/models/entities/MachineryImage.dart';
3
+
4
+class Machinery {
5
+  // APP 注册状态
6
+  String? appStatus;
7
+  //购买时间
8
+  String? buyDate;
9
+//  创建时间
10
+  String? createDate;
11
+//  创建用户
12
+  String? createUser;
13
+//  押金
14
+  int? deposit;
15
+//  工作状态
16
+  String? jobStatus;
17
+//  人工费
18
+  int? laborCost;
19
+//  当前位置
20
+  String? location;
21
+//  农机Id
22
+  String? machineryId;
23
+//  名称
24
+  String? name;
25
+//  机构ID
26
+  String? orgId;
27
+//  机构名称
28
+  String? orgName;
29
+//  农机价格
30
+  int? price;
31
+  //  归属区域id
32
+  String? regionId;
33
+  //  归属区域名
34
+  String? regionName;
35
+  //  状态
36
+  int? status;
37
+  //  主图
38
+  String? thumb;
39
+  //  农机类型
40
+  String? typeId;
41
+  //  类型名称
42
+  String? typeName;
43
+  //  更新时间
44
+  String? updateDate;
45
+  //  更新用户
46
+  String? updateUser;
47
+
48
+  //农机详情列表
49
+  List<ExtendContent>? contentList = [];
50
+
51
+  //农机banner图集
52
+  List<MachineryImage>? imagesList = [];
53
+
54
+  Machinery();
55
+
56
+  Machinery.fromJson(Map<String, dynamic> json)
57
+      : machineryId = json["machineryId"],
58
+        name = json["name"],
59
+        typeId = json["typeId"],
60
+        typeName = json["typeName"],
61
+        price = json["price"],
62
+        thumb = json["thumb"],
63
+        location = json["location"],
64
+        // distance=json["distance"],调度??
65
+        orgId = json["orgId"],
66
+        orgName = json["orgName"],
67
+        jobStatus = json["jobStatus"],
68
+        status = json["status"],
69
+        contentList = jsonToContentList(json["contentList"]),
70
+        imagesList = jsonToImagesList(json["imagesList"]);
71
+
72
+  Map<String, dynamic> toJson() => {
73
+        'machineryId': machineryId,
74
+        'name': name,
75
+        'typeId': typeId,
76
+        'typeName': typeName,
77
+        'price': price,
78
+        'thumb': thumb,
79
+        'location': location,
80
+        // 'distance':distance,
81
+        'orgId': orgId,
82
+        'orgName': orgName,
83
+        'jobStatus': jobStatus,
84
+        'status': status,
85
+        'contentList': ListTojson(contentList),
86
+        'imagesList': ListTojson(imagesList),
87
+      };
88
+}
89
+
90
+List<ExtendContent> jsonToContentList(list) {
91
+  List<ExtendContent> contList = [];
92
+  if (list!=null) {
93
+    list.forEach((item) {
94
+      contList.add(ExtendContent.fromJson(item));
95
+    });
96
+  }
97
+  return contList;
98
+}
99
+
100
+List<MachineryImage> jsonToImagesList(list) {
101
+  List<MachineryImage> contList = [];
102
+  if (list!=null) {
103
+    list.forEach((item) {
104
+      contList.add(MachineryImage.fromJson(item));
105
+    });
106
+  }
107
+  return contList;
108
+}
109
+
110
+List<Map<String, dynamic>> ListTojson(list) {
111
+  List<Map<String, dynamic>> contList = [];
112
+  list.forEach((item) {
113
+    contList.add(item.toJson());
114
+  });
115
+  return contList;
116
+}

+ 33
- 0
lib/models/entities/MachineryImage.dart 查看文件

@@ -0,0 +1,33 @@
1
+class MachineryImage {
2
+//  图片ID
3
+  String? imageId;
4
+//  状态
5
+  int? status;
6
+//  对象ID
7
+  String? targetId;
8
+//  所属对象
9
+  String? targetType;
10
+//  图片地址
11
+  String? url;
12
+//创建时间
13
+  String? createDate;
14
+
15
+  MachineryImage();
16
+
17
+  MachineryImage.fromJson(Map<String, dynamic> json)
18
+      : imageId = json["imageId"],
19
+        status = json["status"],
20
+        targetId = json["targetId"],
21
+        targetType = json["targetType"],
22
+        url = json["url"],
23
+        createDate = json["createDate"];
24
+
25
+  Map<String, dynamic> toJson() => {
26
+        'imageId': imageId,
27
+        'status': status,
28
+        'targetId': targetId,
29
+        'targetType': targetType,
30
+        'url': url,
31
+        'createDate': createDate,
32
+      };
33
+}

+ 15
- 13
lib/models/entities/person.dart 查看文件

@@ -1,9 +1,9 @@
1
-
2 1
 class Person {
3 2
   String? personId;
4 3
   String? appId;
5 4
   String? openid;
6 5
   String? nickName;
6
+  String? userName;
7 7
   String? avatar;
8 8
   int? sex;
9 9
   String? phone;
@@ -11,13 +11,14 @@ class Person {
11 11
   int? status;
12 12
   String? createDate;
13 13
 
14
-  Person ();
14
+  Person();
15 15
 
16 16
   Person.fromJson(Map<String, dynamic> json)
17 17
       : personId = json["personId"],
18 18
         appId = json["appId"],
19 19
         openid = json["openid"],
20 20
         nickName = json["nickName"],
21
+        userName = json["userName"],
21 22
         avatar = json["avatar"],
22 23
         sex = json["sex"],
23 24
         phone = json["phone"],
@@ -26,15 +27,16 @@ class Person {
26 27
         createDate = json["createDate"];
27 28
 
28 29
   Map<String, dynamic> toJson() => {
29
-    'personId' : personId,
30
-    'appId' : appId,
31
-    'openid' : openid,
32
-    'nickName' : nickName,
33
-    'avatar' : avatar,
34
-    'sex' : sex,
35
-    'phone' : phone,
36
-    'userId' : userId,
37
-    'status' : status,
38
-    'createDate' : createDate,
39
-  };
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
+      };
40 42
 }

+ 33
- 4
lib/pages/machineryList/index.dart 查看文件

@@ -1,11 +1,40 @@
1 1
 import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:get/get.dart';
4
+import 'package:worker_client/models/app.dart';
5
+import 'package:worker_client/models/entities/Machinery.dart';
6
+import 'package:worker_client/pages/machineryList/widgets/MachineryCard.dart';
7
+import 'package:worker_client/services/machinery.dart';
8
+import 'package:worker_client/widgets/NullCard.dart';
2 9
 import 'package:worker_client/widgets/layout/BasicPage.dart';
3 10
 
4
-class MachineryList extends BasicPage{
11
+class MachineryList extends BasicPage {
12
+  final machineryList = Rx<List<Machinery>>([]);
13
+  String? location = AppController.t.locationStr;
14
+  @override
15
+  void beforeShow() {
16
+    super.beforeShow();
17
+    getMachineryList({'pageNum': 1, 'location': location}).then((res) {
18
+      dynamic list = <Machinery>[];
19
+      res['records'].forEach((item) => {list.add(Machinery.fromJson(item))});
20
+      machineryList(list);
21
+    });
22
+  }
23
+
5 24
   @override
6 25
   Widget builder(BuildContext context) {
7 26
     naviTitle = '我的';
8
-    return const Text('农机列表');
27
+    return Container(
28
+      padding: EdgeInsets.only(top: 15.w),
29
+      child: Obx(() => machineryList.value.length > 0
30
+          ? ListView(
31
+        children: machineryList.value
32
+            .map((e) =>
33
+            MachineryCard(machinery: e, goDetail: () {}, goMap: () {}))
34
+            .toList(),
35
+      )
36
+          : const NullCard(text: '暂无更多农机')),
37
+    )
38
+      ;
9 39
   }
10
-
11
-}
40
+}

+ 89
- 0
lib/pages/machineryList/widgets/MachineryCard.dart 查看文件

@@ -0,0 +1,89 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+import 'package:worker_client/models/entities/Machinery.dart';
4
+
5
+import '../../../widgets/Jianbian/index.dart';
6
+
7
+class MachineryCard extends StatelessWidget {
8
+  final Machinery machinery;
9
+  final GestureTapCallback goDetail;
10
+  final GestureTapCallback goMap;
11
+
12
+  const MachineryCard(
13
+      {Key? key,
14
+      required this.machinery,
15
+      required this.goDetail,
16
+      required this.goMap})
17
+      : super(key: key);
18
+  @override
19
+  Widget build(BuildContext context) {
20
+    return Container(
21
+      margin: EdgeInsets.only(left:15.w,right: 15.w,bottom: 15.w),
22
+      clipBehavior: Clip.hardEdge,
23
+      decoration: BoxDecoration(
24
+          color: Colors.white,
25
+          borderRadius: BorderRadius.all(Radius.circular(20.w)),
26
+          boxShadow: [
27
+            BoxShadow(
28
+                color: const Color(0x14000000),
29
+                offset: const Offset(0, 0),
30
+                blurRadius: 22.w)
31
+          ]),
32
+      child: Stack(
33
+        children: [
34
+          Column(
35
+            children: [
36
+              GestureDetector(
37
+                onTap: goDetail,
38
+                child: Image.network(
39
+                  machinery.thumb.toString(),
40
+                  width: 345.w,
41
+                  height: 227.7.w,
42
+                  fit: BoxFit.fill,
43
+                ),
44
+              ),
45
+              Container(
46
+                padding: EdgeInsets.fromLTRB(14.w, 19.5.h, 14.w, 30.h),
47
+                child: Row(
48
+                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
49
+                  children: [
50
+                    SizedBox(
51
+                      width: 250.w,
52
+                      child: GestureDetector(
53
+                        onTap: goDetail,
54
+                        child: Text(
55
+                          machinery.name.toString(),
56
+                          softWrap: true,
57
+                          textAlign: TextAlign.left,
58
+                          overflow: TextOverflow.ellipsis,
59
+                          maxLines: 1,
60
+                          style: TextStyle(
61
+                            fontWeight: FontWeight.w700,
62
+                            fontSize: 18.sp,
63
+                            color: const Color(0xFF222222),
64
+                          ),
65
+                        ),
66
+                      ),
67
+                    ),
68
+                    GestureDetector(
69
+                      onTap: goMap,
70
+                      child: const Text(
71
+                        '进入地图>>',
72
+                        style: TextStyle(fontWeight: FontWeight.w700),
73
+                      ),
74
+                    )
75
+                  ],
76
+                ),
77
+              ),
78
+            ],
79
+          ),
80
+          Jianbian(
81
+            status: machinery.status,
82
+            type: 'machinery',
83
+            value: machinery.jobStatus,
84
+          ),
85
+        ],
86
+      ),
87
+    );
88
+  }
89
+}

+ 20
- 11
lib/pages/main/index.dart 查看文件

@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
2 2
 import 'package:flutter_screenutil/flutter_screenutil.dart';
3 3
 import 'package:get/get.dart';
4 4
 import 'package:get_storage/get_storage.dart';
5
+import 'package:worker_client/models/app.dart';
5 6
 import 'package:worker_client/widgets/GradientButton.dart';
6 7
 import 'package:worker_client/widgets/MyCell/index.dart';
7 8
 import 'package:worker_client/widgets/layout/BasicPage.dart';
@@ -12,7 +13,7 @@ class Main extends BasicPage {
12 13
     tabIndex = 2;
13 14
     naviTitle = '我的';
14 15
   }
15
-
16
+  var store = AppController.t;
16 17
   GetStorage box = GetStorage();
17 18
 
18 19
   void loginOut() {
@@ -26,7 +27,8 @@ class Main extends BasicPage {
26 27
         },
27 28
         onCancel: () => true);
28 29
   }
29
-  void goMachinery(){
30
+
31
+  void goMachinery() {
30 32
     Get.toNamed('/machineryList');
31 33
   }
32 34
 
@@ -54,18 +56,24 @@ class Main extends BasicPage {
54 56
                     children: [
55 57
                       Container(
56 58
                         margin: EdgeInsets.fromLTRB(40.w, 0, 10.w, 0),
57
-                        child: Image.asset(
58
-                          'images/main/defaultAvatar.png',
59
-                          width: 63.w,
60
-                          height: 63.w,
61
-                        ),
59
+                        child: store.user().avatar != null
60
+                            ? Image.network(
61
+                                store.user().avatar.toString(),
62
+                                width: 63.w,
63
+                                height: 63.w,
64
+                              )
65
+                            : Image.asset(
66
+                                'images/main/defaultAvatar.png',
67
+                                width: 63.w,
68
+                                height: 63.w,
69
+                              ),
62 70
                       ),
63 71
                       Column(
64 72
                         mainAxisAlignment: MainAxisAlignment.center,
65 73
                         crossAxisAlignment: CrossAxisAlignment.start,
66 74
                         children: [
67 75
                           Text(
68
-                            '姓名',
76
+                            store.user().nickName != null?store.user().nickName.toString():'',
69 77
                             style: TextStyle(
70 78
                                 color: Colors.white,
71 79
                                 fontWeight: FontWeight.w500,
@@ -81,7 +89,8 @@ class Main extends BasicPage {
81 89
                           Container(
82 90
                             margin: EdgeInsets.fromLTRB(0, 19.h, 0, 0),
83 91
                             child: Text(
84
-                              '手机号',
92
+                                store.user().nickName != null?
93
+                              store.user().phone.toString():'',
85 94
                               style: TextStyle(
86 95
                                   color: Colors.white,
87 96
                                   fontWeight: FontWeight.w500,
@@ -107,7 +116,7 @@ class Main extends BasicPage {
107 116
                 child: Container(
108 117
                   decoration: const BoxDecoration(color: Color(0xb2000000)),
109 118
                   child: Text(
110
-                    '该账号归。。。所属',
119
+                    '该账号归${store.user().nickName!=null?store.user().nickName.toString():''}所属',
111 120
                     style: TextStyle(color: Colors.white, fontSize: 12.sp),
112 121
                   ),
113 122
                 ),
@@ -131,7 +140,7 @@ class Main extends BasicPage {
131 140
                       mainAxisAlignment: MainAxisAlignment.spaceAround,
132 141
                       children: [
133 142
                         GestureDetector(
134
-                          onTap:(){
143
+                          onTap: () {
135 144
                             goMachinery();
136 145
                           },
137 146
                           child: Column(

+ 23
- 0
lib/services/machinery.dart 查看文件

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

+ 96
- 0
lib/widgets/Jianbian/index.dart 查看文件

@@ -0,0 +1,96 @@
1
+import 'dart:math';
2
+import 'package:flutter/material.dart';
3
+import 'package:flutter_screenutil/flutter_screenutil.dart';
4
+import 'package:worker_client/widgets/MyCard/entities/ItemColor.dart';
5
+
6
+class Jianbian extends StatelessWidget {
7
+  Jianbian({Key? key,  this.type, required this.status, this.value})
8
+      : super(key: key);
9
+
10
+  final String? type;
11
+  final dynamic status;
12
+  final dynamic? value;
13
+
14
+  List<ItemColor> colors = [
15
+    ItemColor(const Color(0xFFC7C7C7), const Color(0xFF8F8F8F),
16
+        const Color(0xFFC0C0C0)),
17
+    ItemColor(const Color(0xFFFFC937), const Color(0xFFFFAB8C),
18
+        const Color(0xFFFF703B)),
19
+    ItemColor(const Color(0xFF06B03B), const Color(0xFF00AE39),
20
+        const Color(0xFFA0E067)),
21
+  ];
22
+
23
+  String Title() {
24
+    return type == 'machinery'
25
+        ? (status == 0
26
+            ? '维修中'
27
+            : (value == null || value == 3)
28
+                ? '空闲中'
29
+                : '使用中')
30
+        : (status == 0
31
+            ? '待作业'
32
+            : status == 1 || status == 2
33
+                ? '进行中'
34
+                : status == 3
35
+                    ? '已完成'
36
+                    : '');
37
+  }
38
+
39
+  ItemColor CurrentColor() {
40
+    return type == 'machinery'
41
+        //是农机列表卡片??要改
42
+        ? (status == 0
43
+            ? colors[0]
44
+            : (value == null || value == 3)
45
+                ? colors[1]
46
+                : colors[2])
47
+        : (status == 0
48
+            ? colors[1]
49
+            : status == 1 || status == 2
50
+                ? colors[2]
51
+                : status == 3
52
+                    ? colors[0]
53
+                    : colors[0]);
54
+  }
55
+
56
+  @override
57
+  Widget build(BuildContext context) {
58
+    return Positioned(
59
+      top: -61.w,
60
+      left: -67.w,
61
+      child: Transform.rotate(
62
+        angle: pi / 6,
63
+        child: Container(
64
+          width: 112.5.w,
65
+          height: 108.5.w,
66
+          decoration: BoxDecoration(
67
+            borderRadius: BorderRadius.all(Radius.circular(68.5.w)),
68
+            border: Border.all(
69
+                width: 1.w,
70
+                color: CurrentColor().borderColor,
71
+                style: BorderStyle.solid),
72
+            gradient: LinearGradient(
73
+              colors: [
74
+                CurrentColor().rightColor,
75
+                CurrentColor().leftColor,
76
+              ],
77
+            ),
78
+          ),
79
+          child: Transform.rotate(
80
+            angle: -pi / 2.3,
81
+            child: Transform.translate(
82
+              offset: Offset(38.w, 85.w),
83
+              child: Text(
84
+                Title(),
85
+                style: TextStyle(
86
+                    fontSize: 14.sp,
87
+                    fontWeight: FontWeight.bold,
88
+                    color: const Color(0xffffffff)),
89
+              ),
90
+            ),
91
+          ),
92
+        ),
93
+      ),
94
+    );
95
+  }
96
+}

+ 3
- 98
lib/widgets/MyCard/index.dart 查看文件

@@ -2,6 +2,7 @@ import 'dart:math';
2 2
 import 'package:flutter/material.dart';
3 3
 import 'package:flutter_screenutil/flutter_screenutil.dart';
4 4
 import 'package:worker_client/models/entities/Job.dart';
5
+import 'package:worker_client/widgets/Jianbian/index.dart';
5 6
 import 'package:worker_client/widgets/MyButton/index.dart';
6 7
 import 'package:worker_client/widgets/MyCard/entities/ItemColor.dart';
7 8
 import 'package:worker_client/widgets/MyCard/widgets/CardCell.dart';
@@ -15,7 +16,7 @@ class MyCard extends StatelessWidget {
15 16
   final bool detail;
16 17
   final GestureTapCallback onClick;
17 18
   final GestureTapCallback? goDetail;
18
-  MyCard(
19
+  const MyCard(
19 20
       {Key? key,
20 21
       required this.item,
21 22
       this.type,
@@ -27,66 +28,6 @@ class MyCard extends StatelessWidget {
27 28
       this.goDetail})
28 29
       : super(key: key);
29 30
 
30
-  List<ItemColor> colors = [
31
-    ItemColor(const Color(0xFFC7C7C7), const Color(0xFF8F8F8F),
32
-        const Color(0xFFC0C0C0)),
33
-    ItemColor(const Color(0xFFFFC937), const Color(0xFFFFAB8C),
34
-        const Color(0xFFFF703B)),
35
-    ItemColor(const Color(0xFF06B03B), const Color(0xFF00AE39),
36
-        const Color(0xFFA0E067)),
37
-  ];
38
-
39
-  String Title() {
40
-    return type == 'machinery'
41
-        ? (item.status == 0
42
-            ? '维修中'
43
-            : (value != null || value == 3)
44
-                ? '空闲中'
45
-                : '使用中')
46
-        : (item is Job
47
-            ? (item.status == 0
48
-                ? '待作业'
49
-                : item.status == 1 || item.status == 2
50
-                    ? '进行中'
51
-                    : item.status == 3
52
-                        ? '已完成'
53
-                        : '')
54
-            : (item.workStatus == 0
55
-                ? '待作业'
56
-                : item.workStatus == 1 || item.workStatus == 2
57
-                    ? '进行中'
58
-                    : item.workStatus == 3
59
-                        ? '已完成'
60
-                        : ''));
61
-  }
62
-
63
-  ItemColor CurrentColor() {
64
-    return type == 'machinery'
65
-        //是农机列表卡片??要改
66
-        ? (item.status == 0
67
-            ? colors[0]
68
-            : (value != null || value == 3)
69
-                ? colors[1]
70
-                : colors[2])
71
-        : (item is Job
72
-            //作业列表卡片
73
-            ? (item.status == 0
74
-                ? colors[1]
75
-                : item.status == 1 || item.status == 2
76
-                    ? colors[2]
77
-                    : item.status == 3
78
-                        ? colors[0]
79
-                        : colors[0])
80
-            //订单列表卡片
81
-            : (item.workStatus == 0
82
-                ? colors[1]
83
-                : item.workStatus == 1 || item.workStatus == 2
84
-                    ? colors[2]
85
-                    : item.workStatus == 3
86
-                        ? colors[0]
87
-                        : colors[0]));
88
-  }
89
-
90 31
   @override
91 32
   Widget build(BuildContext context) {
92 33
     return Container(
@@ -105,43 +46,7 @@ class MyCard extends StatelessWidget {
105 46
       ),
106 47
       child: Stack(
107 48
         children: [
108
-          Positioned(
109
-            top: -61.w,
110
-            left: -67.w,
111
-            child: Transform.rotate(
112
-              angle: pi / 6,
113
-              child: Container(
114
-                width: 112.5.w,
115
-                height: 108.5.w,
116
-                decoration: BoxDecoration(
117
-                  borderRadius: BorderRadius.all(Radius.circular(68.5.w)),
118
-                  border: Border.all(
119
-                      width: 1.w,
120
-                      color: CurrentColor().borderColor,
121
-                      style: BorderStyle.solid),
122
-                  gradient: LinearGradient(
123
-                    colors: [
124
-                      CurrentColor().rightColor,
125
-                      CurrentColor().leftColor,
126
-                    ],
127
-                  ),
128
-                ),
129
-                child: Transform.rotate(
130
-                  angle: -pi / 2.3,
131
-                  child: Transform.translate(
132
-                    offset: Offset(38.w, 85.w),
133
-                    child: Text(
134
-                      Title(),
135
-                      style: TextStyle(
136
-                          fontSize: 14.sp,
137
-                          fontWeight: FontWeight.bold,
138
-                          color: const Color(0xffffffff)),
139
-                    ),
140
-                  ),
141
-                ),
142
-              ),
143
-            ),
144
-          ),
49
+          Jianbian(status: job?item.status:item.workStatus),
145 50
           Container(
146 51
             padding: EdgeInsets.all(20.w),
147 52
             child: Column(

+ 33
- 0
lib/widgets/NullCard.dart 查看文件

@@ -0,0 +1,33 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter_screenutil/flutter_screenutil.dart';
3
+
4
+class NullCard extends StatelessWidget {
5
+  final String text;
6
+  const NullCard({Key? key, required this.text}) : super(key: key);
7
+  @override
8
+  Widget build(BuildContext context) {
9
+    return Container(
10
+      width: 345.w,
11
+      padding: EdgeInsets.all(30.w),
12
+      alignment: Alignment.center,
13
+      child: Column(
14
+        children: [
15
+          Container(
16
+            margin: EdgeInsets.fromLTRB(0, 0, 0, 22.h),
17
+            child: Image.asset(
18
+              'images/noData.png',
19
+              width: 135.w,
20
+            ),
21
+          ),
22
+          Text(
23
+            text,
24
+            style: TextStyle(
25
+                fontSize: 17.sp, color: Color(0xFFb4b4b4)),
26
+          )
27
+        ],
28
+      ),
29
+    );
30
+  }
31
+
32
+
33
+}