|
...
|
...
|
@@ -20,6 +20,8 @@ import 'package:one_key/widgets/MyDivider.dart'; |
|
|
|
import 'package:one_key/widgets/app_bar.dart';
|
|
|
|
import 'package:one_key/widgets/area_item.dart';
|
|
|
|
import 'package:one_key/widgets/common_button.dart';
|
|
|
|
import 'package:one_key/widgets/common_button_flat.dart';
|
|
|
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
import 'package:one_key/widgets/page_exception.dart';
|
|
|
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
import 'package:one_key/widgets/table_item.dart';
|
|
...
|
...
|
@@ -339,124 +341,167 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Consumer<TableManagerModel>(
|
|
|
|
builder: (context, model, child) {
|
|
|
|
int sum = 3;
|
|
|
|
int hide = 0;
|
|
|
|
int btnNum = 0;
|
|
|
|
if (tableManagerModel.morning == "00:00-00:00") {
|
|
|
|
hide++;
|
|
|
|
}
|
|
|
|
if (tableManagerModel.noon == "00:00-00:00") {
|
|
|
|
hide++;
|
|
|
|
}
|
|
|
|
if (tableManagerModel.night == "00:00-00:00") {
|
|
|
|
hide++;
|
|
|
|
}
|
|
|
|
btnNum = sum - hide;
|
|
|
|
return Column(
|
|
|
|
children: <Widget>[
|
|
|
|
SystemAppBar("桌位", showLeading: false),
|
|
|
|
Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
width: double.infinity,
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(vertical: ScreenUtil().setHeight(16)),
|
|
|
|
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(15)),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Expanded(
|
|
|
|
child: Center(
|
|
|
|
child: GestureDetector(
|
|
|
|
onTap: () {
|
|
|
|
DialogUtil.showCalendarDialog(
|
|
|
|
context, tableManagerModel.dateTime)
|
|
|
|
.then((day) {
|
|
|
|
if (day != null) {
|
|
|
|
tableManagerModel.createDateText(context, day);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
child: Text(
|
|
|
|
tableManagerModel.dateText,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
fontSize: ScreenUtil().setSp(34)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
MyDivider(
|
|
|
|
ScreenUtil().setWidth(2),
|
|
|
|
ScreenUtil().setHeight(68),
|
|
|
|
color: MyColours.color_E0E0E0,
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(30)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Offstage(
|
|
|
|
offstage:
|
|
|
|
tableManagerModel.morning == "00:00-00:00"
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
right: ScreenUtil().setWidth(18)),
|
|
|
|
child: CommonButton(
|
|
|
|
content: "早市",
|
|
|
|
state: tableManagerModel.currTimeIndex == 1
|
|
|
|
? 1
|
|
|
|
: 0,
|
|
|
|
width: 92,
|
|
|
|
height: 48,
|
|
|
|
fontSize: 32,
|
|
|
|
onPress: () {
|
|
|
|
if (tableManagerModel.currTimeIndex == 1)
|
|
|
|
return;
|
|
|
|
tableManagerModel.currTimeIndex = 1;
|
|
|
|
tableManagerModel.getReserveList(context);
|
|
|
|
},
|
|
|
|
))),
|
|
|
|
Offstage(
|
|
|
|
offstage: tableManagerModel.noon == "00:00-00:00"
|
|
|
|
onTap: () {
|
|
|
|
DialogUtil.showCalendarDialog(
|
|
|
|
context, tableManagerModel.dateTime)
|
|
|
|
.then((day) {
|
|
|
|
if (day != null) {
|
|
|
|
tableManagerModel.createDateText(context, day);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
// height: ScreenUtil().setWidth(80),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(15),
|
|
|
|
vertical: ScreenUtil().setWidth(20)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(20))),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
tableManagerModel.dateText,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
)),
|
|
|
|
HEmptyView(10),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('f_arrow_right'),
|
|
|
|
width: ScreenUtil().setWidth(25),
|
|
|
|
// height: ScreenUtil().setWidth(10),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
|
|
|
|
// MyDivider(
|
|
|
|
// ScreenUtil().setWidth(2),
|
|
|
|
// ScreenUtil().setHeight(68),
|
|
|
|
// color: MyColours.color_E0E0E0,
|
|
|
|
// ),
|
|
|
|
HEmptyView(20),
|
|
|
|
Container(
|
|
|
|
width: ScreenUtil().setWidth(206),
|
|
|
|
height: ScreenUtil().setWidth(74),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Color.fromRGBO(232, 232, 232, 1),
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(20),
|
|
|
|
)),
|
|
|
|
child: Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
Offstage(
|
|
|
|
offstage: tableManagerModel.morning == "00:00-00:00"
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
child: CommonButtonFlat(
|
|
|
|
content: "早市",
|
|
|
|
state:
|
|
|
|
tableManagerModel.currTimeIndex == 1 ? 1 : 0,
|
|
|
|
fontSize: 28,
|
|
|
|
right: tableManagerModel.noon == "00:00-00:00" &&
|
|
|
|
tableManagerModel.night == "00:00-00:00"
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
right: ScreenUtil().setWidth(18)),
|
|
|
|
child: CommonButton(
|
|
|
|
content: "午市",
|
|
|
|
state: tableManagerModel.currTimeIndex == 2
|
|
|
|
? 1
|
|
|
|
: 0,
|
|
|
|
width: 92,
|
|
|
|
height: 48,
|
|
|
|
fontSize: 32,
|
|
|
|
onPress: () {
|
|
|
|
if (tableManagerModel.currTimeIndex == 2)
|
|
|
|
return;
|
|
|
|
tableManagerModel.currTimeIndex = 2;
|
|
|
|
tableManagerModel.getReserveList(context);
|
|
|
|
},
|
|
|
|
))),
|
|
|
|
Offstage(
|
|
|
|
offstage: tableManagerModel.night == "00:00-00:00"
|
|
|
|
width: ScreenUtil().setWidth(200) / btnNum,
|
|
|
|
onPress: () {
|
|
|
|
if (tableManagerModel.currTimeIndex == 1)
|
|
|
|
return;
|
|
|
|
tableManagerModel.currTimeIndex = 1;
|
|
|
|
tableManagerModel.getReserveList(context);
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
btnNum == 3 && tableManagerModel.currTimeIndex == 3
|
|
|
|
? MyDivider(
|
|
|
|
ScreenUtil().setWidth(4),
|
|
|
|
ScreenUtil().setWidth(46),
|
|
|
|
color: MyColours.color_dfdfdf,
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
Offstage(
|
|
|
|
offstage: tableManagerModel.noon == "00:00-00:00"
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
child: Container(
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: ScreenUtil().setWidth(10)),
|
|
|
|
child: CommonButton(
|
|
|
|
content: "晚市",
|
|
|
|
child: CommonButtonFlat(
|
|
|
|
content: "午市",
|
|
|
|
state:
|
|
|
|
tableManagerModel.currTimeIndex == 3 ? 1 : 0,
|
|
|
|
width: 92,
|
|
|
|
height: 48,
|
|
|
|
fontSize: 32,
|
|
|
|
tableManagerModel.currTimeIndex == 2 ? 1 : 0,
|
|
|
|
fontSize: 28,
|
|
|
|
width: ScreenUtil().setWidth(200) / btnNum,
|
|
|
|
left: tableManagerModel.morning == "00:00-00:00"
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
right: tableManagerModel.night == "00:00-00:00"
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
onPress: () {
|
|
|
|
if (tableManagerModel.currTimeIndex == 3)
|
|
|
|
if (tableManagerModel.currTimeIndex == 2)
|
|
|
|
return;
|
|
|
|
tableManagerModel.currTimeIndex = 3;
|
|
|
|
tableManagerModel.currTimeIndex = 2;
|
|
|
|
tableManagerModel.getReserveList(context);
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
btnNum == 3 && tableManagerModel.currTimeIndex == 1
|
|
|
|
? MyDivider(
|
|
|
|
ScreenUtil().setWidth(4),
|
|
|
|
ScreenUtil().setWidth(46),
|
|
|
|
color: MyColours.color_dfdfdf,
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
Offstage(
|
|
|
|
offstage: tableManagerModel.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"
|
|
|
|
? true
|
|
|
|
: false,
|
|
|
|
state: tableManagerModel.currTimeIndex == 3 ? 1 : 0,
|
|
|
|
fontSize: 28,
|
|
|
|
width: ScreenUtil().setWidth(200) / btnNum,
|
|
|
|
onPress: () {
|
|
|
|
if (tableManagerModel.currTimeIndex == 3) return;
|
|
|
|
tableManagerModel.currTimeIndex = 3;
|
|
|
|
tableManagerModel.getReserveList(context);
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
...
|
...
|
|