对接 租赁认证接口

hmxc
张萌 3 years ago
parent 3fc91e468e
commit 876eb16fdd

@ -22,6 +22,7 @@ class API {
static _News news = _News();
static _Search search = _Search();
static _Pay pay = _Pay();
static _House house = _House();
}
class _Login {
@ -275,7 +276,6 @@ class _Manager {
///app
String get getDoorQrCode => '/user/doorQRCode/getQrCode';
}
class _Community {
@ -377,6 +377,12 @@ class _Upload {
String get uploadRepair => '/user/upload/uploadRepair';
String get uploadEvent => '/user/upload/uploadGambit';
///
String get uploadCardFront => '/user/upload/uploadAppIdCardFront';
///
String get uploadCardBack => '/user/upload/uploadAppIdCardBack';
}
class _Message {
@ -444,3 +450,20 @@ class _Pay {
///
String get reportReapirCheck => '/user/alipay/reportRepairCheckAlipay';
}
class _House {
///
String get leaseCertification => '/user/myHouse/leaseCertification';
///
String get leaseEcho => '/user/myHouse/leaseEcho';
///
String get leaseList => '/user/myHouse/leaseList';
///id
String get leaseFindByld => '/user/myHouse/leaseFindById';
///
String get submitLeaseInfo => '/user/myHouse/submitPersonalLeaseInfo';
}

@ -3,6 +3,7 @@ import 'package:aku_community/model/user/house_model.dart';
import 'package:aku_community/models/user/passed_house_list_model.dart';
import 'package:aku_community/utils/network/base_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
import 'package:bot_toast/bot_toast.dart';
class HouseFunc {
///
@ -13,9 +14,37 @@ class HouseFunc {
}
///
static Future<List<PassedHouseListModel>> get passedHouses async{
BaseModel model = await NetUtil().get(API.user.passedHouseList);
static Future<List<PassedHouseListModel>> get passedHouses async {
BaseModel model = await NetUtil().get(API.user.passedHouseList);
if (!model.status!) return [];
return (model.data as List).map((e) => PassedHouseListModel.fromJson(e)).toList();
return (model.data as List)
.map((e) => PassedHouseListModel.fromJson(e))
.toList();
}
///
Future leaseCertification(
String name,
String sex,
String tel,
String idNumber,
) async {
BaseModel baseModel =
await NetUtil().post(API.house.leaseCertification, params: {
"name": name,
"sex": getSex[sex],
"tel": tel,
"idNumber": idNumber,
});
if (baseModel.status ?? false) {
BotToast.showText(text: '提交成功');
return true;
}
return false;
}
Map<String, int> getSex = {
'': 1,
'': 2,
};
}

@ -1,8 +1,10 @@
import 'package:aku_community/base/base_style.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/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:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -83,12 +85,47 @@ class _UserIdentifyPageState extends State<UserIdentifyPage> {
),
bottomNavi: BottomButton(
onPressed: () async {
await Get.dialog(_errorDialog());
if (canSubmit) {
bool result = await HouseFunc().leaseCertification(
_nameController.text,
_sex,
_phoneController.text,
_indentifyCodeController.text);
if (result) {
Get.off(() => TenantHouseListPage());
} else {
await Get.dialog(_errorDialog());
}
}
},
child: '提交'.text.size(32.sp).bold.color(ktextPrimary).make()),
);
}
bool get canSubmit {
if (_nameController.text.isEmpty) {
BotToast.showText(text: '姓名不能为空!');
return false;
}
if (_phoneController.text.isEmpty) {
BotToast.showText(text: '手机号码不能为空!');
return false;
}
if (_indentifyCodeController.text.isEmpty) {
BotToast.showText(text: '身份证号码不能为空!');
return false;
}
if (_sex == '请选择性别') {
BotToast.showText(text: '请先选择性别');
return false;
}
if (_identify == '请选择身份') {
BotToast.showText(text: '请先选择身份');
return false;
}
return true;
}
Widget _sexBottomSheet() {
return CupertinoActionSheet(
title:
@ -142,7 +179,9 @@ class _UserIdentifyPageState extends State<UserIdentifyPage> {
return CupertinoAlertDialog(
title:
'账户不存在'.text.size(34.sp).color(ktextPrimary).bold.isIntrinsic.make(),
content: '原因:用户未具备相关资格'
content: '''原因:
1.
2.'''
.text
.size(26.sp)
.color(ktextPrimary)
@ -159,9 +198,9 @@ class _UserIdentifyPageState extends State<UserIdentifyPage> {
CupertinoDialogAction(
onPressed: () {
Get.back();
Get.off(() => TenantHouseListPage());
Get.back();
},
child: '修改信息'
child: '回到首页'
.text
.size(34.sp)
.isIntrinsic

Loading…
Cancel
Save