diff --git a/lib/models/house_keeping/house_keeping_list_model.dart b/lib/models/house_keeping/house_keeping_list_model.dart new file mode 100644 index 00000000..9321b0e4 --- /dev/null +++ b/lib/models/house_keeping/house_keeping_list_model.dart @@ -0,0 +1,66 @@ +import 'package:equatable/equatable.dart'; + +import 'package:aku_community/model/common/img_model.dart'; +import 'package:json_annotation/json_annotation.dart'; +part 'house_keeping_list_model.g.dart'; + +@JsonSerializable() +class HouseKeepingListModel extends Equatable { + final int id; + final String proposerName; + final String proposerTel; + final String roomName; + final int type; + final String content; + final int status; + final int? completion; + final String? processDescription; + final String? handlingTime; + final double? payFee; + final int? evaluation; + final String? evaluationContent; + final String? evaluationTime; + final String createDate; + final List submitImgList; + HouseKeepingListModel({ + required this.id, + required this.proposerName, + required this.proposerTel, + required this.roomName, + required this.type, + required this.content, + required this.status, + this.completion, + this.processDescription, + this.handlingTime, + this.payFee, + this.evaluation, + this.evaluationContent, + this.evaluationTime, + required this.createDate, + required this.submitImgList, + }); + factory HouseKeepingListModel.fromJson(Map json) => + _$HouseKeepingListModelFromJson(json); + @override + List get props { + return [ + id, + proposerName, + proposerTel, + roomName, + type, + content, + status, + completion, + processDescription, + handlingTime, + payFee, + evaluation, + evaluationContent, + evaluationTime, + createDate, + submitImgList, + ]; + } +} diff --git a/lib/models/house_keeping/house_keeping_list_model.g.dart b/lib/models/house_keeping/house_keeping_list_model.g.dart new file mode 100644 index 00000000..713bcade --- /dev/null +++ b/lib/models/house_keeping/house_keeping_list_model.g.dart @@ -0,0 +1,31 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'house_keeping_list_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +HouseKeepingListModel _$HouseKeepingListModelFromJson( + Map json) { + return HouseKeepingListModel( + id: json['id'] as int, + proposerName: json['proposerName'] as String, + proposerTel: json['proposerTel'] as String, + roomName: json['roomName'] as String, + type: json['type'] as int, + content: json['content'] as String, + status: json['status'] as int, + completion: json['completion'] as int?, + processDescription: json['processDescription'] as String?, + handlingTime: json['handlingTime'] as String?, + payFee: (json['payFee'] as num?)?.toDouble(), + evaluation: json['evaluation'] as int?, + evaluationContent: json['evaluationContent'] as String?, + evaluationTime: json['evaluationTime'] as String?, + createDate: json['createDate'] as String, + submitImgList: (json['submitImgList'] as List) + .map((e) => ImgModel.fromJson(e as Map)) + .toList(), + ); +} diff --git a/lib/ui/manager/house_keeping/house_keeping_func.dart b/lib/ui/manager/house_keeping/house_keeping_func.dart new file mode 100644 index 00000000..45a030eb --- /dev/null +++ b/lib/ui/manager/house_keeping/house_keeping_func.dart @@ -0,0 +1,20 @@ +import 'package:aku_community/constants/api.dart'; +import 'package:aku_community/utils/network/base_model.dart'; +import 'package:aku_community/utils/network/net_util.dart'; + +class HouseKeepingFunc { + static Future submitHouseKeeping( + int estateId, + int type, + String content, + List urls + ) async { + BaseModel baseModel = await NetUtil().post(API.manager.submitHouseKeeping, + params: {"estateId": estateId, "type": type, "content": content,"submitImgUrls":urls}); + if (baseModel.status ?? false) { + return true; + } else { + return false; + } + } +}