From 075241dd86ce5ae59e30e8cca5c90f67200caf71 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Tue, 15 Mar 2022 18:40:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95=E9=A1=B5=20=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=9B=A2=E9=98=9F=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/icons/alarm_clock.png | Bin 0 -> 794 bytes assets/icons/task_location.png | Bin 0 -> 836 bytes lib/constants/application_objects.dart | 4 +- lib/gen/assets.gen.dart | 8 + lib/models/work_order/team_list_model.dart | 24 +++ lib/models/work_order/team_list_model.g.dart | 18 ++ lib/pages/home/home_page.dart | 2 +- .../work_order/all_order/all_order_view.dart | 15 ++ .../work_order/handling/handling_view.dart | 15 ++ .../has_received/has_received_view.dart | 15 ++ .../work_order/team_list_page.dart | 79 ++++++++ .../to_be_allocated/to_be_allocated_view.dart | 15 ++ .../to_be_confirm/to_be_confirm_view.dart | 15 ++ .../work_order/work_order_card.dart | 183 ++++++++++++++++++ .../work_order/work_order_detail_page.dart | 15 ++ .../work_order/work_order_page.dart | 63 ++++++ 16 files changed, 468 insertions(+), 3 deletions(-) create mode 100644 assets/icons/alarm_clock.png create mode 100644 assets/icons/task_location.png create mode 100644 lib/models/work_order/team_list_model.dart create mode 100644 lib/models/work_order/team_list_model.g.dart create mode 100644 lib/ui/function_and_service/work_order/all_order/all_order_view.dart create mode 100644 lib/ui/function_and_service/work_order/handling/handling_view.dart create mode 100644 lib/ui/function_and_service/work_order/has_received/has_received_view.dart create mode 100644 lib/ui/function_and_service/work_order/team_list_page.dart create mode 100644 lib/ui/function_and_service/work_order/to_be_allocated/to_be_allocated_view.dart create mode 100644 lib/ui/function_and_service/work_order/to_be_confirm/to_be_confirm_view.dart create mode 100644 lib/ui/function_and_service/work_order/work_order_card.dart create mode 100644 lib/ui/function_and_service/work_order/work_order_detail_page.dart create mode 100644 lib/ui/function_and_service/work_order/work_order_page.dart diff --git a/assets/icons/alarm_clock.png b/assets/icons/alarm_clock.png new file mode 100644 index 0000000000000000000000000000000000000000..5eb641fa1e6953cdae65f43157b5ea386dc3a7cb GIT binary patch literal 794 zcmV+#1LgdQP)`3B?CfddNYCPl%K3hu}Bx$pz&md?gn1tX(Nr|HOl$a`pyde4t5p4SJ;Q9p&)-~L|4f*EB7;2LPGDu!1Ln8lb-)6eig5;(JegveKZ=;e7W?^ zKf!L$2!1#4Y>jNU}V&FYQ1oGbZNjcfc>;&aVc4nrQe$|y}yO2J=ORf)5p^2;- z%Arw{z1i2+@spe*zyIb?q473{tL&^TXgp2mVYWKGdxq)x96$NaqlreVGE>9G%^ChW zu@KFQEHNL?LbSRPnJl4fWDC)AdRb5<%oizIGh~r5WAYGv<1K}q_dIh{(H88`J*#3v z^bLiodRq-yQ!$BCj^$~F?a-2txuS1mDBd+8TG28y$}MMwW(8G3@obD(g!e7xN3{oM zA=+{iaF%ykh`z+U$bMQe7NXg|=Jd9@k*$U-i|yVqjNNoNh-SMeXyGR$iz$7jLH(*h?P+y%9s^wiNzu%3o8^wzM2nYxA{)}H19;VW!C{U(;1eUj0K zrD)mnPM4d^wDeTYQjpQ|FP0;XC+A-#!Yz(!1qx0#6e##2Udw4kdVnW_WN9e}c#;ge z8u0=KL)KKQtW+?0KyxTJ7CDY>3s++q-m>WDQH|APg^jgM%AI@4>o|_%IF92uj^hmS Y2ncnFo$=}ti!Q8r$}C&e z{I;0Wyotq#c3+ZxPWC6+Rq_76WEa_Zt*6R$*fCXWxP|Bj`dnKk`(C`JIA&;!^6SEW zBs;;daEhk4TwzBnM01`EO%skvo6mW}Z_s%L#m#YhEvAs4&^?FVvU9px8^|bDn}=;a z4lQX7ZiF%e)7-Zzir0$Pew?ErX`~jY8r*oy1%|0w8ZFo9`zZ5fZAmM=MswY&RmWTO zy63!)$;Q!zTG84LsC54^fk)bC?mMOfd#M$z{WwL-sI8RtZSnaW!&GfIEktWKuqfL0 z?T^_ZZ9eBHYxDo$85wW#c;ItM8!1+@FNx}0lUv+QTwX!nntnxvi(80hLZOWe-Id!y z3gyjGGzCj%5Ke=a(2EcJ?l)9mA(|pyV0fzVGj_}rcc;W8f1e{fgAPZzs(5HsBWti- zJxp?KvTdUA76%Swf)<%Kkwj!$!Awu93x!sqDR>26q%>TOWkyEP=H=Rg*6R9}qB+`2 z_;3!x;=gqXxZF`$UXz_!m3o$V6#KdMGC)~WE-CaKjHiv)E{pXriwAKW;Ro?phcHVU zQ|}sLnXh4vmuMowkFeci9=h}=I0+`6qKOD+GIBhkJze<&j33x-;w@U>=7J-5GSG%X zKccI2y0Wi-A_#pIQ3gKmjP9C!ixwJmyDqx3RiqDsAP9mW2!bFuJpTceC7A^2H#ye; O0000 appObjects = [ AO('开门码', R.ASSETS_ICONS_FUNC_KMM_PNG, () => OpeningCodePage()), AO('访客邀请', R.ASSETS_ICONS_FUNC_FKYQ_PNG, () => VisitorAccessPage()), - AO('报事报修', R.ASSETS_ICONS_FUNC_BSBX_PNG, () => FixedSubmitPage()), + AO('报事报修', R.ASSETS_ICONS_FUNC_BSBX_PNG, () => WorkOrderPage()), AO('生活缴费', R.ASSETS_ICONS_FUNC_SHJF_PNG, () => LifePayChoosePage()), AO('业委会', R.ASSETS_ICONS_FUNC_YWH_PNG, () => IndustryCommitteePage()), AO('建议咨询', R.ASSETS_ICONS_FUNC_JYZX_PNG, diff --git a/lib/gen/assets.gen.dart b/lib/gen/assets.gen.dart index 51c56375..202cd77f 100644 --- a/lib/gen/assets.gen.dart +++ b/lib/gen/assets.gen.dart @@ -133,6 +133,10 @@ class $AssetsIconsGen { /// File path: assets/icons/alarm.png AssetGenImage get alarm => const AssetGenImage('assets/icons/alarm.png'); + /// File path: assets/icons/alarm_clock.png + AssetGenImage get alarmClock => + const AssetGenImage('assets/icons/alarm_clock.png'); + /// File path: assets/icons/alipay_round.png AssetGenImage get alipayRound => const AssetGenImage('assets/icons/alipay_round.png'); @@ -849,6 +853,10 @@ class $AssetsIconsGen { /// File path: assets/icons/tag.png AssetGenImage get tag => const AssetGenImage('assets/icons/tag.png'); + /// File path: assets/icons/task_location.png + AssetGenImage get taskLocation => + const AssetGenImage('assets/icons/task_location.png'); + /// File path: assets/icons/test_kingcion.png AssetGenImage get testKingcion => const AssetGenImage('assets/icons/test_kingcion.png'); diff --git a/lib/models/work_order/team_list_model.dart b/lib/models/work_order/team_list_model.dart new file mode 100644 index 00000000..a03b3252 --- /dev/null +++ b/lib/models/work_order/team_list_model.dart @@ -0,0 +1,24 @@ +import 'package:aku_new_community/model/common/img_model.dart'; +import 'package:json_annotation/json_annotation.dart'; + +part 'team_list_model.g.dart'; + +@JsonSerializable() +class TeamListModel { + final int id; + final String name; + final List imgs; + final String tel; + final String position; + + factory TeamListModel.fromJson(Map json) => + _$TeamListModelFromJson(json); + + const TeamListModel({ + required this.id, + required this.name, + required this.imgs, + required this.tel, + required this.position, + }); +} diff --git a/lib/models/work_order/team_list_model.g.dart b/lib/models/work_order/team_list_model.g.dart new file mode 100644 index 00000000..d526c0b8 --- /dev/null +++ b/lib/models/work_order/team_list_model.g.dart @@ -0,0 +1,18 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'team_list_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +TeamListModel _$TeamListModelFromJson(Map json) => + TeamListModel( + id: json['id'] as int, + name: json['name'] as String, + imgs: (json['imgs'] as List) + .map((e) => ImgModel.fromJson(e as Map)) + .toList(), + tel: json['tel'] as String, + position: json['position'] as String, + ); diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 4deff9a7..365072d7 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -599,7 +599,7 @@ class _HomePageState extends State padding: EdgeInsets.zero, onPressed: () { if (LoginUtil.isNotLogin) return; - if (!LoginUtil.haveRoom(ao.title)) return; + // if (!LoginUtil.haveRoom(ao.title)) return; if (ao.page == null) { BotToast.showText(text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5)); } else { diff --git a/lib/ui/function_and_service/work_order/all_order/all_order_view.dart b/lib/ui/function_and_service/work_order/all_order/all_order_view.dart new file mode 100644 index 00000000..3fa79438 --- /dev/null +++ b/lib/ui/function_and_service/work_order/all_order/all_order_view.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class AllOrderView extends StatefulWidget { + const AllOrderView({Key? key}) : super(key: key); + + @override + _AllOrderViewState createState() => _AllOrderViewState(); +} + +class _AllOrderViewState extends State { + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/lib/ui/function_and_service/work_order/handling/handling_view.dart b/lib/ui/function_and_service/work_order/handling/handling_view.dart new file mode 100644 index 00000000..c7804da1 --- /dev/null +++ b/lib/ui/function_and_service/work_order/handling/handling_view.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class HandlingView extends StatefulWidget { + const HandlingView({Key? key}) : super(key: key); + + @override + _HandlingViewState createState() => _HandlingViewState(); +} + +class _HandlingViewState extends State { + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/lib/ui/function_and_service/work_order/has_received/has_received_view.dart b/lib/ui/function_and_service/work_order/has_received/has_received_view.dart new file mode 100644 index 00000000..902e411f --- /dev/null +++ b/lib/ui/function_and_service/work_order/has_received/has_received_view.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class HasReceivedView extends StatefulWidget { + const HasReceivedView({Key? key}) : super(key: key); + + @override + _HasReceivedViewState createState() => _HasReceivedViewState(); +} + +class _HasReceivedViewState extends State { + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/lib/ui/function_and_service/work_order/team_list_page.dart b/lib/ui/function_and_service/work_order/team_list_page.dart new file mode 100644 index 00000000..7ba31fff --- /dev/null +++ b/lib/ui/function_and_service/work_order/team_list_page.dart @@ -0,0 +1,79 @@ +import 'package:aku_new_community/extensions/num_ext.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/models/work_order/team_list_model.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:url_launcher/url_launcher.dart'; +import 'package:velocity_x/src/extensions/string_ext.dart'; + +class TeamListPage extends StatefulWidget { + const TeamListPage({Key? key}) : super(key: key); + + @override + _TeamListPageState createState() => _TeamListPageState(); +} + +class _TeamListPageState extends State { + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '服务团队名单', + body: ListView( + children: [ + _PositionTile('主负责人'), + ...[].map((e) => _personTile(e)).toList() + ], + ), + ); + } + + Widget _personTile(TeamListModel model) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 16.w), + width: double.infinity, + child: Row( + children: [ + CircleAvatar( + backgroundColor: Colors.red, + ), + 16.wb, + Column( + children: [ + model.name.text + .size(28.sp) + .color(Colors.black.withOpacity(0.85)) + .make(), + 8.hb, + model.position.text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ], + ), + Spacer(), + GestureDetector( + onTap: () async { + await launch('tel:${model.tel}'); + }, + child: Assets.icons.phone.image(width: 40.w, height: 40.w), + ) + ], + ), + ); + } + + Widget _PositionTile(String text) { + return Container( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 16.w), + width: double.infinity, + child: Text( + text, + style: TextStyle( + fontSize: 26.sp, + color: Colors.black.withOpacity(0.45), + ), + ), + ); + } +} diff --git a/lib/ui/function_and_service/work_order/to_be_allocated/to_be_allocated_view.dart b/lib/ui/function_and_service/work_order/to_be_allocated/to_be_allocated_view.dart new file mode 100644 index 00000000..13f5b4c4 --- /dev/null +++ b/lib/ui/function_and_service/work_order/to_be_allocated/to_be_allocated_view.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class ToBeAllocatedView extends StatefulWidget { + const ToBeAllocatedView({Key? key}) : super(key: key); + + @override + _ToBeAllocatedViewState createState() => _ToBeAllocatedViewState(); +} + +class _ToBeAllocatedViewState extends State { + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/lib/ui/function_and_service/work_order/to_be_confirm/to_be_confirm_view.dart b/lib/ui/function_and_service/work_order/to_be_confirm/to_be_confirm_view.dart new file mode 100644 index 00000000..d9001dfa --- /dev/null +++ b/lib/ui/function_and_service/work_order/to_be_confirm/to_be_confirm_view.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class ToBeConfirmView extends StatefulWidget { + const ToBeConfirmView({Key? key}) : super(key: key); + + @override + _ToBeConfirmViewState createState() => _ToBeConfirmViewState(); +} + +class _ToBeConfirmViewState extends State { + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/lib/ui/function_and_service/work_order/work_order_card.dart b/lib/ui/function_and_service/work_order/work_order_card.dart new file mode 100644 index 00000000..60842ec9 --- /dev/null +++ b/lib/ui/function_and_service/work_order/work_order_card.dart @@ -0,0 +1,183 @@ +import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/extensions/num_ext.dart'; +import 'package:aku_new_community/gen/assets.gen.dart'; +import 'package:aku_new_community/utils/bee_date_util.dart'; +import 'package:aku_new_community/widget/buttons/card_bottom_button.dart'; +import 'package:aku_new_community/widget/views/bee_hor_image_view.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/src/extensions/string_ext.dart'; + +class WorkOrderCard extends StatelessWidget { + const WorkOrderCard({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Stack( + children: [ + Positioned( + top: 9.35.w, + right: 0, + child: Container( + width: 160.w, + height: 60.w, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.bottomLeft, + end: Alignment.topRight, + colors: [ + Color(0xFFFAC058), + Color(0xFFFFD589), + ]), + color: kPrimaryColor, + borderRadius: + BorderRadius.only(topRight: Radius.circular(12.w)), + ), + alignment: Alignment.center, + child: Text( + '已接单', + style: TextStyle( + fontSize: 26.sp, + color: Colors.black, + ), + ), + )), + ClipPath( + clipper: WorkOrderCardClip(), + child: Container( + padding: EdgeInsets.all(24.w), + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(12.w), + bottomLeft: Radius.circular(12.w), + bottomRight: Radius.circular(12.w)), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + padding: + EdgeInsets.symmetric(vertical: 8.w, horizontal: 16.w), + decoration: BoxDecoration( + color: Color(0xFFFFFBE6), + borderRadius: BorderRadius.circular(8.w), + ), + child: '家政服务' + .text + .size(24.sp) + .color(Color(0xFFD48806)) + .make(), + ), + ], + ), + 16.hb, + Row( + children: [ + Assets.icons.alarmClock.image(width: 40.w, height: 40.w), + 24.wb, + '2022.02.21 15:30' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ], + ), + 16.hb, + Row( + children: [ + Assets.icons.taskLocation.image(width: 40.w, height: 40.w), + 24.wb, + '绿城·碧桂园3好楼门外' + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + ], + ), + 60.hb, + 'xxxxxxxxxxxxxxxxxxxxxxxx' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.65)) + .make(), + 24.hb, + BeeHorImageView( + maxCount: 4, imgs: [], imgWidth: 146.w, imgHeight: 146.w), + 24.hb, + Row( + children: [ + BeeDateUtil(DateTime.now()) + .timeAgo + .text + .size(24.sp) + .color(Colors.black.withOpacity(0.45)) + .make(), + 280.wb, + CardBottomButton.yellow(text: '催促进度', onPressed: () {}), + 24.wb, + GestureDetector( + onTap: () {}, + child: Icon( + CupertinoIcons.ellipsis_vertical, + size: 40.w, + ), + ) + ], + ), + ], + ), + ), + ) + ], + ); + } +} + +class WorkOrderCardClip extends CustomClipper { + @override + bool shouldReclip(covariant CustomClipper oldClipper) { + return false; + } + + @override + Path getClip(Size size) { + Path path = Path(); + //第一段圆弧起始位置的横坐标 + double asx = 531.w; + //第一段圆弧终点位置横坐标 + double aex = 542.46.w; + //第一段圆弧终点位置纵坐标 + double aey = 9.34.w; + + //第一段圆弧控制点位置横坐标 + double acx = 540.w; + + //第二段圆弧起始点位置横坐标 + double bsx = 558.45.w; + //第二段圆弧起始点位置纵坐标 + double bsy = 58.88.w; + //第二段圆弧终点点位置横坐标 + double bex = 569.91.w; + //第二段圆弧终点位纵横坐标 + double bey = 67.35.w; + //第二段圆弧控制点位置横坐标 + double bcx = 561.06.w; + //第二段圆弧控制点位置纵坐标 + double bcy = 67.35.w; + path.lineTo(asx, 0); + path.quadraticBezierTo(acx, 0, aex, aey); + path.lineTo(bsx, bsy); + path.quadraticBezierTo(bcx, bcy, bex, bey); + path.lineTo(size.width, bey); + path.lineTo(size.width, size.height); + path.lineTo(0, size.height); + path.lineTo(0, 0); + path.close(); + return path; + } +} diff --git a/lib/ui/function_and_service/work_order/work_order_detail_page.dart b/lib/ui/function_and_service/work_order/work_order_detail_page.dart new file mode 100644 index 00000000..f6310e85 --- /dev/null +++ b/lib/ui/function_and_service/work_order/work_order_detail_page.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class WorkOrderDetailPage extends StatefulWidget { + const WorkOrderDetailPage({Key? key}) : super(key: key); + + @override + _WorkOrderDetailPageState createState() => _WorkOrderDetailPageState(); +} + +class _WorkOrderDetailPageState extends State { + @override + Widget build(BuildContext context) { + return Container(); + } +} diff --git a/lib/ui/function_and_service/work_order/work_order_page.dart b/lib/ui/function_and_service/work_order/work_order_page.dart new file mode 100644 index 00000000..c8f82985 --- /dev/null +++ b/lib/ui/function_and_service/work_order/work_order_page.dart @@ -0,0 +1,63 @@ +import 'package:aku_new_community/ui/function_and_service/work_order/work_order_card.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/tab_bar/bee_tab_bar.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class WorkOrderPage extends StatefulWidget { + const WorkOrderPage({Key? key}) : super(key: key); + + @override + _WorkOrderPageState createState() => _WorkOrderPageState(); +} + +class _WorkOrderPageState extends State + with SingleTickerProviderStateMixin { + List _tabs = ['全部', '待分配', '已接单', '处理中', '待确认']; + late TabController _tabController; + + @override + void initState() { + _tabController = TabController(length: _tabs.length, vsync: this); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '报事报修', + actions: [ + IconButton( + onPressed: () {}, + icon: Icon( + CupertinoIcons.question_circle, + size: 40.w, + )) + ], + appBarBottom: BeeTabBar( + tabs: _tabs, + controller: _tabController, + ), + body: TabBarView( + controller: _tabController, + children: + _tabs.mapIndexed((e, index) => _getOrderView(index)).toList()), + ); + } + + Widget _getOrderView(int index) { + return EasyRefresh( + child: ListView.separated( + padding: EdgeInsets.all(24.w), + itemBuilder: (context, index) { + return WorkOrderCard(); + }, + separatorBuilder: (context, index) { + return 24.w.heightBox; + }, + itemCount: 1)); + } +}