添加 生活缴费 预充值页面

房屋租赁-结清剩余租金-剩余租金为负 调用另外接口
hmxc
张萌 3 years ago
parent 17202dbc0a
commit f8cfca794d

@ -498,6 +498,9 @@ class _Pay {
///- ///-
String get leaseRentBillOrderCheck => String get leaseRentBillOrderCheck =>
'/user/alipay/leaseRentBillOrderCheckAlipay'; '/user/alipay/leaseRentBillOrderCheckAlipay';
///-app -( 0 )
String get leaseRentOrderNegative => '/user/myHouse/leaseRentOrderAlipay';
} }
class _House { class _House {

@ -1,3 +1,4 @@
import 'package:aku_community/pages/life_pay/life_pre_pay_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -163,7 +164,6 @@ class _LifePayPageState extends State<LifePayPage> {
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
if (_selectYears.contains(index)) {} if (_selectYears.contains(index)) {}
dynamic payMent = await (Get.to(() => LifePayDetailPage( dynamic payMent = await (Get.to(() => LifePayDetailPage(
model: _models[index], model: _models[index],
selectModel: _selectModels[index], selectModel: _selectModels[index],
@ -209,7 +209,7 @@ class _LifePayPageState extends State<LifePayPage> {
bool result = await PayUtil() bool result = await PayUtil()
.callAliPay(baseModel.message!, API.pay.dailPayMentCheck); .callAliPay(baseModel.message!, API.pay.dailPayMentCheck);
if (result) { if (result) {
Get.off(()=>PayFinishPage()); Get.off(() => PayFinishPage());
} }
} }
cancel(); cancel();
@ -218,6 +218,42 @@ class _LifePayPageState extends State<LifePayPage> {
); );
} }
Widget _buildPrePayment() {
return Container(
padding: EdgeInsets.symmetric(vertical: 32.w, horizontal: 32.w),
width: double.infinity,
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'当前预缴'.text.size(28.sp).color(ktextSubColor).make(),
30.w.heightBox,
Row(
children: [
'¥'.text.size(28.sp).black.make(),
16.w.widthBox,
'2300'.text.size(40.sp).black.bold.make(),
Spacer(),
MaterialButton(
elevation: 0,
height: 50.w,
padding: EdgeInsets.symmetric(vertical: 8.w, horizontal: 25.w),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(24.w),
side: BorderSide(color: Color(0xFF979797), width: 1.w)),
color: Colors.white,
onPressed: () {
Get.to(() => LifePrePayPage());
},
child: '预缴充值'.text.size(28.sp).black.make(),
)
],
),
],
),
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final appProvider = Provider.of<AppProvider>(context); final appProvider = Provider.of<AppProvider>(context);
@ -269,6 +305,8 @@ class _LifePayPageState extends State<LifePayPage> {
}, },
context: context), context: context),
16.w.heightBox, 16.w.heightBox,
_buildPrePayment(),
16.w.heightBox,
Container( Container(
padding: EdgeInsets.all(32.w), padding: EdgeInsets.all(32.w),
width: double.infinity, width: double.infinity,

@ -0,0 +1,148 @@
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/widget/bee_divider.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/bottom_sheets/pay_mothod_bottom_sheet.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/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
class LifePrePayPage extends StatefulWidget {
LifePrePayPage({Key? key}) : super(key: key);
@override
_LifePrePayPageState createState() => _LifePrePayPageState();
}
class _LifePrePayPageState extends State<LifePrePayPage> {
late TextEditingController _editingController;
String _payMethod = '支付宝';
@override
void initState() {
super.initState();
_editingController = TextEditingController();
}
@override
void dispose() {
_editingController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '预缴充值',
body: ListView(
children: [
HouseHeadCard(context: context),
16.w.heightBox,
Container(
padding: EdgeInsets.symmetric(vertical: 32.w, horizontal: 32.w),
width: double.infinity,
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'预缴金额'.text.size(28.sp).black.make(),
30.w.heightBox,
Row(
children: [
'¥'.text.size(28.sp).black.bold.make(),
16.w.widthBox,
TextField(
controller: _editingController,
decoration: InputDecoration(
hintText: '0.0',
hintStyle: TextStyle(
fontSize: 56.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
border: InputBorder.none,
isDense: true,
contentPadding: EdgeInsets.zero,
),
style: TextStyle(
fontSize: 56.sp,
fontWeight: FontWeight.bold,
color: Colors.black,
),
inputFormatters: [FilteringTextInputFormatter.digitsOnly],
keyboardType: TextInputType.number,
).expand(),
],
),
16.w.heightBox,
BeeDivider.horizontal(),
16.w.heightBox,
'当前房屋下的预缴金额为 '
.richText
.withTextSpanChildren([
'2300'
.textSpan
.bold
.size(28.sp)
.color(kPrimaryColor)
.make(),
''.textSpan.size(28.sp).black.make()
])
.black
.size(28.sp)
.make(),
16.w.heightBox,
'当账单到期时,将会自动从当前房屋下的预缴金额中扣除相应费用。'
.text
.size(24.sp)
.color(ktextSubColor)
.make(),
],
),
),
16.w.heightBox,
// Container(
// width: double.infinity,
// color: Colors.white,
// padding: EdgeInsets.symmetric(vertical: 32.w, horizontal: 32.w),
// child: Row(
// children: [
// '缴费方式'.text.size(28.sp).black.make(),
// Spacer(),
// TextButton(
// onPressed: () async {
// Get.bottomSheet(PayMethodBottomSheet(onChoose: (value) {
// _paymethod = value;
// Get.back();
// setState(() {});
// }));
// },
// child: _paymethod.text.size(28.sp).black.make()),
// 24.w.widthBox,
// Icon(
// CupertinoIcons.chevron_right,
// size: 40.w,
// ),
// ],
// ),
// ),
BeeInputRow.button(
title: '支付方式',
hintText: _payMethod,
onPressed: () {
Get.bottomSheet(PayMethodBottomSheet(onChoose: (value) {
_payMethod = value;
Get.back();
setState(() {});
}));
}),
],
),
bottomNavi: BottomButton(
onPressed: () {}, child: '立即充值'.text.size(32.sp).bold.black.make()),
);
}
}

