添加 我的房屋

添加 实名认证流程
pull/1/head
张萌 3 years ago
parent e28c64eb19
commit 05c01671fa

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 KiB

@ -43,6 +43,9 @@ class _User {
///
String get setNickName => '/app/user/settingNickName';
///
String get certification => '/app/user/verified';
}
class _Login {

@ -989,6 +989,10 @@ class $AssetsImagesGen {
AssetGenImage get cardYellow =>
const AssetGenImage('assets/images/card_yellow.png');
/// File path: assets/images/certification.png
AssetGenImage get certification =>
const AssetGenImage('assets/images/certification.png');
/// File path: assets/images/circle_left_bottom.png
AssetGenImage get circleLeftBottom =>
const AssetGenImage('assets/images/circle_left_bottom.png');
@ -1029,6 +1033,10 @@ class $AssetsImagesGen {
AssetGenImage get houseAttestation =>
const AssetGenImage('assets/images/house_attestation.png');
/// File path: assets/images/house_empty.png
AssetGenImage get houseEmpty =>
const AssetGenImage('assets/images/house_empty.png');
/// File path: assets/images/house_header.png
AssetGenImage get houseHeader =>
const AssetGenImage('assets/images/house_header.png');
@ -1083,6 +1091,9 @@ class $AssetsImagesGen {
AssetGenImage get splashLogo =>
const AssetGenImage('assets/images/splash_logo.png');
/// File path: assets/images/success.png
AssetGenImage get success => const AssetGenImage('assets/images/success.png');
/// File path: assets/images/white.png
AssetGenImage get white => const AssetGenImage('assets/images/white.png');

@ -1,4 +1,3 @@
import 'package:aku_new_community/model/common/img_model.dart';
import 'package:json_annotation/json_annotation.dart';
part 'user_info_model.g.dart';
@ -8,6 +7,7 @@ class UserInfoModel {
final int id;
final int communityId;
final String? name;
final String? idCard;
final String tel;
// final List<ImgModel> imgUrls;
@ -39,6 +39,7 @@ class UserInfoModel {
required this.id,
required this.communityId,
this.name,
this.idCard,
required this.tel,
this.sex,
this.nickName,

@ -9,7 +9,7 @@ import 'package:aku_new_community/provider/user_provider.dart';
import 'package:aku_new_community/ui/market/order/order_page.dart';
import 'package:aku_new_community/ui/profile/car/car_manage_page.dart';
import 'package:aku_new_community/ui/profile/car_parking/car_parking_page.dart';
import 'package:aku_new_community/ui/profile/house/house_owners_page.dart';
import 'package:aku_new_community/ui/profile/new_house/my_house_page.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/widget/others/user_tool.dart';
import 'package:flutter/cupertino.dart';
@ -514,9 +514,10 @@ class _PersonalIndexState extends State<PersonalIndex>
_function(
'我的房屋',
R.ASSETS_ICONS_ICON_MY_HOUSE_PNG,
() => HouseOwnersPage(
identify: 4,
),
() => MyHousePage(),
// () => HouseOwnersPage(
// identify: 4,
// ),
// userProvider.myHouses.first.communityName ??
''),
36.hb,

@ -49,6 +49,7 @@ class _SplashPageState extends State<SplashPage> {
appProvider.initApplications();
appProvider.startLocation();
if (HiveStore.appBox!.get('login') ?? false) {
////
await userProvider.setLogin(HiveStore.appBox!.get('token'));
}
} catch (e) {

@ -26,14 +26,12 @@ class UserProvider extends ChangeNotifier {
bool get isNotLogin => !_isLogin;
Future setLogin(int token) async {
// try {
final appProvider = Provider.of<AppProvider>(Get.context!, listen: false);
_isLogin = true;
NetUtil().dio!.options.headers['app-login-token'] = token;
HiveStore.appBox!.put('token', token);
HiveStore.appBox!.put('login', true);
await updateUserInfo();
// await updateMyHouseInfo();
///
_userConfig = await HiveStore.userBox!.get('${_userInfoModel!.id}') ??
@ -47,9 +45,6 @@ class UserProvider extends ChangeNotifier {
WebSocketUtil().startWebSocket();
}
notifyListeners();
// } catch (e) {
// LoggerData.addData(e);
// }
}
logout() {
@ -122,8 +117,6 @@ class UserProvider extends ChangeNotifier {
showMessage: true,
);
if (baseModel.success) {
// _userInfoModel!.birthday =
// DateUtil.formatDate(date, format: "yyyy-MM-dd HH:mm:ss");
notifyListeners();
}
}
@ -136,7 +129,6 @@ class UserProvider extends ChangeNotifier {
showMessage: true,
);
if (baseModel.success) {
// _userInfoModel!.nickName = name;
notifyListeners();
}
}
@ -168,6 +160,9 @@ class UserProvider extends ChangeNotifier {
}
}
///
///
///
UserConfigModel _userConfig =
UserConfigModel(userId: 0, clockRemind: false, todayClocked: false);

@ -0,0 +1,181 @@
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/others/user_tool.dart';
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:velocity_x/velocity_x.dart';
class AddHousePage extends StatefulWidget {
const AddHousePage({Key? key}) : super(key: key);
@override
_AddHousePageState createState() => _AddHousePageState();
}
class _AddHousePageState extends State<AddHousePage> {
@override
Widget build(BuildContext context) {
var identify = Padding(
padding: EdgeInsets.only(bottom: 24.w),
child: Row(
children: [
SizedBox(
width: 170.w,
child: '认证身份'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
),
Expanded(
child: GestureDetector(
onTap: () {
BotToast.showText(text: 'text');
},
child: Material(
color: Colors.transparent,
child: Row(
children: [
'业主'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
Spacer(),
Icon(
CupertinoIcons.chevron_right,
size: 20.w,
color: Colors.black.withOpacity(0.65),
),
],
),
),
),
),
],
),
);
var name = Padding(
padding: EdgeInsets.symmetric(vertical: 24.w),
child: Row(
children: [
SizedBox(
width: 170.w,
child: '姓名'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
),
Expanded(
child: Row(
children: [
'${UserTool.userProvider.userInfoModel!.name}'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
),
),
],
),
);
var code = Padding(
padding: EdgeInsets.symmetric(vertical: 24.w),
child: Row(
children: [
SizedBox(
width: 170.w,
child: '身份证号'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
),
Expanded(
child: Row(
children: [
'${UserTool.userProvider.userInfoModel!.idCard}'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
),
),
],
),
);
var tel = Padding(
padding: EdgeInsets.only(top: 24.w),
child: Row(
children: [
SizedBox(
width: 170.w,
child: '手机号'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
),
Expanded(
child: Row(
children: [
'${UserTool.userProvider.userInfoModel!.tel}'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
],
),
),
],
),
);
return BeeScaffold(
title: '身份认证',
body: SafeArea(
child: ListView(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
children: [
Container(
width: 686.w,
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(16.w)),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding:
EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
child: '身份信息'.text.size(32.sp).black.bold.make(),
),
BeeDivider.horizontal(),
Padding(
padding:
EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
identify,
BeeDivider.horizontal(),
name,
BeeDivider.horizontal(),
code,
BeeDivider.horizontal(),
tel
],
),
)
],
),
),
],
)),
);
}
}

@ -0,0 +1,155 @@
import 'package:aku_new_community/constants/sars_api.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/ui/profile/new_house/certification/certification_success_page.dart';
import 'package:aku_new_community/ui/profile/new_house/widgets/add_house_button.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_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:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class CertificationPage extends StatefulWidget {
const CertificationPage({Key? key}) : super(key: key);
@override
_CertificationPageState createState() => _CertificationPageState();
}
class _CertificationPageState extends State<CertificationPage> {
TextEditingController _nameController = TextEditingController();
TextEditingController _codeController = TextEditingController();
Widget get tips {
var reg = RegexUtil.matches(
r'^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$',
_codeController.text);
if (!reg && _codeController.text.isNotEmpty) {
return '身份证号输入有误,请重新输入'.text.size(28.sp).color(Colors.red).make();
} else {
return '证件信息绑定后将不能修改,请填写本人的实名信息'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.25))
.make();
}
}
@override
void dispose() {
_nameController.dispose();
_codeController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '实名认证',
body: SafeArea(
child: ListView(
children: [
40.w.heightBox,
Assets.images.certification.image(width: 300, height: 300.w),
40.w.heightBox,
'您所提供的身份信息仅用于本APP身份绑定\n未经您本人允许不会用于其他用途'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.25))
.align(TextAlign.center)
.make(),
50.w.heightBox,
Container(
width: 686.w,
// height: 210.w,
padding: EdgeInsets.symmetric(horizontal: 32.w),
margin: EdgeInsets.symmetric(horizontal: 24.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16.w),
),
child: Column(
children: [
Row(
children: [
SizedBox(
child: '姓名'.text.size(28.sp).color(Colors.black).make(),
width: 120.w,
),
Expanded(
child: TextField(
controller: _nameController,
onChanged: (text) {
setState(() {});
},
decoration: InputDecoration(
hintText: '请输入真实姓名',
border: InputBorder.none,
hintStyle: TextStyle(
fontSize: 28.sp,
color: Colors.black.withOpacity(0.25))),
)),
],
),
BeeDivider.horizontal(),
Row(
children: [
SizedBox(
child: '身份证'.text.size(28.sp).color(Colors.black).make(),
width: 120.w,
),
Expanded(
child: TextField(
controller: _codeController,
keyboardType: TextInputType.number,
onChanged: (text) {
setState(() {});
},
decoration: InputDecoration(
hintText: '请输入身份证号码',
border: InputBorder.none,
hintStyle: TextStyle(
fontSize: 28.sp,
color: Colors.black.withOpacity(0.25))),
)),
],
),
],
),
),
24.w.heightBox,
Padding(
padding: EdgeInsets.only(left: 32.w),
child: tips,
),
],
)),
bottomNavi: Padding(
padding: EdgeInsets.all(32.w),
child: AddHouseButton(
text: '提交',
onTap: () async {
var cancel = BotToast.showLoading();
var base =
await NetUtil().post(SARSAPI.user.certification, params: {
'name': _nameController.text,
'idCard': _codeController.text,
});
if (base.success) {
Get.off(() => CertificationSuccessPage());
UserTool.userProvider.updateUserInfo();
UserTool.userProvider.updateMyHouseInfo();
} else {
BotToast.showText(text: base.msg);
}
cancel();
},
),
),
);
}
}

