diff --git a/assets/icons/alarm_clock.png b/assets/icons/alarm_clock.png new file mode 100644 index 00000000..5eb641fa Binary files /dev/null and b/assets/icons/alarm_clock.png differ diff --git a/assets/icons/task_location.png b/assets/icons/task_location.png new file mode 100644 index 00000000..de56355a Binary files /dev/null and b/assets/icons/task_location.png differ diff --git a/lib/constants/application_objects.dart b/lib/constants/application_objects.dart index 940c6245..c1d51014 100644 --- a/lib/constants/application_objects.dart +++ b/lib/constants/application_objects.dart @@ -20,11 +20,11 @@ import 'package:aku_new_community/pages/service_browse/service_browse_page.dart' import 'package:aku_new_community/pages/services/old_age/old_age_support_page_simple.dart'; import 'package:aku_new_community/pages/setting_page/settings_page.dart'; import 'package:aku_new_community/pages/surrounding_enterprises/surrounding_enterprises_page.dart'; -import 'package:aku_new_community/pages/things_page/fixed_submit_page.dart'; import 'package:aku_new_community/pages/visitor_access_page/visitor_access_page.dart'; import 'package:aku_new_community/ui/community/activity/activity_list_page.dart'; import 'package:aku_new_community/ui/community/facility/facility_appointment_page.dart'; import 'package:aku_new_community/ui/function_and_service/task/task_page.dart'; +import 'package:aku_new_community/ui/function_and_service/work_order/work_order_page.dart'; import 'package:aku_new_community/ui/home/application/all_application.dart'; import 'package:aku_new_community/ui/manager/advice/advice_page.dart'; import 'package:aku_new_community/ui/manager/house_keeping/house_keeping_page.dart'; @@ -74,7 +74,7 @@ List 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)); + } +}