update life pay record page

hmxc
张萌 3 years ago
parent ce6165d9c3
commit cf4a65f706

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

Loading…
Cancel
Save