|
...
|
...
|
@@ -99,9 +99,9 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { |
|
|
|
String dateText = ""; //当前显示日期时间
|
|
|
|
|
|
|
|
int currTimeIndex = 2;
|
|
|
|
String? morning; //早市时间段
|
|
|
|
String? noon; //午市时间段
|
|
|
|
String? night; //晚市时间段
|
|
|
|
// String? morning; //早市时间段
|
|
|
|
// String? noon; //午市时间段
|
|
|
|
// String? night; //晚市时间段
|
|
|
|
NotebookDetail? detailEntity;
|
|
|
|
|
|
|
|
late StoreBaseIndoProvider storeBaseIndoProvider;
|
|
...
|
...
|
@@ -115,13 +115,13 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { |
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
if (App.sp!.containsKey('user')) {
|
|
|
|
String s = App.sp!.getString('user')!;
|
|
|
|
User _user = User.fromJson(json.decode(s));
|
|
|
|
morning = _user.morning!.isEmpty ? "00:00-00:00" : _user.morning;
|
|
|
|
noon = _user.noon!.isEmpty ? "00:00-00:00" : _user.noon;
|
|
|
|
night = _user.night!.isEmpty ? "00:00-00:00" : _user.night;
|
|
|
|
}
|
|
|
|
// if (App.sp!.containsKey('user')) {
|
|
|
|
// String s = App.sp!.getString('user')!;
|
|
|
|
// User _user = User.fromJson(json.decode(s));
|
|
|
|
// morning = _user.morning!.isEmpty ? "00:00-00:00" : _user.morning;
|
|
|
|
// noon = _user.noon!.isEmpty ? "00:00-00:00" : _user.noon;
|
|
|
|
// night = _user.night!.isEmpty ? "00:00-00:00" : _user.night;
|
|
|
|
// }
|
|
|
|
|
|
|
|
_nameNode.addListener(() {
|
|
|
|
if (_nameNode.hasFocus) {
|
|
...
|
...
|
@@ -271,14 +271,17 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { |
|
|
|
|
|
|
|
print(detailEntity);
|
|
|
|
if (detailEntity!.phone != '0') {
|
|
|
|
_notebookDetailChangeModel.phoneController.text = detailEntity!.phone??"";
|
|
|
|
_notebookDetailChangeModel.phoneController.text =
|
|
|
|
detailEntity!.phone ?? "";
|
|
|
|
}
|
|
|
|
if (detailEntity!.rnameStr != '') {
|
|
|
|
_notebookDetailChangeModel.nameController.text = detailEntity!.rname??"";
|
|
|
|
_notebookDetailChangeModel.nameController.text =
|
|
|
|
detailEntity!.rname ?? "";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (detailEntity!.cusdem != '' && detailEntity!.cusdem != null) {
|
|
|
|
_notebookDetailChangeModel.customController.text = detailEntity!.cusdem??"";
|
|
|
|
_notebookDetailChangeModel.customController.text =
|
|
|
|
detailEntity!.cusdem ?? "";
|
|
|
|
}
|
|
|
|
|
|
|
|
_notebookDetailChangeModel.initSexList();
|
|
...
|
...
|
@@ -798,11 +801,11 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { |
|
|
|
// });
|
|
|
|
// }
|
|
|
|
_getContactData() async {
|
|
|
|
Contact? contact = await _contactPicker.selectPhoneNumber();
|
|
|
|
Contact? contact = await _contactPicker.selectPhoneNumber();
|
|
|
|
if (contact != null) {
|
|
|
|
setState(() {
|
|
|
|
String? fullName =
|
|
|
|
contact.fullName?.replaceAll(new RegExp(r"\s+\b|\b\s"), "") ??'';
|
|
|
|
contact.fullName?.replaceAll(new RegExp(r"\s+\b|\b\s"), "") ?? '';
|
|
|
|
// String phone = (contact.phoneNumbers![0]
|
|
|
|
// .replaceAll(new RegExp(r"\s+\b|\b\s"), ""));
|
|
|
|
// if (fullName == null) {
|
|
...
|
...
|
@@ -811,7 +814,8 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { |
|
|
|
// fullName = contact.fullName!;
|
|
|
|
// }
|
|
|
|
_notebookDetailChangeModel.phoneController.text =
|
|
|
|
(contact.selectedPhoneNumber?.replaceAll(new RegExp(r"\s+"), ""))??'';
|
|
|
|
(contact.selectedPhoneNumber?.replaceAll(new RegExp(r"\s+"), "")) ??
|
|
|
|
'';
|
|
|
|
nameStr = fullName;
|
|
|
|
// _homeEnterModel.nameController.text = fullName + _nameSuffix();
|
|
|
|
_addNameSuffix(fullName, _nameSuffix());
|
|
...
|
...
|
@@ -1012,15 +1016,14 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { |
|
|
|
//如果不允许变更过去餐段订单的时间,则开始判断
|
|
|
|
//连个条件同时成立: 1.订单的时间是过去 2. 时间改变
|
|
|
|
if (!isSetOver) {
|
|
|
|
String? times;
|
|
|
|
String? times = '00:00-00:00';
|
|
|
|
//找到当前餐段对应的时间段
|
|
|
|
if (currTimeIndex == 1) {
|
|
|
|
times = morning;
|
|
|
|
} else if (currTimeIndex == 2) {
|
|
|
|
times = noon;
|
|
|
|
} else if (currTimeIndex == 3) {
|
|
|
|
times = night;
|
|
|
|
int index = storeBaseIndoProvider.dayDateData!
|
|
|
|
.indexWhere((element) => element.ddateSolt == '${currTimeIndex}');
|
|
|
|
if (index != -1) {
|
|
|
|
times = storeBaseIndoProvider.dayDateData![index].mdate;
|
|
|
|
}
|
|
|
|
|
|
|
|
//else if (currTimeIndex == 4) {
|
|
|
|
// times = meal1;
|
|
|
|
// } else if (currTimeIndex == 5) {
|
|
...
|
...
|
@@ -1308,22 +1311,26 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { |
|
|
|
|
|
|
|
//选中的时间+餐段组合的时间戳结束日期和现在比较,< 现在,则会变更到过去
|
|
|
|
|
|
|
|
String? times;
|
|
|
|
String times = '00:00-00:00';
|
|
|
|
//找到当前餐段对应的时间段
|
|
|
|
//找到当前餐段对应的时间段
|
|
|
|
if (currTimeIndex == 1) {
|
|
|
|
times = morning;
|
|
|
|
} else if (currTimeIndex == 2) {
|
|
|
|
times = noon;
|
|
|
|
} else if (currTimeIndex == 3) {
|
|
|
|
times = night;
|
|
|
|
int index = storeBaseIndoProvider
|
|
|
|
.dayDateData!
|
|
|
|
.indexWhere((element) =>
|
|
|
|
element.ddateSolt ==
|
|
|
|
'${currTimeIndex}');
|
|
|
|
if (index != -1) {
|
|
|
|
times = storeBaseIndoProvider
|
|
|
|
.dayDateData![index].mdate!;
|
|
|
|
}
|
|
|
|
|
|
|
|
//else if (currTimeIndex == 4) {
|
|
|
|
// times = meal1;
|
|
|
|
// } else if (currTimeIndex == 5) {
|
|
|
|
// times = meal2;
|
|
|
|
// }
|
|
|
|
//组装时间戳
|
|
|
|
List<String> datas = times!.split('-');
|
|
|
|
List<String> datas = times.split('-');
|
|
|
|
// DateTime selectStime = DateTime.parse('${dateTimeSelect.year}' +
|
|
|
|
// '-' +
|
|
|
|
// '${dateTimeSelect.month}' +
|
|
...
|
...
|
@@ -2329,6 +2336,16 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { |
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
print(detailEntity!.uid);
|
|
|
|
String? times = '00:00-00:00';
|
|
|
|
//找到当前餐段对应的时间段
|
|
|
|
int index = storeBaseIndoProvider.dayDateData!
|
|
|
|
.indexWhere((element) =>
|
|
|
|
element.ddateSolt ==
|
|
|
|
'${currTimeIndex}');
|
|
|
|
if (index != -1) {
|
|
|
|
times = storeBaseIndoProvider
|
|
|
|
.dayDateData![index].mdate;
|
|
|
|
}
|
|
|
|
|
|
|
|
SunReserveInfoModel? _model =
|
|
|
|
_notebookDetailChangeModel
|
|
...
|
...
|
@@ -2342,9 +2359,7 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { |
|
|
|
detailEntity!.uid,
|
|
|
|
currTimeIndex,
|
|
|
|
dateTime,
|
|
|
|
morning,
|
|
|
|
noon,
|
|
|
|
night)
|
|
|
|
times )
|
|
|
|
: await _notebookDetailChangeModel
|
|
|
|
.setReserveInfoOnly(
|
|
|
|
context,
|
|
...
|
...
|
@@ -2352,9 +2367,7 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> { |
|
|
|
detailEntity!.uid,
|
|
|
|
currTimeIndex,
|
|
|
|
dateTime,
|
|
|
|
morning,
|
|
|
|
noon,
|
|
|
|
night);
|
|
|
|
times );
|
|
|
|
if (_model != null) {
|
|
|
|
if (ObjectUtil.isNotEmpty(_model.row) ||
|
|
|
|
ObjectUtil.isNotEmpty(_model.row!.id)) {
|
...
|
...
|
|