重构房屋模块结构

对接剩余租金结算及支付
添加剩余租金支付页面
hmxc
张萌 3 years ago
parent 55e56c47bc
commit 99dbfd911f

@ -467,6 +467,12 @@ class _Pay {
///
String get leaseCheckAlipay => '/user/alipay/leaseCheckAlipay';
///app - ( APP )
String get leaseRentOrderAlipay => '/user/alipay/leaseRentOrderAlipay';
///-
String get leaseRentCheck => '/user/alipay/leaseRentOrderCheckAlipay';
}
class _House {

@ -1,5 +1,5 @@
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/ui/profile/house/upload_empty_list_page.dart';
import 'package:aku_community/ui/profile/house/contract_stop/upload_empty_list_page.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/buttons/bottom_button.dart';
import 'package:flutter/material.dart';

@ -0,0 +1,84 @@
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/constants/api.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/bottom_sheets/pay_mothod_bottom_sheet.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:bot_toast/bot_toast.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:power_logger/power_logger.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class PaySuerplusRentPage extends StatefulWidget {
///
final String time;
///
final num amount;
final int id;
PaySuerplusRentPage(
{Key? key, required this.time, required this.amount, required this.id})
: super(key: key);
@override
_PaySuerplusRentPageState createState() => _PaySuerplusRentPageState();
}
class _PaySuerplusRentPageState extends State<PaySuerplusRentPage> {
String _payMethod = '支付宝';
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '核对信息',
body: ListView(
children: [
HouseHeadCard(context: context),
BeeInputRow.button(
title: '不再计租时间',
hintText:
DateUtil.formatDateStr(widget.time, format: 'yyyy-MM-dd'),
onPressed: () {}),
BeeInputRow.button(
title: '剩余需结清房租(元)',
hintText: widget.amount.toStringAsFixed(2),
onPressed: () {}),
BeeInputRow.button(
title: '支付方式',
hintText: _payMethod,
onPressed: () {
Get.bottomSheet(PayMethodBottomSheet(onChoose: (value) {
_payMethod = value;
Get.back();
setState(() {});
}));
})
],
),
bottomNavi: BottomButton(
onPressed: () async {
Function cancel = BotToast.showLoading();
try {
String code = await HouseFunc()
.leaseRentOrder(widget.id, 1, widget.amount.toDouble());
bool result =
await PayUtil().callAliPay(code, API.pay.leaseRentCheck);
if (result) {
Get.to(() => PayFinishPage());
}
} catch (e) {
LoggerData.addData(e);
}
cancel();
},
child: '点击支付'.text.size(32.sp).color(ktextPrimary).bold.make()),
);
}
}

@ -1,6 +1,7 @@
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/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';
import 'package:aku_community/widget/others/finish_result_image.dart';
import 'package:flutter/material.dart';
@ -58,7 +59,13 @@ class _SubmitFinishPageState extends State<SubmitFinishPage> {
onPressed: () async {
LeaseDetailModel? model =
await HouseFunc().leaseDetail(widget.leaseId);
Get.back();
if (model != null) {
Get.to(() => PaySuerplusRentPage(
id:widget.leaseId,
time: model.notMeterRentDate ?? '',
amount: model.requiredRent ?? 0,
));
}
},
child: '去支付'.text.color(ktextPrimary).size(36.sp).make(),
),

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

@ -1,6 +1,6 @@
import 'package:aku_community/models/house/lease_detail_model.dart';
import 'package:aku_community/ui/profile/house/contract_stop_page.dart';
import 'package:aku_community/ui/profile/house/submit_finish_page.dart';
import 'package:aku_community/ui/profile/house/contract_stop/contract_stop_page.dart';
import 'package:aku_community/ui/profile/house/contract_stop/submit_finish_page.dart';
import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
@ -18,7 +18,7 @@ import 'package:aku_community/ui/profile/house/house_card.dart';
import 'package:aku_community/ui/profile/house/house_func.dart';
import 'package:aku_community/ui/profile/house/identify_selection_page.dart';
import 'package:aku_community/ui/profile/house/my_house_list.dart';
import 'package:aku_community/ui/profile/house/tenant_house_list_page.dart';
import 'package:aku_community/ui/profile/house/lease_relevation/tenant_house_list_page.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/buttons/bottom_button.dart';

