添加:生活缴费记录页

对接:缴费记录
hmxc
张萌 4 years ago
parent 268a48d617
commit d0141fda34

@ -182,6 +182,9 @@ class _Manager {
///app
String get questionnaireSubmit => '/user/questionnaire/submit';
///
String get paymentRecord => '/user/dailyPayment/paymentRecord';
}
class _Community {

@ -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;
}
}

@ -1,4 +1,5 @@
import 'package:akuCommunity/constants/app_values.dart';
import 'package:akuCommunity/pages/life_pay/life_pay_record_page.dart';
import 'package:akuCommunity/provider/app_provider.dart';
import 'package:akuCommunity/ui/profile/house/pick_my_house_page.dart';
import 'package:flutter/cupertino.dart';
@ -214,7 +215,7 @@ class _LifePayPageState extends State<LifePayPage> {
actions: [
InkWell(
onTap: () {
// LifePayRecordPage().to();
Get.to(() => LifePayRecordPage());
},
child: Container(
padding: EdgeInsets.fromLTRB(32.w, 28.w, 32.w, 20.w),

@ -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…
Cancel
Save