|
|
@ -1,5 +1,8 @@
|
|
|
|
// Flutter imports:
|
|
|
|
// Flutter imports:
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/const/api.dart';
|
|
|
|
import 'package:aku_community_manager/models/manager/bussiness_and_fix/bussiness_and_fix_model.dart';
|
|
|
|
import 'package:aku_community_manager/models/manager/bussiness_and_fix/bussiness_and_fix_model.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/models/user/user_info_model.dart';
|
|
|
|
|
|
|
|
import 'package:aku_community_manager/provider/user_provider.dart';
|
|
|
|
import 'package:aku_community_manager/tools/aku_map.dart';
|
|
|
|
import 'package:aku_community_manager/tools/aku_map.dart';
|
|
|
|
import 'package:aku_community_manager/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart';
|
|
|
|
import 'package:aku_community_manager/ui/sub_pages/business_and_fix/business_and_fix_detail_page.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
@ -11,8 +14,6 @@ import 'package:get/get.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
|
|
// Project imports:
|
|
|
|
// Project imports:
|
|
|
|
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
|
|
|
|
|
|
|
|
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/screen_tool.dart';
|
|
|
|
import 'package:aku_community_manager/tools/screen_tool.dart';
|
|
|
|
import 'package:aku_community_manager/tools/widget_tool.dart';
|
|
|
|
import 'package:aku_community_manager/tools/widget_tool.dart';
|
|
|
@ -29,9 +30,9 @@ class BusinessFixCard extends StatefulWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
class _BusinessFixCardState extends State<BusinessFixCard> {
|
|
|
|
class _BusinessFixCardState extends State<BusinessFixCard> {
|
|
|
|
USER_ROLE get userRole {
|
|
|
|
UserInfoModel get userInfoModel {
|
|
|
|
final userProvider = Provider.of<UserProvider>(context, listen: false);
|
|
|
|
final userProvider = Provider.of<UserProvider>(context, listen: false);
|
|
|
|
return userProvider.userInfoModel.role;
|
|
|
|
return userProvider.infoModel;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String get dateStart => DateUtil.formatDateStr(widget.model.repairDate,
|
|
|
|
String get dateStart => DateUtil.formatDateStr(widget.model.repairDate,
|
|
|
@ -61,10 +62,9 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final userProvider = Provider.of<UserProvider>(context, listen: false);
|
|
|
|
|
|
|
|
return GestureDetector(
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
onTap: () {
|
|
|
|
Get.to(BusinessAndFixDetailPage(model: widget.model));
|
|
|
|
Get.to(() => BusinessAndFixDetailPage(model: widget.model));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.all(24.w),
|
|
|
|
padding: EdgeInsets.all(24.w),
|
|
|
@ -86,12 +86,10 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
AkuMap.fixStatus(
|
|
|
|
AkuMap.fixStatus(userInfoModel.canOperation,
|
|
|
|
userProvider.infoModel.canOperation,
|
|
|
|
userInfoModel.canPickUpTicket, widget.model.status),
|
|
|
|
userProvider.infoModel.canPickUpTicket,
|
|
|
|
|
|
|
|
widget.model.status),
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
color: widget.model.status <4
|
|
|
|
color: widget.model.status < 4
|
|
|
|
? Color(0XFFFF4501)
|
|
|
|
? Color(0XFFFF4501)
|
|
|
|
: AppStyle.minorTextColor,
|
|
|
|
: AppStyle.minorTextColor,
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -141,7 +139,8 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
child: FadeInImage.assetNetwork(
|
|
|
|
child: FadeInImage.assetNetwork(
|
|
|
|
placeholder: R.ASSETS_PLACEHOLDER_WEBP, image: imgObj),
|
|
|
|
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
|
|
|
|
|
|
|
|
image: API.image(imgObj ?? '')),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
itemCount: widget.model.imgUrls.length,
|
|
|
|
itemCount: widget.model.imgUrls.length,
|
|
|
@ -150,118 +149,115 @@ class _BusinessFixCardState extends State<BusinessFixCard> {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_buildBottomCard() {
|
|
|
|
_buildBottomCard() {
|
|
|
|
switch (userRole) {
|
|
|
|
if (userInfoModel.canPickUpTicket) {
|
|
|
|
case USER_ROLE.FIXER:
|
|
|
|
if (widget.model.status > 4) return SizedBox();
|
|
|
|
if (widget.model.status > 4) return SizedBox();
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Divider(
|
|
|
|
Divider(
|
|
|
|
height: 48.w,
|
|
|
|
height: 48.w,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Row(
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Spacer(),
|
|
|
|
Spacer(),
|
|
|
|
widget.model.status == 3
|
|
|
|
widget.model.status == 3
|
|
|
|
? MaterialButton(
|
|
|
|
? MaterialButton(
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
height: 64.w,
|
|
|
|
height: 64.w,
|
|
|
|
minWidth: 160.w,
|
|
|
|
minWidth: 160.w,
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
borderRadius: BorderRadius.circular(4.w),
|
|
|
|
borderRadius: BorderRadius.circular(4.w),
|
|
|
|
side: BorderSide(
|
|
|
|
side: BorderSide(
|
|
|
|
width: 2.w,
|
|
|
|
width: 2.w,
|
|
|
|
color: AppStyle.primaryColor,
|
|
|
|
color: AppStyle.primaryColor,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: Text(
|
|
|
|
),
|
|
|
|
'申请延时',
|
|
|
|
child: Text(
|
|
|
|
style: TextStyle(
|
|
|
|
'申请延时',
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 28.sp,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
fontSize: 28.sp,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onPressed: () {
|
|
|
|
),
|
|
|
|
// Get.to(FixMoreTimePage(model: widget.model));
|
|
|
|
onPressed: () {
|
|
|
|
},
|
|
|
|
// Get.to(FixMoreTimePage(model: widget.model));
|
|
|
|
)
|
|
|
|
},
|
|
|
|
: SizedBox(),
|
|
|
|
)
|
|
|
|
widget.model.status == 3 ? AkuBox.w(24) : SizedBox(),
|
|
|
|
: SizedBox(),
|
|
|
|
widget.model.status == 3
|
|
|
|
widget.model.status == 3 ? AkuBox.w(24) : SizedBox(),
|
|
|
|
? AkuMaterialButton(
|
|
|
|
widget.model.status == 3
|
|
|
|
onPressed: () {
|
|
|
|
? AkuMaterialButton(
|
|
|
|
// Get.to(FixWorkFinishPage(model: widget.model));
|
|
|
|
onPressed: () {
|
|
|
|
},
|
|
|
|
// Get.to(FixWorkFinishPage(model: widget.model));
|
|
|
|
radius: 4.w,
|
|
|
|
},
|
|
|
|
color: AppStyle.primaryColor,
|
|
|
|
radius: 4.w,
|
|
|
|
minWidth: 160.w,
|
|
|
|
color: AppStyle.primaryColor,
|
|
|
|
height: 64.w,
|
|
|
|
minWidth: 160.w,
|
|
|
|
child: Text(
|
|
|
|
height: 64.w,
|
|
|
|
'处理完成',
|
|
|
|
child: Text(
|
|
|
|
style: TextStyle(
|
|
|
|
'处理完成',
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 28.sp,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
fontSize: 28.sp,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
),
|
|
|
|
: SizedBox(),
|
|
|
|
)
|
|
|
|
widget.model.status == 2
|
|
|
|
: SizedBox(),
|
|
|
|
? AkuMaterialButton(
|
|
|
|
widget.model.status == 2
|
|
|
|
onPressed: () {
|
|
|
|
? AkuMaterialButton(
|
|
|
|
// final userProvider =
|
|
|
|
onPressed: () {
|
|
|
|
// Provider.of<UserProvider>(context, listen: false);
|
|
|
|
// final userProvider =
|
|
|
|
// widget.model.detail.fixStatuses.add(FixStatus(
|
|
|
|
// Provider.of<UserProvider>(context, listen: false);
|
|
|
|
// title: '${userProvider.userInfoModel.nickName}已接单',
|
|
|
|
// widget.model.detail.fixStatuses.add(FixStatus(
|
|
|
|
// date: DateTime.now(),
|
|
|
|
// title: '${userProvider.userInfoModel.nickName}已接单',
|
|
|
|
// ));
|
|
|
|
// date: DateTime.now(),
|
|
|
|
// widget.model.type = FIX_ENUM.PROCESSING;
|
|
|
|
// ));
|
|
|
|
// Get.back();
|
|
|
|
// widget.model.type = FIX_ENUM.PROCESSING;
|
|
|
|
},
|
|
|
|
// Get.back();
|
|
|
|
radius: 4.w,
|
|
|
|
},
|
|
|
|
color: AppStyle.primaryColor,
|
|
|
|
radius: 4.w,
|
|
|
|
minWidth: 160.w,
|
|
|
|
color: AppStyle.primaryColor,
|
|
|
|
height: 64.w,
|
|
|
|
minWidth: 160.w,
|
|
|
|
child: Text(
|
|
|
|
height: 64.w,
|
|
|
|
'立即接单',
|
|
|
|
child: Text(
|
|
|
|
style: TextStyle(
|
|
|
|
'立即接单',
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: 28.sp,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
),
|
|
|
|
fontSize: 28.sp,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
),
|
|
|
|
: SizedBox(),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
: SizedBox(),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
],
|
|
|
|
break;
|
|
|
|
);
|
|
|
|
default:
|
|
|
|
} else {
|
|
|
|
return Column(
|
|
|
|
return Column(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
widget.homeDisplay ? Divider(height: 24.w) : Divider(height: 48.w),
|
|
|
|
widget.homeDisplay ? Divider(height: 24.w) : Divider(height: 48.w),
|
|
|
|
Align(
|
|
|
|
Align(
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
child: AkuMaterialButton(
|
|
|
|
child: AkuMaterialButton(
|
|
|
|
height: 64.w,
|
|
|
|
height: 64.w,
|
|
|
|
onPressed: () {
|
|
|
|
onPressed: () {
|
|
|
|
// Get.to(BusinessAndFixDetailPage(model: widget.model));
|
|
|
|
Get.to(() => BusinessAndFixDetailPage(model: widget.model));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
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,
|
|
|
|
fontSize: 28.sp,
|
|
|
|
fontSize: 28.sp,
|
|
|
|
height: 40 / 28,
|
|
|
|
height: 40 / 28,
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
],
|
|
|
|
break;
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|