报事报修!

hmxc
小赖 4 years ago
parent 792eeafaaa
commit bb70e7d442

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

@ -49,6 +49,24 @@ class FixModel {
static List<FixModel> initList() { static List<FixModel> initList() {
return [ return [
FixModel(
title: '小区大道路灯坏了。',
dateStart: DateTime(2020, 10, 25, 14, 28, 56),
type: FIX_ENUM.HAND_OUT,
imgs: [
R.ASSETS_STATIC_FIX_LIGHT1_PNG,
R.ASSETS_STATIC_FIX_LIGHT2_PNG,
R.ASSETS_STATIC_FIX_LIGHT3_PNG,
],
detail: FixDetailModel(
userName: '杨建',
userPhoneNumber: '18882928888',
fixArea: 'C区',
fixStatuses: [
FixStatus(title: '申请保修', date: DateTime(2020, 10, 23, 10, 28, 56)),
],
),
),
FixModel( FixModel(
title: '小区西大门车栏坏了,请物业尽快修理更换。', title: '小区西大门车栏坏了,请物业尽快修理更换。',
dateStart: DateTime(2020, 10, 21, 7, 28, 56), dateStart: DateTime(2020, 10, 21, 7, 28, 56),
@ -147,6 +165,16 @@ enum FIX_PAYMENT_TYPE {
PAY, PAY,
} }
Map<FIX_PAYMENT_TYPE, String> fixPaymentMap = {
FIX_PAYMENT_TYPE.FREE: '无偿服务',
FIX_PAYMENT_TYPE.PAY: '有偿服务',
};
Map<String, FIX_PAYMENT_TYPE> fixPaymentStringMap = {
'无偿服务': FIX_PAYMENT_TYPE.FREE,
'有偿服务': FIX_PAYMENT_TYPE.PAY,
};
/// ///
enum FIX_SUB_TYPE { enum FIX_SUB_TYPE {
/// ///
@ -156,6 +184,16 @@ enum FIX_SUB_TYPE {
HURRY, HURRY,
} }
Map<FIX_SUB_TYPE, String> fixSubTypeMap = {
FIX_SUB_TYPE.NORMAL: '一般单',
FIX_SUB_TYPE.HURRY: '加急单',
};
Map<String, FIX_SUB_TYPE> fixSubTypeStringMap = {
'一般单': FIX_SUB_TYPE.NORMAL,
'加急单': FIX_SUB_TYPE.HURRY,
};
/// ///
enum FIX_DATE_LIMIT { enum FIX_DATE_LIMIT {
HOUR_24, HOUR_24,
@ -163,6 +201,18 @@ enum FIX_DATE_LIMIT {
HOUR_8, HOUR_8,
} }
Map<FIX_DATE_LIMIT, String> fixDateLimitMap = {
FIX_DATE_LIMIT.HOUR_24: '24小时内处理',
FIX_DATE_LIMIT.HOUR_12: '12小时内处理',
FIX_DATE_LIMIT.HOUR_8: '8小时内处理',
};
Map<String, FIX_DATE_LIMIT> fixDateLimitStringMap = {
'24小时内处理': FIX_DATE_LIMIT.HOUR_24,
'12小时内处理': FIX_DATE_LIMIT.HOUR_12,
'8小时内处理': FIX_DATE_LIMIT.HOUR_8,
};
class FixDetailModel { class FixDetailModel {
/// ///
String userName; String userName;

@ -30,6 +30,10 @@ class FixProvider extends ChangeNotifier {
.where((element) => element.type == FIX_ENUM.WAIT_PICKUP) .where((element) => element.type == FIX_ENUM.WAIT_PICKUP)
.toList(); .toList();
List<FixModel> _fixerModels = _fixModels
.where((element) => element.type != FIX_ENUM.HAND_OUT)
.toList();
switch (role) { switch (role) {
case USER_ROLE.MANAGER: case USER_ROLE.MANAGER:
return [ return [
@ -46,7 +50,7 @@ class FixProvider extends ChangeNotifier {
_waitPickUpModels, _waitPickUpModels,
_processingModels, _processingModels,
_doneModels, _doneModels,
_fixModels, _fixerModels,
][index]; ][index];
break; break;
} }

@ -72,8 +72,10 @@ class _LoginPageState extends State<LoginPage> {
onChanged: (text) { onChanged: (text) {
setState(() {}); setState(() {});
}, },
maxLength: 11,
keyboardType: TextInputType.phone, keyboardType: TextInputType.phone,
decoration: InputDecoration( decoration: InputDecoration(
counterText: '',
suffixIconConstraints: BoxConstraints( suffixIconConstraints: BoxConstraints(
minHeight: 0, minHeight: 0,
minWidth: 0, minWidth: 0,

@ -5,6 +5,8 @@ import 'package:aku_community_manager/provider/user_provider.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/widget_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/inner/show_bottom_sheet.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
@ -25,6 +27,7 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
return userProvider.userInfoModel.role; return userProvider.userInfoModel.role;
} }
bool get isHandOut => widget.model.type == FIX_ENUM.HAND_OUT;
FixDetailModel get detailModel => widget.model.detail; FixDetailModel get detailModel => widget.model.detail;
String get fixType { String get fixType {
@ -102,11 +105,115 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
padding: EdgeInsets.symmetric(vertical: 16.w), padding: EdgeInsets.symmetric(vertical: 16.w),
children: [ children: [
_buildInfo(), _buildInfo(),
_buildType(), _buildType(widget.model.type == FIX_ENUM.HAND_OUT),
_buildProcess(), _buildProcess(),
_buildResult(), detailModel.result == null ? SizedBox() : _buildResult(),
], ],
), ),
bottom: Builder(
builder: (context) {
final userProvider =
Provider.of<UserProvider>(context, listen: false);
if (widget.model.type == FIX_ENUM.HAND_OUT) {
return AkuMaterialButton(
color: AppStyle.primaryColor,
nullColor: AppStyle.minorColor,
onPressed: detailModel.type != null &&
detailModel.subType != null &&
detailModel.limit != null
? () {}
: null,
child: Text(
'立即派单',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
);
} else if (widget.model.type == FIX_ENUM.WAIT_PICKUP) {
if (userProvider.userInfoModel.role == USER_ROLE.MANAGER) {
return AkuMaterialButton(
color: AppStyle.primaryColor,
nullColor: AppStyle.minorColor,
onPressed: () {},
child: Text(
'改派',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
);
} else {
return AkuMaterialButton(
color: AppStyle.primaryColor,
nullColor: AppStyle.minorColor,
onPressed: () {},
child: Text(
'立即接单',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
);
}
} else if (widget.model.type == FIX_ENUM.PROCESSING &&
userProvider.userInfoModel.role == USER_ROLE.FIXER)
return Container(
height: 96.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Colors.white,
boxShadow: [
BoxShadow(
offset: Offset(0, -10.w),
blurRadius: 10.w,
color: Color(0xFFF9F9F9),
)
],
),
child: Row(
children: [
AkuBox.w(32),
MaterialButton(
height: 72.w,
minWidth: 304.w,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.w),
side: BorderSide(
width: 2.w,
color: AppStyle.primaryColor,
),
),
onPressed: () {},
child: Text(
'申请延时',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
),
Spacer(),
AkuMaterialButton(
height: 72.w,
minWidth: 304.w,
radius: 4.w,
color: AppStyle.primaryColor,
onPressed: () {},
child: Text(
'处理完成',
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
),
AkuBox.w(32),
],
),
);
else
return SizedBox();
},
),
); );
} }
@ -160,13 +267,64 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
); );
} }
_buildType() { _buildType(bool canTap) {
return _buildRawBox( return _buildRawBox(
title: '工单类型', title: '工单类型',
children: [ children: [
_buildTypeTile('派单类型', fixType, false), _buildTypeTile(
_buildTypeTile('工单时限', dateLimit, false), '派单类型',
_buildTypeTile('工单子类', subType, false), fixType,
canTap,
helpContent: '请选择服务类型',
onTap: () {
showItemSheet(
title: '派单类型',
items: ['无偿服务', '有偿服务'],
selectItem: fixPaymentMap[detailModel.type],
onTap: (result) {
detailModel.type = fixPaymentStringMap[result];
},
).then((_) {
setState(() {});
});
},
),
_buildTypeTile(
'工单时限',
dateLimit,
canTap,
helpContent: '请选择工单时限',
onTap: () {
showItemSheet(
title: '工单时限',
items: ['24小时内处理', '12小时内处理', '8小时内处理'],
selectItem: fixDateLimitMap[detailModel.limit],
onTap: (result) {
detailModel.limit = fixDateLimitStringMap[result];
},
).then((_) {
setState(() {});
});
},
),
_buildTypeTile(
'工单子类',
subType,
canTap,
helpContent: '请选择工单子类',
onTap: () {
showItemSheet(
title: '工单子类',
items: ['一般单', '加急单'],
selectItem: fixSubTypeMap[detailModel.subType],
onTap: (result) {
detailModel.subType = fixSubTypeStringMap[result];
},
).then((_) {
setState(() {});
});
},
),
], ],
); );
} }
@ -276,11 +434,12 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
); );
} }
Widget _buildTypeTile(String title, String content, bool canTap) { Widget _buildTypeTile(String title, String content, bool canTap,
{VoidCallback onTap, String helpContent}) {
return Material( return Material(
color: Colors.transparent, color: Colors.transparent,
child: InkWell( child: InkWell(
onTap: canTap ? () {} : null, onTap: canTap ? onTap : null,
child: Row( child: Row(
children: [ children: [
AkuBox.h(96), AkuBox.h(96),
@ -293,13 +452,23 @@ class _BusinessAndFixDetailPageState extends State<BusinessAndFixDetailPage> {
), ),
Spacer(), Spacer(),
Text( Text(
content, TextUtil.isEmpty(content) ? helpContent : content,
style: TextStyle( style: TextStyle(
fontSize: 28.sp, fontSize: 28.sp,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: AppStyle.primaryTextColor, color: TextUtil.isEmpty(content)
? AppStyle.minorTextColor
: AppStyle.primaryTextColor,
), ),
), ),
isHandOut ? AkuBox.w(24) : SizedBox(),
isHandOut
? Icon(
Icons.arrow_forward_ios,
size: 24.w,
color: AppStyle.minorTextColor,
)
: SizedBox(),
], ],
), ),
), ),

@ -29,11 +29,8 @@ class _BusinessAndFixPageState extends State<BusinessAndFixPage>
case USER_ROLE.FIXER: case USER_ROLE.FIXER:
return ['待接单', '处理中', '已处理', '全部']; return ['待接单', '处理中', '已处理', '全部'];
break; break;
case USER_ROLE.SECURITY:
return [];
break;
default: default:
return []; return ['待接单', '处理中', '已处理', '全部'];
break; break;
} }
} }

@ -52,64 +52,70 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return GestureDetector(
padding: EdgeInsets.all(24), onTap: () {
child: Column( Get.to(BusinessAndFixDetailPage(model: widget.model));
crossAxisAlignment: CrossAxisAlignment.start, },
mainAxisSize: MainAxisSize.min, child: Container(
children: [ padding: EdgeInsets.all(24.w),
Row( child: Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Container( mainAxisSize: MainAxisSize.min,
child: Text( children: [
'报事报修', Row(
style: TextStyle( children: [
color: AppStyle.secondaryColor, Container(
fontSize: 20.sp, child: Text(
fontWeight: FontWeight.bold, '报事报修',
style: TextStyle(
color: AppStyle.secondaryColor,
fontSize: 20.sp,
fontWeight: FontWeight.bold,
),
),
padding:
EdgeInsets.symmetric(vertical: 6.w, horizontal: 16.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2.w),
border:
Border.all(width: 2.w, color: AppStyle.secondaryColor),
), ),
), ),
padding: EdgeInsets.symmetric(vertical: 6.w, horizontal: 16.w), AkuBox.w(16),
decoration: BoxDecoration( Expanded(
borderRadius: BorderRadius.circular(2.w), child: Text(
border: dateStart,
Border.all(width: 2.w, color: AppStyle.secondaryColor), style: TextStyle(
), color: AppStyle.minorTextColor,
), fontSize: 22.sp,
AkuBox.w(16), ),
Expanded(
child: Text(
dateStart,
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 22.sp,
), ),
), ),
fixTypeWidget,
],
),
AkuBox.h(24),
Text(
widget.model.title,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
), ),
fixTypeWidget,
],
),
AkuBox.h(24),
Text(
widget.model.title,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
), ),
), AkuBox.h(16),
AkuBox.h(16), _buildImgs(),
_buildImgs(), _buildBottomCard(),
_buildBottomCard(), ],
], ),
), margin: EdgeInsets.symmetric(
margin: EdgeInsets.symmetric( horizontal: 32.w,
horizontal: 32.w, vertical: 8.w,
vertical: 8.w, ),
), decoration: BoxDecoration(
decoration: BoxDecoration( color: Colors.white,
color: Colors.white, borderRadius: BorderRadius.circular(8.w),
borderRadius: BorderRadius.circular(8.w), ),
), ),
); );
} }