@ -0,0 +1,44 @@
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/pages/tab_navigator.dart';
import 'package:aku_new_community/ui/profile/new_house/widgets/add_house_button.dart';
import 'package:aku_new_community/widget/bee_scaffold.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';
class CertificationSuccessPage extends StatefulWidget {
const CertificationSuccessPage({Key? key}) : super(key: key);
@override
_CertificationSuccessPageState createState() =>
_CertificationSuccessPageState();
}
class _CertificationSuccessPageState extends State<CertificationSuccessPage> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '认证结果',
body: SafeArea(
child: Center(
child: Column(
children: [
Assets.images.success.image(width: 320.w, height: 320.w),
34.w.heightBox,
'提交成功'.text.size(40.sp).color(Colors.black).bold.make(),
94.w.heightBox,
AddHouseButton(text: '添加房屋', onTap: () {}),
40.w.heightBox,
AddHouseButton(
text: '返回首页',
hollow: true,
onTap: () {
Get.offAll(() => TabNavigator());
})
],
),
)),
);
}
}

@ -0,0 +1,75 @@
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/ui/profile/new_house/add_house_page.dart';
import 'package:aku_new_community/ui/profile/new_house/widgets/add_house_button.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/dialog/certification_dialog.dart';
import 'package:aku_new_community/widget/others/user_tool.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';
class MyHousePage extends StatefulWidget {
const MyHousePage({Key? key}) : super(key: key);
@override
_MyHousePageState createState() => _MyHousePageState();
}
class _MyHousePageState extends State<MyHousePage> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '我的房屋',
body: SafeArea(
child: UserTool.userProvider.myHouses.isEmpty
? _emptyWidget()
: ListView()),
bottomNavi: Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w),
child: AddHouseButton(
onTap: () async {
if (UserTool.userProvider.userInfoModel?.name == null) {
await Get.dialog(CertificationDialog());
} else {
Get.to(() => AddHousePage());
}
},
text: '添加房屋',
),
),
);
}
Widget _houseCard() {
return Stack(
children: [
Container(
width: 686.w,
padding: EdgeInsets.all(24.w),
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(8.w)),
child: Column(
children: [],
),
),
],
);
}
Widget _emptyWidget() {
return Center(
child: Column(
children: [
180.w.heightBox,
Assets.images.houseEmpty.image(width: 480.w, height: 480.w),
'当前没有绑定任何房屋'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.25))
.make(),
],
),
);
}
}