@ -72,7 +72,9 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
_buildEvaluate(), _buildEvaluate(),
], ],
), ),
) ),
// 40.w.heightBox,
// _background(),
], ],
), ),
bottomNavi: _getBottomButton(), bottomNavi: _getBottomButton(),
@ -290,4 +292,92 @@ class _HouseKeepingDetailPageState extends State<HouseKeepingDetailPage> {
), ),
); );
} }
// int _airPlane = 1;
// int _train = 2;
// int _xxx = 3;
// int _select = 1;
// Widget _background() {
// return Center(
// child: Container(
// width: 600.w,
// height: 600.w,
// decoration: BoxDecoration(
// color: Colors.transparent,
// borderRadius: BorderRadius.circular(16.w)),
// child: Column(
// children: [
// Row(
// children: [
// _header(
// _airPlane,
// _select,
// 'aaa',
// 'left'
// ).expand(),
// _header(_train, _select, 'bbb', 'mid').expand(),
// _header(_xxx, _select, 'ccc', 'right').expand(),
// ],
// ),
// Container(
// width: double.infinity,
// alignment: Alignment.center,
// child: 'xxxxxxxx'.text.size(36.sp).black.make(),
// color: Colors.white,
// ).expand(),
// ],
// ),
// ),
// );
// }
// Widget _header(int value, int selectValue, String title, String position) {
// bool isSelect = value == selectValue;
// return Column(
// children: [
// isSelect
// ? Container(
// height: 40.w,
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.only(
// topLeft: position == 'left'
// ? Radius.zero
// : Radius.circular(20.w),
// topRight: position == 'right'
// ? Radius.zero
// : Radius.circular(20.w))),
// )
// : Container(height: 40.w, color: Colors.transparent),
// isSelect
// ? Container(
// height: 120.w,
// alignment: Alignment.center,
// width: double.infinity,
// child: title.text.size(32.sp).red500.make(),
// color: Colors.white,
// )
// : GestureDetector(
// onTap: () {
// _select = value;
// setState(() {});
// },
// child: Container(
// height: 120.w,
// width: double.infinity,
// alignment: Alignment.center,
// child: title.text.size(30.sp).black.make(),
// decoration: BoxDecoration(
// color: Colors.pinkAccent,
// borderRadius: BorderRadius.only(
// topLeft:!(position=='right')? Radius.circular(16.w):Radius.zero,
// topRight: !(position=='left')?Radius.circular(16.w):Radius.zero,
// bottomLeft: !(position=='left')?Radius.circular(16.w):Radius.zero,
// bottomRight:!(position=='right')?Radius.circular(16.w):Radius.zero)),
// ),
// ),
// ],
// );
// }
} }