@ -1,19 +1,32 @@
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/screen_tool.dart';
class AkuBackButton extends StatefulWidget { class AkuBackButton extends StatefulWidget {
final Brightness brightness; final Brightness brightness;
final IconData icon; final IconData icon;
final bool text;
AkuBackButton({ AkuBackButton({
Key key, Key key,
this.brightness = Brightness.light, this.brightness = Brightness.light,
this.icon = Icons.arrow_back_ios, this.icon = Icons.arrow_back_ios,
this.text = false,
}) : super(key: key); }) : super(key: key);
AkuBackButton.close({ AkuBackButton.close({
Key key, Key key,
this.brightness = Brightness.light, this.brightness = Brightness.light,
this.icon = Icons.clear, this.icon = Icons.clear,
this.text = false,
}) : super(key: key);
AkuBackButton.text({
Key key,
this.brightness = Brightness.light,
this.icon,
this.text = true,
}) : super(key: key); }) : super(key: key);
@override @override
@ -24,18 +37,32 @@ class _AkuBackButtonState extends State<AkuBackButton> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Navigator.canPop(context) return Navigator.canPop(context)
? IconButton( ? widget.text
icon: Icon( ? AkuMaterialButton(
widget.icon, padding: EdgeInsets.symmetric(horizontal: 32.w),
size: 32.w, onPressed: () {
color: widget.brightness == Brightness.light Navigator.pop(context);
? Color(0xFF333333) },
: Color(0xFFEEEEEE), child: Text(
), '取消',
onPressed: () { style: TextStyle(
Navigator.pop(context); color: AppStyle.primaryTextColor,
}, fontSize: 28.w,
) fontWeight: FontWeight.bold,
),
))
: IconButton(
icon: Icon(
widget.icon,
size: 32.w,
color: widget.brightness == Brightness.light
? Color(0xFF333333)
: Color(0xFFEEEEEE),
),
onPressed: () {
Navigator.pop(context);
},
)
: SizedBox(); : SizedBox();
} }
} }

@ -0,0 +1,75 @@
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
///show bottom sheet
showAkuSheet({
Widget child,
}) async {
await Get.bottomSheet(
Material(
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(16.w)),
),
child: child,
),
);
}
Future showItemSheet({
String title,
List<String> items,
String selectItem,
Function(String result) onTap,
}) async {
await showAkuSheet(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
children: [
Expanded(
child: Align(
alignment: Alignment.centerLeft,
child: AkuBackButton.text(),
),
),
Text(
title,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 32.w,
fontWeight: FontWeight.bold,
),
),
Spacer(),
],
),
...items.map((e) {
return AkuMaterialButton(
height: 96.w,
minWidth: double.infinity,
onPressed: () {
Get.back();
onTap(e);
},
child: Text(
e,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 32.sp,
color: e == selectItem
? AppStyle.secondaryColor
: AppStyle.primaryTextColor,
),
),
);
}).toList(),
],
),
);
}
Loading…
Cancel
Save