parent
e28c64eb19
commit
05c01671fa
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 340 KiB |
After Width: | Height: | Size: 314 KiB |
@ -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(),
|
||||
);
|
||||
}
|
||||
}
|
@ -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…
Reference in new issue