From dda81c802d3436f23c97f8ecb272cd8677a3c028 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Tue, 13 Jul 2021 15:54:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E5=AE=B6=E6=94=BF=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../house_keeping_list_model.dart | 66 +++++++++++++++++++ .../house_keeping_list_model.g.dart | 31 +++++++++ .../house_keeping/house_keeping_func.dart | 20 ++++++ 3 files changed, 117 insertions(+) create mode 100644 lib/models/house_keeping/house_keeping_list_model.dart create mode 100644 lib/models/house_keeping/house_keeping_list_model.g.dart create mode 100644 lib/ui/manager/house_keeping/house_keeping_func.dart 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; + } + } +}