diff --git a/lib/const/api.dart b/lib/const/api.dart index 7137814..be7aa01 100644 --- a/lib/const/api.dart +++ b/lib/const/api.dart @@ -250,8 +250,26 @@ class _Manage { ///管家app 客户访谈管理:查询所有客户访谈信息 String get interviewList => '/user/interview/list'; - ///管家app 客户访谈管理:访谈回 + ///管家app 客户访谈管理:访谈回复 String get interviewFeedBack => '/user/interview/feedBack'; + + ///管家app 一键报警:添加管家app报警记录 + String get insertAlarmRecord => '/user/alarm/insertAlarmRecord'; + + ///管家app 家政服务:查询所有的家政服务信息 + String get houseKeepingList => '/user/housekeeping/list'; + + ///管家app 楼栋查询:查询所有楼栋id和name(管家app) + String get allBuilding => '/user/personalData/findAll'; + + ///管家app 单元查询:根据楼栋id查询对应的单元id和name(管家app) + String get allUnit => '/user/personalData/findByBuildingId'; + + ///管家app 单元查询:根据单元id查询对应的房产id和name(管家app) + String get allHous => '/user/personalData/findByBuildingUnitId'; + + ///管家app 家政服务管理:添加家政服务信息 + String get addHouseKeeping => '/user/housekeeping/insert'; } class _Upload { diff --git a/lib/models/manager/house_keeping/house_keeping_building_model.dart b/lib/models/manager/house_keeping/house_keeping_building_model.dart new file mode 100644 index 0000000..7636779 --- /dev/null +++ b/lib/models/manager/house_keeping/house_keeping_building_model.dart @@ -0,0 +1,21 @@ +class HouseKeepingBuildingModel { + int value; + String label; + + HouseKeepingBuildingModel({this.value, this.label}); + + HouseKeepingBuildingModel.fromJson(Map json) { + value = json['value']; + label = json['label']; + } + + Map toJson() { + final Map data = new Map(); + data['value'] = this.value; + data['label'] = this.label; + return data; + } + + factory HouseKeepingBuildingModel.init() => + HouseKeepingBuildingModel(value: -1, label: ''); +} diff --git a/lib/models/manager/house_keeping/house_keeping_list_model.dart b/lib/models/manager/house_keeping/house_keeping_list_model.dart new file mode 100644 index 0000000..a3da86a --- /dev/null +++ b/lib/models/manager/house_keeping/house_keeping_list_model.dart @@ -0,0 +1,44 @@ +class HouseKeepingListModel { + int id; + String roomName; + int num; + String leaderName; + String leaderTel; + String content; + String createName; + String createDate; + + HouseKeepingListModel( + {this.id, + this.roomName, + this.num, + this.leaderName, + this.leaderTel, + this.content, + this.createName, + this.createDate}); + + HouseKeepingListModel.fromJson(Map json) { + id = json['id']; + roomName = json['roomName']; + num = json['num']; + leaderName = json['leaderName']; + leaderTel = json['leaderTel']; + content = json['content']; + createName = json['createName']; + createDate = json['createDate']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['roomName'] = this.roomName; + data['num'] = this.num; + data['leaderName'] = this.leaderName; + data['leaderTel'] = this.leaderTel; + data['content'] = this.content; + data['createName'] = this.createName; + data['createDate'] = this.createDate; + return data; + } +} diff --git a/lib/ui/home/application/applications_page.dart b/lib/ui/home/application/applications_page.dart index b5a7883..ba26a2c 100644 --- a/lib/ui/home/application/applications_page.dart +++ b/lib/ui/home/application/applications_page.dart @@ -1,6 +1,7 @@ // Flutter imports: import 'package:aku_community_manager/ui/manage_pages/clock_in_out/clock_in_out_page.dart'; import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_select_page.dart'; +import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_page.dart'; import 'package:aku_community_manager/ui/manage_pages/interview/interview_page.dart'; import 'package:flutter/material.dart'; @@ -91,7 +92,8 @@ class _ApplicationPageState extends State AppApplication( '卫生管理', R.ASSETS_PLACEHOLDER_WEBP, () => HygienceManagePage()), AppApplication('考勤管理', R.ASSETS_PLACEHOLDER_WEBP, () => ClockInOutPage()), - AppApplication('访谈管理', R.ASSETS_PLACEHOLDER_WEBP, () => InterviewPage()) + AppApplication('访谈管理', R.ASSETS_PLACEHOLDER_WEBP, () => InterviewPage()), + AppApplication('家政服务', R.ASSETS_PLACEHOLDER_WEBP, () => HouseKeepingPage()), ]; @override diff --git a/lib/ui/home/search_workorder_page.dart b/lib/ui/home/search_workorder_page.dart index 23bf4be..a1bd866 100644 --- a/lib/ui/home/search_workorder_page.dart +++ b/lib/ui/home/search_workorder_page.dart @@ -1,6 +1,7 @@ // Flutter imports: import 'package:aku_community_manager/ui/manage_pages/clock_in_out/clock_in_out_page.dart'; import 'package:aku_community_manager/ui/manage_pages/facilities/facilities_select_page.dart'; +import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_page.dart'; import 'package:aku_community_manager/ui/manage_pages/interview/interview_page.dart'; import 'package:flutter/material.dart'; @@ -62,7 +63,8 @@ class _SearchWorkOrderpageState extends State { AppApplication( '卫生管理', R.ASSETS_PLACEHOLDER_WEBP, () => HygienceManagePage()), AppApplication('考勤管理', R.ASSETS_PLACEHOLDER_WEBP, () => ClockInOutPage()), - AppApplication('访谈管理', R.ASSETS_PLACEHOLDER_WEBP, () => InterviewPage()) + AppApplication('访谈管理', R.ASSETS_PLACEHOLDER_WEBP, () => InterviewPage()), + AppApplication('家政服务', R.ASSETS_PLACEHOLDER_WEBP, () => HouseKeepingPage()), ]; List _displayApps = []; diff --git a/lib/ui/manage_pages/house_keeping/house_keeping_add_page.dart b/lib/ui/manage_pages/house_keeping/house_keeping_add_page.dart new file mode 100644 index 0000000..5be7b8b --- /dev/null +++ b/lib/ui/manage_pages/house_keeping/house_keeping_add_page.dart @@ -0,0 +1,343 @@ +import 'package:aku_community_manager/const/api.dart'; +import 'package:aku_community_manager/models/manager/house_keeping/house_keeping_building_model.dart'; +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/tools/aku_divider.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart'; +import 'package:aku_community_manager/utils/network/base_model.dart'; +import 'package:aku_community_manager/utils/network/net_util.dart'; +import 'package:bot_toast/bot_toast.dart'; +import 'package:dio/dio.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart' hide Response; +import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart'; + +class HouseKeepingAddPage extends StatefulWidget { + HouseKeepingAddPage({Key key}) : super(key: key); + + @override + _HouseKeepingAddPageState createState() => _HouseKeepingAddPageState(); +} + +class _HouseKeepingAddPageState extends State { + HouseKeepingBuildingModel _buidling = HouseKeepingBuildingModel.init(); + HouseKeepingBuildingModel _united = HouseKeepingBuildingModel.init(); + HouseKeepingBuildingModel _houseProperty = HouseKeepingBuildingModel.init(); + TextEditingController _nameController; + TextEditingController _telController; + TextEditingController _numController; + TextEditingController _contentController; + @override + void initState() { + super.initState(); + _nameController = TextEditingController(); + _telController = TextEditingController(); + _numController = TextEditingController(); + _contentController = TextEditingController(); + } + + @override + void dispose() { + _nameController.dispose(); + _telController.dispose(); + _numController.dispose(); + _contentController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return AkuScaffold( + title: '添加', + body: ListView( + children: [ + 24.w.heightBox, + _slectEstate(), + 40.w.heightBox, + Container( + width: double.infinity, + decoration: BoxDecoration(color: Colors.white), + padding: EdgeInsets.all(32.w), + child: Column( + children: [ + _inputRowTile('负责人名称', _nameController), + _inputRowTile('负责人手机号', _telController), + _inputRowTile('人数', _numController), + _inputRowTile('内容', _contentController), + ].sepWidget(separate: 40.w.heightBox), + ), + ), + ], + ), + bottom: AkuBottomButton( + title: '立即提交', + onTap: () async { + await _submit(); + }, + ), + ); + } + + Future _submit() async { + BaseModel baseModel = await NetUtil().post( + API.manage.addHouseKeeping, + params: { + "estateId": _houseProperty.value, + "num": int.parse(_numController.text), + "leaderName": _nameController.text, + "leaderTel": _telController.text, + "content": _contentController.text, + }, + showMessage: true, + ); + if (baseModel.status) { + Get.back(); + } + } + + Widget _slectEstate() { + return Container( + width: double.infinity, + padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 24.w), + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(8.w)), + child: Column( + children: [ + _buildingslecet(), + 40.w.heightBox, + _uniteSelect(), + 40.w.heightBox, + _houseSelect() + ], + ), + ); + } + + _buildingslecet() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '选择楼栋'.text.size(32.sp).color(kTextPrimaryColor).bold.make(), + InkWell( + onTap: () async { + List _models = []; + + Response response = await NetUtil().dio.get( + API.manage.allBuilding, + ); + if (response.statusCode == 200) { + _models = (response.data as List) + .map((e) => HouseKeepingBuildingModel.fromJson(e)) + .toList(); + } + // showItemSheet( + // title: '选择楼栋', + // items: _models.map((e) => e.label).toList(), + // ); + await _showBottomSheet('选择楼栋', _models, onTap: (e) { + _buidling = e; + setState(() {}); + }); + }, + child: Column( + children: [ + 32.w.heightBox, + Row( + children: [ + _buidling.label.isEmptyOrNull + ? '请选择楼栋' + .text + .size(30.sp) + .color(kTextSubColor) + .bold + .make() + : _buidling.label.text + .size(28.sp) + .color(kTextPrimaryColor) + .make(), + Spacer() + ], + ).material(color: Colors.transparent), + ], + )), + 12.w.heightBox, + AkuDivider.horizontal(), + ], + ); + } + + _uniteSelect() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '选择单元'.text.size(32.sp).color(kTextPrimaryColor).bold.make(), + InkWell( + onTap: () async { + List _models = []; + + if (_buidling.value == -1) { + BotToast.showText(text: '请先选择楼栋!'); + return; + } + + Response response = await NetUtil().dio.get(API.manage.allUnit, + queryParameters: {"buildingId": _buidling.value}); + if (response.statusCode == 200) { + _models = (response.data as List) + .map((e) => HouseKeepingBuildingModel.fromJson(e)) + .toList(); + } + await _showBottomSheet('选择单元', _models, onTap: (e) { + _united = e; + setState(() {}); + }); + }, + child: Column( + children: [ + 32.w.heightBox, + Row( + children: [ + _united.label.isEmptyOrNull + ? '请选择单元' + .text + .size(30.sp) + .color(kTextSubColor) + .bold + .make() + : _united.label.text + .size(28.sp) + .color(kTextPrimaryColor) + .make(), + Spacer() + ], + ).material(color: Colors.transparent), + ], + )), + 12.w.heightBox, + AkuDivider.horizontal(), + ], + ); + } + + _houseSelect() { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + '选择房产'.text.size(32.sp).color(kTextPrimaryColor).bold.make(), + GestureDetector( + onTap: () async { + List _models = []; + + if (_united.value == -1) { + BotToast.showText(text: '请先选择单元!'); + return; + } + + Response response = await NetUtil().dio.get(API.manage.allHous, + queryParameters: {"unitId": _united.value}); + if (response.statusCode == 200) { + _models = (response.data as List) + .map((e) => HouseKeepingBuildingModel.fromJson(e)) + .toList(); + } + await _showBottomSheet('选择单元', _models, onTap: (e) { + _houseProperty = e; + setState(() {}); + }); + }, + child: Column( + children: [ + 32.w.heightBox, + Row( + children: [ + _houseProperty.label.isEmptyOrNull + ? '请选择房产' + .text + .size(30.sp) + .color(kTextSubColor) + .bold + .make() + : _houseProperty.label.text + .size(28.sp) + .color(kTextPrimaryColor) + .make(), + Spacer() + ], + ).material(color: Colors.transparent), + ], + )), + 12.w.heightBox, + AkuDivider.horizontal(), + ], + ); + } + + Future _showBottomSheet(String title, List models, + {Function(HouseKeepingBuildingModel model) onTap}) async { + await Get.bottomSheet( + CupertinoActionSheet( + title: title.text + .size(32.sp) + .bold + .color(kTextPrimaryColor) + .isIntrinsic + .make(), + actions: models + .map( + (e) => CupertinoActionSheetAction( + onPressed: () { + onTap(e); + Get.back(); + setState(() {}); + }, + child: e.label.text + .size(28.sp) + .color(kTextPrimaryColor) + .isIntrinsic + .make(), + ), + ) + .toList(), + ), + ); + } + + Widget _inputRowTile(String title, TextEditingController controller, + {String hintText, List formatters}) { + return Container( + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + title.text.size(28.sp).color(kTextPrimaryColor).make(), + 32.w.heightBox, + TextField( + inputFormatters: formatters, + controller: controller, + textAlign: TextAlign.start, + onChanged: (value) { + setState(() {}); + }, + decoration: InputDecoration( + hintText: hintText ?? '', + isDense: true, + contentPadding: EdgeInsets.zero, + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide(color: Color(0xFFE8E8E8), width: 2.w), + ), + ), + style: TextStyle( + fontSize: 36.sp, + fontWeight: FontWeight.bold, + color: kTextPrimaryColor, + ), + ), + ], + ), + ); + } +} diff --git a/lib/ui/manage_pages/house_keeping/house_keeping_card.dart b/lib/ui/manage_pages/house_keeping/house_keeping_card.dart new file mode 100644 index 0000000..7e67d81 --- /dev/null +++ b/lib/ui/manage_pages/house_keeping/house_keeping_card.dart @@ -0,0 +1,95 @@ +import 'package:aku_community_manager/models/manager/house_keeping/house_keeping_list_model.dart'; +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/tools/aku_divider.dart'; +import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_detail_page.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'; +import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart'; + +class HouseKeepingCard extends StatefulWidget { + final HouseKeepingListModel model; + HouseKeepingCard({Key key, this.model}) : super(key: key); + + @override + _HouseKeepingCardState createState() => _HouseKeepingCardState(); +} + +class _HouseKeepingCardState extends State { + @override + Widget build(BuildContext context) { + return MaterialButton( + minWidth: double.infinity, + color: Colors.white, + shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)), + elevation: 0, + padding: EdgeInsets.all(24.w), + onPressed: () { + Get.to(() => HouseKeepingDetailPage(model:widget.model)); + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + '家政服务'.text.size(32.sp).color(kTextPrimaryColor).bold.make(), + Spacer(), + ], + ), + 16.w.heightBox, + AkuDivider.horizontal(), + 24.w.heightBox, + ...[ + _rowTile( + R.ASSETS_MANAGE_IC_RENWU_PNG, + '房产名称', + widget.model.roomName.text + .size(24.sp) + .color(kTextSubColor) + .make()), + _rowTile( + R.ASSETS_MANAGE_IC_RENWU_PNG, + '人数', + widget.model.num + .toString() + .text + .size(24.sp) + .color(kTextSubColor) + .make()), + _rowTile( + R.ASSETS_MANAGE_IC_RENWU_PNG, + '负责人姓名', + widget.model.leaderName.text + .size(24.sp) + .color(kTextSubColor) + .make()), + _rowTile( + R.ASSETS_MESSAGE_IC_PHONE_PNG, + '负责人手机', + widget.model.leaderTel.text + .size(24.sp) + .color(kTextSubColor) + .make()), + ].sepWidget(separate: 12.w.heightBox), + ], + ), + ); + } + + Widget _rowTile(String iconPath, String title, Widget content) { + return Row( + children: [ + SizedBox( + width: 40.w, + height: 40.w, + child: Image.asset(iconPath), + ), + 12.w.widthBox, + title.text.size(24.sp).color(kTextSubColor).make(), + Spacer(), + content, + ], + ); + } +} diff --git a/lib/ui/manage_pages/house_keeping/house_keeping_detail_page.dart b/lib/ui/manage_pages/house_keeping/house_keeping_detail_page.dart new file mode 100644 index 0000000..73035e2 --- /dev/null +++ b/lib/ui/manage_pages/house_keeping/house_keeping_detail_page.dart @@ -0,0 +1,139 @@ +import 'package:aku_community_manager/models/manager/house_keeping/house_keeping_list_model.dart'; +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/tools/aku_divider.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart'; + +class HouseKeepingDetailPage extends StatefulWidget { + final HouseKeepingListModel model; + HouseKeepingDetailPage({Key key, this.model}) : super(key: key); + + @override + _HouseKeepingDetailPageState createState() => _HouseKeepingDetailPageState(); +} + +class _HouseKeepingDetailPageState extends State { + @override + Widget build(BuildContext context) { + return AkuScaffold( + title: '服务详情', + body: ListView( + padding: EdgeInsets.all(32.w), + children: [ + _interviewInfo(), + 20.w.heightBox, + _contentWidget(), + ], + ), + ); + } + + Widget _interviewInfo() { + return Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(8.w)), + padding: EdgeInsets.all(24.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + '家政服务'.text.size(32.sp).color(kTextPrimaryColor).bold.make(), + Spacer(), + ], + ), + 16.w.heightBox, + AkuDivider.horizontal(), + 24.w.heightBox, + ...[ + _rowTile( + R.ASSETS_MANAGE_IC_RENWU_PNG, + '房产名称', + widget.model.roomName.text + .size(24.sp) + .color(kTextSubColor) + .make()), + _rowTile( + R.ASSETS_MANAGE_IC_RENWU_PNG, + '人数', + widget.model.num + .toString() + .text + .size(24.sp) + .color(kTextSubColor) + .make()), + _rowTile( + R.ASSETS_MANAGE_IC_RENWU_PNG, + '负责人姓名', + widget.model.leaderName.text + .size(24.sp) + .color(kTextSubColor) + .make()), + _rowTile( + R.ASSETS_MESSAGE_IC_PHONE_PNG, + '负责人手机', + widget.model.leaderTel.text + .size(24.sp) + .color(kTextSubColor) + .make()), + ].sepWidget(separate: 12.w.heightBox), + // _getBottomButtons(widget.model.status), + ], + ), + ); + } + + Widget _contentWidget() { + return Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(8.w)), + padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + '访谈内容'.text.size(32.sp).color(kTextPrimaryColor).bold.make(), + Spacer(), + ], + ), + 16.w.heightBox, + AkuDivider.horizontal(), + 20.w.heightBox, + widget.model.content.text.size(28.sp).color(kTextPrimaryColor).make(), + 40.w.heightBox, + Row( + children: [ + Spacer(), + widget.model.createDate.text + .size(24.sp) + .color(kTextSubColor) + .make(), + ], + ), + ], + ), + ); + } + + Widget _rowTile(String iconPath, String title, Widget content) { + return Row( + children: [ + SizedBox( + width: 40.w, + height: 40.w, + child: Image.asset(iconPath), + ), + 12.w.widthBox, + title.text.size(24.sp).color(kTextSubColor).make(), + Spacer(), + content, + ], + ); + } +} diff --git a/lib/ui/manage_pages/house_keeping/house_keeping_page.dart b/lib/ui/manage_pages/house_keeping/house_keeping_page.dart new file mode 100644 index 0000000..f450222 --- /dev/null +++ b/lib/ui/manage_pages/house_keeping/house_keeping_page.dart @@ -0,0 +1,59 @@ +import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_add_page.dart'; +import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_view.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class HouseKeepingPage extends StatefulWidget { + HouseKeepingPage({Key key}) : super(key: key); + + @override + _HouseKeepingPageState createState() => _HouseKeepingPageState(); +} + +class _HouseKeepingPageState extends State + with TickerProviderStateMixin { + List _tabs = ['未处理', '已处理']; + TabController _tabController; + @override + void initState() { + super.initState(); + _tabController = TabController(length: _tabs.length, vsync: this); + } + + @override + void dispose() { + _tabController?.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return AkuScaffold( + title: '家政服务', + // appBarBottom: PreferredSize( + // preferredSize: Size.fromHeight(88.w), + // child: AkuTabBar(controller: _tabController, tabs: _tabs), + // ), + // body: TabBarView( + // children: List.generate( + // _tabs.length, + // (index) => HouseKeepingView( + // index:index, + // ), + // ), + // ), + actions: [ + IconButton( + iconSize: 40.w, + icon: Icon(CupertinoIcons.plus_circle,size: 40.w,color: Colors.black,), + onPressed: () { + Get.to(() => HouseKeepingAddPage()); + }) + ], + body: HouseKeepingView(), + ); + } +} diff --git a/lib/ui/manage_pages/house_keeping/house_keeping_view.dart b/lib/ui/manage_pages/house_keeping/house_keeping_view.dart new file mode 100644 index 0000000..d371ca9 --- /dev/null +++ b/lib/ui/manage_pages/house_keeping/house_keeping_view.dart @@ -0,0 +1,55 @@ +import 'package:aku_community_manager/const/api.dart'; +import 'package:aku_community_manager/models/manager/house_keeping/house_keeping_list_model.dart'; +import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_card.dart'; +import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_easyrefresh/easy_refresh.dart'; +import 'package:velocity_x/velocity_x.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +class HouseKeepingView extends StatefulWidget { + final int index; + HouseKeepingView({Key key, this.index}) : super(key: key); + + @override + _HouseKeepingViewState createState() => _HouseKeepingViewState(); +} + +class _HouseKeepingViewState extends State { + EasyRefreshController _refreshController; + + @override + void initState() { + super.initState(); + _refreshController = EasyRefreshController(); + } + + @override + void dispose() { + _refreshController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return BeeListView( + path: API.manage.houseKeepingList, + controller: _refreshController, + convert: (models) { + return models.tableList + .map((e) => HouseKeepingListModel.fromJson(e)) + .toList(); + }, + builder: (items) { + return ListView.separated( + padding: EdgeInsets.all(24.w), + itemBuilder: (context, index) { + return HouseKeepingCard(model: items[index]); + }, + separatorBuilder: (_, __) { + return 24.w.heightBox; + }, + itemCount: items.length); + }); + } +} diff --git a/lib/ui/manage_pages/key_manage/key_aplly_input_page.dart b/lib/ui/manage_pages/key_manage/key_aplly_input_page.dart index a5b8a07..4d1e2ec 100644 --- a/lib/ui/manage_pages/key_manage/key_aplly_input_page.dart +++ b/lib/ui/manage_pages/key_manage/key_aplly_input_page.dart @@ -12,6 +12,7 @@ import 'package:velocity_x/velocity_x.dart'; import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart'; +import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart'; class KeyApplyInputPage extends StatefulWidget { KeyApplyInputPage({Key key}) : super(key: key); @@ -80,7 +81,7 @@ class _KeyApplyInputPageState extends State { backgroundColor: Colors.white, body: Center( child: Padding( - padding: EdgeInsets.symmetric(horizontal: 32.w), + padding: EdgeInsets.all( 32.w), child: Column( children: [ _inputRowTile('申请人姓名', _nameController), @@ -88,7 +89,7 @@ class _KeyApplyInputPageState extends State { formatters: [FilteringTextInputFormatter.digitsOnly]), _inputRowTile('身份', _roleController), _inputRowTile('对应设备位置', _placeController), - ], + ].sepWidget(separate: 40.w.heightBox), ), ), ), @@ -106,14 +107,13 @@ class _KeyApplyInputPageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - 40.w.heightBox, title.text.size(28.sp).color(kTextPrimaryColor).make(), 32.w.heightBox, TextField( inputFormatters: formatters, + controller: controller, textAlign: TextAlign.start, onChanged: (value) { - controller.text = value; setState(() {}); }, decoration: InputDecoration( diff --git a/lib/ui/manage_pages/packages_manage/add_package_page.dart b/lib/ui/manage_pages/packages_manage/add_package_page.dart index 3617106..34e4108 100644 --- a/lib/ui/manage_pages/packages_manage/add_package_page.dart +++ b/lib/ui/manage_pages/packages_manage/add_package_page.dart @@ -16,6 +16,7 @@ import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/inner/aku_bottom_button.dart'; import 'package:aku_community_manager/utils/network/base_model.dart'; import 'package:aku_community_manager/utils/network/net_util.dart'; +import 'package:aku_community_manager/tools/extensions/list_extension_tool.dart'; class AddPackagePage extends StatefulWidget { AddPackagePage({Key key}) : super(key: key); @@ -91,7 +92,7 @@ class _AddPackagePageState extends State { backgroundColor: Colors.white, body: Center( child: Padding( - padding: EdgeInsets.symmetric(horizontal: 32.w), + padding: EdgeInsets.all(32.w), child: Column( children: [ _inputRowTile('收件人姓名', _nameController), @@ -101,7 +102,7 @@ class _AddPackagePageState extends State { _inputRowTile('包裹单号', _codeController, formatters: [FilteringTextInputFormatter.digitsOnly]), _inputRowTile('放置位置', _placeController), - ], + ].sepWidget(separate: 40.w.heightBox), ), ), ), @@ -153,14 +154,13 @@ class _AddPackagePageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - 40.w.heightBox, title.text.size(28.sp).color(kTextPrimaryColor).make(), 32.w.heightBox, TextField( inputFormatters: formatters, + controller: controller, textAlign: TextAlign.start, onChanged: (value) { - controller.text = value; setState(() {}); }, decoration: InputDecoration( diff --git a/lib/ui/tool_pages/warning/warning_page.dart b/lib/ui/tool_pages/warning/warning_page.dart index 051d63f..281b736 100644 --- a/lib/ui/tool_pages/warning/warning_page.dart +++ b/lib/ui/tool_pages/warning/warning_page.dart @@ -2,6 +2,8 @@ import 'dart:ui'; // Flutter imports: +import 'package:aku_community_manager/const/api.dart'; +import 'package:aku_community_manager/utils/network/net_util.dart'; import 'package:flutter/material.dart'; // Package imports: @@ -191,7 +193,10 @@ class _WarningPageState extends State { alignment: Alignment.center, child: AkuCupertinoButton( minWidth: 0, - onPressed: () { + onPressed: () async { + await NetUtil() + .post(API.manage.insertAlarmRecord, showMessage: true); + launch('tel:110'); // Get.to(()=>WarningSubPage()); },