@ -0,0 +1,34 @@
import 'package:aku_new_community/base/base_style.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class AddHouseButton extends StatelessWidget {
final String text;
final VoidCallback onTap;
final bool hollow;
const AddHouseButton({
Key? key,
required this.text,
required this.onTap,
this.hollow = false,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialButton(
minWidth: 686.w,
height: 93.w,
color: hollow ? Colors.white : kPrimaryColor,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.w),
side: hollow
? BorderSide(color: Colors.black.withOpacity(0.25))
: BorderSide.none),
onPressed: onTap,
child: text.text.size(32.sp).black.bold.make(),
);
}
}

@ -65,7 +65,7 @@ class NetUtil {
try {
Response res = await _dio!.get(path, queryParameters: params);
if (!res.data['success']) {
_baseModel = BaseModel.error(res.data['message'], res.data['success'],
_baseModel = BaseModel.error(res.data['msg'], res.data['success'],
res.data['data'], res.data['code']);
_parseRequestError(_baseModel, showMessage: showMessage);
} else {
@ -92,7 +92,7 @@ class NetUtil {
try {
Response res = await _dio!.post(path, data: params);
if (!res.data['success']) {
_baseModel = BaseModel.error(res.data['message'], res.data['success'],
_baseModel = BaseModel.error(res.data['msg'], res.data['success'],
res.data['data'], res.data['code']);
_parseRequestError(_baseModel, showMessage: showMessage);
} else {
@ -102,6 +102,7 @@ class NetUtil {
_parseErr(e);
_baseModel = BaseModel(code: 0, msg: '未知错误', success: false, data: null);
}
return _baseModel;
}
@ -198,7 +199,7 @@ class NetUtil {
userProvider.logout();
Get.offAll(() => LoginPage());
}
if (!model.success || showMessage) {
if (!model.success && showMessage) {
BotToast.showText(text: model.msg);
}
}

@ -0,0 +1,83 @@
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/ui/profile/new_house/certification/certification_page.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';
class CertificationDialog extends StatelessWidget {
const CertificationDialog({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: Material(
child: Container(
width: 623.w,
height: 394.w,
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 48.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
),
child: Column(
children: [
'实名认证提醒'.text.size(32.sp).black.bold.isIntrinsic.make(),
48.w.heightBox,
'添加房屋需要填写住户的真实信息,请在选择房屋前完成实名认证。'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.isIntrinsic
.make(),
64.w.heightBox,
Row(
children: [
MaterialButton(
onPressed: () {
Get.back();
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.w),
side:
BorderSide(color: Colors.black.withOpacity(0.25))),
color: Colors.white,
minWidth: 260.w,
height: 70.w,
elevation: 0,
child: '取消'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.isIntrinsic
.make(),
),
Spacer(),
MaterialButton(
onPressed: () {
Get.off(() => CertificationPage());
},
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.w),
),
elevation: 0,
color: kPrimaryColor,
minWidth: 260.w,
height: 70.w,
child: '进行实名认证'
.text
.size(28.sp)
.color(Colors.black)
.bold
.isIntrinsic
.make(),
)
],
)
],
),
),
),
);
}
}
Loading…
Cancel
Save