|
|
@ -1,6 +1,7 @@
|
|
|
|
import 'package:akuCommunity/constants/app_values.dart';
|
|
|
|
import 'package:akuCommunity/constants/app_values.dart';
|
|
|
|
import 'package:akuCommunity/provider/app_provider.dart';
|
|
|
|
import 'package:akuCommunity/provider/app_provider.dart';
|
|
|
|
import 'package:akuCommunity/ui/profile/house/pick_my_house_page.dart';
|
|
|
|
import 'package:akuCommunity/ui/profile/house/pick_my_house_page.dart';
|
|
|
|
|
|
|
|
import 'package:flustars/flustars.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
|
@ -34,6 +35,7 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
|
|
|
|
TextEditingController _userCarNum = new TextEditingController();
|
|
|
|
TextEditingController _userCarNum = new TextEditingController();
|
|
|
|
DateTime dateTime;
|
|
|
|
DateTime dateTime;
|
|
|
|
int _selectSex = 1;
|
|
|
|
int _selectSex = 1;
|
|
|
|
|
|
|
|
GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
|
|
|
|
|
|
|
|
|
|
|
Widget _buildHouseCard(
|
|
|
|
Widget _buildHouseCard(
|
|
|
|
String title,
|
|
|
|
String title,
|
|
|
@ -82,7 +84,8 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget _input(String title, hintText, TextEditingController controller) {
|
|
|
|
Widget _input(String title, hintText, TextEditingController controller,
|
|
|
|
|
|
|
|
FormFieldValidator validator) {
|
|
|
|
return Container(
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: 36.w,
|
|
|
|
left: 36.w,
|
|
|
@ -103,7 +106,11 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
|
|
|
|
style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)),
|
|
|
|
style: TextStyle(fontSize: 28.sp, color: Color(0xff333333)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(height: 25.w),
|
|
|
|
SizedBox(height: 25.w),
|
|
|
|
CommonInput(inputController: controller, hintText: hintText)
|
|
|
|
CommonInput(
|
|
|
|
|
|
|
|
inputController: controller,
|
|
|
|
|
|
|
|
hintText: hintText,
|
|
|
|
|
|
|
|
validator: validator,
|
|
|
|
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -243,11 +250,17 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
return MaterialButton(
|
|
|
|
return MaterialButton(
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
|
|
if (formKey.currentState.validate()) {
|
|
|
|
|
|
|
|
if (dateTime == null) {
|
|
|
|
|
|
|
|
BotToast.showText(text: '请选择到访时间');
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
VoidCallback cancel = BotToast.showLoading();
|
|
|
|
VoidCallback cancel = BotToast.showLoading();
|
|
|
|
await ManagerFunc.insertVisitorInfo(id, type, _userName.text,
|
|
|
|
await ManagerFunc.insertVisitorInfo(id, type, _userName.text,
|
|
|
|
_selectSex, tel, _userCarNum.text, dateTime);
|
|
|
|
_selectSex, tel, _userCarNum.text, dateTime);
|
|
|
|
cancel();
|
|
|
|
cancel();
|
|
|
|
Get.off(VisitorRecordPage());
|
|
|
|
Get.off(VisitorRecordPage());
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
minWidth: double.infinity,
|
|
|
|
minWidth: double.infinity,
|
|
|
|
height: 96.w,
|
|
|
|
height: 96.w,
|
|
|
@ -293,8 +306,8 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
|
|
|
|
child: '访客记录'.text.black.size(28.sp).make(),
|
|
|
|
child: '访客记录'.text.black.size(28.sp).make(),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
],
|
|
|
|
],
|
|
|
|
body: Container(
|
|
|
|
body: Form(
|
|
|
|
color: Colors.white,
|
|
|
|
key: formKey,
|
|
|
|
child: ListView(
|
|
|
|
child: ListView(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
SingleChildScrollView(
|
|
|
|
SingleChildScrollView(
|
|
|
@ -309,9 +322,23 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
|
|
|
|
S.of(context).tempPlotName,
|
|
|
|
S.of(context).tempPlotName,
|
|
|
|
appProvider.selectedHouse.roomName,
|
|
|
|
appProvider.selectedHouse.roomName,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
_input('访客姓名', '请输入访客姓名', _userName),
|
|
|
|
_input(
|
|
|
|
|
|
|
|
'访客姓名',
|
|
|
|
|
|
|
|
'请输入访客姓名',
|
|
|
|
|
|
|
|
_userName,
|
|
|
|
|
|
|
|
(text) {
|
|
|
|
|
|
|
|
if (TextUtil.isEmpty(text)) return '姓名不能为空';
|
|
|
|
|
|
|
|
if (!RegexUtil.isZh(text)) return '姓名包含特殊文字';
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
_sexSelect(),
|
|
|
|
_sexSelect(),
|
|
|
|
_input('是否驾车', '请输入,例如浙A88888(没有驾车可不填)', _userCarNum),
|
|
|
|
_input(
|
|
|
|
|
|
|
|
'是否驾车',
|
|
|
|
|
|
|
|
'请输入,例如浙A88888(没有驾车可不填)',
|
|
|
|
|
|
|
|
_userCarNum,
|
|
|
|
|
|
|
|
(text) => null,
|
|
|
|
|
|
|
|
),
|
|
|
|
_selectTime(),
|
|
|
|
_selectTime(),
|
|
|
|
SizedBox(height: 64.w),
|
|
|
|
SizedBox(height: 64.w),
|
|
|
|
_create(
|
|
|
|
_create(
|
|
|
@ -325,7 +352,7 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
).material(color: Colors.white),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|