|
...
|
...
|
@@ -198,22 +198,22 @@ class NotebookDetailChangeModel with ChangeNotifier { |
|
|
|
night = userModel.user.night.isEmpty ? "00:00-00:00" : userModel.user.night;
|
|
|
|
userModel.user.morning == ''
|
|
|
|
? dailyMap.putIfAbsent('morning', () => '')
|
|
|
|
: dailyMap.putIfAbsent(
|
|
|
|
'morning', () => _getHourAndMinute(userModel.user.morning, 1));
|
|
|
|
: dailyMap.putIfAbsent('morning',
|
|
|
|
() => _getHourAndMinute(context, userModel.user.morning, 1));
|
|
|
|
userModel.user.noon == ''
|
|
|
|
? dailyMap.putIfAbsent('noon', () => '')
|
|
|
|
: dailyMap.putIfAbsent(
|
|
|
|
'noon', () => _getHourAndMinute(userModel.user.noon, 2));
|
|
|
|
'noon', () => _getHourAndMinute(context, userModel.user.noon, 2));
|
|
|
|
userModel.user.night == ''
|
|
|
|
? dailyMap.putIfAbsent('night', () => '')
|
|
|
|
: dailyMap.putIfAbsent(
|
|
|
|
'night', () => _getHourAndMinute(userModel.user.night, 3));
|
|
|
|
'night', () => _getHourAndMinute(context, userModel.user.night, 3));
|
|
|
|
// _initSunDateList(
|
|
|
|
// userModel.user.morning, userModel.user.noon, userModel.user.night);
|
|
|
|
}
|
|
|
|
|
|
|
|
//根据获取时间 11:00-12:30 获取30分钟间隔组装的数组
|
|
|
|
_getHourAndMinute(String hourAndMinuteStr, int mnd) {
|
|
|
|
_getHourAndMinute(BuildContext context, String hourAndMinuteStr, int mnd) {
|
|
|
|
List tempDate = hourAndMinuteStr.split("-");
|
|
|
|
String beginDate = tempDate[0];
|
|
|
|
String endDate = tempDate[1];
|
|
...
|
...
|
@@ -261,19 +261,43 @@ class NotebookDetailChangeModel with ChangeNotifier { |
|
|
|
tempSelect = true;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
String beginDate = '';
|
|
|
|
if (mnd == 1) {
|
|
|
|
if (temp == '08:00') {
|
|
|
|
tempSelect = true;
|
|
|
|
beginDate = '08:00';
|
|
|
|
if (userModel.user.morning != '' && userModel.user.morning != null) {
|
|
|
|
List tempDate = userModel.user.morning.split("-");
|
|
|
|
beginDate = tempDate[0];
|
|
|
|
}
|
|
|
|
} else if (mnd == 2) {
|
|
|
|
if (temp == '12:00') {
|
|
|
|
tempSelect = true;
|
|
|
|
beginDate = '12:00';
|
|
|
|
if (userModel.user.noon != '' && userModel.user.noon != null) {
|
|
|
|
List tempDate = userModel.user.noon.split("-");
|
|
|
|
beginDate = tempDate[0];
|
|
|
|
}
|
|
|
|
} else if (mnd == 3) {
|
|
|
|
if (temp == '18:00') {
|
|
|
|
tempSelect = true;
|
|
|
|
beginDate = '18:00';
|
|
|
|
if (userModel.user.night != '' && userModel.user.night != null) {
|
|
|
|
List tempDate = userModel.user.night.split("-");
|
|
|
|
beginDate = tempDate[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (temp == beginDate) {
|
|
|
|
tempSelect = true;
|
|
|
|
}
|
|
|
|
// if (mnd == 1) {
|
|
|
|
// if (temp == '08:00') {
|
|
|
|
// tempSelect = true;
|
|
|
|
// }
|
|
|
|
// } else if (mnd == 2) {
|
|
|
|
// if (temp == '12:00') {
|
|
|
|
// tempSelect = true;
|
|
|
|
// }
|
|
|
|
// } else if (mnd == 3) {
|
|
|
|
// if (temp == '18:00') {
|
|
|
|
// tempSelect = true;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
Map tempMap = {'title': temp, 'select': tempSelect};
|
|
|
|
res.add(tempMap);
|
|
...
|
...
|
@@ -573,12 +597,32 @@ class NotebookDetailChangeModel with ChangeNotifier { |
|
|
|
String tempTime = ddateHm; //默认上个页面到店时间半小时值
|
|
|
|
if (ddateSolt != currTimeIndex.toString()) {
|
|
|
|
//餐段发生改变,则重新默认到店时间半小时值
|
|
|
|
// if (currTimeIndex == 1) {
|
|
|
|
// tempTime = '08:00';
|
|
|
|
// } else if (currTimeIndex == 2) {
|
|
|
|
// tempTime = '12:00';
|
|
|
|
// } else if (currTimeIndex == 3) {
|
|
|
|
// tempTime = '18:00';
|
|
|
|
// }
|
|
|
|
|
|
|
|
if (currTimeIndex == 1) {
|
|
|
|
tempTime = '08:00';
|
|
|
|
if (userModel.user.morning != '' && userModel.user.morning != null) {
|
|
|
|
List tempDate = userModel.user.morning.split("-");
|
|
|
|
tempTime = tempDate[0];
|
|
|
|
}
|
|
|
|
} else if (currTimeIndex == 2) {
|
|
|
|
tempTime = '12:00';
|
|
|
|
if (userModel.user.noon != '' && userModel.user.noon != null) {
|
|
|
|
List tempDate = userModel.user.noon.split("-");
|
|
|
|
tempTime = tempDate[0];
|
|
|
|
}
|
|
|
|
} else if (currTimeIndex == 3) {
|
|
|
|
tempTime = '18:00';
|
|
|
|
if (userModel.user.night != '' && userModel.user.night != null) {
|
|
|
|
List tempDate = userModel.user.night.split("-");
|
|
|
|
tempTime = tempDate[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -779,15 +823,37 @@ class NotebookDetailChangeModel with ChangeNotifier { |
|
|
|
|
|
|
|
if (ddateSolt != currTimeIndex.toString() || tempTime == '') {
|
|
|
|
//餐段发生改变,则重新默认到店时间半小时值
|
|
|
|
// if (currTimeIndex == 1) {
|
|
|
|
// tempTime = '08:00';
|
|
|
|
// ddateSolt = '1';
|
|
|
|
// } else if (currTimeIndex == 2) {
|
|
|
|
// tempTime = '12:00';
|
|
|
|
// ddateSolt = '2';
|
|
|
|
// } else if (currTimeIndex == 3) {
|
|
|
|
// tempTime = '18:00';
|
|
|
|
// ddateSolt = '3';
|
|
|
|
// }
|
|
|
|
if (currTimeIndex == 1) {
|
|
|
|
tempTime = '08:00';
|
|
|
|
ddateSolt = '1';
|
|
|
|
if (userModel.user.morning != '' && userModel.user.morning != null) {
|
|
|
|
List tempDate = userModel.user.morning.split("-");
|
|
|
|
tempTime = tempDate[0];
|
|
|
|
}
|
|
|
|
} else if (currTimeIndex == 2) {
|
|
|
|
tempTime = '12:00';
|
|
|
|
ddateSolt = '2';
|
|
|
|
if (userModel.user.noon != '' && userModel.user.noon != null) {
|
|
|
|
List tempDate = userModel.user.noon.split("-");
|
|
|
|
tempTime = tempDate[0];
|
|
|
|
}
|
|
|
|
} else if (currTimeIndex == 3) {
|
|
|
|
tempTime = '18:00';
|
|
|
|
ddateSolt = '3';
|
|
|
|
if (userModel.user.night != '' && userModel.user.night != null) {
|
|
|
|
List tempDate = userModel.user.night.split("-");
|
|
|
|
tempTime = tempDate[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|