添加 申请退还保证金页面

对接其接口
hmxc
张萌 3 years ago
parent 99dbfd911f
commit 0a0fbb6cee

@ -500,4 +500,7 @@ class _House {
///-
String get submitTerminateApplication =>
'/user/myHouse/submitTerminateApplication';
///-退
String get refundApplication => '/user/myHouse/depositRefundApplication';
}

@ -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<PayResultPage> {
@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(),
),
],
),
),
);
}
}

@ -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<RefundBondPage> {
@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()),
);
}
}

@ -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<RefundBondResultPage> {
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,
],
),
),
);
}
}

@ -225,6 +225,19 @@ class HouseFunc {
}
}
///-退
Future<bool> 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<String, int> getSex = {
'': 1,
'': 2,

@ -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<HouseOwnersPage> {
Get.to(
() => SubmitFinishPage(status: model.status, leaseId: model.id));
break;
case 14:
Get.to(() => PayResultPage());
break;
default:
}
}

Loading…
Cancel
Save