hmxc
张萌 3 years ago
parent 103b1dffe2
commit b79b6c7ec5

@ -280,6 +280,13 @@ class _Manage {
///app
String get submitRenovation => '/user/userDecorationNew/submitReport';
///app
String get newHouseKeepingList => '/user/housekeepingService/list';
///appid
String get newHouseKeepingProcess =>
'/user/housekeepingService/findHousekeepingProcessRecord';
}
class _Upload {

@ -92,6 +92,17 @@ class HouseKeepingListModel extends Equatable {
}
}
String get completionString {
switch (this.completion) {
case 1:
return '未完成';
case 2:
return '已完成';
default:
return '未知';
}
}
@override
List<Object?> get props {
return [

@ -0,0 +1,46 @@
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
part 'house_keeping_process_model.g.dart';
@JsonSerializable()
class HouseKeepingProcessModel extends Equatable {
final int id;
final int housekeepingServiceId;
final String operationDate;
final int operationType;
@JsonKey(name: 'operator')
final int opName;
final int operatorType;
final String operatorContent;
HouseKeepingProcessModel({
required this.id,
required this.housekeepingServiceId,
required this.operationDate,
required this.operationType,
required this.opName,
required this.operatorType,
required this.operatorContent,
});
factory HouseKeepingProcessModel.fromJson(Map<String, dynamic> json) =>
_$HouseKeepingProcessModelFromJson(json);
factory HouseKeepingProcessModel.fail() => HouseKeepingProcessModel(
id: -1,
housekeepingServiceId: -1,
operationDate: '',
opName: 0,
operationType: 0,
operatorContent: '',
operatorType: 1);
@override
List<Object> get props {
return [
id,
housekeepingServiceId,
operationDate,
operationType,
operatorType,
operatorContent,
];
}
}

@ -0,0 +1,20 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'house_keeping_process_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
HouseKeepingProcessModel _$HouseKeepingProcessModelFromJson(
Map<String, dynamic> json) {
return HouseKeepingProcessModel(
id: json['id'] as int,
housekeepingServiceId: json['housekeepingServiceId'] as int,
operationDate: json['operationDate'] as String,
operationType: json['operationType'] as int,
opName: json['operator'] as int,
operatorType: json['operatorType'] as int,
operatorContent: json['operatorContent'] as String,
);
}

@ -1,9 +1,11 @@
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/json_models/manager/house_keeping/house_keeping_process_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/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_func.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';
@ -22,7 +24,14 @@ class HouseKeepingCard extends StatelessWidget {
Widget build(BuildContext context) {
return GestureDetector(
onTap: () async {
await Get.to(() => HouseKeepingDetailPage(model: model));
List<HouseKeepingProcessModel> processModels =
await HouseKeepingFunc.getHouseKeepingProcess(
model.id,
);
await Get.to(() => HouseKeepingDetailPage(
model: model,
processModels: processModels,
));
callRefresh();
},
child: Container(

@ -1,5 +1,6 @@
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/json_models/manager/house_keeping/house_keeping_process_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_feed_back_page.dart';
@ -15,9 +16,14 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community_manager/utils/extension/list_extension.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
class HouseKeepingDetailPage extends StatefulWidget {
final HouseKeepingListModel model;
HouseKeepingDetailPage({Key? key, required this.model}) : super(key: key);
final List<HouseKeepingProcessModel> processModels;
HouseKeepingDetailPage(
{Key? key, required this.model, required this.processModels})
: super(key: key);
@override
_HouseKeepingDetailPageState createState() => _HouseKeepingDetailPageState();
@ -85,7 +91,7 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
children: [
'完成情况'.text.size(28.sp).color(kTextSubColor).make(),
Spacer(),
'widget.model.completionString'.text.size(32.sp).black.make()
widget.model.completionString.text.size(32.sp).black.make()
],
),
40.w.heightBox,
@ -99,7 +105,7 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
8.w.widthBox,
'维修人'.text.size(28.sp).color(kTextSubColor).make(),
Spacer(),
'widget.model.proposerName'.text.size(28.sp).black.make(),
widget.model.handlerName!.text.size(28.sp).black.make(),
],
),
16.w.heightBox,
@ -113,20 +119,21 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
8.w.widthBox,
'联系电话'.text.size(28.sp).color(kTextSubColor).make(),
Spacer(),
'widget.model.proposerTel'.text.size(28.sp).black.make(),
widget.model.handlerTel!.text.size(28.sp).black.make(),
],
),
16.w.heightBox,
40.w.heightBox,
'处理描述'.text.size(28.sp).color(kTextSubColor).make(),
24.w.heightBox,
('widget.model.processDescription')
.text
widget.model.processDescription!.text
.size(2)
.black
.softWrap(true)
.make(),
BeeGridImageView(urls: [])
BeeGridImageView(
urls:
widget.model.handlerImgList.map((e) => e.url ?? '').toList())
],
),
);
@ -152,7 +159,7 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
allowHalfRating: true,
itemPadding: EdgeInsets.symmetric(horizontal: 15.w),
itemSize: 32.w,
initialRating: (0).toDouble(),
initialRating: (widget.model.evaluation!).toDouble(),
ratingWidget: RatingWidget(
empty: Icon(
CupertinoIcons.star,
@ -171,8 +178,15 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
40.w.heightBox,
AkuDivider.horizontal(),
40.w.heightBox,
('').text.size(28.sp).black.softWrap(true).make(),
BeeGridImageView(urls: [])
widget.model.evaluationContent!.text
.size(28.sp)
.black
.softWrap(true)
.make(),
BeeGridImageView(
urls: widget.model.evaluationImgList
.map((e) => e.url ?? '')
.toList())
],
),
);
@ -181,15 +195,21 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
_buildInfo() {
return AkuTitleBox(
title: '服务信息',
suffix: widget.model.statusString.text.size(28.sp).color(Color(0xFFFF4501)).make(),
suffix: widget.model.statusString.text
.size(28.sp)
.color(Color(0xFFFF4501))
.make(),
children: [
16.w.heightBox,
_buildTile(R.ASSETS_MESSAGE_IC_PEOPLE_PNG, '报修人', widget.model.proposerName),
_buildTile(R.ASSETS_MESSAGE_IC_PHONE_PNG, '联系电话', widget.model.proposerTel),
_buildTile(R.ASSETS_MESSAGE_IC_AREA_PNG, '报修区域', '${0}'),
_buildTile(
R.ASSETS_MESSAGE_IC_PEOPLE_PNG, '申请人', widget.model.proposerName),
_buildTile(
R.ASSETS_MESSAGE_IC_PHONE_PNG, '联系电话', widget.model.proposerTel),
_buildTile(R.ASSETS_MESSAGE_IC_AREA_PNG, '地址',
'${S.of(context)!.tempPlotName}·${widget.model.roomName}'),
8.w.heightBox,
Text(
'',
widget.model.content,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontWeight: FontWeight.bold,
@ -203,11 +223,12 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
crossAxisSpacing: 16.w,
mainAxisSpacing: 16.w,
),
children: [].map((e) {
children: widget.model.submitImgList.map((e) {
return ClipRRect(
borderRadius: BorderRadius.circular(4.w),
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_PLACEHOLDER_WEBP, image: API.image('')),
placeholder: R.ASSETS_PLACEHOLDER_WEBP,
image: API.image(e.url ?? '')),
);
}).toList(),
shrinkWrap: true,
@ -248,11 +269,11 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
_buildProcess() {
return AkuTitleBox(
title: '报修进程',
children: [].map((e) {
title: '服务进程',
children: widget.processModels.map((e) {
return _buildProcessTile(
'',
DateUtil.formatDateStr(e.operationDate!,
e.operatorContent,
DateUtil.formatDateStr(e.operationDate,
format: 'yyyy-MM-dd HH:mm:ss'),
);
}).toList(),

@ -0,0 +1,19 @@
import 'package:aku_community_manager/const/api.dart';
import 'package:aku_community_manager/json_models/manager/house_keeping/house_keeping_process_model.dart';
import 'package:aku_community_manager/utils/network/base_model.dart';
import 'package:aku_community_manager/utils/network/net_util.dart';
class HouseKeepingFunc {
///
static Future getHouseKeepingProcess(int id) async {
BaseModel baseModel = await NetUtil().get(API.manage.newHouseKeepingProcess,
params: {"housekeepingServiceId": id});
if (baseModel.status ?? false) {
return (baseModel.data as List)
.map((e) => HouseKeepingProcessModel.fromJson(e))
.toList();
} else {
return [];
}
}
}

@ -33,8 +33,10 @@ class _HouseKeepingViewState extends State<HouseKeepingView> {
@override
Widget build(BuildContext context) {
return BeeListView(
path: API.manage.houseKeepingList,
// extraParams: {"status": widget.index == 0 ? null : widget.index},
path: API.manage.newHouseKeepingList,
extraParams: {
"housekeepingServiceStatus": widget.index == 0 ? null : widget.index
},
controller: _refreshController,
convert: (models) {
return models.tableList!

Loading…
Cancel
Save