From 20678c59ca08af632b83540cdbc8dec7dc4e1603 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Mon, 28 Jun 2021 09:33:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E6=8E=A5=E7=94=9F=E6=88=90=E5=90=88?= =?UTF-8?q?=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/api.dart | 4 ++++ lib/ui/profile/house/contract_preview_page.dart | 8 ++++++-- lib/ui/profile/house/house_func.dart | 16 ++++++++++++++++ .../house/house_information_check_page.dart | 1 + 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/lib/constants/api.dart b/lib/constants/api.dart index afd64b48..b28202ac 100644 --- a/lib/constants/api.dart +++ b/lib/constants/api.dart @@ -469,4 +469,8 @@ class _House { ///我的房屋:提交个人租赁信息 String get submitLeaseInfo => '/user/myHouse/submitPersonalLeaseInfo'; + + ///我的房屋:生成合同 + String get generateContract => '/user/myHouse/generateValidContract'; + } diff --git a/lib/ui/profile/house/contract_preview_page.dart b/lib/ui/profile/house/contract_preview_page.dart index 870b99c3..681dfa5c 100644 --- a/lib/ui/profile/house/contract_preview_page.dart +++ b/lib/ui/profile/house/contract_preview_page.dart @@ -18,7 +18,9 @@ import 'package:velocity_x/velocity_x.dart'; class ContractPreviewPage extends StatefulWidget { final String url; - ContractPreviewPage({Key? key, required this.url}) : super(key: key); + final int id; + ContractPreviewPage({Key? key, required this.url, required this.id}) + : super(key: key); @override _ContractPreviewPageState createState() => _ContractPreviewPageState(); @@ -75,8 +77,10 @@ class _ContractPreviewPageState extends State { if (_signFile != null) { Function cancel = BotToast.showLoading(); String result = await HouseFunc().uploadSignName(_signFile!); + String path = await HouseFunc() + .generateContract(widget.id, widget.url, result); Get.off(() => DownLoadContractPage( - path: result, + path: path, )); cancel(); } else { diff --git a/lib/ui/profile/house/house_func.dart b/lib/ui/profile/house/house_func.dart index 50568c86..e997cc67 100644 --- a/lib/ui/profile/house/house_func.dart +++ b/lib/ui/profile/house/house_func.dart @@ -126,6 +126,22 @@ class HouseFunc { } } + ///生成正式合同 + Future generateContract(int id, String pUrl, String url) async { + BaseModel baseModel = + await NetUtil().post(API.house.generateContract, params: { + "id": id, + "ContractPreviewImgUrl": pUrl, + "contractSignatureImgUrl": url, + }); + + if (baseModel.status ?? false) { + return baseModel.data; + } else { + return ''; + } + } + static Map getSex = { '男': 1, '女': 2, diff --git a/lib/ui/profile/house/house_information_check_page.dart b/lib/ui/profile/house/house_information_check_page.dart index d9f25310..99374b82 100644 --- a/lib/ui/profile/house/house_information_check_page.dart +++ b/lib/ui/profile/house/house_information_check_page.dart @@ -65,6 +65,7 @@ class _HouseInformationCheckPageState extends State { if (result.isNotEmpty) { Get.back(); Get.off(() => ContractPreviewPage( + id: widget.detailModel.id, url: result, )); }