parent
268a48d617
commit
d0141fda34
@ -0,0 +1,44 @@
|
||||
class LifePayRecordModel {
|
||||
int id;
|
||||
String chargesTemplateDetailName;
|
||||
String roomName;
|
||||
String years;
|
||||
int 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.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;
|
||||
}
|
||||
}
|
@ -0,0 +1,139 @@
|
||||
import 'package:akuCommunity/base/base_style.dart';
|
||||
import 'package:akuCommunity/constants/api.dart';
|
||||
import 'package:akuCommunity/model/manager/life_pay_record_model.dart';
|
||||
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
|
||||
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
||||
import 'package:flustars/flustars.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
class LifePayRecordPage extends StatefulWidget {
|
||||
LifePayRecordPage({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_LifePayRecordPageState createState() => _LifePayRecordPageState();
|
||||
}
|
||||
|
||||
class _LifePayRecordPageState extends State<LifePayRecordPage> {
|
||||
EasyRefreshController _refreshController;
|
||||
Map<int, String> getPayType = {1: '支付宝', 2: '微信', 3: '现金', 4: 'pos'};
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_refreshController = EasyRefreshController();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_refreshController?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BeeScaffold(
|
||||
title: '生活缴费',
|
||||
body: BeeListView(
|
||||
path: API.manager.paymentRecord,
|
||||
controller: _refreshController,
|
||||
convert: (models) {
|
||||
return models.tableList
|
||||
.map((e) => LifePayRecordModel.fromJson(e))
|
||||
.toList();
|
||||
},
|
||||
builder: (items) {
|
||||
return ListView(
|
||||
padding: EdgeInsets.symmetric(vertical: 32.w, horizontal: 32.w),
|
||||
children: [
|
||||
'如果有疑问,请联系物业客服 '
|
||||
.richText
|
||||
.withTextSpanChildren([
|
||||
'400-6754322'
|
||||
.textSpan
|
||||
.color(Color(0xFFFF8200))
|
||||
.size(24.sp)
|
||||
.bold
|
||||
.make()
|
||||
])
|
||||
.size(24.sp)
|
||||
.color(ktextSubColor)
|
||||
.make(),
|
||||
32.w.heightBox,
|
||||
...items.map((e) => _buildRecordCard(e)).toList()
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildRecordCard(LifePayRecordModel model) {
|
||||
return Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
model.chargesTemplateDetailName.text
|
||||
.size(30.sp)
|
||||
.color(ktextPrimary)
|
||||
.bold
|
||||
.make(),
|
||||
Spacer(),
|
||||
'人才智慧社区 ${model.roomName}'
|
||||
.text
|
||||
.size(24.sp)
|
||||
.color(Color(0xFF999999))
|
||||
.make()
|
||||
],
|
||||
),
|
||||
50.w.heightBox,
|
||||
Row(
|
||||
children: [
|
||||
'${model.years}年'.text.color(ktextSubColor).size(24.sp).make(),
|
||||
Spacer(),
|
||||
'${model.paidPrice}'
|
||||
.text
|
||||
.color(Color(0xFFFC361D))
|
||||
.size(28.sp)
|
||||
.bold
|
||||
.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)
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
'付款方式'.text.color(ktextSubColor).size(28.sp).make(),
|
||||
Spacer(),
|
||||
'${getPayType[model.payType]}'
|
||||
.text
|
||||
.color(ktextPrimary)
|
||||
.size(28.sp)
|
||||
.make(),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
'订单号'.text.color(ktextSubColor).size(28.sp).make(),
|
||||
Spacer(),
|
||||
'${model.code}'.text.color(ktextPrimary).size(28.sp).make(),
|
||||
],
|
||||
),
|
||||
],
|
||||
)
|
||||
.box
|
||||
.color(Colors.white)
|
||||
.padding(EdgeInsets.symmetric(vertical: 32.w, horizontal: 20.w))
|
||||
.make();
|
||||
}
|
||||
}
|
Loading…
Reference in new issue