From d0141fda34509ef39eeea4d0415a0dd59b0208a4 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Thu, 1 Apr 2021 16:18:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E7=94=9F=E6=B4=BB?= =?UTF-8?q?=E7=BC=B4=E8=B4=B9=E8=AE=B0=E5=BD=95=E9=A1=B5=20=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=EF=BC=9A=E7=BC=B4=E8=B4=B9=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/api.dart | 3 + lib/model/manager/life_pay_record_model.dart | 44 ++++++ lib/pages/life_pay/life_pay_page.dart | 3 +- lib/pages/life_pay/life_pay_record_page.dart | 139 +++++++++++++++++++ 4 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 lib/model/manager/life_pay_record_model.dart create mode 100644 lib/pages/life_pay/life_pay_record_page.dart diff --git a/lib/constants/api.dart b/lib/constants/api.dart index 03c231f7..793e7377 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -182,6 +182,9 @@ class _Manager { ///问卷调查:app问卷调查提交 String get questionnaireSubmit => '/user/questionnaire/submit'; + + ///生活缴费:缴费记录 + String get paymentRecord => '/user/dailyPayment/paymentRecord'; } class _Community { diff --git a/lib/model/manager/life_pay_record_model.dart b/lib/model/manager/life_pay_record_model.dart new file mode 100644 index 00000000..fea38101 --- /dev/null +++ b/lib/model/manager/life_pay_record_model.dart @@ -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 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 toJson() { + final Map data = new Map(); + 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; + } +} diff --git a/lib/pages/life_pay/life_pay_page.dart b/lib/pages/life_pay/life_pay_page.dart index be99ce8c..80c0b370 100644 --- a/lib/pages/life_pay/life_pay_page.dart +++ b/lib/pages/life_pay/life_pay_page.dart @@ -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 { actions: [ InkWell( onTap: () { - // LifePayRecordPage().to(); + Get.to(() => LifePayRecordPage()); }, child: Container( padding: EdgeInsets.fromLTRB(32.w, 28.w, 32.w, 20.w), diff --git a/lib/pages/life_pay/life_pay_record_page.dart b/lib/pages/life_pay/life_pay_record_page.dart new file mode 100644 index 00000000..6fc01950 --- /dev/null +++ b/lib/pages/life_pay/life_pay_record_page.dart @@ -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 { + EasyRefreshController _refreshController; + Map 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(); + } +}