|
...
|
...
|
@@ -111,7 +111,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
String ddateHm = '选填';
|
|
|
|
int actualPnumIndex;
|
|
|
|
int ddateIndex;
|
|
|
|
List<String> couponsCan = []; //优惠券弹框数据
|
|
|
|
// List<String> couponsCan = []; //优惠券弹框数据
|
|
|
|
String youhui = '选择优惠';
|
|
|
|
int couponSelectIndex = 0;
|
|
|
|
CouponProvider couponProvider;
|
|
...
|
...
|
@@ -121,6 +121,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
|
|
|
|
String smsErro = '';
|
|
|
|
String showErro = '';
|
|
|
|
// int
|
|
|
|
|
|
|
|
ScrollController _scrollCrl = ScrollController();
|
|
|
|
final ItemPositionsListener itemPositionsListener =
|
|
...
|
...
|
@@ -148,45 +149,47 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
String smsContent = '';
|
|
|
|
PersonnelProvider personnelProvider;
|
|
|
|
|
|
|
|
DateTime dateTime = DateTime.now();
|
|
|
|
|
|
|
|
String dateText = ""; //当前显示日期时间
|
|
|
|
int currTimeIndex = 1; //当前选中时间段
|
|
|
|
String morning; //早市时间段
|
|
|
|
String noon; //午市时间段
|
|
|
|
String night; //晚市时间段
|
|
|
|
// UserModel userModel;
|
|
|
|
|
|
|
|
// Map dailyMap = {}; // 早市对应半点钟,午市对应半点钟、晚市对应半点钟
|
|
|
|
bool swichState = false; //仅看空座
|
|
|
|
String selectDateStr = '';
|
|
|
|
String selectWeekAndLunarCalendar = '';
|
|
|
|
String doltStr = '';
|
|
|
|
DateTime dateTimeSelect;
|
|
|
|
int selectNumber = 0;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
// TODO: implement initState
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
LogUtil.v("table_manager_page initState");
|
|
|
|
// for (int i = 1; i < 31; i++) {
|
|
|
|
// personNumList.add(i.toString());
|
|
|
|
// }
|
|
|
|
personNumList = Utils.getPersonNumList();
|
|
|
|
|
|
|
|
// personNumList.add('30以上');
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
initTimeTable();
|
|
|
|
personNumList = Utils.getPersonNumList();
|
|
|
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
// tableManagerModel.pageStateOrReserve = PageState.Loading;
|
|
|
|
// tableManagerModel.initTimeTable(context);
|
|
|
|
if (App.sp.containsKey('table_list')) {
|
|
|
|
// //退出清空桌位数据
|
|
|
|
App.sp.remove('table_list');
|
|
|
|
}
|
|
|
|
|
|
|
|
// getSpTableList();
|
|
|
|
UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
tableManagerModel.dateTime = DateTime.now();
|
|
|
|
tableManagerModel.dateText =
|
|
|
|
tableManagerModel.returnDate(tableManagerModel.dateTime);
|
|
|
|
setState(() {});
|
|
|
|
tableManagerModel.dateTimeSelect = tableManagerModel.dateTime;
|
|
|
|
// tableManagerModel.notifyListeners;
|
|
|
|
getUserAccountTypeById(showLoading: false);
|
|
|
|
// couponProvider.sendSMS = false;
|
|
|
|
// String tableSp = App.sp.getString('table_list_or_reserve');
|
|
|
|
// if (tableSp != null) {
|
|
|
|
// //有缓存数据
|
|
|
|
// // tableManagerModel.showLoading = true;
|
|
|
|
// // Loading.showLoading(context);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
_myExtendedMaterialTextSelectionControls =
|
|
|
|
MyTextSelectionControls(callback: (value) {
|
|
|
|
_baseIndoProvider.phoneController.value = TextEditingValue(
|
|
...
|
...
|
@@ -196,17 +199,10 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
offset: value.toString().length)));
|
|
|
|
});
|
|
|
|
_getSellerById();
|
|
|
|
|
|
|
|
// _couponNetworkData(selfDismiss: true);
|
|
|
|
|
|
|
|
// getDzSellerConf();
|
|
|
|
// _getRemark();
|
|
|
|
|
|
|
|
EventBus().on("refresh_tablemanager", (arg) {
|
|
|
|
//订座-完成预订 刷新管理桌位
|
|
|
|
tableManagerModel.getTableListOrReserve(
|
|
|
|
context,
|
|
|
|
);
|
|
|
|
context, currTimeIndex, dateTime, selectNumber);
|
|
|
|
print(tableManagerModel);
|
|
|
|
});
|
|
|
|
EventBus().on("refresh_tablePhoto", (arg) {
|
|
...
|
...
|
@@ -234,6 +230,155 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
//初始化时间
|
|
|
|
initTimeTable() {
|
|
|
|
dateTime = DateTime.now();
|
|
|
|
dateText = returnDate(dateTime);
|
|
|
|
dateTimeSelect = dateTime;
|
|
|
|
|
|
|
|
if (dateTime.isBefore(DateTime.parse(dateTime.year.toString() +
|
|
|
|
"-" +
|
|
|
|
Utils.addZeroNumber(dateTime.month) +
|
|
|
|
"-" +
|
|
|
|
Utils.addZeroNumber(dateTime.day) +
|
|
|
|
" " +
|
|
|
|
morning.split("-")[1] +
|
|
|
|
":00"))) {
|
|
|
|
//未过早市
|
|
|
|
currTimeIndex = 1;
|
|
|
|
} else if (dateTime.isAfter(DateTime.parse(dateTime.year.toString() +
|
|
|
|
"-" +
|
|
|
|
Utils.addZeroNumber(dateTime.month) +
|
|
|
|
"-" +
|
|
|
|
Utils.addZeroNumber(dateTime.day) +
|
|
|
|
" " +
|
|
|
|
morning.split("-")[1] +
|
|
|
|
":00")) &&
|
|
|
|
dateTime.isBefore(DateTime.parse(dateTime.year.toString() +
|
|
|
|
"-" +
|
|
|
|
Utils.addZeroNumber(dateTime.month) +
|
|
|
|
"-" +
|
|
|
|
Utils.addZeroNumber(dateTime.day) +
|
|
|
|
" " +
|
|
|
|
noon.split("-")[1] +
|
|
|
|
":00"))) {
|
|
|
|
//过了早市,未过午市
|
|
|
|
currTimeIndex = 2;
|
|
|
|
} else if (dateTime.isAfter(DateTime.parse(dateTime.year.toString() +
|
|
|
|
"-" +
|
|
|
|
Utils.addZeroNumber(dateTime.month) +
|
|
|
|
"-" +
|
|
|
|
Utils.addZeroNumber(dateTime.day) +
|
|
|
|
" " +
|
|
|
|
noon.split("-")[1] +
|
|
|
|
":00")) &&
|
|
|
|
dateTime.isBefore(DateTime.parse(dateTime.year.toString() +
|
|
|
|
"-" +
|
|
|
|
Utils.addZeroNumber(dateTime.month) +
|
|
|
|
"-" +
|
|
|
|
Utils.addZeroNumber(dateTime.day) +
|
|
|
|
" " +
|
|
|
|
night.split("-")[1] +
|
|
|
|
":00"))) {
|
|
|
|
//过了午市,未过晚市
|
|
|
|
currTimeIndex = 3;
|
|
|
|
} else {
|
|
|
|
//过了晚市
|
|
|
|
currTimeIndex = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
selectDateStr = returnDayDateStr(dateTime);
|
|
|
|
selectWeekAndLunarCalendar = returnWeekAndLunarCalendar(dateTime, context);
|
|
|
|
}
|
|
|
|
|
|
|
|
String returnWeekAndLunarCalendar(DateTime day, BuildContext context) {
|
|
|
|
String date = "星期${Utils.formatWeekDayNum(day.weekday)} ";
|
|
|
|
date += Utils.lunarCalendarHolidays(day);
|
|
|
|
_getDoltStr(context);
|
|
|
|
return date;
|
|
|
|
}
|
|
|
|
|
|
|
|
String returnDayDateStr(DateTime day) {
|
|
|
|
String date = '';
|
|
|
|
DateTime dateNow = DateTime.now();
|
|
|
|
String ymd = "${day.year}年" +
|
|
|
|
Utils.addZeroNumber(day.month) +
|
|
|
|
"月" +
|
|
|
|
Utils.addZeroNumber(day.day) +
|
|
|
|
"日";
|
|
|
|
|
|
|
|
if (Utils.isOneDay(day, dateNow)) {
|
|
|
|
date += "今天 ";
|
|
|
|
} else if (Utils.isOneDay(day, dateNow.add(Duration(days: 1)))) {
|
|
|
|
date += "明天 ";
|
|
|
|
} else if (Utils.isOneDay(day, dateNow.add(Duration(days: 2)))) {
|
|
|
|
date += "后天 ";
|
|
|
|
}
|
|
|
|
date += ymd;
|
|
|
|
// date += " 星期${Utils.formatWeekDayNum(day.weekday)}";
|
|
|
|
return date;
|
|
|
|
}
|
|
|
|
|
|
|
|
//生成日期文本
|
|
|
|
createDateText(BuildContext context, DateTime day) {
|
|
|
|
if (Utils.isOneDay(day, dateTime)) return; //日期没变
|
|
|
|
dateTimeSelect = day;
|
|
|
|
dateText = returnDate(day);
|
|
|
|
selectDateStr = returnDayDateStr(day);
|
|
|
|
selectWeekAndLunarCalendar = returnWeekAndLunarCalendar(day, context);
|
|
|
|
dateTime = day;
|
|
|
|
// getReserveList(context, needLoading: false, showloading: true);
|
|
|
|
}
|
|
|
|
|
|
|
|
//生成日期文本
|
|
|
|
createDateText1(BuildContext context, DateTime day) {
|
|
|
|
if (Utils.isOneDay(day, dateTime)) return; //日期没变
|
|
|
|
dateTimeSelect = day;
|
|
|
|
dateText = returnDate(day);
|
|
|
|
selectDateStr = returnDayDateStr(day);
|
|
|
|
selectWeekAndLunarCalendar = returnWeekAndLunarCalendar(day, context);
|
|
|
|
dateTime = day;
|
|
|
|
// getReserveList(context, needLoading: false, showloading: true);
|
|
|
|
}
|
|
|
|
|
|
|
|
String _returnDayDateWeek(DateTime day) {
|
|
|
|
String date = '';
|
|
|
|
DateTime dateNow = DateTime.now();
|
|
|
|
String ymd = "${day.year}-" +
|
|
|
|
Utils.addZeroNumber(day.month) +
|
|
|
|
"-" +
|
|
|
|
Utils.addZeroNumber(day.day);
|
|
|
|
|
|
|
|
if (Utils.isOneDay(day, dateNow)) {
|
|
|
|
date += "今天 ";
|
|
|
|
} else if (Utils.isOneDay(day, dateNow.add(Duration(days: 1)))) {
|
|
|
|
date += "明天 ";
|
|
|
|
} else if (Utils.isOneDay(day, dateNow.add(Duration(days: 2)))) {
|
|
|
|
date += "后天 ";
|
|
|
|
}
|
|
|
|
date += ymd;
|
|
|
|
date += " 星期${Utils.formatWeekDayNum(day.weekday)}";
|
|
|
|
return date;
|
|
|
|
}
|
|
|
|
|
|
|
|
returnDate(DateTime day) {
|
|
|
|
// String time = Utils.lunarCalendarHolidays(day);
|
|
|
|
String date = _returnDayDateWeek(day);
|
|
|
|
// date += ' ${time}';
|
|
|
|
return date;
|
|
|
|
}
|
|
|
|
|
|
|
|
_getDoltStr(BuildContext context) {
|
|
|
|
if (currTimeIndex == 1) {
|
|
|
|
doltStr = '早餐';
|
|
|
|
} else if (currTimeIndex == 2) {
|
|
|
|
doltStr = '午餐';
|
|
|
|
} else if (currTimeIndex == 3) {
|
|
|
|
doltStr = '晚餐';
|
|
|
|
}
|
|
|
|
// _initTimeDdate(currTimeIndex, context);
|
|
|
|
}
|
|
|
|
|
|
|
|
List<TableListReseveSunModel> getSpTableList() {
|
|
|
|
String tableList = App.sp.getString('table_list_or_reserve');
|
|
|
|
if (tableList == null) {
|
|
...
|
...
|
@@ -272,8 +417,8 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
_getSellerById() async {
|
|
|
|
StoreBaseIndoProvider storeBaseIndoProvider =
|
|
|
|
Provider.of<StoreBaseIndoProvider>(context, listen: false);
|
|
|
|
GetSellerInfoSunModel sellerInfoSunModel =
|
|
|
|
await storeBaseIndoProvider.getSellerById(context, showLoading: false);
|
|
|
|
GetSellerInfoSunModel sellerInfoSunModel = await storeBaseIndoProvider
|
|
|
|
.getSellerById(context, showLoading: false, selfDismiss: true);
|
|
|
|
if (sellerInfoSunModel != null) {
|
|
|
|
if (App.sp.containsKey('user')) {
|
|
|
|
String s = App.sp.getString('user');
|
|
...
|
...
|
@@ -289,8 +434,22 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
'${sellerInfoSunModel.data.mapAddress}${sellerInfoSunModel.data.realAddress ?? ''}';
|
|
|
|
await UserModel().saveUserInfo(_user);
|
|
|
|
}
|
|
|
|
UserModel userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
morning = userModel.user.morning.isEmpty
|
|
|
|
? "00:00-00:00"
|
|
|
|
: userModel.user.morning;
|
|
|
|
noon = userModel.user.noon.isEmpty ? "00:00-00:00" : userModel.user.noon;
|
|
|
|
night =
|
|
|
|
userModel.user.night.isEmpty ? "00:00-00:00" : userModel.user.night;
|
|
|
|
setState(() {});
|
|
|
|
bool showLoading = true;
|
|
|
|
if (tableManagerModel.pageStateOrReserve == PageState.Loading) {
|
|
|
|
showLoading = false;
|
|
|
|
}
|
|
|
|
tableManagerModel.getTableListOrReserve(
|
|
|
|
context, currTimeIndex, dateTime, selectNumber,
|
|
|
|
showLoading: showLoading);
|
|
|
|
}
|
|
|
|
tableManagerModel.initTimeTable(context);
|
|
|
|
}
|
|
|
|
|
|
|
|
// ///获取备注信息
|
|
...
|
...
|
@@ -421,65 +580,64 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
}
|
|
|
|
|
|
|
|
///消费券
|
|
|
|
_couponNetworkData(
|
|
|
|
{bool isShowLoading = true, bool selfDismiss = false}) async {
|
|
|
|
couponSelectIndex = 0;
|
|
|
|
Map<String, String> params = {
|
|
|
|
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
'status': '1'
|
|
|
|
};
|
|
|
|
await couponProvider.getCustomerSelectActivityNew(context, params,
|
|
|
|
isShowLoading: isShowLoading, selfDismiss: selfDismiss);
|
|
|
|
//此人已经新建好券
|
|
|
|
if (couponProvider.couponListSelect.length > 0) {
|
|
|
|
// couponProvider.initCouponSelect(context);
|
|
|
|
couponsCan = [];
|
|
|
|
List<CouponSunModel> temp = [];
|
|
|
|
for (int i = 0; i < couponProvider.couponListSelect.length; i++) {
|
|
|
|
if (couponProvider.couponListSelect[i].isOpenBool) {
|
|
|
|
// 店铺优惠券
|
|
|
|
if (couponProvider.couponListSelect[i].isType == '1') {
|
|
|
|
if (couponProvider.couponListSelect[i].uidList != null) {
|
|
|
|
List<String> listuids =
|
|
|
|
couponProvider.couponListSelect[i].uidList.split(',');
|
|
|
|
if (listuids.contains(
|
|
|
|
Provider.of<UserModel>(context, listen: false).user.openid))
|
|
|
|
couponsCan.add(couponProvider.couponListSelect[i].aname);
|
|
|
|
temp.add(couponProvider.couponListSelect[i]);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//我的优惠券
|
|
|
|
couponsCan.add(couponProvider.couponListSelect[i].aname);
|
|
|
|
temp.add(couponProvider.couponListSelect[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
couponProvider.couponListSelect = temp;
|
|
|
|
//获取绑定的优惠券
|
|
|
|
// _getActivityByRid();
|
|
|
|
|
|
|
|
// if (couponProvider.coupons.length == 0) {
|
|
|
|
// setState(() {
|
|
|
|
// couponHeight = 0.0;
|
|
|
|
// });
|
|
|
|
// } else {
|
|
|
|
// setState(() {
|
|
|
|
// couponHeight = 140.0;
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
} else {
|
|
|
|
//没有新建的优惠券
|
|
|
|
// setState(() {
|
|
|
|
// couponHeight = 0.0;
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// _couponNetworkData(
|
|
|
|
// {bool isShowLoading = true, bool selfDismiss = false}) async {
|
|
|
|
// couponSelectIndex = 0;
|
|
|
|
// Map<String, String> params = {
|
|
|
|
// "uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
// 'status': '1'
|
|
|
|
// };
|
|
|
|
// await couponProvider.getCustomerSelectActivityNew(context, params,
|
|
|
|
// isShowLoading: isShowLoading, selfDismiss: selfDismiss);
|
|
|
|
// //此人已经新建好券
|
|
|
|
// if (couponProvider.couponListSelect.length > 0) {
|
|
|
|
// // couponProvider.initCouponSelect(context);
|
|
|
|
// couponsCan = [];
|
|
|
|
// List<CouponSunModel> temp = [];
|
|
|
|
// for (int i = 0; i < couponProvider.couponListSelect.length; i++) {
|
|
|
|
// if (couponProvider.couponListSelect[i].isOpenBool) {
|
|
|
|
// // 店铺优惠券
|
|
|
|
// if (couponProvider.couponListSelect[i].isType == '1') {
|
|
|
|
// if (couponProvider.couponListSelect[i].uidList != null) {
|
|
|
|
// List<String> listuids =
|
|
|
|
// couponProvider.couponListSelect[i].uidList.split(',');
|
|
|
|
// if (listuids.contains(
|
|
|
|
// Provider.of<UserModel>(context, listen: false).user.openid))
|
|
|
|
// couponsCan.add(couponProvider.couponListSelect[i].aname);
|
|
|
|
// temp.add(couponProvider.couponListSelect[i]);
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// //我的优惠券
|
|
|
|
// couponsCan.add(couponProvider.couponListSelect[i].aname);
|
|
|
|
// temp.add(couponProvider.couponListSelect[i]);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// couponProvider.couponListSelect = temp;
|
|
|
|
// //获取绑定的优惠券
|
|
|
|
// // _getActivityByRid();
|
|
|
|
|
|
|
|
// // if (couponProvider.coupons.length == 0) {
|
|
|
|
// // setState(() {
|
|
|
|
// // couponHeight = 0.0;
|
|
|
|
// // });
|
|
|
|
// // } else {
|
|
|
|
// // setState(() {
|
|
|
|
// // couponHeight = 140.0;
|
|
|
|
// // });
|
|
|
|
// // }
|
|
|
|
// } else {
|
|
|
|
// //没有新建的优惠券
|
|
|
|
// // setState(() {
|
|
|
|
// // couponHeight = 0.0;
|
|
|
|
// // });
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
///刷新图片显示
|
|
|
|
_refreshTablePhoto() async {
|
|
|
|
await tableManagerModel.getTableListOrReserve(
|
|
|
|
context,
|
|
|
|
);
|
|
|
|
context, currTimeIndex, dateTime, selectNumber);
|
|
|
|
tableManagerModel.notifyListeners();
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -2043,14 +2201,15 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
|
|
|
|
_onlyReserve() async {
|
|
|
|
bool isShow = true; //是否需要弹窗 “预订失败!”
|
|
|
|
SunReserveInfoModel _model =
|
|
|
|
await tableManagerModel.setReserveInfoOrReseve(context, (v) {
|
|
|
|
SunReserveInfoModel _model = await tableManagerModel
|
|
|
|
.setReserveInfoOrReseve(context, (v) {
|
|
|
|
if (v) {
|
|
|
|
isShow = true;
|
|
|
|
} else {
|
|
|
|
isShow = false;
|
|
|
|
}
|
|
|
|
}, needKeep: true, guest: widget.guest);
|
|
|
|
}, dateTime, currTimeIndex, morning, noon, night,
|
|
|
|
needKeep: true, guest: widget.guest);
|
|
|
|
if (_model != null &&
|
|
|
|
ObjectUtil.isNotEmpty(_model.row) &&
|
|
|
|
ObjectUtil.isNotEmpty(_model.row.id)) {
|
|
...
|
...
|
@@ -2185,9 +2344,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
tableManagerModel.selectDateStr +
|
|
|
|
' ' +
|
|
|
|
tableManagerModel.doltStr,
|
|
|
|
selectDateStr + ' ' + doltStr,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
...
|
...
|
@@ -2195,7 +2352,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
),
|
|
|
|
VEmptyView(8),
|
|
|
|
Text(
|
|
|
|
tableManagerModel.selectWeekAndLunarCalendar,
|
|
|
|
selectWeekAndLunarCalendar,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(20)),
|
|
...
|
...
|
@@ -2400,14 +2557,15 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
|
|
|
|
_wechatReserve(bool isWechat) async {
|
|
|
|
bool isShow = true; //是否需要弹窗 “预订失败!”
|
|
|
|
SunReserveInfoModel _model =
|
|
|
|
await tableManagerModel.setReserveInfoOrReseve(context, (v) {
|
|
|
|
SunReserveInfoModel _model = await tableManagerModel
|
|
|
|
.setReserveInfoOrReseve(context, (v) {
|
|
|
|
if (v) {
|
|
|
|
isShow = true;
|
|
|
|
} else {
|
|
|
|
isShow = false;
|
|
|
|
}
|
|
|
|
}, needKeep: true, guest: widget.guest);
|
|
|
|
}, dateTime, currTimeIndex, morning, noon, night,
|
|
|
|
needKeep: true, guest: widget.guest);
|
|
|
|
if (_model != null &&
|
|
|
|
ObjectUtil.isNotEmpty(_model.row) &&
|
|
|
|
ObjectUtil.isNotEmpty(_model.row.id)) {
|
|
...
|
...
|
@@ -3210,7 +3368,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
} else {
|
|
|
|
isShow = false;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}, dateTime, currTimeIndex, morning, noon, night,
|
|
|
|
needKeep: true,
|
|
|
|
pnum: pnum,
|
|
|
|
cusdem: cusdem,
|
|
...
|
...
|
@@ -3463,11 +3621,11 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
_clickMorAndNoonAndNig(BuildContext context) async {
|
|
|
|
ddateIndex = null;
|
|
|
|
ddateHm = '选填';
|
|
|
|
tableManagerModel.selectDateStr =
|
|
|
|
tableManagerModel.returnDayDateStr(tableManagerModel.dateTimeSelect);
|
|
|
|
tableManagerModel.selectWeekAndLunarCalendar = tableManagerModel
|
|
|
|
.returnWeekAndLunarCalendar(tableManagerModel.dateTimeSelect, context);
|
|
|
|
bool success = await tableManagerModel.getTableListOrReserve(context,
|
|
|
|
selectDateStr = returnDayDateStr(dateTimeSelect);
|
|
|
|
selectWeekAndLunarCalendar =
|
|
|
|
returnWeekAndLunarCalendar(dateTimeSelect, context);
|
|
|
|
bool success = await tableManagerModel.getTableListOrReserve(
|
|
|
|
context, currTimeIndex, dateTime, selectNumber,
|
|
|
|
showLoading: true, selfDismiss: false);
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -3497,13 +3655,13 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
int sum = 3;
|
|
|
|
int hide = 0;
|
|
|
|
int btnNum = 0;
|
|
|
|
if (tableManagerModel.morning == "00:00-00:00") {
|
|
|
|
if (morning == "00:00-00:00") {
|
|
|
|
hide++;
|
|
|
|
}
|
|
|
|
if (tableManagerModel.noon == "00:00-00:00") {
|
|
|
|
if (noon == "00:00-00:00") {
|
|
|
|
hide++;
|
|
|
|
}
|
|
|
|
if (tableManagerModel.night == "00:00-00:00") {
|
|
|
|
if (night == "00:00-00:00") {
|
|
|
|
hide++;
|
|
|
|
}
|
|
|
|
btnNum = sum - hide;
|
|
...
|
...
|
@@ -3519,14 +3677,16 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
Expanded(
|
|
|
|
child: GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
DialogUtil.showCalendarDialog(
|
|
|
|
context, tableManagerModel.dateTime)
|
|
|
|
DialogUtil.showCalendarDialog(context, dateTime)
|
|
|
|
.then((day) async {
|
|
|
|
if (day != null) {
|
|
|
|
tableManagerModel.createDateText1(context, day);
|
|
|
|
createDateText1(context, day);
|
|
|
|
bool success =
|
|
|
|
await tableManagerModel.getTableListOrReserve(
|
|
|
|
context,
|
|
|
|
currTimeIndex,
|
|
|
|
dateTime,
|
|
|
|
selectNumber,
|
|
|
|
showLoading: true,
|
|
|
|
);
|
|
|
|
}
|
|
...
|
...
|
@@ -3546,7 +3706,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
tableManagerModel.dateText,
|
|
|
|
dateText,
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_ffffff,
|
|
...
|
...
|
@@ -3570,8 +3730,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
HEmptyView(20),
|
|
|
|
Container(
|
|
|
|
width: btnNum == 3 &&
|
|
|
|
(tableManagerModel.currTimeIndex == 3 ||
|
|
|
|
tableManagerModel.currTimeIndex == 1)
|
|
|
|
(currTimeIndex == 3 || currTimeIndex == 1)
|
|
|
|
? ScreenUtil().setWidth(300) +
|
|
|
|
ScreenUtil().setWidth(4)
|
|
|
|
: ScreenUtil().setWidth(300),
|
|
...
|
...
|
@@ -3587,33 +3746,26 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
children: <Widget>[
|
|
|
|
Offstage(
|
|
|
|
offstage:
|
|
|
|
tableManagerModel.morning == "00:00-00:00"
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
morning == "00:00-00:00" ? true : false,
|
|
|
|
child: CommonButtonFlat(
|
|
|
|
content: "早餐",
|
|
|
|
state: tableManagerModel.currTimeIndex == 1
|
|
|
|
? 1
|
|
|
|
: 0,
|
|
|
|
state: currTimeIndex == 1 ? 1 : 0,
|
|
|
|
fontSize: 28,
|
|
|
|
right:
|
|
|
|
tableManagerModel.noon == "00:00-00:00" &&
|
|
|
|
tableManagerModel.night ==
|
|
|
|
"00:00-00:00"
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
right: noon == "00:00-00:00" &&
|
|
|
|
night == "00:00-00:00"
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
width: ScreenUtil().setWidth(300) / btnNum,
|
|
|
|
onPress: () {
|
|
|
|
if (tableManagerModel.currTimeIndex == 1)
|
|
|
|
return;
|
|
|
|
if (currTimeIndex == 1) return;
|
|
|
|
setState(() {
|
|
|
|
tableManagerModel.currTimeIndex = 1;
|
|
|
|
currTimeIndex = 1;
|
|
|
|
});
|
|
|
|
|
|
|
|
_clickMorAndNoonAndNig(context);
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
btnNum == 3 && tableManagerModel.currTimeIndex == 3
|
|
|
|
btnNum == 3 && currTimeIndex == 3
|
|
|
|
? MyDivider(
|
|
|
|
ScreenUtil().setWidth(4),
|
|
|
|
ScreenUtil().setWidth(46),
|
|
...
|
...
|
@@ -3621,35 +3773,23 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
Offstage(
|
|
|
|
offstage:
|
|
|
|
tableManagerModel.noon == "00:00-00:00"
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
offstage: noon == "00:00-00:00" ? true : false,
|
|
|
|
child: CommonButtonFlat(
|
|
|
|
content: "午餐",
|
|
|
|
state: tableManagerModel.currTimeIndex == 2
|
|
|
|
? 1
|
|
|
|
: 0,
|
|
|
|
state: currTimeIndex == 2 ? 1 : 0,
|
|
|
|
fontSize: 28,
|
|
|
|
width: ScreenUtil().setWidth(300) / btnNum,
|
|
|
|
left:
|
|
|
|
tableManagerModel.morning == "00:00-00:00"
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
right:
|
|
|
|
tableManagerModel.night == "00:00-00:00"
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
left: morning == "00:00-00:00" ? true : false,
|
|
|
|
right: night == "00:00-00:00" ? true : false,
|
|
|
|
onPress: () {
|
|
|
|
if (tableManagerModel.currTimeIndex == 2)
|
|
|
|
return;
|
|
|
|
if (currTimeIndex == 2) return;
|
|
|
|
setState(() {
|
|
|
|
tableManagerModel.currTimeIndex = 2;
|
|
|
|
currTimeIndex = 2;
|
|
|
|
});
|
|
|
|
_clickMorAndNoonAndNig(context);
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
btnNum == 3 && tableManagerModel.currTimeIndex == 1
|
|
|
|
btnNum == 3 && currTimeIndex == 1
|
|
|
|
? MyDivider(
|
|
|
|
ScreenUtil().setWidth(4),
|
|
|
|
ScreenUtil().setWidth(46),
|
|
...
|
...
|
@@ -3657,27 +3797,21 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
Offstage(
|
|
|
|
offstage: tableManagerModel.night == "00:00-00:00"
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
offstage: night == "00:00-00:00" ? true : false,
|
|
|
|
child: Container(
|
|
|
|
child: CommonButtonFlat(
|
|
|
|
content: "晚餐",
|
|
|
|
left: tableManagerModel.morning ==
|
|
|
|
"00:00-00:00" &&
|
|
|
|
tableManagerModel.noon == "00:00-00:00"
|
|
|
|
left: morning == "00:00-00:00" &&
|
|
|
|
noon == "00:00-00:00"
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
state: tableManagerModel.currTimeIndex == 3
|
|
|
|
? 1
|
|
|
|
: 0,
|
|
|
|
state: currTimeIndex == 3 ? 1 : 0,
|
|
|
|
fontSize: 28,
|
|
|
|
width: ScreenUtil().setWidth(300) / btnNum,
|
|
|
|
onPress: () {
|
|
|
|
if (tableManagerModel.currTimeIndex == 3)
|
|
|
|
return;
|
|
|
|
if (currTimeIndex == 3) return;
|
|
|
|
setState(() {
|
|
|
|
tableManagerModel.currTimeIndex = 3;
|
|
|
|
currTimeIndex = 3;
|
|
|
|
});
|
|
|
|
|
|
|
|
_clickMorAndNoonAndNig(context);
|
|
...
|
...
|
@@ -3697,7 +3831,8 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
child: ExceptionPage(
|
|
|
|
pageState: model.pageStateOrReserve,
|
|
|
|
callback: () {
|
|
|
|
tableManagerModel.getTableListOrReserve(context,
|
|
|
|
tableManagerModel.getTableListOrReserve(
|
|
|
|
context, currTimeIndex, dateTime, selectNumber,
|
|
|
|
showLoading: true);
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有桌位哦",
|
|
...
|
...
|
@@ -3736,8 +3871,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
setState(() {
|
|
|
|
// isSelected = false;
|
|
|
|
area.select = true;
|
|
|
|
tableManagerModel.selectNumber =
|
|
|
|
index;
|
|
|
|
selectNumber = index;
|
|
|
|
// tableManagerModel.currentArea =
|
|
|
|
// tableManagerModel
|
|
|
|
// .areas[index - 1].name;
|
|
...
|
...
|
@@ -3756,9 +3890,9 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
model.swichState = !model.swichState;
|
|
|
|
swichState = !swichState;
|
|
|
|
});
|
|
|
|
if (model.swichState) {
|
|
|
|
if (swichState) {
|
|
|
|
//把没有预订和宴会的桌子筛选出来显示
|
|
|
|
|
|
|
|
model.tablesOrReserveData
|
|
...
|
...
|
@@ -3823,7 +3957,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
// color: MyColours.color_9C9C9C),
|
|
|
|
HEmptyView(30),
|
|
|
|
Image.asset(
|
|
|
|
model.swichState
|
|
|
|
swichState
|
|
|
|
? Utils.getImgPath(
|
|
|
|
'f_swich_on')
|
|
|
|
: Utils.getImgPath(
|
|
...
|
...
|
@@ -3847,7 +3981,12 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (tableManagerModel.selectNumber != null)
|
|
|
|
if (tableManagerModel.tablesOrReserveDataShow !=
|
|
|
|
null &&
|
|
|
|
tableManagerModel
|
|
|
|
.tablesOrReserveDataShow.length >
|
|
|
|
0 &&
|
|
|
|
selectNumber != null)
|
|
|
|
Expanded(
|
|
|
|
// flex: 2,
|
|
|
|
child: Container(
|
|
...
|
...
|
@@ -3855,8 +3994,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
minHeight:
|
|
|
|
ScreenUtil().setWidth(100)),
|
|
|
|
color: Color.fromRGBO(249, 249, 249, 1),
|
|
|
|
child: item(
|
|
|
|
tableManagerModel.selectNumber))),
|
|
|
|
child: item(selectNumber))),
|
|
|
|
tableManagerModel.selectTablesOrReserve.length > 0
|
|
|
|
?
|
|
|
|
// wechatNotification
|
...
|
...
|
|