家政服务card 接口对接

hmxc
张萌 3 years ago
parent 1b1336e1c5
commit 337364ceb0

@ -1,4 +1,5 @@
// Flutter imports: // Flutter imports:
import 'package:aku_community_manager/models/user/user_info_model.dart';
import 'package:aku_community_manager/tools/user_tool.dart'; import 'package:aku_community_manager/tools/user_tool.dart';
import 'package:aku_community_manager/ui/manage_pages/clock_in_out/clock_in_out_page.dart'; 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/facilities/facilities_select_page.dart';
@ -96,8 +97,9 @@ class _ApplicationPageState extends State<ApplicationPage>
AppApplication( AppApplication(
'考勤管理', R.ASSETS_HOME_CLOCK_IN_OUT_PNG, () => ClockInOutPage()), '考勤管理', R.ASSETS_HOME_CLOCK_IN_OUT_PNG, () => ClockInOutPage()),
AppApplication('访谈管理', R.ASSETS_HOME_INTERVIEW_PNG, () => InterviewPage()), AppApplication('访谈管理', R.ASSETS_HOME_INTERVIEW_PNG, () => InterviewPage()),
AppApplication( if (UserTool.userProvider.infoModel!.houseKeepingAuthority == HKAUTH.HIDE)
'家政服务', R.ASSETS_HOME_HOUSE_KEEPING_PNG, () => HouseKeepingPage()), AppApplication(
'家政服务', R.ASSETS_HOME_HOUSE_KEEPING_PNG, () => HouseKeepingPage()),
]; ];
@override @override

@ -1,7 +1,7 @@
// Flutter imports: // Flutter imports:
import 'dart:async'; import 'dart:async';
import 'package:aku_community_manager/json_models/system_message_green_model.dart'; import 'package:aku_community_manager/json_models/message/system_message_green_model.dart';
import 'package:aku_community_manager/ui/home/messages/message_map.dart'; import 'package:aku_community_manager/ui/home/messages/message_map.dart';
import 'package:aku_community_manager/ui/manage_pages/green_manage/green_manage_page.dart'; import 'package:aku_community_manager/ui/manage_pages/green_manage/green_manage_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_button.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_button.dart';

@ -1,7 +1,7 @@
// Flutter imports: // Flutter imports:
import 'dart:async'; import 'dart:async';
import 'package:aku_community_manager/json_models/system_message_hygience_model.dart'; import 'package:aku_community_manager/json_models/message/system_message_hygience_model.dart';
import 'package:aku_community_manager/ui/home/messages/message_map.dart'; import 'package:aku_community_manager/ui/home/messages/message_map.dart';
import 'package:aku_community_manager/ui/manage_pages/hygience_manage/hygience_manage_page.dart'; import 'package:aku_community_manager/ui/manage_pages/hygience_manage/hygience_manage_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_button.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_button.dart';

