完成合同截止模块

hmxc
张萌 3 years ago
parent 93219dd166
commit cacbc52377

@ -1,12 +1,24 @@
import 'package:aku_community/base/base_style.dart'; 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/bee_scaffold.dart';
import 'package:aku_community/widget/others/finish_result_image.dart'; import 'package:aku_community/widget/others/finish_result_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class PayResultPage extends StatefulWidget { 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 @override
_PayResultPageState createState() => _PayResultPageState(); _PayResultPageState createState() => _PayResultPageState();
@ -35,7 +47,11 @@ class _PayResultPageState extends State<PayResultPage> {
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.w)), borderRadius: BorderRadius.circular(8.w)),
onPressed: () async { 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(), child: '申请保证金退还'.text.color(ktextPrimary).size(36.sp).make(),
), ),

@ -77,7 +77,8 @@ class _PaySuerplusRentPageState extends State<PaySuerplusRentPage> {
bool result = bool result =
await PayUtil().callAliPay(code, API.pay.leaseRentCheck); await PayUtil().callAliPay(code, API.pay.leaseRentCheck);
if (result) { if (result) {
Get.to(() => PayFinishPage()); Get.back();
Get.off(() => PayFinishPage());
} }
} catch (e) { } catch (e) {
LoggerData.addData(e); LoggerData.addData(e);

@ -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/buttons/bottom_button.dart';
import 'package:aku_community/widget/others/bee_input_row.dart'; import 'package:aku_community/widget/others/bee_input_row.dart';
import 'package:aku_community/widget/others/house_head_card.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/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -30,6 +31,7 @@ class _RefundBondPageState extends State<RefundBondPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
bgColor: Colors.white,
title: '保证金信息', title: '保证金信息',
body: ListView( body: ListView(
children: [ children: [
@ -50,11 +52,13 @@ class _RefundBondPageState extends State<RefundBondPage> {
), ),
bottomNavi: BottomButton( bottomNavi: BottomButton(
onPressed: () async { onPressed: () async {
Function cancel = BotToast.showLoading();
bool result = await HouseFunc().refundBond(widget.id); bool result = await HouseFunc().refundBond(widget.id);
if (result) { if (result) {
Get.back(); Get.back();
Get.back(); Get.back();
} }
cancel();
}, },
child: '提交退款申请'.text.size(32.sp).color(ktextPrimary).bold.make()), child: '提交退款申请'.text.size(32.sp).color(ktextPrimary).bold.make()),
); );

@ -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/bee_scaffold.dart';
import 'package:aku_community/widget/others/finish_result_image.dart'; import 'package:aku_community/widget/others/finish_result_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class RefundBondResultPage extends StatefulWidget { class RefundBondResultPage extends StatefulWidget {
///```UserTool.appProveider.selectedHouse```
final int status; 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 @override
_RefundBondResultPageState createState() => _RefundBondResultPageState(); _RefundBondResultPageState createState() => _RefundBondResultPageState();
@ -42,6 +57,25 @@ class _RefundBondResultPageState extends State<RefundBondResultPage> {
48.w.heightBox, 48.w.heightBox,
statusString.text.black.size(36.sp).make(), statusString.text.black.size(36.sp).make(),
96.w.heightBox, 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(),
], ],
), ),
), ),

@ -1,5 +1,6 @@
import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/models/house/lease_detail_model.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/house_func.dart';
import 'package:aku_community/ui/profile/house/contract_stop/pay_surplus_rent_page.dart'; import 'package:aku_community/ui/profile/house/contract_stop/pay_surplus_rent_page.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/bee_scaffold.dart';
@ -32,6 +33,7 @@ class _SubmitFinishPageState extends State<SubmitFinishPage> {
return '未知'; return '未知';
} }
} }
String get contentString { String get contentString {
switch (widget.status) { switch (widget.status) {
case 11: case 11:
@ -61,31 +63,55 @@ class _SubmitFinishPageState extends State<SubmitFinishPage> {
48.w.heightBox, 48.w.heightBox,
contentString.text.black.size(28.sp).make(), contentString.text.black.size(28.sp).make(),
96.w.heightBox, 96.w.heightBox,
widget.status != 13 butttons(),
? SizedBox() ],
: MaterialButton( ),
),
);
}
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, elevation: 0,
minWidth: 702.w, minWidth: 702.w,
height: 98.w, height: 98.w,
color: kPrimaryColor, color: kPrimaryColor,
shape: RoundedRectangleBorder( shape:
borderRadius: BorderRadius.circular(8.w)), RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)),
onPressed: () async { onPressed: () async {
LeaseDetailModel? model = LeaseDetailModel? model =
await HouseFunc().leaseDetail(widget.leaseId); await HouseFunc().leaseDetail(widget.leaseId);
if (model != null) { if (model != null) {
Get.to(() => PaySuerplusRentPage( Get.to(() => PaySuerplusRentPage(
id:widget.leaseId, id: widget.leaseId,
time: model.notMeterRentDate ?? '', time: model.notMeterRentDate ?? '',
amount: model.requiredRent ?? 0, amount: model.requiredRent ?? 0,
)); ));
} }
}, },
child: '去支付'.text.color(ktextPrimary).size(36.sp).make(), child: '结清剩余租金'.text.color(ktextPrimary).size(36.sp).make(),
),
],
),
),
); );
default:
return SizedBox();
}
} }
} }

@ -236,12 +236,23 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
() => SubmitFinishPage(status: model.status, leaseId: model.id)); () => SubmitFinishPage(status: model.status, leaseId: model.id));
break; break;
case 14: case 14:
Get.to(() => PayResultPage()); Get.to(() => PayResultPage(
name: model.name,
bond: model.margin.toDouble(),
date: DateTime.now().toString(),
id: model.id,
));
break; break;
case 15: case 15:
case 16: case 16:
case 17: 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; break;
default: default:
} }

Loading…
Cancel
Save