|
...
|
...
|
@@ -2,6 +2,7 @@ import 'dart:async'; |
|
|
|
|
|
|
|
import 'package:common_utils/common_utils.dart';
|
|
|
|
import 'package:dotted_border/dotted_border.dart';
|
|
|
|
import 'package:easy_contact_picker/easy_contact_picker.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/constant/state.dart';
|
|
...
|
...
|
@@ -11,6 +12,7 @@ import 'package:one_key/models/guest_info_model.dart'; |
|
|
|
import 'package:one_key/models/reserve_info_model.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/pages/table/area_item_table.dart';
|
|
|
|
import 'package:one_key/provider/base_info_provider.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/provider/table_manager_model.dart';
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
...
|
...
|
@@ -18,6 +20,7 @@ import 'package:one_key/res/colors.dart'; |
|
|
|
import 'package:one_key/utils/dialog_util.dart';
|
|
|
|
import 'package:one_key/utils/event_bus.dart';
|
|
|
|
import 'package:one_key/route/navigator_util.dart';
|
|
|
|
import 'package:one_key/utils/misc.dart';
|
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
|
|
import 'package:one_key/widgets/MyDivider.dart';
|
|
|
|
|
|
...
|
...
|
@@ -30,6 +33,7 @@ import 'package:one_key/widgets/system_app_bar.dart'; |
|
|
|
|
|
|
|
import 'package:one_key/models/table.dart' as t;
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'dart:convert' as convert;
|
|
|
|
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
|
...
|
...
|
@@ -58,6 +62,18 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
ScrollController _areaController = ScrollController();
|
|
|
|
List<String> personNumList = [];
|
|
|
|
bool isSelected = true; //全部按钮
|
|
|
|
String nameStr;
|
|
|
|
FocusNode _nameNode = FocusNode();
|
|
|
|
FocusNode _phoneNode = FocusNode();
|
|
|
|
bool showPhoneHistory = false; //显示客户历史记录
|
|
|
|
EasyContactPicker _contactPicker = EasyContactPicker();
|
|
|
|
BaseIndoProvider _baseIndoProvider;
|
|
|
|
int sexSelectIndex = 0;
|
|
|
|
String sexStr = '先生';
|
|
|
|
String actualPnum = '选填';
|
|
|
|
String ddateHm = '选填';
|
|
|
|
int actualPnumIndex;
|
|
|
|
int ddateIndex;
|
|
|
|
|
|
|
|
// ScrollController _scrollCrl = ScrollController();
|
|
|
|
final ItemPositionsListener itemPositionsListener =
|
|
...
|
...
|
@@ -69,9 +85,10 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
super.initState();
|
|
|
|
|
|
|
|
LogUtil.v("table_manager_page initState");
|
|
|
|
for (int i = 1; i < 31; i++) {
|
|
|
|
personNumList.add(i.toString());
|
|
|
|
}
|
|
|
|
// for (int i = 1; i < 31; i++) {
|
|
|
|
// personNumList.add(i.toString());
|
|
|
|
// }
|
|
|
|
personNumList = Utils.getPersonNumList();
|
|
|
|
|
|
|
|
// personNumList.add('30以上');
|
|
|
|
|
|
...
|
...
|
@@ -355,16 +372,665 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
_openAddressBook() async {
|
|
|
|
if (!(await checkContactPermission())) {
|
|
|
|
PermissionStatus permissionStatus = await contactPermissionStatus();
|
|
|
|
if (permissionStatus == PermissionStatus.permanentlyDenied) {
|
|
|
|
//用户选择不在弹出权限提示框
|
|
|
|
print('never');
|
|
|
|
DialogUtil.openAlertDialog(
|
|
|
|
context, '未获得通讯录权限', "请在手机的权限管理里,将通讯录权限开启", '去设置', 340.0,
|
|
|
|
onTap: () {
|
|
|
|
openSetting();
|
|
|
|
Navigator.pop(context, '');
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
// 申请权限
|
|
|
|
bool canContacts = await requestContactPermission();
|
|
|
|
if (canContacts) {
|
|
|
|
_getContactData();
|
|
|
|
} else {
|
|
|
|
//拒绝通讯录权限 , 苹果拒绝权限后,不再提示权限框,进入此处
|
|
|
|
DialogUtil.openAlertDialog(
|
|
|
|
context, '未获得通讯录权限', "请在手机的权限管理里,将通讯录权限开启。", '去设置', 340.0,
|
|
|
|
onTap: () {
|
|
|
|
openSetting();
|
|
|
|
Navigator.pop(context, '');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
_getContactData();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_getContactData() async {
|
|
|
|
Contact contact = await _contactPicker.selectContactWithNative();
|
|
|
|
|
|
|
|
setState(() {
|
|
|
|
String fullName =
|
|
|
|
contact.fullName.replaceAll(new RegExp(r"\s+\b|\b\s"), "");
|
|
|
|
String phone =
|
|
|
|
contact.phoneNumber.replaceAll(new RegExp(r"\s+\b|\b\s"), "");
|
|
|
|
if (fullName.compareTo(phone) == 0) {
|
|
|
|
fullName = '';
|
|
|
|
} else {
|
|
|
|
fullName = contact.fullName;
|
|
|
|
}
|
|
|
|
_baseIndoProvider.phoneController.text =
|
|
|
|
contact.phoneNumber.replaceAll(new RegExp(r"\s+"), "");
|
|
|
|
nameStr = fullName;
|
|
|
|
// _homeEnterModel.nameController.text = fullName + _nameSuffix();
|
|
|
|
_addNameSuffix(fullName, _nameSuffix());
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
_addNameSuffix(String name, String suffix) {
|
|
|
|
if (name == _baseIndoProvider.nameController.text &&
|
|
|
|
_baseIndoProvider.nameController.text.endsWith(suffix)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
_baseIndoProvider.nameController.text = name + suffix;
|
|
|
|
}
|
|
|
|
|
|
|
|
//姓名后缀
|
|
|
|
_nameSuffix() {
|
|
|
|
for (var item in _baseIndoProvider.sexList) {
|
|
|
|
if (item['select'] == true) {
|
|
|
|
return item['title'];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ///底部弹框,设置时间30分钟间隔布局
|
|
|
|
// _showDateChooseWidget(BuildContext context) async {
|
|
|
|
// String title = '早餐';
|
|
|
|
// if (detailEntity.ddate_solt == '2') {
|
|
|
|
// title = '午餐';
|
|
|
|
// } else if (detailEntity.ddate_solt == '3') {
|
|
|
|
// title = '晚餐';
|
|
|
|
// }
|
|
|
|
|
|
|
|
// for (var itemSun in dailyList) {
|
|
|
|
// itemSun['select'] = false;
|
|
|
|
// if (itemSun['title'] == detailEntity.ddateStr) {
|
|
|
|
// itemSun['select'] = true;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// // if (item['isSelect'] == true) {
|
|
|
|
|
|
|
|
// // }
|
|
|
|
|
|
|
|
// final option = await showModalBottomSheet(
|
|
|
|
// context: context,
|
|
|
|
// isScrollControlled: true,
|
|
|
|
// backgroundColor: Colors.white,
|
|
|
|
// builder: (context) {
|
|
|
|
// return StatefulBuilder(builder: (context, state) {
|
|
|
|
// return SafeArea(
|
|
|
|
// child: Container(
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// borderRadius:
|
|
|
|
// BorderRadius.circular(ScreenUtil().setWidth(10))),
|
|
|
|
// child: Column(
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
// children: [
|
|
|
|
// InkWell(
|
|
|
|
// onTap: () {
|
|
|
|
// Navigator.pop(context);
|
|
|
|
// },
|
|
|
|
// child: Align(
|
|
|
|
// alignment: Alignment.centerRight,
|
|
|
|
// child: Container(
|
|
|
|
// padding: EdgeInsets.fromLTRB(
|
|
|
|
// ScreenUtil().setWidth(40),
|
|
|
|
// ScreenUtil().setWidth(40),
|
|
|
|
// ScreenUtil().setWidth(40),
|
|
|
|
// ScreenUtil().setWidth(10)),
|
|
|
|
// child: Image.asset(
|
|
|
|
// 'assets/close.png',
|
|
|
|
// width: ScreenUtil().setWidth(32),
|
|
|
|
// height: ScreenUtil().setWidth(32),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// Center(
|
|
|
|
// child: Text(title,
|
|
|
|
// style: TextStyle(
|
|
|
|
// fontSize: ScreenUtil().setSp(34),
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
// color: MyColours.color_353535)),
|
|
|
|
// ),
|
|
|
|
// Padding(
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: ScreenUtil().setWidth(60),
|
|
|
|
// vertical: ScreenUtil().setWidth(40)),
|
|
|
|
// child: GridView.builder(
|
|
|
|
// padding:
|
|
|
|
// EdgeInsets.only(top: ScreenUtil().setWidth(20)),
|
|
|
|
// shrinkWrap: true,
|
|
|
|
// cacheExtent: ScreenUtil().setWidth(0),
|
|
|
|
// itemCount: dailyList.length,
|
|
|
|
// gridDelegate:
|
|
|
|
// SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
// crossAxisCount: 3,
|
|
|
|
// childAspectRatio: 80 / 36,
|
|
|
|
// mainAxisSpacing:
|
|
|
|
// ScreenUtil().setWidth(15 * 2),
|
|
|
|
// crossAxisSpacing:
|
|
|
|
// ScreenUtil().setWidth(38 * 2)),
|
|
|
|
// itemBuilder: (BuildContext context, int index) {
|
|
|
|
// // locationState = state;
|
|
|
|
// return CustomButton(
|
|
|
|
// onTap: () async {
|
|
|
|
// // state(() {
|
|
|
|
// for (var item in dailyList) {
|
|
|
|
// item['select'] = false;
|
|
|
|
// if (item['title'] ==
|
|
|
|
// dailyList[index]['title']) {
|
|
|
|
// item['select'] = true;
|
|
|
|
|
|
|
|
// // _homeEnterModel.isSetDate = "1";
|
|
|
|
// ddateHm = item['title'];
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
// detailModel.notifyListeners();
|
|
|
|
// Navigator.pop(context);
|
|
|
|
// // setState(() {
|
|
|
|
// // selectPnum = value.first;
|
|
|
|
// // pnum = pnumlist[value.first];
|
|
|
|
// // });
|
|
|
|
// bool sucess = await detailModel.upReserveInfo(
|
|
|
|
// context, widget.rid,
|
|
|
|
// dateStr: ddateHm,
|
|
|
|
// ymd: detailEntity.ddateYMD);
|
|
|
|
|
|
|
|
// if (sucess) {
|
|
|
|
// EventBus()
|
|
|
|
// .emit("refresh_tablemanager"); //刷新桌位
|
|
|
|
// bus.emit("refresh_book_list"); //刷新已预订列表
|
|
|
|
// bus.emit("refresh_detail");
|
|
|
|
// await _getReserveDetail(showCicle: false);
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// width: 80,
|
|
|
|
// height: 36,
|
|
|
|
// dateText: dailyList[index]['title'].toString(),
|
|
|
|
// dayText: '',
|
|
|
|
// isSelect: dailyList[index]['select'],
|
|
|
|
// );
|
|
|
|
// }))
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ));
|
|
|
|
// });
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
|
|
|
|
_customerInfoWidget() {
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(48),
|
|
|
|
),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
// VEmptyView(30),
|
|
|
|
// MyDivider(double.infinity,
|
|
|
|
// ScreenUtil().setWidth(2),
|
|
|
|
// color:
|
|
|
|
// MyColours.color_efefef),
|
|
|
|
//电话
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(68),
|
|
|
|
margin: EdgeInsets.only(top: ScreenUtil().setWidth(44)),
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(16)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(12)),
|
|
|
|
// color: Colors.red,
|
|
|
|
border: Border.all(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_DBDBDB)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
controller: _baseIndoProvider.phoneController,
|
|
|
|
focusNode: _phoneNode,
|
|
|
|
// textAlignVertical: TextAlignVertical.top,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "预留电话",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
if (value.isEmpty || value.length > 11) {
|
|
|
|
//内容为空,或 超过11位
|
|
|
|
setState(() {
|
|
|
|
_baseIndoProvider.userHistorys.clear();
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Map<String, String> params = {
|
|
|
|
"keywords": value,
|
|
|
|
"sid": Provider.of<UserModel>(context, listen: false)
|
|
|
|
.user
|
|
|
|
.sellerid,
|
|
|
|
};
|
|
|
|
_baseIndoProvider.getUserHistorys(context, params);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
_phoneNode.unfocus();
|
|
|
|
},
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
showPhoneHistory = true;
|
|
|
|
});
|
|
|
|
// Future.delayed(Duration(milliseconds: 300), () {
|
|
|
|
// _controller.jumpTo(_controller.position.maxScrollExtent);
|
|
|
|
// });
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
)),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
_openAddressBook();
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: ScreenUtil().setWidth(84) * 3,
|
|
|
|
height: ScreenUtil().setWidth(48),
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
child: Text('一键录入',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
Stack(
|
|
|
|
clipBehavior: Clip.none,
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
children: [
|
|
|
|
//电话
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(top: ScreenUtil().setWidth(40)),
|
|
|
|
height: ScreenUtil().setWidth(68),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(16)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(12)),
|
|
|
|
// color: Colors.red,
|
|
|
|
border: Border.all(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_DBDBDB)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(30),
|
|
|
|
color: MyColours.color_353535),
|
|
|
|
controller: _baseIndoProvider.nameController,
|
|
|
|
focusNode: _nameNode,
|
|
|
|
// textAlignVertical: TextAlignVertical.top,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "顾客姓名",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
// contentPadding:
|
|
|
|
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
|
|
|
|
// border: InputBorder.none,
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none),
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
print('ggg');
|
|
|
|
|
|
|
|
nameStr = value;
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
print('fff');
|
|
|
|
_nameNode.unfocus();
|
|
|
|
// _homeEnterModel.nameController.text =
|
|
|
|
// nameStr + _nameSuffix();
|
|
|
|
_addNameSuffix(nameStr, _nameSuffix());
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(40),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
List<String> list = [];
|
|
|
|
for (Map item in _baseIndoProvider.sexList) {
|
|
|
|
list.add(item['title']);
|
|
|
|
}
|
|
|
|
DialogUtil.showSelectCusmanDialog(context, list,
|
|
|
|
(value) async {
|
|
|
|
if (value != null) {
|
|
|
|
sexSelectIndex = value.first;
|
|
|
|
sexStr = list[sexSelectIndex];
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
}, selecteds: [sexSelectIndex])
|
|
|
|
.then((value) {});
|
|
|
|
},
|
|
|
|
child: Row(children: [
|
|
|
|
Text(
|
|
|
|
sexStr,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Image.asset(Utils.getImgPath('quan_down_f'),
|
|
|
|
width: ScreenUtil().setWidth(28),
|
|
|
|
height: ScreenUtil().setWidth(28)),
|
|
|
|
]),
|
|
|
|
// Row(
|
|
|
|
// children: _baseIndoProvider.sexList.map((value) {
|
|
|
|
// return _callButton(
|
|
|
|
// onPress: () {
|
|
|
|
// for (var item in _baseIndoProvider.sexList) {
|
|
|
|
// item['select'] = false;
|
|
|
|
// if (item['title'] == value['title']) {
|
|
|
|
// item['select'] = true;
|
|
|
|
// if (oldSex != item['code']) {
|
|
|
|
// if (nameStr != null && nameStr != '') {
|
|
|
|
// _addNameSuffix(nameStr, item['title']);
|
|
|
|
// }
|
|
|
|
// if (nameStr != null && nameStr != '') {
|
|
|
|
// _showConfirmWidget(needSex: true);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// _baseIndoProvider.notifyListeners();
|
|
|
|
// },
|
|
|
|
// content: value['title'],
|
|
|
|
// hasLeftBorder: value['hasLeftBorder'],
|
|
|
|
// isSelect: value['select']);
|
|
|
|
// }).toList()),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(top: ScreenUtil().setWidth(40)),
|
|
|
|
height: ScreenUtil().setWidth(68),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(16)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(12)),
|
|
|
|
// color: Colors.red,
|
|
|
|
border: Border.all(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_DBDBDB)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Row(children: [
|
|
|
|
Text(
|
|
|
|
'就餐人数:',
|
|
|
|
style: TextStyle(
|
|
|
|
// letterSpacing: ScreenUtil().setWidth(1.8 * 2),
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
DialogUtil.showSelectCusmanDialog(
|
|
|
|
context, personNumList, (value) async {
|
|
|
|
if (value != null) {
|
|
|
|
actualPnumIndex = value.first;
|
|
|
|
actualPnum = personNumList[value.first];
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
selecteds: actualPnumIndex == null
|
|
|
|
? []
|
|
|
|
: [actualPnumIndex])
|
|
|
|
.then((value) {});
|
|
|
|
},
|
|
|
|
child: Expanded(
|
|
|
|
child: Text(actualPnum,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: actualPnum == '选填'
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_515151)),
|
|
|
|
),
|
|
|
|
|
|
|
|
// HEmptyView(6),
|
|
|
|
// Image.asset(
|
|
|
|
// Utils.getImgPath(
|
|
|
|
// false ? 'c_arrow_up' : 'c_arrow_down'),
|
|
|
|
// width: ScreenUtil().setWidth(28),
|
|
|
|
// // height: ScreenUtil().setWidth(10),
|
|
|
|
// ),
|
|
|
|
)
|
|
|
|
]),
|
|
|
|
MyDivider(ScreenUtil().setWidth(2),
|
|
|
|
ScreenUtil().setWidth(46),
|
|
|
|
color: MyColours.color_BFC4D4),
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'就餐时间:',
|
|
|
|
style: TextStyle(
|
|
|
|
// letterSpacing: ScreenUtil().setWidth(1.8 * 2),
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(26)),
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
DialogUtil.showSelectCusmanDialog(
|
|
|
|
context, tableManagerModel.dailyList,
|
|
|
|
(value) async {
|
|
|
|
if (value != null) {
|
|
|
|
ddateIndex = value.first;
|
|
|
|
ddateHm = tableManagerModel
|
|
|
|
.dailyList[value.first];
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
selecteds: ddateIndex == null
|
|
|
|
? []
|
|
|
|
: [ddateIndex])
|
|
|
|
.then((value) {});
|
|
|
|
},
|
|
|
|
child: Expanded(
|
|
|
|
child: Text(ddateHm,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: ddateHm == '选填'
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_515151)),
|
|
|
|
),
|
|
|
|
|
|
|
|
// HEmptyView(6),
|
|
|
|
// Image.asset(
|
|
|
|
// Utils.getImgPath(
|
|
|
|
// false ? 'c_arrow_up' : 'c_arrow_down'),
|
|
|
|
// width: ScreenUtil().setWidth(28),
|
|
|
|
// // height: ScreenUtil().setWidth(10),
|
|
|
|
// ),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
top: 0,
|
|
|
|
left: 0,
|
|
|
|
child: Offstage(
|
|
|
|
offstage: !(showPhoneHistory &&
|
|
|
|
_baseIndoProvider.userHistorys.length > 0),
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
border: Border.all(color: Colors.white),
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
// color: Colors.red,
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
color: MyColours.color_e5e5e5,
|
|
|
|
blurRadius: ScreenUtil().setWidth(20))
|
|
|
|
]),
|
|
|
|
width: ScreenUtil().setWidth(440),
|
|
|
|
height: _baseIndoProvider.userHistorys.length > 1
|
|
|
|
? ScreenUtil().setWidth(140)
|
|
|
|
: ScreenUtil().setWidth(104),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(30)),
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.topCenter,
|
|
|
|
child: MediaQuery.removePadding(
|
|
|
|
context: context,
|
|
|
|
removeTop: true,
|
|
|
|
child: ListView.builder(
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
showPhoneHistory = false;
|
|
|
|
_baseIndoProvider.phoneController
|
|
|
|
.text = _baseIndoProvider
|
|
|
|
.userHistorys[index]
|
|
|
|
.phone !=
|
|
|
|
null
|
|
|
|
? _baseIndoProvider
|
|
|
|
.userHistorys[index].phone
|
|
|
|
: '';
|
|
|
|
// _homeEnterModel.nameController.text =
|
|
|
|
// _homeEnterModel
|
|
|
|
// .userHistorys[index].rname +
|
|
|
|
// _nameSuffix();
|
|
|
|
_addNameSuffix(
|
|
|
|
_baseIndoProvider
|
|
|
|
.userHistorys[index].rname,
|
|
|
|
_nameSuffix());
|
|
|
|
nameStr = _baseIndoProvider
|
|
|
|
.userHistorys[index].rname;
|
|
|
|
_phoneNode.unfocus();
|
|
|
|
_baseIndoProvider.userHistorys
|
|
|
|
.clear();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setWidth(102),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: (index !=
|
|
|
|
(_baseIndoProvider
|
|
|
|
.userHistorys
|
|
|
|
.length -
|
|
|
|
1) &&
|
|
|
|
_baseIndoProvider
|
|
|
|
.userHistorys
|
|
|
|
.length >
|
|
|
|
1)
|
|
|
|
? BorderSide(
|
|
|
|
color: MyColours
|
|
|
|
.color_e5e5e5,
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(2))
|
|
|
|
: BorderSide.none)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
_baseIndoProvider
|
|
|
|
.userHistorys[index]
|
|
|
|
.phone ==
|
|
|
|
null
|
|
|
|
? ''
|
|
|
|
: _baseIndoProvider
|
|
|
|
.userHistorys[index]
|
|
|
|
.phone,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
_baseIndoProvider
|
|
|
|
.userHistorys[index]
|
|
|
|
.rname ==
|
|
|
|
null
|
|
|
|
? ''
|
|
|
|
: _baseIndoProvider
|
|
|
|
.userHistorys[index]
|
|
|
|
.rname,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(32)),
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
},
|
|
|
|
itemExtent: ScreenUtil().setWidth(104),
|
|
|
|
itemCount:
|
|
|
|
_baseIndoProvider.userHistorys.length,
|
|
|
|
))),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
],
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
///选中的桌子widget
|
|
|
|
Widget _selectTableWidget() {
|
|
|
|
return Container(
|
|
|
|
// constraints: BoxConstraints(maxHeight: ScreenUtil().setWidth(760)),
|
|
|
|
// height: ScreenUtil().setWidth(400),
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: ScreenUtil().setWidth(40),
|
|
|
|
right: ScreenUtil().setWidth(40),
|
|
|
|
top: ScreenUtil().setWidth(15)),
|
|
|
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
boxShadow: [
|
|
...
|
...
|
@@ -373,50 +1039,99 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
blurRadius: ScreenUtil().setWidth(14))
|
|
|
|
],
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
topLeft: Radius.circular(ScreenUtil().setWidth(30)),
|
|
|
|
topRight: Radius.circular(ScreenUtil().setWidth(30)),
|
|
|
|
topLeft: Radius.circular(ScreenUtil().setWidth(24)),
|
|
|
|
topRight: Radius.circular(ScreenUtil().setWidth(24)),
|
|
|
|
)),
|
|
|
|
child: Column(
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
Stack(alignment: Alignment.centerRight, children: [
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
vertical: ScreenUtil().setSp(16),
|
|
|
|
),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
topLeft: Radius.circular(ScreenUtil().setWidth(24)),
|
|
|
|
topRight: Radius.circular(ScreenUtil().setWidth(24)),
|
|
|
|
)),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
tableManagerModel.selectDateStr,
|
|
|
|
tableManagerModel.selectDateStr +
|
|
|
|
' ' +
|
|
|
|
tableManagerModel.doltStr,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(45),
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
VEmptyView(8),
|
|
|
|
Text(
|
|
|
|
tableManagerModel.selectWeekAndLunarCalendar,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(30)),
|
|
|
|
),
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(20)),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
top: ScreenUtil().setWidth(6),
|
|
|
|
),
|
|
|
|
child: Text(
|
|
|
|
tableManagerModel.doltStr,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(48),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
right: ScreenUtil().setWidth(40),
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {},
|
|
|
|
child: Text(
|
|
|
|
'清空',
|
|
|
|
style: TextStyle(
|
|
|
|
decoration: TextDecoration.underline,
|
|
|
|
color: MyColours.color_438E93,
|
|
|
|
fontSize: ScreenUtil().setSp(20)),
|
|
|
|
)))
|
|
|
|
]),
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.only(top: ScreenUtil().setWidth(44)),
|
|
|
|
height: ScreenUtil().setWidth(60),
|
|
|
|
child: ListView.builder(
|
|
|
|
padding: EdgeInsets.only(left: ScreenUtil().setWidth(48)),
|
|
|
|
itemCount: tableManagerModel.selectTables.length,
|
|
|
|
shrinkWrap: true,
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
itemBuilder: (BuildContext contxt, int index) {
|
|
|
|
t.Table table = tableManagerModel.selectTables[index];
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.only(right: ScreenUtil().setWidth(20)),
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: ScreenUtil().setWidth(16),
|
|
|
|
right: ScreenUtil().setWidth(4),
|
|
|
|
top: ScreenUtil().setWidth(14),
|
|
|
|
bottom: ScreenUtil().setWidth(14)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
width: ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_438E93),
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(8))),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
table.name,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_438E93,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
),
|
|
|
|
HEmptyView(14),
|
|
|
|
Image.asset(Utils.getImgPath('table_m_close'),
|
|
|
|
width: ScreenUtil().setWidth(32)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
_customerInfoWidget(),
|
|
|
|
VEmptyView(40),
|
|
|
|
Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
...
|
...
|
@@ -830,11 +1545,13 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
}
|
|
|
|
|
|
|
|
///早餐、午餐、晚餐点击方法
|
|
|
|
_clickMorAndNoonAndNig() async {
|
|
|
|
_clickMorAndNoonAndNig(BuildContext context) async {
|
|
|
|
ddateIndex = null;
|
|
|
|
ddateHm = '选填';
|
|
|
|
tableManagerModel.selectDateStr =
|
|
|
|
tableManagerModel.returnDayDateStr(tableManagerModel.dateTimeSelect);
|
|
|
|
tableManagerModel.selectWeekAndLunarCalendar = tableManagerModel
|
|
|
|
.returnWeekAndLunarCalendar(tableManagerModel.dateTimeSelect);
|
|
|
|
.returnWeekAndLunarCalendar(tableManagerModel.dateTimeSelect, context);
|
|
|
|
await tableManagerModel.getReserveList(context,
|
|
|
|
needLoading: true, showMsg: true);
|
|
|
|
}
|
|
...
|
...
|
@@ -842,6 +1559,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
tableManagerModel = Provider.of<TableManagerModel>(context, listen: true);
|
|
|
|
_baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true);
|
|
|
|
return Scaffold(
|
|
|
|
appBar: widget.guest == null
|
|
|
|
? null
|
|
...
|
...
|
@@ -968,7 +1686,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
tableManagerModel.currTimeIndex = 1;
|
|
|
|
});
|
|
|
|
|
|
|
|
_clickMorAndNoonAndNig();
|
|
|
|
_clickMorAndNoonAndNig(context);
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
btnNum == 3 && tableManagerModel.currTimeIndex == 3
|
|
...
|
...
|
@@ -1004,7 +1722,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
setState(() {
|
|
|
|
tableManagerModel.currTimeIndex = 2;
|
|
|
|
});
|
|
|
|
_clickMorAndNoonAndNig();
|
|
|
|
_clickMorAndNoonAndNig(context);
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
btnNum == 3 && tableManagerModel.currTimeIndex == 1
|
|
...
|
...
|
@@ -1038,7 +1756,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
tableManagerModel.currTimeIndex = 3;
|
|
|
|
});
|
|
|
|
|
|
|
|
_clickMorAndNoonAndNig();
|
|
|
|
_clickMorAndNoonAndNig(context);
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
),
|
...
|
...
|
|