支付信息回显

hmxc
张萌 3 years ago
parent 61b197347e
commit 2e97ab7020

@ -1,5 +1,6 @@
import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/constants/api.dart'; import 'package:aku_community/constants/api.dart';
import 'package:aku_community/models/house/lease_detail_model.dart';
import 'package:aku_community/pages/life_pay/pay_finish_page.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/pages/life_pay/pay_util.dart';
import 'package:aku_community/ui/profile/house/house_func.dart'; import 'package:aku_community/ui/profile/house/house_func.dart';
@ -23,20 +24,25 @@ class ContractPayPage extends StatefulWidget {
} }
class _ContractPayPageState extends State<ContractPayPage> { class _ContractPayPageState extends State<ContractPayPage> {
late TextEditingController _contractCodeController; String _contractCode = '';
late TextEditingController _payTotalController; num _payTotal = 0;
LeaseDetailModel? _model;
String _payMethod = '选择支付方式'; String _payMethod = '选择支付方式';
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_contractCodeController = TextEditingController(); Future.delayed(Duration(milliseconds: 300), () async {
_payTotalController = TextEditingController(); _model = (await HouseFunc().leaseDetail(widget.id));
if (_model != null) {
_contractCode = _model!.code;
_payTotal = _model!.margin;
}
setState(() {});
});
} }
@override @override
void dispose() { void dispose() {
_contractCodeController.dispose();
_payTotalController.dispose();
super.dispose(); super.dispose();
} }
@ -47,16 +53,16 @@ class _ContractPayPageState extends State<ContractPayPage> {
body: ListView( body: ListView(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
children: [ children: [
BeeInputRow( BeeInputRow.button(
controller: _contractCodeController, onPressed: () {},
hintText: '请填写合同编号', hintText: _contractCode,
title: '合同编号', title: '合同编号',
isRequire: true, isRequire: true,
), ),
BeeInputRow( BeeInputRow.button(
title: '保证金金额(元)', title: '保证金金额(元)',
controller: _payTotalController, onPressed: () {},
hintText: '填写保证金金额'), hintText: _payTotal.toStringAsFixed(2)),
BeeInputRow.button( BeeInputRow.button(
title: '支付方式', title: '支付方式',
hintText: _payMethod, hintText: _payMethod,

@ -14,6 +14,7 @@ import 'package:dotted_border/dotted_border.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';
import 'package:power_logger/power_logger.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class ContractPreviewPage extends StatefulWidget { class ContractPreviewPage extends StatefulWidget {
@ -76,6 +77,7 @@ class _ContractPreviewPageState extends State<ContractPreviewPage> {
onPressed: () async { onPressed: () async {
if (_signFile != null) { if (_signFile != null) {
Function cancel = BotToast.showLoading(); Function cancel = BotToast.showLoading();
try {
String result = await HouseFunc().uploadSignName(_signFile!); String result = await HouseFunc().uploadSignName(_signFile!);
String path = await HouseFunc() String path = await HouseFunc()
.generateContract(widget.id, widget.url, result); .generateContract(widget.id, widget.url, result);
@ -83,6 +85,9 @@ class _ContractPreviewPageState extends State<ContractPreviewPage> {
path: path, path: path,
id: widget.id, id: widget.id,
)); ));
} catch (e) {
LoggerData.addData(e);
}
cancel(); cancel();
} else { } else {
BotToast.showText(text: '请先签名!'); BotToast.showText(text: '请先签名!');

@ -101,8 +101,11 @@ class _UploadContractsPageState extends State<UploadContractsPage> {
bool result = bool result =
await HouseFunc().submitFormalContract(widget.id, _urls); await HouseFunc().submitFormalContract(widget.id, _urls);
if (result) { if (result) {
Get.to(() => ContractPayPage(id: widget.id,)); Get.to(() => ContractPayPage(
id: widget.id,
));
} }
cancel();
}, },
child: '提交审核'.text.size(32.sp).color(ktextPrimary).bold.make()), child: '提交审核'.text.size(32.sp).color(ktextPrimary).bold.make()),
); );

Loading…
Cancel
Save