我的房屋-缴费查询-租金缴纳 页面完成

对接其接口
hmxc
张萌 3 years ago
parent a0c09ef099
commit 215df782fa

@ -484,6 +484,13 @@ class _Pay {
///-
String get leaseRentCheck => '/user/alipay/leaseRentOrderCheckAlipay';
///app - ( APP )
String get leaseRentBillorder => '/user/alipay/leaseRentBillOrderAlipay';
///-
String get leaseRentBillOrderCheck =>
'/user/alipay/leaseRentBillOrderCheckAlipay';
}
class _House {

@ -1,4 +1,5 @@
import 'package:equatable/equatable.dart';
import 'package:flustars/flustars.dart';
import 'package:json_annotation/json_annotation.dart';
part 'lease_fee_list_model.g.dart';
@ -54,4 +55,6 @@ class LeaseFeeListModel extends Equatable {
return '未知';
}
}
DateTime get createDateTime => DateUtil.getDateTime(this.createDate)!;
}

@ -234,6 +234,19 @@ class HouseFunc {
}
}
///app - ( APP )
///1
///1. 2. 3. 4.pos
Future<String> leaseRentBillOrder(int id, int type, double price) async {
BaseModel baseModel = await NetUtil().post(API.pay.leaseRentBillorder,
params: {"sysLeaseRentId": id, "payType": type, "payPrice": price});
if (baseModel.status ?? false) {
return baseModel.message!;
} else {
return '';
}
}
static Map<String, int> getSex = {
'': 1,
'': 2,

@ -0,0 +1,179 @@
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/models/house/lease_fee_list_model.dart';
import 'package:aku_community/pages/life_pay/pay_finish_page.dart';
import 'package:aku_community/pages/life_pay/pay_util.dart';
import 'package:aku_community/ui/profile/house/house_func.dart';
import 'package:aku_community/widget/bee_divider.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/buttons/bottom_button.dart';
import 'package:aku_community/widget/others/user_tool.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:get/get.dart';
import 'package:power_logger/power_logger.dart';
class LeasePayQueryDetailPage extends StatefulWidget {
final LeaseFeeListModel model;
LeasePayQueryDetailPage({Key? key, required this.model}) : super(key: key);
@override
_LeasePayQueryDetailPageState createState() =>
_LeasePayQueryDetailPageState();
}
class _LeasePayQueryDetailPageState extends State<LeasePayQueryDetailPage> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '缴费详情',
bodyColor: Colors.white,
body: Center(
child: Column(
children: [
72.w.heightBox,
widget.model.price.text.size(48.sp).bold.black.make(),
16.w.heightBox,
widget.model.payStatusString.text
.size(32.sp)
.color(widget.model.payStatus == 0 ? Colors.red : Colors.black)
.bold
.make(),
80.w.heightBox,
_buildInfo(),
Offstage(
offstage: widget.model.payStatus == 0,
child: _buildFinishInfo(),
)
],
),
),
bottomNavi: Offstage(
offstage: widget.model.payStatus != 0,
child: BottomButton(
onPressed: () async {
Function cancel = BotToast.showLoading();
bool result = false;
try {
String code = await HouseFunc().leaseRentBillOrder(
UserTool.appProveider.selectedHouse!.sysLeaseId!,
1, //
widget.model.price.toDouble());
result = await PayUtil()
.callAliPay(code, API.pay.leaseRentBillOrderCheck);
} catch (e) {
LoggerData.addData(e);
}
if (result) {
Get.off(() => PayFinishPage());
}
cancel();
},
child: '立即支付'.text.size(32.sp).bold.black.make()),
),
);
}
Widget _buildInfo() {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Column(
children: [
Row(
children: [
'付款方式'.text.size(28.sp).color(ktextSubColor).make(),
Spacer(),
//
'支付宝'.text.size(28.sp).black.make()
],
),
Row(
children: [
'月份'.text.size(28.sp).color(ktextSubColor).make(),
Spacer(),
'${widget.model.createDateTime.month.toString()}'
.text
.size(28.sp)
.black
.make()
],
),
Row(
children: [
'类型'.text.size(28.sp).color(ktextSubColor).make(),
Spacer(),
widget.model.typeString.text.size(28.sp).black.make()
],
),
Row(
children: [
'截止时间'.text.size(28.sp).color(ktextSubColor).make(),
Spacer(),
DateUtil.formatDate(
DateTime(
widget.model.createDateTime.year,
widget.model.createDateTime.month + 1,
0,
),
format: 'yyyy-MM-dd')
.toString()
.text
.size(28.sp)
.black
.make()
],
),
Row(
children: [
'对应房屋'.text.size(28.sp).color(ktextSubColor).make(),
Spacer(),
'${S.of(context)!.tempPlotName}·${UserTool.appProveider.selectedHouse!.roomName}'
.text
.size(28.sp)
.black
.make()
],
),
].sepWidget(separate: 32.w.heightBox),
),
);
}
Widget _buildFinishInfo() {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Column(
children: [
32.w.heightBox,
BeeDivider.horizontal(),
32.w.heightBox,
Row(
children: [
'缴费人'.text.size(28.sp).color(ktextSubColor).make(),
Spacer(),
'${UserTool.userProvider.userInfoModel!.name}'
.text
.size(28.sp)
.black
.make()
],
),
32.w.heightBox,
Row(
children: [
'缴纳时间'.text.size(28.sp).color(ktextSubColor).make(),
Spacer(),
'${DateUtil.formatDate(widget.model.createDateTime)}'
.text
.size(28.sp)
.black
.make()
],
),
],
),
);
}
}

@ -1,6 +1,7 @@
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/models/house/lease_fee_list_model.dart';
import 'package:aku_community/ui/profile/house/lease_pay_query/lease_pay_query_detail_page.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/utils/network/base_list_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
@ -170,7 +171,13 @@ class _LeasePayQueryPageState extends State<LeasePayQueryPage> {
}
Widget _buildCard(LeaseFeeListModel model) {
return Column(
return GestureDetector(
onTap: () {
Get.to(() => LeasePayQueryDetailPage(
model: model,
));
},
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
@ -186,11 +193,7 @@ class _LeasePayQueryPageState extends State<LeasePayQueryPage> {
],
),
12.w.heightBox,
GestureDetector(
onTap: () {
model.payStatus == 0 ? null : null;
},
child: Row(
Row(
children: [
'${DateUtil.formatDateStr(model.createDate, format: 'MM/dd HH:mm')}'
.text
@ -209,10 +212,10 @@ class _LeasePayQueryPageState extends State<LeasePayQueryPage> {
.make(),
],
),
),
32.w.heightBox,
BeeDivider.horizontal(),
],
),
);
}
}

@ -1,8 +1,10 @@
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:power_logger/power_logger.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/base/base_style.dart';
@ -81,6 +83,8 @@ class _ContractPayPageState extends State<ContractPayPage> {
bottomNavi: BottomButton(
child: '点击支付'.text.size(32.sp).bold.color(ktextPrimary).make(),
onPressed: () async {
Function cancel = BotToast.showLoading();
try {
String code = await HouseFunc()
.leaseAlipay(widget.id, 1, _model!.margin.toDouble());
if (code.isNotEmpty) {
@ -90,6 +94,10 @@ class _ContractPayPageState extends State<ContractPayPage> {
Get.off(() => PayFinishPage());
}
}
} catch (e) {
LoggerData.addData(e);
}
cancel();
},
),
);

Loading…
Cancel
Save