@ -79,7 +79,7 @@ class _PaySuerplusRentPageState extends State<PaySuerplusRentPage> {
onPressed: () async { onPressed: () async {
Function cancel = BotToast.showLoading(); Function cancel = BotToast.showLoading();
try { try {
if (widget.amount <= 0) { if (widget.amount > 0) {
String code = await HouseFunc() String code = await HouseFunc()
.leaseRentOrder(widget.id, 1, widget.amount.toDouble()); .leaseRentOrder(widget.id, 1, widget.amount.toDouble());
bool result = bool result =
@ -88,13 +88,26 @@ class _PaySuerplusRentPageState extends State<PaySuerplusRentPage> {
Get.back(); Get.back();
Get.off(() => PayFinishPage()); Get.off(() => PayFinishPage());
} }
} else {} } else {
bool result = await HouseFunc().leaseRentOrderNegative(
widget.id, widget.amount.toDouble());
if (result) {
Get.back();
Get.back();
BotToast.showText(text: '退款成功');
}
}
} catch (e) { } catch (e) {
LoggerData.addData(e); LoggerData.addData(e);
} }
cancel(); cancel();
}, },
child: '点击支付'.text.size(32.sp).color(ktextPrimary).bold.make()), child: '${widget.amount > 0 ? '点击支付' : '点击退款'}'
.text
.size(32.sp)
.color(ktextPrimary)
.bold
.make()),
); );
} }
} }

@ -11,6 +11,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:aku_community/extensions/widget_list_ext.dart';
class RefundBondPage extends StatefulWidget { class RefundBondPage extends StatefulWidget {
final String name; final String name;
@ -48,7 +49,7 @@ class _RefundBondPageState extends State<RefundBondPage> {
onPressed: () {}), onPressed: () {}),
BeeInputRow.button( BeeInputRow.button(
title: '保证金缴纳时间', hintText: widget.date, onPressed: () {}), title: '保证金缴纳时间', hintText: widget.date, onPressed: () {}),
], ].sepWidget(separate: 24.w.heightBox),
).paddingSymmetric(horizontal: 32.w) ).paddingSymmetric(horizontal: 32.w)
], ],
), ),

@ -74,7 +74,7 @@ class _RefundBondResultPageState extends State<RefundBondResultPage> {
id: widget.id)); id: widget.id));
}, },
child: child:
'申请保证金退还'.text.color(ktextPrimary).size(36.sp).make(), '重新申请'.text.color(ktextPrimary).size(36.sp).make(),
) )
: SizedBox(), : SizedBox(),
], ],

@ -221,6 +221,16 @@ class HouseFunc {
} }
} }
///-app -( 0 )
Future<bool> leaseRentOrderNegative(int id, double price) async {
BaseModel baseModel =
await NetUtil().post(API.pay.leaseRentOrderNegative, params: {
"sysLeaseId": id,
"payPrice": price,
});
return baseModel.status ?? false;
}
///-退 ///-退
Future<bool> refundBond(int id) async { Future<bool> refundBond(int id) async {
BaseModel baseModel = BaseModel baseModel =

@ -243,7 +243,7 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
Get.to(() => PayResultPage( Get.to(() => PayResultPage(
name: model.name, name: model.name,
bond: model.margin.toDouble(), bond: model.margin.toDouble(),
date: DateUtil.formatDateStr(model.marginPayDate!), date: DateUtil.formatDateStr(model.marginPayDate??''),
id: model.id, id: model.id,
)); ));
break; break;
@ -254,7 +254,7 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
status: model.status, status: model.status,
name: model.name, name: model.name,
bond: model.margin.toDouble(), bond: model.margin.toDouble(),
date: DateUtil.formatDateStr(model.marginPayDate!), date: DateUtil.formatDateStr(model.marginPayDate??''),
id: model.id, id: model.id,
)); ));
break; break;

Loading…
Cancel
Save