@ -8,7 +8,7 @@ import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/const/resource.dart';
import 'package:aku_community/extensions/widget_list_ext.dart';
import 'package:aku_community/ui/profile/house/my_house_list.dart';
import 'package:aku_community/ui/profile/house/user_identify_page.dart';
import 'package:aku_community/ui/profile/house/lease_relevation/user_identify_page.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
class IdentifySelectionPage extends StatelessWidget {

@ -1,3 +1,4 @@
import 'package:aku_community/widget/bottom_sheets/pay_mothod_bottom_sheet.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -69,9 +70,11 @@ class _ContractPayPageState extends State<ContractPayPage> {
title: '支付方式',
hintText: _payMethod,
onPressed: () async {
Get.bottomSheet(
_payMethodSheet(),
);
Get.bottomSheet(PayMethodBottomSheet(onChoose: (value) {
_payMethod = value;
Get.back();
setState(() {});
}));
}),
].sepWidget(separate: 24.w.heightBox),
),
@ -91,21 +94,4 @@ class _ContractPayPageState extends State<ContractPayPage> {
),
);
}
Widget _payMethodSheet() {
return CupertinoActionSheet(
title:
'支付方式'.text.size(32.sp).bold.color(ktextPrimary).isIntrinsic.make(),
actions: [
CupertinoActionSheetAction(
onPressed: () {
_payMethod = '支付宝';
Get.back();
setState(() {});
},
child:
'支付宝'.text.size(32.sp).color(ktextPrimary).isIntrinsic.make())
],
);
}
}

@ -12,7 +12,7 @@ import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/ui/profile/house/download_contract_page.dart';
import 'package:aku_community/ui/profile/house/lease_relevation/download_contract_page.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';

@ -6,7 +6,7 @@ import 'package:open_file/open_file.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/ui/profile/house/upload_contracts_page.dart';
import 'package:aku_community/ui/profile/house/lease_relevation/upload_contracts_page.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/others/finish_result_image.dart';
import 'package:aku_community/widget/views/%20bee_download_view.dart';

@ -10,7 +10,7 @@ import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart';
import 'package:aku_community/models/house/lease_detail_model.dart';
import 'package:aku_community/models/house/submit_model.dart';
import 'package:aku_community/ui/profile/house/contract_preview_page.dart';
import 'package:aku_community/ui/profile/house/lease_relevation/contract_preview_page.dart';
import 'package:aku_community/ui/profile/house/house_func.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/bee_divider.dart';

@ -0,0 +1,59 @@
import 'package:flutter/cupertino.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';
import 'package:aku_community/const/resource.dart';
import 'package:aku_community/extensions/widget_list_ext.dart';
import 'package:aku_community/ui/profile/house/my_house_list.dart';
import 'package:aku_community/ui/profile/house/lease_relevation/user_identify_page.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
class IdentifySelectionPage extends StatelessWidget {
const IdentifySelectionPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '身份选择',
body: ListView(
children: [
20.w.heightBox,
_buidTile(R.ASSETS_ICONS_HOUSE_PNG, '业主', true),
_buidTile(R.ASSETS_ICONS_HOUSE_PNG, '租户', false)
].sepWidget(separate: 20.w.heightBox),
),
);
}
Widget _buidTile(String iconPath, String text, bool isOwner) {
return Row(
children: [
SizedBox(
width: 32.w,
height: 32.w,
child: Image.asset(iconPath),
),
28.w.widthBox,
text.text.black.size(30.sp).make(),
Spacer(),
Icon(
CupertinoIcons.chevron_forward,
size: 32.w,
),
],
)
.box
.padding(EdgeInsets.symmetric(vertical: 40.w, horizontal: 32.w))
.make()
.onInkTap(() {
Get.off(() => isOwner ? MyHouseList() : UserIdentifyPage());
}).material(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
clipBehavior: Clip.antiAlias,
);
}
}

@ -7,9 +7,9 @@ import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/const/resource.dart';
import 'package:aku_community/models/house/lease_list_model.dart';
import 'package:aku_community/ui/profile/house/contract_pay_page.dart';
import 'package:aku_community/ui/profile/house/supplement_information_page.dart';
import 'package:aku_community/ui/profile/house/upload_contracts_page.dart';
import 'package:aku_community/ui/profile/house/lease_relevation/contract_pay_page.dart';
import 'package:aku_community/ui/profile/house/lease_relevation/supplement_information_page.dart';
import 'package:aku_community/ui/profile/house/lease_relevation/upload_contracts_page.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/buttons/card_bottom_button.dart';

