From 3ab174c27503eb3c1858ad3a68ec08bc449e23bf Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Tue, 13 Jul 2021 15:53:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=B6=E6=94=BF=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/application_objects.dart | 3 ++ .../house_keeping/house_keeping_page.dart | 53 +++++++++++++++++++ .../house_keeping/house_keeping_view.dart | 48 +++++++++++++++++ 3 files changed, 104 insertions(+) create mode 100644 lib/ui/manager/house_keeping/house_keeping_page.dart create mode 100644 lib/ui/manager/house_keeping/house_keeping_view.dart diff --git a/lib/constants/application_objects.dart b/lib/constants/application_objects.dart index 624be852..0088910f 100644 --- a/lib/constants/application_objects.dart +++ b/lib/constants/application_objects.dart @@ -1,5 +1,6 @@ // import 'package:aku_community/widget/bee_scaffold.dart'; +import 'package:aku_community/ui/manager/house_keeping/house_keeping_page.dart'; import 'package:flutter/material.dart'; import 'package:aku_community/const/resource.dart'; @@ -90,6 +91,7 @@ List appObjects = [ AO('电子商务', R.ASSETS_ICONS_COMMERC_PNG, () => ElectronicCommercPage()), AO('服务浏览', R.ASSETS_ICONS_SERVICE_PNG, () => ServiceBrowsePage()), AO('社区介绍', R.ASSETS_ICONS_INTRODUCE_PNG, () => CommunityIntroducePage()), + AO('家政服务', R.ASSETS_IMAGES_PLACEHOLDER_WEBP, () => HouseKeepingPage()), // AO( // '小区教育', // R.ASSETS_IMAGES_PLACEHOLDER_WEBP, @@ -173,6 +175,7 @@ List _smartManagerApp = [ '电子商务', '服务浏览', '社区介绍', + '家政服务' // '小区教育', // '健康运动', // '家政服务', diff --git a/lib/ui/manager/house_keeping/house_keeping_page.dart b/lib/ui/manager/house_keeping/house_keeping_page.dart new file mode 100644 index 00000000..3d16c500 --- /dev/null +++ b/lib/ui/manager/house_keeping/house_keeping_page.dart @@ -0,0 +1,53 @@ +import 'package:aku_community/ui/manager/house_keeping/add_house_keeping_page.dart'; +import 'package:aku_community/ui/manager/house_keeping/house_keeping_view.dart'; +import 'package:aku_community/widget/bee_scaffold.dart'; +import 'package:aku_community/widget/buttons/bottom_button.dart'; +import 'package:aku_community/widget/tab_bar/bee_tab_bar.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class HouseKeepingPage extends StatefulWidget { + HouseKeepingPage({Key? key}) : super(key: key); + + @override + _HouseKeepingPageState createState() => _HouseKeepingPageState(); +} + +class _HouseKeepingPageState extends State + with TickerProviderStateMixin { + List _tabs = ['全部', '待派单', '已派单', '处理中', '待支付', '待评价', '已完成']; + late TabController _controller; + @override + void initState() { + super.initState(); + _controller = TabController(length: _tabs.length, vsync: this); + } + + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '家政服务', + appBarBottom: BeeTabBar( + controller: _controller, + tabs: _tabs, + scrollable: true, + ), + body: TabBarView( + controller: _controller, + children: List.generate( + _tabs.length, + (index) => HouseKeepingView( + index: index, + ), + ), + ), + bottomNavi: BottomButton( + onPressed: () { + Get.to(() => AddHouseKeepingPage()); + }, + child: '新增'.text.size(32.sp).bold.black.make()), + ); + } +} diff --git a/lib/ui/manager/house_keeping/house_keeping_view.dart b/lib/ui/manager/house_keeping/house_keeping_view.dart new file mode 100644 index 00000000..a87e83e5 --- /dev/null +++ b/lib/ui/manager/house_keeping/house_keeping_view.dart @@ -0,0 +1,48 @@ +import 'package:aku_community/constants/api.dart'; +import 'package:aku_community/models/house_keeping/house_keeping_list_model.dart'; +import 'package:aku_community/pages/things_page/widget/bee_list_view.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; + +class HouseKeepingView extends StatefulWidget { + final int index; + HouseKeepingView({Key? key, required this.index}) : super(key: key); + + @override + _HouseKeepingViewState createState() => _HouseKeepingViewState(); +} + +class _HouseKeepingViewState extends State { + late EasyRefreshController _controller; + @override + void initState() { + super.initState(); + _controller = EasyRefreshController(); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BeeListView( + path: API.manager.houseKeepingList, + controller: _controller, + extraParams: { + "housekeepingStatus": widget.index == 0 ? null : widget.index + }, + convert: (models) { + return models.tableList!.map((e) => HouseKeepingListModel.fromJson(e)).toList(); + }, + builder: (items) { + return ListView( + children: [ + + ], + ); + }); + } +}