|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
import 'package:akuCommunity/widget/picker/bee_date_picker.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
|
@ -6,6 +7,7 @@ import 'package:flustars/flustars.dart';
|
|
|
|
import 'package:flutter_icons/flutter_icons.dart';
|
|
|
|
import 'package:flutter_icons/flutter_icons.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
import 'package:share/share.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:akuCommunity/pages/manager_func.dart';
|
|
|
|
import 'package:akuCommunity/pages/manager_func.dart';
|
|
|
@ -17,7 +19,6 @@ import 'package:akuCommunity/utils/headers.dart';
|
|
|
|
import 'package:akuCommunity/widget/bee_divider.dart';
|
|
|
|
import 'package:akuCommunity/widget/bee_divider.dart';
|
|
|
|
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
|
|
|
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
|
|
|
import 'package:akuCommunity/widget/common_input.dart';
|
|
|
|
import 'package:akuCommunity/widget/common_input.dart';
|
|
|
|
import 'package:akuCommunity/widget/picker/bee_date_picker.dart';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VisitorAccessPage extends StatefulWidget {
|
|
|
|
class VisitorAccessPage extends StatefulWidget {
|
|
|
|
VisitorAccessPage({Key key}) : super(key: key);
|
|
|
|
VisitorAccessPage({Key key}) : super(key: key);
|
|
|
@ -117,33 +118,33 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
|
|
|
|
IconData sexIcon,
|
|
|
|
IconData sexIcon,
|
|
|
|
int value,
|
|
|
|
int value,
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
return InkWell(
|
|
|
|
return MaterialButton(
|
|
|
|
onTap: () {
|
|
|
|
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
|
|
|
|
|
|
|
elevation: 0,
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
setState(() {
|
|
|
|
setState(() {
|
|
|
|
_selectSex = value;
|
|
|
|
_selectSex = value;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
height: 72.w,
|
|
|
|
height: 72.w,
|
|
|
|
width: 176.w,
|
|
|
|
minWidth: 176.w,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: 13.w,
|
|
|
|
vertical: 13.w,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
|
|
|
color: Color(0xffffffff),
|
|
|
|
color: Color(0xffffffff),
|
|
|
|
borderRadius: BorderRadius.all(Radius.circular(36)),
|
|
|
|
shape: StadiumBorder(
|
|
|
|
border: Border.all(
|
|
|
|
side: BorderSide(
|
|
|
|
color:
|
|
|
|
width: 1.w,
|
|
|
|
value == _selectSex ? Color(0xffffc40c) : Color(0xff979797),
|
|
|
|
color: value == _selectSex ? Color(0xffffc40c) : Color(0xff979797),
|
|
|
|
width: 1)),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
Icon(
|
|
|
|
Icon(
|
|
|
|
sexIcon,
|
|
|
|
sexIcon,
|
|
|
|
size: 32.sp,
|
|
|
|
size: 32.sp,
|
|
|
|
color:
|
|
|
|
color: value == _selectSex ? Color(0xff333333) : Color(0xff979797),
|
|
|
|
value == _selectSex ? Color(0xff333333) : Color(0xff979797),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
SizedBox(width: 9.w),
|
|
|
|
SizedBox(width: 9.w),
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
@ -157,7 +158,6 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -217,7 +217,7 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
|
|
|
|
Text(
|
|
|
|
Text(
|
|
|
|
dateTime == null
|
|
|
|
dateTime == null
|
|
|
|
? '请选择到访时间'
|
|
|
|
? '请选择到访时间'
|
|
|
|
: '${dateTime.toString().substring(0, 11)}',
|
|
|
|
: '${DateUtil.formatDate(dateTime, format: 'yyyy-MM-dd')}',
|
|
|
|
style: TextStyle(
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
fontSize: 34.sp,
|
|
|
|
fontSize: 34.sp,
|
|
|
@ -244,26 +244,20 @@ class _VisitorAccessPageState extends State<VisitorAccessPage> {
|
|
|
|
int type,
|
|
|
|
int type,
|
|
|
|
String tel,
|
|
|
|
String tel,
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
|
|
|
|
final appProvider = Provider.of<AppProvider>(context);
|
|
|
|
return MaterialButton(
|
|
|
|
return MaterialButton(
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
if (formKey.currentState.validate()) {
|
|
|
|
String result = await ManagerFunc.shareVisitor(
|
|
|
|
if (dateTime == null) {
|
|
|
|
estateId: appProvider.selectedHouse.estateId,
|
|
|
|
BotToast.showText(text: '请选择到访时间');
|
|
|
|
name: _userName.text,
|
|
|
|
return;
|
|
|
|
sex: _selectSex,
|
|
|
|
}
|
|
|
|
carNumber: _userCarNum.text,
|
|
|
|
VoidCallback cancel = BotToast.showLoading();
|
|
|
|
date: dateTime,
|
|
|
|
await ManagerFunc.insertVisitorInfo(
|
|
|
|
tel: tel,
|
|
|
|
id,
|
|
|
|
|
|
|
|
type,
|
|
|
|
|
|
|
|
_userName.text,
|
|
|
|
|
|
|
|
_selectSex,
|
|
|
|
|
|
|
|
tel,
|
|
|
|
|
|
|
|
_userCarNum.text,
|
|
|
|
|
|
|
|
dateTime,
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
cancel();
|
|
|
|
if (result != null)
|
|
|
|
Get.off(VisitorRecordPage());
|
|
|
|
Share.share(
|
|
|
|
}
|
|
|
|
'http://test.akuhotel.com:8804/static/dist/index.html#/visitor?$result');
|
|
|
|
},
|
|
|
|
},
|
|
|
|
minWidth: double.infinity,
|
|
|
|
minWidth: double.infinity,
|
|
|
|
height: 96.w,
|
|
|
|
height: 96.w,
|
|
|
|