Commit f9eb331089c11fb37f8f61ada6ee4c14aa5af4e5

Authored by wdn127929
1 parent 5aecc32f

桌位、时间不可变更

... ... @@ -548,7 +548,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5321;
CURRENT_PROJECT_VERSION = 5322;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
... ... @@ -696,7 +696,7 @@
CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5321;
CURRENT_PROJECT_VERSION = 5322;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
... ... @@ -732,7 +732,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 5321;
CURRENT_PROJECT_VERSION = 5322;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
... ...
... ... @@ -174,6 +174,10 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> {
flex: 1,
child: InkWell(
onTap: () {
if (!_getIsSetOver()) {
Utils.showToast('不允许变更过去餐段订单的时间');
return;
}
String createtime = detailEntity.ddate.toString() + '000';
DateTime reservedate =
DateTime.fromMillisecondsSinceEpoch(int.parse(createtime));
... ... @@ -809,7 +813,7 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> {
'-' +
Utils.addZeroNumber(time.month) +
'-' +
Utils.addZeroNumber(time.day) +
Utils.addZeroNumber(time.day) +
' ${datas[1]}:00'); //选中餐段结束时间戳
// 过去的餐段界定
if (selectEtime.isBefore(DateTime.now())) {
... ... @@ -878,6 +882,53 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> {
}
}
_getIsSetOver() {
//判断时间是否可变更
bool setOrder = true; //默认允许变更过去餐段订单的时间
//如果不允许变更过去餐段订单的时间,则开始判断
//连个条件同时成立: 1.订单的时间是过去 2. 时间改变
if (!isSetOver) {
String times;
//找到当前餐段对应的时间段
if (currTimeIndex == 1) {
times = morning;
} else if (currTimeIndex == 2) {
times = noon;
} else if (currTimeIndex == 3) {
times = night;
}
//else if (currTimeIndex == 4) {
// times = meal1;
// } else if (currTimeIndex == 5) {
// times = meal2;
// }
//组装时间戳
List<String> datas = times.split('-');
// DateTime selectStime = DateTime.parse('${dateTimeSelect.year}' +
// '-' +
// '${dateTimeSelect.month}' +
// '-' +
// '${dateTimeSelect.day}' +
// ' ${datas[0]}:00'); //选中餐段开始时间戳
DateTime selectEtime = DateTime.parse('${dateTime.year}' +
'-' +
Utils.addZeroNumber(dateTime.month) +
'-' +
Utils.addZeroNumber(dateTime.day) +
' ${datas[1]}:00'); //选中餐段结束时间戳
// 过去的餐段界定
if (selectEtime.isBefore(DateTime.now())) {
// 属于过去餐段
setOrder = false;
} else {
// 属于未来餐段
setOrder = true;
}
}
return setOrder;
}
@override
Widget build(BuildContext context) {
storeBaseIndoProvider =
... ... @@ -1105,52 +1156,7 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> {
horizontal: ScreenUtil().setWidth(15)),
child: GestureDetector(
onTap: () {
//判断时间是否可变更
bool setOrder = true; //默认允许变更过去餐段订单的时间
//如果不允许变更过去餐段订单的时间,则开始判断
//连个条件同时成立: 1.订单的时间是过去 2. 时间改变
if (!isSetOver) {
String times;
//找到当前餐段对应的时间段
if (currTimeIndex == 1) {
times = morning;
} else if (currTimeIndex == 2) {
times = noon;
} else if (currTimeIndex == 3) {
times = night;
}
//else if (currTimeIndex == 4) {
// times = meal1;
// } else if (currTimeIndex == 5) {
// times = meal2;
// }
//组装时间戳
List<String> datas = times.split('-');
// DateTime selectStime = DateTime.parse('${dateTimeSelect.year}' +
// '-' +
// '${dateTimeSelect.month}' +
// '-' +
// '${dateTimeSelect.day}' +
// ' ${datas[0]}:00'); //选中餐段开始时间戳
DateTime selectEtime = DateTime.parse(
'${dateTime.year}' +
'-' +
Utils.addZeroNumber(dateTime.month) +
'-' +
Utils.addZeroNumber(dateTime.day) +
' ${datas[1]}:00'); //选中餐段结束时间戳
// 过去的餐段界定
if (selectEtime.isBefore(DateTime.now())) {
// 属于过去餐段
setOrder = false;
} else {
// 属于未来餐段
setOrder = true;
}
}
if (!setOrder) {
if (!_getIsSetOver()) {
Utils.showToast('不允许变更过去餐段订单的时间');
return;
}
... ... @@ -1504,6 +1510,10 @@ class _NoteBookChangeFPageOnlyState extends State<NoteBookChangeFPageOnly> {
onTap: () async {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
if (!_getIsSetOver()) {
Utils.showToast('不允许变更过去餐段订单的桌位');
return;
}
int ddate = dateTime.millisecondsSinceEpoch;
String ddateSolt = currTimeIndex.toString();
Map temp = await NavigatorUtil
... ...
... ... @@ -492,7 +492,7 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text('允许变更过去餐段订单的时间',
Text('允许变更过去餐段订单',
style: TextStyle(
color: MyColours.color_515151,
fontSize: ScreenUtil().setSp(28))),
... ...