From 0a0fbb6cee6365147a0b9c384d45327f54f959ab Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Tue, 6 Jul 2021 11:35:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E9=80=80=E8=BF=98=E4=BF=9D=E8=AF=81=E9=87=91=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=20=E5=AF=B9=E6=8E=A5=E5=85=B6=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/api.dart | 3 + .../house/contract_stop/pay_result_page.dart | 47 +++++++++++++++ .../house/contract_stop/refund_bond_page.dart | 58 +++++++++++++++++++ .../refund_bond_result_page.dart | 50 ++++++++++++++++ lib/ui/profile/house/house_func.dart | 13 +++++ lib/ui/profile/house/house_owners_page.dart | 4 ++ 6 files changed, 175 insertions(+) create mode 100644 lib/ui/profile/house/contract_stop/pay_result_page.dart create mode 100644 lib/ui/profile/house/contract_stop/refund_bond_page.dart create mode 100644 lib/ui/profile/house/contract_stop/refund_bond_result_page.dart diff --git a/lib/constants/api.dart b/lib/constants/api.dart index 1a27f919..7fe1d300 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -500,4 +500,7 @@ class _House { ///我的房屋-终止合同:提交终止申请 String get submitTerminateApplication => '/user/myHouse/submitTerminateApplication'; + + ///我的房屋-合同终止:保证金退还申请 + String get refundApplication => '/user/myHouse/depositRefundApplication'; } diff --git a/lib/ui/profile/house/contract_stop/pay_result_page.dart b/lib/ui/profile/house/contract_stop/pay_result_page.dart new file mode 100644 index 00000000..d25f8c86 --- /dev/null +++ b/lib/ui/profile/house/contract_stop/pay_result_page.dart @@ -0,0 +1,47 @@ +import 'package:aku_community/base/base_style.dart'; +import 'package:aku_community/widget/bee_scaffold.dart'; +import 'package:aku_community/widget/others/finish_result_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class PayResultPage extends StatefulWidget { + PayResultPage({Key? key}) : super(key: key); + + @override + _PayResultPageState createState() => _PayResultPageState(); +} + +class _PayResultPageState extends State { + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '支付信息', + body: Center( + child: Column( + children: [ + 76.w.heightBox, + FinishResultImage( + status: true, + ), + 48.w.heightBox, + '已支付剩余租金'.text.black.size(36.sp).make(), + 96.w.heightBox, + MaterialButton( + elevation: 0, + minWidth: 702.w, + height: 98.w, + color: kPrimaryColor, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.w)), + onPressed: () async { + + }, + child: '申请保证金退还'.text.color(ktextPrimary).size(36.sp).make(), + ), + ], + ), + ), + ); + } +} diff --git a/lib/ui/profile/house/contract_stop/refund_bond_page.dart b/lib/ui/profile/house/contract_stop/refund_bond_page.dart new file mode 100644 index 00000000..ad7ba24e --- /dev/null +++ b/lib/ui/profile/house/contract_stop/refund_bond_page.dart @@ -0,0 +1,58 @@ +import 'package:aku_community/base/base_style.dart'; +import 'package:aku_community/ui/profile/house/house_func.dart'; +import 'package:aku_community/widget/bee_scaffold.dart'; +import 'package:aku_community/widget/buttons/bottom_button.dart'; +import 'package:aku_community/widget/others/bee_input_row.dart'; +import 'package:aku_community/widget/others/house_head_card.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class RefundBondPage extends StatefulWidget { + final String name; + final double bond; + final String date; + final int id; + RefundBondPage( + {Key? key, + required this.name, + required this.bond, + required this.date, + required this.id}) + : super(key: key); + + @override + _RefundBondPageState createState() => _RefundBondPageState(); +} + +class _RefundBondPageState extends State { + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '保证金信息', + body: ListView( + children: [ + HouseHeadCard(context: context), + BeeInputRow.button( + title: '承租人姓名', hintText: widget.name, onPressed: () {}), + BeeInputRow.button( + title: '保证金', + hintText: widget.bond.toStringAsFixed(2), + onPressed: () {}), + BeeInputRow.button( + title: '保证金缴纳时间', hintText: widget.date, onPressed: () {}), + ], + ), + bottomNavi: BottomButton( + onPressed: () async { + bool result = await HouseFunc().refundBond(widget.id); + if (result) { + Get.back(); + Get.back(); + } + }, + child: '提交退款申请'.text.size(32.sp).color(ktextPrimary).bold.make()), + ); + } +} diff --git a/lib/ui/profile/house/contract_stop/refund_bond_result_page.dart b/lib/ui/profile/house/contract_stop/refund_bond_result_page.dart new file mode 100644 index 00000000..239533b9 --- /dev/null +++ b/lib/ui/profile/house/contract_stop/refund_bond_result_page.dart @@ -0,0 +1,50 @@ +import 'package:aku_community/widget/bee_scaffold.dart'; +import 'package:aku_community/widget/others/finish_result_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class RefundBondResultPage extends StatefulWidget { + final int status; + RefundBondResultPage({Key? key, required this.status}) : super(key: key); + + @override + _RefundBondResultPageState createState() => _RefundBondResultPageState(); +} + +class _RefundBondResultPageState extends State { + String get statusString { + switch (widget.status) { + case 15: + return '申请退还保证金审核中'; + case 16: + return '申请退还保证金驳回'; + case 17: + return '申请保证金退还成功'; + + default: + return '未知'; + } + } + + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '保证金退还情况', + body: Center( + child: Column( + children: [ + 76.w.heightBox, + FinishResultImage( + status: widget.status == 16 ? false : true, + haveInHandStatus: widget.status == 15 ? true : false, + ), + 48.w.heightBox, + statusString.text.black.size(36.sp).make(), + 96.w.heightBox, + ], + ), + ), + ); + } +} diff --git a/lib/ui/profile/house/house_func.dart b/lib/ui/profile/house/house_func.dart index fb957d30..754a95ee 100644 --- a/lib/ui/profile/house/house_func.dart +++ b/lib/ui/profile/house/house_func.dart @@ -225,6 +225,19 @@ class HouseFunc { } } + ///我的房屋-合同终止:保证金退还申请 + Future refundBond(int id) async { + BaseModel baseModel = + await NetUtil().get(API.house.refundApplication, params: { + "sysLeaseId": id, + }); + if (baseModel.status ?? false) { + return true; + } else { + return false; + } + } + static Map getSex = { '男': 1, '女': 2, diff --git a/lib/ui/profile/house/house_owners_page.dart b/lib/ui/profile/house/house_owners_page.dart index e4a4152e..0cff5de8 100644 --- a/lib/ui/profile/house/house_owners_page.dart +++ b/lib/ui/profile/house/house_owners_page.dart @@ -1,5 +1,6 @@ import 'package:aku_community/models/house/lease_detail_model.dart'; import 'package:aku_community/ui/profile/house/contract_stop/contract_stop_page.dart'; +import 'package:aku_community/ui/profile/house/contract_stop/pay_result_page.dart'; import 'package:aku_community/ui/profile/house/contract_stop/submit_finish_page.dart'; import 'package:flutter/material.dart'; @@ -231,6 +232,9 @@ class _HouseOwnersPageState extends State { Get.to( () => SubmitFinishPage(status: model.status, leaseId: model.id)); break; + case 14: + Get.to(() => PayResultPage()); + break; default: } }