update life pay record page

hmxc
张萌 3 years ago
parent ce6165d9c3
commit cf4a65f706

@ -1,44 +1,44 @@
class LifePayRecordModel {
int? id;
String? chargesTemplateDetailName;
String? roomName;
String? years;
num? paidPrice;
String? createDate;
int? payType;
String? code;
// class LifePayRecordModel {
// int? id;
// String? chargesTemplateDetailName;
// String? roomName;
// String? years;
// num? paidPrice;
// String? createDate;
// int? payType;
// String? code;
LifePayRecordModel(
{this.id,
this.chargesTemplateDetailName,
this.roomName,
this.years,
this.paidPrice,
this.createDate,
this.payType,
this.code});
// LifePayRecordModel(
// {this.id,
// this.chargesTemplateDetailName,
// this.roomName,
// this.years,
// this.paidPrice,
// this.createDate,
// this.payType,
// this.code});
LifePayRecordModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
chargesTemplateDetailName = json['chargesTemplateDetailName'];
roomName = json['roomName'];
years = json['years'];
paidPrice = json['paidPrice'];
createDate = json['createDate'];
payType = json['payType'];
code = json['code'];
}
// LifePayRecordModel.fromJson(Map<String, dynamic> json) {
// id = json['id'];
// chargesTemplateDetailName = json['chargesTemplateDetailName'];
// roomName = json['roomName'];
// years = json['years'];
// paidPrice = json['paidPrice'];
// createDate = json['createDate'];
// payType = json['payType'];
// code = json['code'];
// }
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['chargesTemplateDetailName'] = this.chargesTemplateDetailName;
data['roomName'] = this.roomName;
data['years'] = this.years;
data['paidPrice'] = this.paidPrice;
data['createDate'] = this.createDate;
data['payType'] = this.payType;
data['code'] = this.code;
return data;
}
}
// Map<String, dynamic> toJson() {
// final Map<String, dynamic> data = new Map<String, dynamic>();
// data['id'] = this.id;
// data['chargesTemplateDetailName'] = this.chargesTemplateDetailName;
// data['roomName'] = this.roomName;
// data['years'] = this.years;
// data['paidPrice'] = this.paidPrice;
// data['createDate'] = this.createDate;
// data['payType'] = this.payType;
// data['code'] = this.code;
// return data;
// }
// }

@ -0,0 +1,43 @@
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
part 'life_pay_record_model.g.dart';
@JsonSerializable()
class LifePayRecordModel extends Equatable {
final int id;
final String chargesTemplateDetailName;
final String roomName;
final int years;
final num paidPrice;
final String createName;
final String createDate;
final int payType;
final String code;
LifePayRecordModel({
required this.id,
required this.chargesTemplateDetailName,
required this.roomName,
required this.years,
required this.paidPrice,
required this.createName,
required this.createDate,
required this.payType,
required this.code,
});
factory LifePayRecordModel.fromJson(Map<String, dynamic> json) =>
_$LifePayRecordModelFromJson(json);
@override
List<Object> get props {
return [
id,
chargesTemplateDetailName,
roomName,
years,
paidPrice,
createName,
createDate,
payType,
code,
];
}
}

@ -0,0 +1,21 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'life_pay_record_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
LifePayRecordModel _$LifePayRecordModelFromJson(Map<String, dynamic> json) {
return LifePayRecordModel(
id: json['id'] as int,
chargesTemplateDetailName: json['chargesTemplateDetailName'] as String,
roomName: json['roomName'] as String,
years: json['years'] as int,
paidPrice: json['paidPrice'] as num,
createName: json['createName'] as String,
createDate: json['createDate'] as String,
payType: json['payType'] as int,
code: json['code'] as String,
);
}

@ -1,3 +1,5 @@
import 'package:aku_community/models/life_pay/life_pay_record_model.dart';
import 'package:aku_community/widget/others/user_tool.dart';
import 'package:flutter/material.dart';
import 'package:flustars/flustars.dart';
@ -8,7 +10,6 @@ import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/extensions/widget_list_ext.dart';
import 'package:aku_community/model/manager/life_pay_record_model.dart';
import 'package:aku_community/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
@ -22,7 +23,13 @@ class LifePayRecordPage extends StatefulWidget {
class _LifePayRecordPageState extends State<LifePayRecordPage> {
EasyRefreshController? _refreshController;
Map<int, String> getPayType = {1: '支付宝', 2: '微信', 3: '现金', 4: 'pos'};
Map<int, String> getPayType = {
1: '支付宝',
2: '微信',
3: '现金',
4: 'pos',
5: '预缴扣除'
};
@override
void initState() {
super.initState();
@ -41,6 +48,9 @@ class _LifePayRecordPageState extends State<LifePayRecordPage> {
title: '生活缴费',
body: BeeListView(
path: API.manager.paymentRecord,
extraParams: {
"estateId": UserTool.appProveider.selectedHouse!.estateId
},
controller: _refreshController,
convert: (models) {
return models.tableList!
@ -82,7 +92,7 @@ class _LifePayRecordPageState extends State<LifePayRecordPage> {
children: [
Row(
children: [
model.chargesTemplateDetailName!.text
model.chargesTemplateDetailName.text
.size(30.sp)
.color(ktextPrimary)
.bold
@ -95,12 +105,12 @@ class _LifePayRecordPageState extends State<LifePayRecordPage> {
.make()
],
),
50.w.heightBox,
16.w.heightBox,
Row(
children: [
'${model.years}'.text.color(ktextSubColor).size(24.sp).make(),
'缴纳人'.text.color(ktextSubColor).size(24.sp).make(),
Spacer(),
'${model.paidPrice}'
'${model.createName}'
.text
.color(Color(0xFFFC361D))
.size(28.sp)
@ -110,9 +120,16 @@ class _LifePayRecordPageState extends State<LifePayRecordPage> {
),
Row(
children: [
'创建时间'.text.color(ktextSubColor).size(28.sp).make(),
'缴纳金额'.text.color(ktextSubColor).size(28.sp).make(),
Spacer(),
'${DateUtil.formatDateStr(model.createDate!, format: "yyyy/MM/dd HH:mm")}'
'${model.paidPrice}'.text.color(ktextPrimary).size(28.sp).make(),
],
),
Row(
children: [
'缴费时间'.text.color(ktextSubColor).size(28.sp).make(),
Spacer(),
'${DateUtil.formatDateStr(model.createDate, format: "yyyy/MM/dd HH:mm")}'
.text
.color(ktextPrimary)
.size(28.sp)
@ -123,7 +140,7 @@ class _LifePayRecordPageState extends State<LifePayRecordPage> {
children: [
'付款方式'.text.color(ktextSubColor).size(28.sp).make(),
Spacer(),
'${getPayType[model.payType!]}'
'${getPayType[model.payType]}'
.text
.color(ktextPrimary)
.size(28.sp)
@ -137,7 +154,7 @@ class _LifePayRecordPageState extends State<LifePayRecordPage> {
'${model.code}'.text.color(ktextPrimary).size(28.sp).make(),
],
),
],
].sepWidget(separate: 24.w.heightBox),
)
.box
.color(Colors.white)

Loading…
Cancel
Save