@ -1,4 +1,6 @@
import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/json_models/manager/house_keeping/house_keeping_list_model.dart';
import 'package:aku_community_manager/models/user/user_info_model.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/user_tool.dart'; import 'package:aku_community_manager/tools/user_tool.dart';
import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_detail_page.dart'; import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_detail_page.dart';
@ -9,101 +11,18 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
// class HouseKeepingCard extends StatefulWidget {
// final HouseKeepingListModel model;
// HouseKeepingCard({Key? key, required this.model}) : super(key: key);
// @override
// _HouseKeepingCardState createState() => _HouseKeepingCardState();
// }
// class _HouseKeepingCardState extends State<HouseKeepingCard> {
// @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,
// ...<Widget>[
// _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,
// ],
// );
// }
// }
class HouseKeepingCard extends StatelessWidget { class HouseKeepingCard extends StatelessWidget {
final VoidCallback callRefresh; final VoidCallback callRefresh;
const HouseKeepingCard({Key? key, required this.callRefresh}) final HouseKeepingListModel model;
const HouseKeepingCard(
{Key? key, required this.callRefresh, required this.model})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return GestureDetector(
onTap: () async { onTap: () async {
await Get.to(() => HouseKeepingDetailPage()); await Get.to(() => HouseKeepingDetailPage(model: model));
callRefresh(); callRefresh();
}, },
child: Container( child: Container(
@ -118,7 +37,7 @@ class HouseKeepingCard extends StatelessWidget {
16.w.widthBox, 16.w.widthBox,
Expanded( Expanded(
child: Text( child: Text(
'dateStart', model.createDate,
style: TextStyle( style: TextStyle(
color: AppStyle.minorTextColor, color: AppStyle.minorTextColor,
fontSize: 22.sp, fontSize: 22.sp,
@ -126,32 +45,14 @@ class HouseKeepingCard extends StatelessWidget {
), ),
), ),
Text( Text(
// widget.hasFinished model.statusString,
// ? '已处理' style: TextStyle(color: Color(0xFFFF4501)),
// : AkuMap.fixStatus(userInfoModel!.canSendTicket,
// userInfoModel!.canPickUpTicket, widget.model.status!),
'',
style:
// widget.hasFinished
true
? TextStyle(color: AppStyle.minorTextColor)
: TextStyle(
// color: widget.model.status! < 4
// ? Color(0XFFFF4501)
// : AppStyle.minorTextColor,
),
), ),
], ],
), ),
24.w.heightBox, 24.w.heightBox,
Text( Text(
// widget.model.reportDetail! model.content,
'',
// maxLines: widget.homeDisplay ? 1 : null,
// overflow: !widget.homeDisplay
// ? TextOverflow.visible
// : TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
fontSize: 28.sp, fontSize: 28.sp,
@ -180,8 +81,7 @@ class HouseKeepingCard extends StatelessWidget {
child: ListView.builder( child: ListView.builder(
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
itemBuilder: (context, index) { itemBuilder: (context, index) {
// var imgObj = widget.model.imgUrls![index].url; var imgObj = model.submitImgList[index].url;
var imgObj = '';
return Container( return Container(
margin: EdgeInsets.symmetric(horizontal: 8.w), margin: EdgeInsets.symmetric(horizontal: 8.w),
height: 168.w, height: 168.w,
@ -191,11 +91,11 @@ class HouseKeepingCard extends StatelessWidget {
), ),
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP, image: API.image('')), placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(imgObj!)),
); );
}, },
// itemCount: widget.model.imgUrls!.length, itemCount: model.submitImgList.length,
itemCount: 1,
), ),
); );
} }
@ -214,22 +114,18 @@ class HouseKeepingCard extends StatelessWidget {
} }
_getButtons() { _getButtons() {
switch (1) { switch (model.status) {
case 1: case 1:
return [ return [
AkuMaterialButton( AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async { onPressed: () async {},
// Get.to(() => BusinessAndFixDetailPage(model: widget.model));
// if (widget.callRefresh != null) {
// widget.callRefresh!();
// }
},
radius: 4, radius: 4,
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text( child: Text(
(UserTool.userProvider.infoModel!.canSendTicket (UserTool.userProvider.infoModel!.houseKeepingAuthority ==
HKAUTH.SEND
? '立即派单' ? '立即派单'
: '查看详情'), : '查看详情'),
style: TextStyle( style: TextStyle(
@ -255,11 +151,10 @@ class HouseKeepingCard extends StatelessWidget {
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text( child: Text(
(UserTool.userProvider.infoModel!.canSendTicket (UserTool.userProvider.infoModel!.houseKeepingAuthority ==
? '改派' HKAUTH.PICK
: UserTool.userProvider.infoModel!.canPickUpTicket ? '立即接单'
? '立即接单' : '催单'),
: '查看详情'),
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -274,18 +169,12 @@ class HouseKeepingCard extends StatelessWidget {
UserTool.userProvider.infoModel!.canPickUpTicket UserTool.userProvider.infoModel!.canPickUpTicket
? AkuMaterialButton( ? AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async { onPressed: () async {},
// Get.to(() => Get.to(() =>
// FixMoreTimePage(dispatchId: widget.model.dispatchId!)));
// if (widget.callRefresh != null) {
// widget.callRefresh!();
// }
},
radius: 4, radius: 4,
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text( child: Text(
('申请延时'), ('查看详情'),
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -297,19 +186,12 @@ class HouseKeepingCard extends StatelessWidget {
: SizedBox(), : SizedBox(),
AkuMaterialButton( AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async { onPressed: () async {},
// Get.to(() => BusinessAndFixDetailPage(model: widget.model));
// if (widget.callRefresh != null) {
// widget.callRefresh!();
// }
},
radius: 4, radius: 4,
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text( child: Text(
(UserTool.userProvider.infoModel!.canPickUpTicket ('联系住户'),
? '处理完成'
: '查看详情'),
style: TextStyle( style: TextStyle(
color: AppStyle.primaryTextColor, color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -323,12 +205,83 @@ class HouseKeepingCard extends StatelessWidget {
return [ return [
AkuMaterialButton( AkuMaterialButton(
height: 64.w, height: 64.w,
onPressed: () async { onPressed: () async {},
// Get.to(() => BusinessAndFixDetailPage(model: widget.model)); radius: 4,
// if (widget.callRefresh != null) { color: AppStyle.primaryColor,
// widget.callRefresh!(); padding: EdgeInsets.symmetric(horizontal: 24.w),
// } child: Text(
}, ('查看详情'),
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 28.sp,
height: 40 / 28,
),
),
),
];
case 5:
return [
AkuMaterialButton(
height: 64.w,
onPressed: () async {},
radius: 4,
color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text(
('查看详情'),
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 28.sp,
height: 40 / 28,
),
),
),
];
case 6:
return [
AkuMaterialButton(
height: 64.w,
onPressed: () async {},
radius: 4,
color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text(
('查看详情'),
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 28.sp,
height: 40 / 28,
),
),
),
];
case 9:
return [
AkuMaterialButton(
height: 64.w,
onPressed: () async {},
radius: 4,
color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text(
('查看详情'),
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
fontSize: 28.sp,
height: 40 / 28,
),
),
),
];
case 10:
return [
AkuMaterialButton(
height: 64.w,
onPressed: () async {},
radius: 4, radius: 4,
color: AppStyle.primaryColor, color: AppStyle.primaryColor,
padding: EdgeInsets.symmetric(horizontal: 24.w), padding: EdgeInsets.symmetric(horizontal: 24.w),

@ -1,4 +1,5 @@
import 'package:aku_community_manager/const/api.dart'; import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/json_models/manager/house_keeping/house_keeping_list_model.dart';
import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/aku_divider.dart'; import 'package:aku_community_manager/tools/aku_divider.dart';
import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_feed_back_page.dart'; import 'package:aku_community_manager/ui/manage_pages/house_keeping/house_keeping_feed_back_page.dart';
@ -14,138 +15,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community_manager/utils/extension/list_extension.dart'; import 'package:aku_community_manager/utils/extension/list_extension.dart';
// class HouseKeepingDetailPage extends StatefulWidget {
// final HouseKeepingListModel model;
// HouseKeepingDetailPage({Key? key, required this.model}) : super(key: key);
// @override
// _HouseKeepingDetailPageState createState() => _HouseKeepingDetailPageState();
// }
// class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
// @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,
// ...<Widget>[
// _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,
// ],
// );
// }
// }
class HouseKeepingDetailPage extends StatefulWidget { class HouseKeepingDetailPage extends StatefulWidget {
HouseKeepingDetailPage({Key? key}) : super(key: key); final HouseKeepingListModel model;
HouseKeepingDetailPage({Key? key, required this.model}) : super(key: key);
@override @override
_HouseKeepingDetailPageState createState() => _HouseKeepingDetailPageState(); _HouseKeepingDetailPageState createState() => _HouseKeepingDetailPageState();
@ -161,7 +33,7 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
children: [ children: [
'服务费用'.text.size(28.sp).black.make(), '服务费用'.text.size(28.sp).black.make(),
Spacer(), Spacer(),
'¥ ${0}'.text.size(32.sp).color(Colors.red).make() '¥ ${widget.model.payFee}'.text.size(32.sp).color(Colors.red).make()
], ],
), ),
); );
@ -308,13 +180,13 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
_buildInfo() { _buildInfo() {
return AkuTitleBox( return AkuTitleBox(
title: '报修信息', title: '服务信息',
suffix: ''.text.size(28.sp).black.make(), suffix: widget.model.statusString.text.size(28.sp).color(Color(0xFFFF4501)).make(),
children: [ children: [
16.w.heightBox, 16.w.heightBox,
_buildTile(R.ASSETS_MESSAGE_IC_PEOPLE_PNG, '报修人', ''), _buildTile(R.ASSETS_MESSAGE_IC_PEOPLE_PNG, '报修人', widget.model.proposerName),
_buildTile(R.ASSETS_MESSAGE_IC_PHONE_PNG, '联系电话', ''), _buildTile(R.ASSETS_MESSAGE_IC_PHONE_PNG, '联系电话', widget.model.proposerTel),
_buildTile(R.ASSETS_MESSAGE_IC_AREA_PNG, '报修区域', ''), _buildTile(R.ASSETS_MESSAGE_IC_AREA_PNG, '报修区域', '${0}'),
8.w.heightBox, 8.w.heightBox,
Text( Text(
'', '',

@ -1,5 +1,5 @@
import 'package:aku_community_manager/const/api.dart'; 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/json_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/manage_pages/house_keeping/house_keeping_card.dart';
import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart'; import 'package:aku_community_manager/ui/widgets/common/bee_list_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -46,6 +46,7 @@ class _HouseKeepingViewState extends State<HouseKeepingView> {
padding: EdgeInsets.all(24.w), padding: EdgeInsets.all(24.w),
itemBuilder: (context, index) { itemBuilder: (context, index) {
return HouseKeepingCard( return HouseKeepingCard(
model: items[index],
callRefresh: () { callRefresh: () {
_refreshController!.callRefresh(); _refreshController!.callRefresh();
}, },

@ -83,6 +83,12 @@ void gen() async {
await Pub.run('build_runner', arguments: ['build']); await Pub.run('build_runner', arguments: ['build']);
} }
@Task('生成model')
void genClean() async {
await Pub.runAsync('build_runner',
arguments: ['build', '--delete-conflicting-outputs']);
}
@Task() @Task()
Future<String> getVersion() async { Future<String> getVersion() async {
String projectPath = Directory('.').absolute.path; String projectPath = Directory('.').absolute.path;

Loading…
Cancel
Save