diff --git a/lib/ui/profile/house/contract_stop/pay_result_page.dart b/lib/ui/profile/house/contract_stop/pay_result_page.dart index 8eb2dd6d..da935c6c 100644 --- a/lib/ui/profile/house/contract_stop/pay_result_page.dart +++ b/lib/ui/profile/house/contract_stop/pay_result_page.dart @@ -1,12 +1,24 @@ import 'package:aku_community/base/base_style.dart'; +import 'package:aku_community/ui/profile/house/contract_stop/refund_bond_page.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:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; class PayResultPage extends StatefulWidget { - PayResultPage({Key? key}) : super(key: key); + final String name; + final double bond; + final String date; + final int id; + PayResultPage( + {Key? key, + required this.name, + required this.bond, + required this.date, + required this.id}) + : super(key: key); @override _PayResultPageState createState() => _PayResultPageState(); @@ -35,7 +47,11 @@ class _PayResultPageState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8.w)), onPressed: () async { - + Get.to(() => RefundBondPage( + name: widget.name, + bond: widget.bond, + date: widget.date, + id: widget.id)); }, child: '申请保证金退还'.text.color(ktextPrimary).size(36.sp).make(), ), diff --git a/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart b/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart index 2a1bf49d..25397cba 100644 --- a/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart +++ b/lib/ui/profile/house/contract_stop/pay_surplus_rent_page.dart @@ -77,7 +77,8 @@ class _PaySuerplusRentPageState extends State { bool result = await PayUtil().callAliPay(code, API.pay.leaseRentCheck); if (result) { - Get.to(() => PayFinishPage()); + Get.back(); + Get.off(() => PayFinishPage()); } } catch (e) { LoggerData.addData(e); diff --git a/lib/ui/profile/house/contract_stop/refund_bond_page.dart b/lib/ui/profile/house/contract_stop/refund_bond_page.dart index 639efde8..27a80078 100644 --- a/lib/ui/profile/house/contract_stop/refund_bond_page.dart +++ b/lib/ui/profile/house/contract_stop/refund_bond_page.dart @@ -4,6 +4,7 @@ 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:bot_toast/bot_toast.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -30,6 +31,7 @@ class _RefundBondPageState extends State { @override Widget build(BuildContext context) { return BeeScaffold( + bgColor: Colors.white, title: '保证金信息', body: ListView( children: [ @@ -50,11 +52,13 @@ class _RefundBondPageState extends State { ), bottomNavi: BottomButton( onPressed: () async { + Function cancel = BotToast.showLoading(); bool result = await HouseFunc().refundBond(widget.id); if (result) { Get.back(); Get.back(); } + cancel(); }, 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 index 2b6838ba..916e7657 100644 --- a/lib/ui/profile/house/contract_stop/refund_bond_result_page.dart +++ b/lib/ui/profile/house/contract_stop/refund_bond_result_page.dart @@ -1,12 +1,27 @@ +import 'package:aku_community/base/base_style.dart'; +import 'package:aku_community/ui/profile/house/contract_stop/refund_bond_page.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:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; class RefundBondResultPage extends StatefulWidget { + ///也可以从```UserTool.appProveider.selectedHouse```中获取 final int status; - RefundBondResultPage({Key? key, required this.status}) : super(key: key); + final String name; + final double bond; + final String date; + final int id; + RefundBondResultPage( + {Key? key, + required this.status, + required this.name, + required this.bond, + required this.date, + required this.id}) + : super(key: key); @override _RefundBondResultPageState createState() => _RefundBondResultPageState(); @@ -42,6 +57,25 @@ class _RefundBondResultPageState extends State { 48.w.heightBox, statusString.text.black.size(36.sp).make(), 96.w.heightBox, + widget.status == 16 + ? MaterialButton( + elevation: 0, + minWidth: 702.w, + height: 98.w, + color: kPrimaryColor, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.w)), + onPressed: () async { + Get.to(() => RefundBondPage( + name: widget.name, + bond: widget.bond, + date: widget.date, + id: widget.id)); + }, + child: + '申请保证金退还'.text.color(ktextPrimary).size(36.sp).make(), + ) + : SizedBox(), ], ), ), diff --git a/lib/ui/profile/house/contract_stop/submit_finish_page.dart b/lib/ui/profile/house/contract_stop/submit_finish_page.dart index e5094009..8512c998 100644 --- a/lib/ui/profile/house/contract_stop/submit_finish_page.dart +++ b/lib/ui/profile/house/contract_stop/submit_finish_page.dart @@ -1,5 +1,6 @@ import 'package:aku_community/base/base_style.dart'; 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/house_func.dart'; import 'package:aku_community/ui/profile/house/contract_stop/pay_surplus_rent_page.dart'; import 'package:aku_community/widget/bee_scaffold.dart'; @@ -32,7 +33,8 @@ class _SubmitFinishPageState extends State { return '未知'; } } - String get contentString { + + String get contentString { switch (widget.status) { case 11: return '您提交的申请正在人工审核中,请耐心等待'; @@ -61,31 +63,55 @@ class _SubmitFinishPageState extends State { 48.w.heightBox, contentString.text.black.size(28.sp).make(), 96.w.heightBox, - widget.status != 13 - ? SizedBox() - : MaterialButton( - elevation: 0, - minWidth: 702.w, - height: 98.w, - color: kPrimaryColor, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8.w)), - onPressed: () async { - LeaseDetailModel? model = - await HouseFunc().leaseDetail(widget.leaseId); - if (model != null) { - Get.to(() => PaySuerplusRentPage( - id:widget.leaseId, - time: model.notMeterRentDate ?? '', - amount: model.requiredRent ?? 0, - )); - } - }, - child: '去支付'.text.color(ktextPrimary).size(36.sp).make(), - ), + butttons(), ], ), ), ); } + + Widget butttons() { + switch (widget.status) { + case 11: + return SizedBox(); + + case 12: + return MaterialButton( + elevation: 0, + minWidth: 702.w, + height: 98.w, + color: kPrimaryColor, + shape: + RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)), + onPressed: () async { + Get.to(() => ContractStopPage()); + }, + child: '重新申请'.text.color(ktextPrimary).size(36.sp).make(), + ); + case 13: + return MaterialButton( + elevation: 0, + minWidth: 702.w, + height: 98.w, + color: kPrimaryColor, + shape: + RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)), + onPressed: () async { + LeaseDetailModel? model = + await HouseFunc().leaseDetail(widget.leaseId); + if (model != null) { + Get.to(() => PaySuerplusRentPage( + id: widget.leaseId, + time: model.notMeterRentDate ?? '', + amount: model.requiredRent ?? 0, + )); + } + }, + child: '结清剩余租金'.text.color(ktextPrimary).size(36.sp).make(), + ); + + default: + return SizedBox(); + } + } } diff --git a/lib/ui/profile/house/house_owners_page.dart b/lib/ui/profile/house/house_owners_page.dart index 1b7e724a..f239f5a0 100644 --- a/lib/ui/profile/house/house_owners_page.dart +++ b/lib/ui/profile/house/house_owners_page.dart @@ -236,12 +236,23 @@ class _HouseOwnersPageState extends State { () => SubmitFinishPage(status: model.status, leaseId: model.id)); break; case 14: - Get.to(() => PayResultPage()); + Get.to(() => PayResultPage( + name: model.name, + bond: model.margin.toDouble(), + date: DateTime.now().toString(), + id: model.id, + )); break; case 15: case 16: case 17: - Get.to(() => RefundBondResultPage(status: model.status)); + Get.to(() => RefundBondResultPage( + status: model.status, + name: model.name, + bond: model.margin.toDouble(), + date: DateTime.now().toString(), + id: model.id, + )); break; default: }