@ -1,5 +1,6 @@
import 'dart:io';
import 'package:aku_community/widget/bottom_sheets/sex_bottom_sheet.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -13,7 +14,7 @@ import 'package:aku_community/extensions/widget_list_ext.dart';
import 'package:aku_community/models/house/lease_detail_model.dart';
import 'package:aku_community/models/house/submit_model.dart';
import 'package:aku_community/ui/profile/house/house_func.dart';
import 'package:aku_community/ui/profile/house/house_information_check_page.dart';
import 'package:aku_community/ui/profile/house/lease_relevation/house_information_check_page.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';
@ -104,7 +105,15 @@ class _SupplementInformationPageState extends State<SupplementInformationPage> {
BeeInputRow.button(
title: '性别',
onPressed: () async {
await Get.bottomSheet(_sexBottomSheet());
await Get.bottomSheet(
SexBottomSheet(
onChoose: (String value) {
_sex = value;
Get.back();
setState(() {});
},
),
);
setState(() {});
},
hintText: _sex,
@ -211,30 +220,6 @@ class _SupplementInformationPageState extends State<SupplementInformationPage> {
}
}
Widget _sexBottomSheet() {
return CupertinoActionSheet(
title:
'选择性别'.text.size(32.sp).bold.color(ktextPrimary).isIntrinsic.make(),
cancelButton: TextButton(
onPressed: () => Get.back(),
child: '取消'.text.size(28.sp).color(ktextSubColor).isIntrinsic.make()),
actions: [
CupertinoActionSheetAction(
onPressed: () {
_sex = '';
Get.back();
},
child: ''.text.size(30.sp).color(ktextPrimary).isIntrinsic.make()),
CupertinoActionSheetAction(
onPressed: () {
_sex = '';
Get.back();
},
child: ''.text.size(30.sp).color(ktextPrimary).isIntrinsic.make())
],
);
}
bool get canSubmit {
if (_nameController.text.isEmpty) {
BotToast.showText(text: '姓名不能为空!');

@ -7,7 +7,7 @@ import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/models/house/lease_list_model.dart';
import 'package:aku_community/pages/things_page/widget/bee_list_view.dart';
import 'package:aku_community/ui/profile/house/lease_house_card.dart';
import 'package:aku_community/ui/profile/house/lease_relevation/lease_house_card.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
class TenantHouseListPage extends StatefulWidget {

@ -1,3 +1,4 @@
import 'package:aku_community/widget/bottom_sheets/sex_bottom_sheet.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -11,7 +12,7 @@ import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/extensions/widget_list_ext.dart';
import 'package:aku_community/models/house/lease_echo_model.dart';
import 'package:aku_community/ui/profile/house/house_func.dart';
import 'package:aku_community/ui/profile/house/tenant_house_list_page.dart';
import 'package:aku_community/ui/profile/house/lease_relevation/tenant_house_list_page.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';
@ -76,7 +77,15 @@ class _UserIdentifyPageState extends State<UserIdentifyPage> {
hintText: _sex,
isRequire: true,
onPressed: () async {
await Get.bottomSheet(_sexBottomSheet());
await Get.bottomSheet(
SexBottomSheet(
onChoose: (String value) {
_sex = value;
Get.back();
setState(() {});
},
),
);
setState(() {});
},
),
@ -143,30 +152,6 @@ class _UserIdentifyPageState extends State<UserIdentifyPage> {
return true;
}
Widget _sexBottomSheet() {
return CupertinoActionSheet(
title:
'选择性别'.text.size(32.sp).bold.color(ktextPrimary).isIntrinsic.make(),
cancelButton: TextButton(
onPressed: () => Get.back(),
child: '取消'.text.size(28.sp).color(ktextSubColor).isIntrinsic.make()),
actions: [
CupertinoActionSheetAction(
onPressed: () {
_sex = '';
Get.back();
},
child: ''.text.size(30.sp).color(ktextPrimary).isIntrinsic.make()),
CupertinoActionSheetAction(
onPressed: () {
_sex = '';
Get.back();
},
child: ''.text.size(30.sp).color(ktextPrimary).isIntrinsic.make())
],
);
}
Widget _identifyBottomSheet() {
return CupertinoActionSheet(
title:

@ -0,0 +1,25 @@
import 'package:aku_community/base/base_style.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class PayMethodBottomSheet extends StatelessWidget {
final Function(String value) onChoose;
const PayMethodBottomSheet({Key? key, required this.onChoose})
: super(key: key);
@override
Widget build(BuildContext context) {
return CupertinoActionSheet(
title:
'支付方式'.text.size(32.sp).bold.color(ktextPrimary).isIntrinsic.make(),
actions: [
CupertinoActionSheetAction(
onPressed: onChoose('支付宝'),
child:
'支付宝'.text.size(32.sp).color(ktextPrimary).isIntrinsic.make())
],
);
}
}

@ -0,0 +1,30 @@
import 'package:aku_community/base/base_style.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class SexBottomSheet extends StatelessWidget {
final Function(String value) onChoose;
const SexBottomSheet({Key? key, required this.onChoose}) : super(key: key);
@override
Widget build(BuildContext context) {
return CupertinoActionSheet(
title:
'选择性别'.text.size(32.sp).bold.color(ktextPrimary).isIntrinsic.make(),
cancelButton: TextButton(
onPressed: () => Get.back(),
child: '取消'.text.size(28.sp).color(ktextSubColor).isIntrinsic.make()),
actions: [
CupertinoActionSheetAction(
onPressed: onChoose(''),
child: ''.text.size(30.sp).color(ktextPrimary).isIntrinsic.make()),
CupertinoActionSheetAction(
onPressed: onChoose(''),
child: ''.text.size(30.sp).color(ktextPrimary).isIntrinsic.make())
],
);
}
}
Loading…
Cancel
Save