parent
7a6e052e75
commit
3dc4fa3783
@ -1,95 +1,350 @@
|
|||||||
import 'package:aku_community_manager/models/manager/house_keeping/house_keeping_list_model.dart';
|
import 'package:aku_community_manager/const/api.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/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';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/inner/aku_chip_box.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
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/tools/extensions/list_extension_tool.dart';
|
|
||||||
|
|
||||||
class HouseKeepingCard extends StatefulWidget {
|
// class HouseKeepingCard extends StatefulWidget {
|
||||||
final HouseKeepingListModel model;
|
// final HouseKeepingListModel model;
|
||||||
HouseKeepingCard({Key? key, required this.model}) : super(key: key);
|
// HouseKeepingCard({Key? key, required this.model}) : super(key: key);
|
||||||
|
|
||||||
@override
|
// @override
|
||||||
_HouseKeepingCardState createState() => _HouseKeepingCardState();
|
// _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 {
|
||||||
|
final VoidCallback callRefresh;
|
||||||
|
const HouseKeepingCard({Key? key, required this.callRefresh})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
class _HouseKeepingCardState extends State<HouseKeepingCard> {
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialButton(
|
return GestureDetector(
|
||||||
minWidth: double.infinity,
|
onTap: () async {
|
||||||
color: Colors.white,
|
await Get.to(() => HouseKeepingDetailPage());
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)),
|
callRefresh();
|
||||||
elevation: 0,
|
|
||||||
padding: EdgeInsets.all(24.w),
|
|
||||||
onPressed: () {
|
|
||||||
Get.to(() => HouseKeepingDetailPage(model:widget.model));
|
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Container(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
padding: EdgeInsets.all(24.w),
|
||||||
children: [
|
child: Column(
|
||||||
Row(
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
mainAxisSize: MainAxisSize.min,
|
||||||
'家政服务'.text.size(32.sp).color(kTextPrimaryColor).bold.make(),
|
children: [
|
||||||
Spacer(),
|
Row(
|
||||||
],
|
children: [
|
||||||
),
|
AkuChipBox(title: '家政服务'),
|
||||||
16.w.heightBox,
|
16.w.widthBox,
|
||||||
AkuDivider.horizontal(),
|
Expanded(
|
||||||
24.w.heightBox,
|
child: Text(
|
||||||
...<Widget>[
|
'dateStart',
|
||||||
_rowTile(
|
style: TextStyle(
|
||||||
R.ASSETS_MANAGE_IC_RENWU_PNG,
|
color: AppStyle.minorTextColor,
|
||||||
'房产名称',
|
fontSize: 22.sp,
|
||||||
widget.model.roomName!.text
|
),
|
||||||
.size(24.sp)
|
),
|
||||||
.color(kTextSubColor)
|
),
|
||||||
.make()),
|
Text(
|
||||||
_rowTile(
|
// widget.hasFinished
|
||||||
R.ASSETS_MANAGE_IC_RENWU_PNG,
|
// ? '已处理'
|
||||||
'人数',
|
// : AkuMap.fixStatus(userInfoModel!.canSendTicket,
|
||||||
widget.model.num
|
|
||||||
.toString()
|
// userInfoModel!.canPickUpTicket, widget.model.status!),
|
||||||
.text
|
'',
|
||||||
.size(24.sp)
|
style:
|
||||||
.color(kTextSubColor)
|
// widget.hasFinished
|
||||||
.make()),
|
true
|
||||||
_rowTile(
|
? TextStyle(color: AppStyle.minorTextColor)
|
||||||
R.ASSETS_MANAGE_IC_RENWU_PNG,
|
: TextStyle(
|
||||||
'负责人姓名',
|
// color: widget.model.status! < 4
|
||||||
widget.model.leaderName!.text
|
// ? Color(0XFFFF4501)
|
||||||
.size(24.sp)
|
// : AppStyle.minorTextColor,
|
||||||
.color(kTextSubColor)
|
),
|
||||||
.make()),
|
),
|
||||||
_rowTile(
|
],
|
||||||
R.ASSETS_MESSAGE_IC_PHONE_PNG,
|
),
|
||||||
'负责人手机',
|
24.w.heightBox,
|
||||||
widget.model.leaderTel!.text
|
Text(
|
||||||
.size(24.sp)
|
// widget.model.reportDetail!
|
||||||
.color(kTextSubColor)
|
'',
|
||||||
.make()),
|
// maxLines: widget.homeDisplay ? 1 : null,
|
||||||
].sepWidget(separate: 12.w.heightBox),
|
// overflow: !widget.homeDisplay
|
||||||
],
|
// ? TextOverflow.visible
|
||||||
|
// : TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppStyle.primaryTextColor,
|
||||||
|
fontSize: 28.sp,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
16.w.heightBox,
|
||||||
|
_buildImgs(),
|
||||||
|
// !widget.canSeeBottomButton ? SizedBox() : _getBottomCard(),
|
||||||
|
_getBottomCard()
|
||||||
|
],
|
||||||
|
),
|
||||||
|
// margin:
|
||||||
|
// widget.homeDisplay ? EdgeInsets.zero : EdgeInsets.only(top: 16.w),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8.w),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _rowTile(String iconPath, String title, Widget content) {
|
_buildImgs() {
|
||||||
return Row(
|
return Container(
|
||||||
|
height: 168.w,
|
||||||
|
child: ListView.builder(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
// var imgObj = widget.model.imgUrls![index].url;
|
||||||
|
var imgObj = '';
|
||||||
|
return Container(
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 8.w),
|
||||||
|
height: 168.w,
|
||||||
|
width: 168.w,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(4.w),
|
||||||
|
),
|
||||||
|
clipBehavior: Clip.antiAlias,
|
||||||
|
child: FadeInImage.assetNetwork(
|
||||||
|
placeholder: R.ASSETS_PLACEHOLDER_WEBP, image: API.image('')),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
// itemCount: widget.model.imgUrls!.length,
|
||||||
|
itemCount: 1,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_getBottomCard() {
|
||||||
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
Divider(height: 48.w),
|
||||||
width: 40.w,
|
Align(
|
||||||
height: 40.w,
|
alignment: Alignment.centerRight,
|
||||||
child: Image.asset(iconPath),
|
child: Row(
|
||||||
),
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
12.w.widthBox,
|
children: _getButtons())),
|
||||||
title.text.size(24.sp).color(kTextSubColor).make(),
|
|
||||||
Spacer(),
|
|
||||||
content,
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_getButtons() {
|
||||||
|
switch (1) {
|
||||||
|
case 1:
|
||||||
|
return [
|
||||||
|
AkuMaterialButton(
|
||||||
|
height: 64.w,
|
||||||
|
onPressed: () async {
|
||||||
|
// Get.to(() => BusinessAndFixDetailPage(model: widget.model));
|
||||||
|
// if (widget.callRefresh != null) {
|
||||||
|
// widget.callRefresh!();
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
radius: 4,
|
||||||
|
color: AppStyle.primaryColor,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 24.w),
|
||||||
|
child: Text(
|
||||||
|
(UserTool.userProvider.infoModel!.canSendTicket
|
||||||
|
? '立即派单'
|
||||||
|
: '查看详情'),
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppStyle.primaryTextColor,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 28.sp,
|
||||||
|
height: 40 / 28,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
];
|
||||||
|
case 2:
|
||||||
|
return [
|
||||||
|
AkuMaterialButton(
|
||||||
|
height: 64.w,
|
||||||
|
onPressed: () async {
|
||||||
|
// Get.to(() => BusinessAndFixDetailPage(model: widget.model));
|
||||||
|
// if (widget.callRefresh != null) {
|
||||||
|
// widget.callRefresh!();
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
radius: 4,
|
||||||
|
color: AppStyle.primaryColor,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 24.w),
|
||||||
|
child: Text(
|
||||||
|
(UserTool.userProvider.infoModel!.canSendTicket
|
||||||
|
? '改派'
|
||||||
|
: UserTool.userProvider.infoModel!.canPickUpTicket
|
||||||
|
? '立即接单'
|
||||||
|
: '查看详情'),
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppStyle.primaryTextColor,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 28.sp,
|
||||||
|
height: 40 / 28,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
];
|
||||||
|
case 3:
|
||||||
|
return [
|
||||||
|
UserTool.userProvider.infoModel!.canPickUpTicket
|
||||||
|
? AkuMaterialButton(
|
||||||
|
height: 64.w,
|
||||||
|
onPressed: () async {
|
||||||
|
// Get.to(() => Get.to(() =>
|
||||||
|
// FixMoreTimePage(dispatchId: widget.model.dispatchId!)));
|
||||||
|
// if (widget.callRefresh != null) {
|
||||||
|
// widget.callRefresh!();
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: SizedBox(),
|
||||||
|
AkuMaterialButton(
|
||||||
|
height: 64.w,
|
||||||
|
onPressed: () async {
|
||||||
|
// Get.to(() => BusinessAndFixDetailPage(model: widget.model));
|
||||||
|
// if (widget.callRefresh != null) {
|
||||||
|
// widget.callRefresh!();
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
radius: 4,
|
||||||
|
color: AppStyle.primaryColor,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 24.w),
|
||||||
|
child: Text(
|
||||||
|
(UserTool.userProvider.infoModel!.canPickUpTicket
|
||||||
|
? '处理完成'
|
||||||
|
: '查看详情'),
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppStyle.primaryTextColor,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 28.sp,
|
||||||
|
height: 40 / 28,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
];
|
||||||
|
case 4:
|
||||||
|
return [
|
||||||
|
AkuMaterialButton(
|
||||||
|
height: 64.w,
|
||||||
|
onPressed: () async {
|
||||||
|
// Get.to(() => BusinessAndFixDetailPage(model: widget.model));
|
||||||
|
// if (widget.callRefresh != null) {
|
||||||
|
// widget.callRefresh!();
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
];
|
||||||
|
default:
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,167 @@
|
|||||||
|
import 'package:aku_community_manager/style/app_style.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/common/aku_material_button.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||||
|
import 'package:expandable/expandable.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||||
|
import 'package:velocity_x/velocity_x.dart';
|
||||||
|
import 'package:aku_community_manager/utils/extension/list_extension.dart';
|
||||||
|
|
||||||
|
class HouseKeepingDepartmentPage extends StatefulWidget {
|
||||||
|
HouseKeepingDepartmentPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_HouseKeepingDepartmentPageState createState() =>
|
||||||
|
_HouseKeepingDepartmentPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _HouseKeepingDepartmentPageState
|
||||||
|
extends State<HouseKeepingDepartmentPage> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AkuScaffold(
|
||||||
|
title: '派单人员列表',
|
||||||
|
body: EasyRefresh(
|
||||||
|
firstRefresh: true,
|
||||||
|
header: MaterialHeader(),
|
||||||
|
onRefresh: () async {},
|
||||||
|
child: ListView(
|
||||||
|
children: [
|
||||||
|
_buildItem(1),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_buildItem(int index) {
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border(
|
||||||
|
top: index == 0
|
||||||
|
? BorderSide.none
|
||||||
|
: BorderSide(color: Color(0xFFE8E8E8), width: 1.w),
|
||||||
|
bottom: BorderSide(color: Color(0xFFE8E8E8), width: 1.w),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Material(
|
||||||
|
color: Colors.white,
|
||||||
|
child: ExpandablePanel(
|
||||||
|
controller: ExpandableController(initialExpanded: true),
|
||||||
|
header: Container(
|
||||||
|
height: 96.w,
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 32.w),
|
||||||
|
child: Text(
|
||||||
|
'model.name!',
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppStyle.primaryTextColor,
|
||||||
|
fontSize: 32.sp,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
collapsed: SizedBox(),
|
||||||
|
expanded: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Divider(
|
||||||
|
color: Color(0xFFE8E8E8),
|
||||||
|
height: 1.w,
|
||||||
|
thickness: 1.w,
|
||||||
|
),
|
||||||
|
...[].map((e) {
|
||||||
|
return Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
AkuMaterialButton(
|
||||||
|
height: 96.w,
|
||||||
|
onPressed: () {
|
||||||
|
// if (_pickedFixers
|
||||||
|
// .indexWhere((element) => element.id == e.id) ==
|
||||||
|
// -1) {
|
||||||
|
// _pickedFixers.add(e);
|
||||||
|
// } else {
|
||||||
|
// _pickedFixers.remove(e);
|
||||||
|
// }
|
||||||
|
// _reportModel!.operato = e.id;
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
72.w.widthBox,
|
||||||
|
Checkbox(
|
||||||
|
checkColor: AppStyle.primaryTextColor,
|
||||||
|
activeColor: AppStyle.primaryColor,
|
||||||
|
value: false,
|
||||||
|
onChanged: (state) {
|
||||||
|
// if (_pickedFixers.indexOf(e) == -1) {
|
||||||
|
// _pickedFixers.add(e);
|
||||||
|
// } else {
|
||||||
|
// _pickedFixers.remove(e);
|
||||||
|
// }
|
||||||
|
// if (_reportModel!.operato == e.id) {
|
||||||
|
// _reportModel!.operato = -1;
|
||||||
|
// } else {
|
||||||
|
// _reportModel!.operato = e.id;
|
||||||
|
// }
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
|
materialTapTargetSize:
|
||||||
|
MaterialTapTargetSize.shrinkWrap,
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
R.ASSETS_MESSAGE_IC_PEOPLE_PNG,
|
||||||
|
height: 40.w,
|
||||||
|
width: 40.w,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
e.name!,
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppStyle.primaryTextColor,
|
||||||
|
fontSize: 28.w,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Spacer(),
|
||||||
|
Image.asset(
|
||||||
|
R.ASSETS_MESSAGE_IC_PHONE_PNG,
|
||||||
|
height: 40.w,
|
||||||
|
width: 40.w,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
e.tel!,
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppStyle.primaryTextColor,
|
||||||
|
fontSize: 28.w,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
100.w.widthBox,
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
].sepWidget(
|
||||||
|
separate: Divider(
|
||||||
|
indent: 32.w,
|
||||||
|
endIndent: 32.w,
|
||||||
|
height: 1.w,
|
||||||
|
thickness: 1.w,
|
||||||
|
color: Color(0xFFE8E8E8),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList()
|
||||||
|
],
|
||||||
|
),
|
||||||
|
theme: ExpandableThemeData(
|
||||||
|
tapHeaderToExpand: true,
|
||||||
|
iconPlacement: ExpandablePanelIconPlacement.right,
|
||||||
|
iconPadding: EdgeInsets.only(top: 32.w, right: 32.w),
|
||||||
|
iconSize: 32.w,
|
||||||
|
iconColor: AppStyle.minorTextColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,191 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
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/app_widgets/aku_pick_image_widget.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/app_widgets/aku_single_check_button.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/app_widgets/bee_grid_image_view.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:velocity_x/velocity_x.dart';
|
||||||
|
class HouseKeepingFeedBackPage extends StatefulWidget {
|
||||||
|
HouseKeepingFeedBackPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_HouseKeepingFeedBackPageState createState() =>
|
||||||
|
_HouseKeepingFeedBackPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _HouseKeepingFeedBackPageState extends State<HouseKeepingFeedBackPage> {
|
||||||
|
int _feedBackStatus = 0;
|
||||||
|
late TextEditingController _editingController;
|
||||||
|
late TextEditingController _priceController;
|
||||||
|
|
||||||
|
List<File> _files = [];
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_editingController = TextEditingController();
|
||||||
|
_priceController = TextEditingController();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_editingController.dispose();
|
||||||
|
_priceController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AkuScaffold(
|
||||||
|
title: '工作汇报',
|
||||||
|
body: ListView(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 16.w),
|
||||||
|
children: <Widget>[
|
||||||
|
_buidlInfo(),
|
||||||
|
16.w.heightBox,
|
||||||
|
_buildFeedBack(),
|
||||||
|
16.w.heightBox,
|
||||||
|
_payTile(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buidlInfo() {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w),
|
||||||
|
color: Colors.white,
|
||||||
|
width: double.infinity,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
'服务信息'.text.size(36.sp).black.bold.make(),
|
||||||
|
40.w.heightBox,
|
||||||
|
''.text.size(28.sp).black.make(),
|
||||||
|
16.w.heightBox,
|
||||||
|
BeeGridImageView(urls: []),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildFeedBack() {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 24.w),
|
||||||
|
width: double.infinity,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
'服务反馈'.text.size(36.sp).black.bold.make(),
|
||||||
|
40.w.heightBox,
|
||||||
|
'完成情况'.text.size(28.sp).black.make(),
|
||||||
|
24.w.heightBox,
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
AkuSingleCheckButton(
|
||||||
|
text: '未完成',
|
||||||
|
value: 1,
|
||||||
|
gropValue: _feedBackStatus,
|
||||||
|
onPressed: () {
|
||||||
|
_feedBackStatus = 1;
|
||||||
|
setState(() {});
|
||||||
|
}),
|
||||||
|
40.w.widthBox,
|
||||||
|
AkuSingleCheckButton(
|
||||||
|
text: '已完成',
|
||||||
|
value: 2,
|
||||||
|
gropValue: _feedBackStatus,
|
||||||
|
onPressed: () {
|
||||||
|
_feedBackStatus = 2;
|
||||||
|
setState(() {});
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
40.w.heightBox,
|
||||||
|
'处理描述'.text.size(28.sp).black.make(),
|
||||||
|
24.w.heightBox,
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.all(24.w),
|
||||||
|
width: double.infinity,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: Colors.black, width: 1.w),
|
||||||
|
borderRadius: BorderRadius.circular(22.w)),
|
||||||
|
child: TextField(
|
||||||
|
controller: _editingController,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
contentPadding: EdgeInsets.zero,
|
||||||
|
isDense: true,
|
||||||
|
border: InputBorder.none,
|
||||||
|
hintText: '请输入处理描述',
|
||||||
|
hintStyle: TextStyle(
|
||||||
|
fontSize: 28.sp,
|
||||||
|
color: kTextSubColor,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
)),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 28.sp,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
maxLines: 10,
|
||||||
|
minLines: 5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
40.w.heightBox,
|
||||||
|
'上传服务完成照片'.text.size(28.sp).black.make(),
|
||||||
|
24.w.heightBox,
|
||||||
|
AkuPickImageWidget(onChanged: (files) {
|
||||||
|
_files = files;
|
||||||
|
})
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _payTile() {
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 32.w, horizontal: 32.w),
|
||||||
|
color: Colors.white,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
'支付费用'.text.size(28.sp).black.make(),
|
||||||
|
350.w.widthBox,
|
||||||
|
'¥'.text.size(32.sp).bold.color(Colors.red).make(),
|
||||||
|
24.w.widthBox,
|
||||||
|
TextField(
|
||||||
|
controller: _editingController,
|
||||||
|
inputFormatters: [
|
||||||
|
FilteringTextInputFormatter.allow(
|
||||||
|
RegExp(r'^[0-9][\.\d]*(,\d+)?$'))
|
||||||
|
],
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
contentPadding: EdgeInsets.zero,
|
||||||
|
isDense: true,
|
||||||
|
border: InputBorder.none,
|
||||||
|
hintText: '请输入金额',
|
||||||
|
hintStyle: TextStyle(
|
||||||
|
fontSize: 32.sp,
|
||||||
|
color: kTextSubColor,
|
||||||
|
fontWeight: FontWeight.bold)),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 32.sp,
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
).expand(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
24.w.heightBox,
|
||||||
|
AkuDivider.horizontal()
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
import 'package:aku_community_manager/const/api.dart';
|
||||||
|
import 'package:aku_community_manager/const/resource.dart';
|
||||||
|
import 'package:aku_community_manager/ui/widgets/inner/bee_image_preview.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
|
||||||
|
class BeeGridImageView extends StatelessWidget {
|
||||||
|
final List<String> urls;
|
||||||
|
final EdgeInsetsGeometry padding;
|
||||||
|
const BeeGridImageView({
|
||||||
|
Key? key,
|
||||||
|
required this.urls,
|
||||||
|
this.padding = EdgeInsets.zero,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
if (urls.isEmpty) return SizedBox();
|
||||||
|
return GridView.builder(
|
||||||
|
padding: padding,
|
||||||
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 3,
|
||||||
|
crossAxisSpacing: 16.w,
|
||||||
|
mainAxisSpacing: 16.w,
|
||||||
|
),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
BeeImagePreview.toPath(path: urls[index], tag: urls[index]);
|
||||||
|
},
|
||||||
|
child: Hero(
|
||||||
|
tag: urls[index],
|
||||||
|
child: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(8.w),
|
||||||
|
child: FadeInImage.assetNetwork(
|
||||||
|
height: 184.w,
|
||||||
|
width: 184.w,
|
||||||
|
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
|
||||||
|
image: API.image(urls[index]),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: urls.length,
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,92 @@
|
|||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:aku_community_manager/const/api.dart';
|
||||||
|
import 'package:aku_community_manager/const/resource.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class BeeImagePreview extends StatefulWidget {
|
||||||
|
static Future<T?> toFile<T>({required File file, String? tag}) async {
|
||||||
|
return await navigator!.push(
|
||||||
|
PageRouteBuilder(
|
||||||
|
opaque: false,
|
||||||
|
fullscreenDialog: true,
|
||||||
|
pageBuilder: (context, animation, secondAnimation) {
|
||||||
|
return FadeTransition(
|
||||||
|
opacity: animation,
|
||||||
|
child: BeeImagePreview.file(file: file, tag: tag),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
transitionsBuilder: (context, animation, secondaryAnimation, child) {
|
||||||
|
return child;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static toPath({required String? path, String? tag}) {
|
||||||
|
navigator!.push(
|
||||||
|
PageRouteBuilder(
|
||||||
|
opaque: false,
|
||||||
|
fullscreenDialog: true,
|
||||||
|
pageBuilder: (context, animation, secondAnimation) {
|
||||||
|
return BeeImagePreview.path(path: path, tag: tag);
|
||||||
|
},
|
||||||
|
transitionsBuilder: (context, animation, secondaryAnimation, child) {
|
||||||
|
return FadeTransition(
|
||||||
|
opacity: animation,
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
final File? file;
|
||||||
|
final String? path;
|
||||||
|
final String? tag;
|
||||||
|
BeeImagePreview.file({Key? key, required this.file, this.tag})
|
||||||
|
: path = null,
|
||||||
|
super(key: key);
|
||||||
|
|
||||||
|
BeeImagePreview.path({Key? key, required this.path, this.tag})
|
||||||
|
: file = null,
|
||||||
|
super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_BeeImagePreviewState createState() => _BeeImagePreviewState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BeeImagePreviewState extends State<BeeImagePreview> {
|
||||||
|
Widget get image {
|
||||||
|
if (widget.file == null)
|
||||||
|
return Hero(
|
||||||
|
tag: widget.tag ?? widget.path!,
|
||||||
|
child: FadeInImage.assetNetwork(
|
||||||
|
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
|
||||||
|
image: API.image(widget.path!),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
else
|
||||||
|
return Hero(
|
||||||
|
tag: widget.tag ?? widget.file.hashCode,
|
||||||
|
child: Image.file(widget.file!),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: Get.back,
|
||||||
|
child: Scaffold(
|
||||||
|
backgroundColor: Colors.black54,
|
||||||
|
body: InteractiveViewer(
|
||||||
|
boundaryMargin: EdgeInsets.all(48),
|
||||||
|
minScale: 0.2,
|
||||||
|
maxScale: 10,
|
||||||
|
child: Center(child: image),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue