|
@@ -5,6 +5,7 @@ import 'package:one_key/provider/user_model.dart'; |
|
@@ -5,6 +5,7 @@ import 'package:one_key/provider/user_model.dart'; |
|
5
|
import 'package:one_key/res/colors.dart';
|
5
|
import 'package:one_key/res/colors.dart';
|
|
6
|
import 'package:one_key/utils/utils.dart';
|
6
|
import 'package:one_key/utils/utils.dart';
|
|
7
|
import 'package:one_key/widgets/h_empty_view.dart';
|
7
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
8
|
+import 'package:one_key/widgets/system_app_bar.dart';
|
|
8
|
import 'package:one_key/widgets/v_empty_view.dart';
|
9
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
9
|
import 'package:provider/provider.dart';
|
10
|
import 'package:provider/provider.dart';
|
|
10
|
import 'package:table_calendar/table_calendar.dart';
|
11
|
import 'package:table_calendar/table_calendar.dart';
|
|
@@ -13,11 +14,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
@@ -13,11 +14,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
13
|
import '../../app.dart';
|
14
|
import '../../app.dart';
|
|
14
|
|
15
|
|
|
15
|
class StoreTypeFillManagePage extends StatefulWidget {
|
16
|
class StoreTypeFillManagePage extends StatefulWidget {
|
|
16
|
- int timeMills; //日期
|
|
|
|
17
|
- int ddate_solt; //时段
|
|
|
|
18
|
-
|
|
|
|
19
|
- StoreTypeFillManagePage({Key key, this.timeMills, this.ddate_solt})
|
|
|
|
20
|
- : super(key: key);
|
17
|
+ StoreTypeFillManagePage({Key key}) : super(key: key);
|
|
21
|
|
18
|
|
|
22
|
@override
|
19
|
@override
|
|
23
|
State<StatefulWidget> createState() {
|
20
|
State<StatefulWidget> createState() {
|
|
@@ -41,6 +38,9 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -41,6 +38,9 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
41
|
|
38
|
|
|
42
|
int timeIndex = 0; //当前时段
|
39
|
int timeIndex = 0; //当前时段
|
|
43
|
int enableIndex = 0; //最早可用时段
|
40
|
int enableIndex = 0; //最早可用时段
|
|
|
|
41
|
+ int timeMills;
|
|
|
|
42
|
+
|
|
|
|
43
|
+ List<String> fillTimes = [];
|
|
44
|
|
44
|
|
|
45
|
//早市,午市,晚市时间段
|
45
|
//早市,午市,晚市时间段
|
|
46
|
Map<String, String> daily = {"morning": "", "noon": "", "night": ""};
|
46
|
Map<String, String> daily = {"morning": "", "noon": "", "night": ""};
|
|
@@ -49,16 +49,30 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -49,16 +49,30 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
49
|
List<SellerTableClassEntity> tables = [];
|
49
|
List<SellerTableClassEntity> tables = [];
|
|
50
|
|
50
|
|
|
51
|
//已选包间数量
|
51
|
//已选包间数量
|
|
52
|
- Map<int, int> roomNum = {0: 0, 1: 0, 2: 0, 3: 0};
|
52
|
+ // Map<int, int> roomNum = {0: 0, 1: 0, 2: 0, 3: 0};
|
|
53
|
|
53
|
|
|
54
|
//已选包间下标
|
54
|
//已选包间下标
|
|
55
|
- List<int> rooms = [];
|
55
|
+ // List<int> rooms = [];
|
|
56
|
|
56
|
|
|
57
|
//获取店铺详情
|
57
|
//获取店铺详情
|
|
58
|
_getStoreDetail() {
|
58
|
_getStoreDetail() {
|
|
59
|
_initTime();
|
59
|
_initTime();
|
|
60
|
_currTimeIndex();
|
60
|
_currTimeIndex();
|
|
61
|
_getSellerTableClass();
|
61
|
_getSellerTableClass();
|
|
|
|
62
|
+ _getTableFillUpDate();
|
|
|
|
63
|
+ }
|
|
|
|
64
|
+
|
|
|
|
65
|
+ _getTableFillUpDate() async {
|
|
|
|
66
|
+ Map<String, String> params = {
|
|
|
|
67
|
+ "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
68
|
+ "type": 'month',
|
|
|
|
69
|
+ "date":
|
|
|
|
70
|
+ "${_selectDateTime.year}-${Utils.addZeroNumber(_selectDateTime.month)}"
|
|
|
|
71
|
+ };
|
|
|
|
72
|
+ StoreDetailModel detailModel =
|
|
|
|
73
|
+ Provider.of<StoreDetailModel>(context, listen: false);
|
|
|
|
74
|
+ fillTimes = await detailModel.getTableFillUpDate(context, params);
|
|
|
|
75
|
+ setState(() {});
|
|
62
|
}
|
76
|
}
|
|
63
|
|
77
|
|
|
64
|
//当前选中时间段
|
78
|
//当前选中时间段
|
|
@@ -90,18 +104,6 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -90,18 +104,6 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
90
|
timeIndex = -1;
|
104
|
timeIndex = -1;
|
|
91
|
enableIndex = 3;
|
105
|
enableIndex = 3;
|
|
92
|
}
|
106
|
}
|
|
93
|
-
|
|
|
|
94
|
- if (widget.timeMills != 0 && widget.ddate_solt != 0) {
|
|
|
|
95
|
- _selectDateTime = DateTime.fromMillisecondsSinceEpoch(widget.timeMills);
|
|
|
|
96
|
- timeIndex = widget.ddate_solt;
|
|
|
|
97
|
- if (!Utils.isOneDay(_selectDateTime, DateTime.now())) {
|
|
|
|
98
|
- //不是今天
|
|
|
|
99
|
- enableIndex = 0;
|
|
|
|
100
|
- }
|
|
|
|
101
|
- widget.timeMills = 0;
|
|
|
|
102
|
- widget.ddate_solt = 0;
|
|
|
|
103
|
- }
|
|
|
|
104
|
-
|
|
|
|
105
|
setState(() {});
|
107
|
setState(() {});
|
|
106
|
}
|
108
|
}
|
|
107
|
|
109
|
|
|
@@ -120,10 +122,8 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -120,10 +122,8 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
120
|
StoreDetailModel detailModel =
|
122
|
StoreDetailModel detailModel =
|
|
121
|
Provider.of<StoreDetailModel>(context, listen: false);
|
123
|
Provider.of<StoreDetailModel>(context, listen: false);
|
|
122
|
tables = await detailModel.getSellerTableClass(context, params);
|
124
|
tables = await detailModel.getSellerTableClass(context, params);
|
|
123
|
- for (int i = 0; i < tables.length; i++) {
|
|
|
|
124
|
- roomNum[i] = 0;
|
|
|
|
125
|
- }
|
|
|
|
126
|
- rooms.clear();
|
125
|
+ // tables.any((element) => element.isFull == 1);
|
|
|
|
126
|
+ // rooms.clear();
|
|
127
|
setState(() {});
|
127
|
setState(() {});
|
|
128
|
}
|
128
|
}
|
|
129
|
|
129
|
|
|
@@ -134,7 +134,9 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -134,7 +134,9 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
134
|
tables = [];
|
134
|
tables = [];
|
|
135
|
_calendarController = CalendarController();
|
135
|
_calendarController = CalendarController();
|
|
136
|
_events = {};
|
136
|
_events = {};
|
|
137
|
- _getStoreDetail();
|
137
|
+ WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
|
|
|
138
|
+ _getStoreDetail();
|
|
|
|
139
|
+ });
|
|
138
|
}
|
140
|
}
|
|
139
|
|
141
|
|
|
140
|
@override
|
142
|
@override
|
|
@@ -156,80 +158,16 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -156,80 +158,16 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
156
|
daily = {"morning": morning, "noon": noon, "night": night};
|
158
|
daily = {"morning": morning, "noon": noon, "night": night};
|
|
157
|
}
|
159
|
}
|
|
158
|
|
160
|
|
|
159
|
- //构建已选包间
|
|
|
|
160
|
- _buildSelectRooms() {
|
|
|
|
161
|
- List<Widget> selectRooms = [];
|
|
|
|
162
|
- for (int i in rooms) {
|
|
|
|
163
|
- selectRooms.add(Container(
|
|
|
|
164
|
- margin: EdgeInsets.only(right: ScreenUtil().setWidth(10)),
|
|
|
|
165
|
- child: Stack(
|
|
|
|
166
|
- children: <Widget>[
|
|
|
|
167
|
- Container(
|
|
|
|
168
|
- width: ScreenUtil().setWidth(150),
|
|
|
|
169
|
- height: ScreenUtil().setWidth(70),
|
|
|
|
170
|
- margin: EdgeInsets.only(
|
|
|
|
171
|
- right: ScreenUtil().setWidth(12),
|
|
|
|
172
|
- top: ScreenUtil().setWidth(12)),
|
|
|
|
173
|
- alignment: Alignment.center,
|
|
|
|
174
|
- decoration: BoxDecoration(
|
|
|
|
175
|
- color: MyColours.color_199095,
|
|
|
|
176
|
- border: Border.all(
|
|
|
|
177
|
- color: MyColours.color_199095,
|
|
|
|
178
|
- width: ScreenUtil().setWidth(2)),
|
|
|
|
179
|
- borderRadius:
|
|
|
|
180
|
- BorderRadius.circular(ScreenUtil().setWidth(10))),
|
|
|
|
181
|
- child: Text(
|
|
|
|
182
|
- "${tables[i].name}",
|
|
|
|
183
|
- maxLines: 1,
|
|
|
|
184
|
- overflow: TextOverflow.ellipsis,
|
|
|
|
185
|
- style: TextStyle(
|
|
|
|
186
|
- fontSize: ScreenUtil().setSp(30),
|
|
|
|
187
|
- color: MyColours.color_199095,
|
|
|
|
188
|
- fontWeight: FontWeight.bold,
|
|
|
|
189
|
- ),
|
|
|
|
190
|
- ),
|
|
|
|
191
|
- ),
|
|
|
|
192
|
- Positioned(
|
|
|
|
193
|
- top: 0,
|
|
|
|
194
|
- right: 0,
|
|
|
|
195
|
- child: GestureDetector(
|
|
|
|
196
|
- onTap: () {
|
|
|
|
197
|
- rooms.remove(i);
|
|
|
|
198
|
- roomNum[i]--;
|
|
|
|
199
|
- setState(() {});
|
|
|
|
200
|
- },
|
|
|
|
201
|
- child: Image.asset(
|
|
|
|
202
|
- "assets/icon_clear.png",
|
|
|
|
203
|
- width: ScreenUtil().setWidth(36),
|
|
|
|
204
|
- height: ScreenUtil().setWidth(36),
|
|
|
|
205
|
- ),
|
|
|
|
206
|
- ),
|
|
|
|
207
|
- )
|
|
|
|
208
|
- ],
|
|
|
|
209
|
- ),
|
|
|
|
210
|
- ));
|
|
|
|
211
|
- }
|
|
|
|
212
|
- return selectRooms;
|
|
|
|
213
|
- }
|
|
|
|
214
|
-
|
|
|
|
215
|
//构建时段
|
161
|
//构建时段
|
|
216
|
Widget _buildShiduan() {
|
162
|
Widget _buildShiduan() {
|
|
217
|
return Container(
|
163
|
return Container(
|
|
218
|
padding: EdgeInsets.only(
|
164
|
padding: EdgeInsets.only(
|
|
219
|
left: ScreenUtil().setWidth(30),
|
165
|
left: ScreenUtil().setWidth(30),
|
|
220
|
- top: ScreenUtil().setWidth(80),
|
166
|
+ top: ScreenUtil().setWidth(60),
|
|
221
|
right: ScreenUtil().setWidth(30)),
|
167
|
right: ScreenUtil().setWidth(30)),
|
|
222
|
child: Column(
|
168
|
child: Column(
|
|
223
|
crossAxisAlignment: CrossAxisAlignment.start,
|
169
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
224
|
children: <Widget>[
|
170
|
children: <Widget>[
|
|
225
|
- Text(
|
|
|
|
226
|
- "预订时段",
|
|
|
|
227
|
- style: TextStyle(
|
|
|
|
228
|
- fontSize: ScreenUtil().setSp(36),
|
|
|
|
229
|
- color: MyColours.color_333333,
|
|
|
|
230
|
- fontWeight: FontWeight.bold),
|
|
|
|
231
|
- ),
|
|
|
|
232
|
- VEmptyView(30),
|
|
|
|
233
|
Stack(
|
171
|
Stack(
|
|
234
|
children: <Widget>[
|
172
|
children: <Widget>[
|
|
235
|
Container(
|
173
|
Container(
|
|
@@ -439,6 +377,11 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -439,6 +377,11 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
439
|
//解析返回显示的日期
|
377
|
//解析返回显示的日期
|
|
440
|
_parseDateDay(DateTime dateTime) {
|
378
|
_parseDateDay(DateTime dateTime) {
|
|
441
|
DateTime now = DateTime.now();
|
379
|
DateTime now = DateTime.now();
|
|
|
|
380
|
+ String dateTimeStr =
|
|
|
|
381
|
+ "${dateTime.year}-${Utils.addZeroNumber(dateTime.month)}-${Utils.addZeroNumber(dateTime.day)}";
|
|
|
|
382
|
+ if (fillTimes.length > 0 && fillTimes.contains(dateTimeStr)) {
|
|
|
|
383
|
+ return "置";
|
|
|
|
384
|
+ }
|
|
442
|
if (Utils.isOneDay(dateTime, now)) {
|
385
|
if (Utils.isOneDay(dateTime, now)) {
|
|
443
|
return "今";
|
386
|
return "今";
|
|
444
|
} else if (Utils.isOneDay(dateTime, now.add(Duration(days: 1)))) {
|
387
|
} else if (Utils.isOneDay(dateTime, now.add(Duration(days: 1)))) {
|
|
@@ -454,10 +397,15 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -454,10 +397,15 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
454
|
Widget build(BuildContext context) {
|
397
|
Widget build(BuildContext context) {
|
|
455
|
userModel = Provider.of<UserModel>(context, listen: false);
|
398
|
userModel = Provider.of<UserModel>(context, listen: false);
|
|
456
|
return Scaffold(
|
399
|
return Scaffold(
|
|
|
|
400
|
+ appBar: SystemAppBar(
|
|
|
|
401
|
+ userModel.user.sellername,
|
|
|
|
402
|
+ onTap: () {
|
|
|
|
403
|
+ Navigator.pop(context);
|
|
|
|
404
|
+ },
|
|
|
|
405
|
+ ),
|
|
457
|
body: Consumer<StoreDetailModel>(
|
406
|
body: Consumer<StoreDetailModel>(
|
|
458
|
builder: (context, model, child) {
|
407
|
builder: (context, model, child) {
|
|
459
|
- Widget widget = Container();
|
|
|
|
460
|
- Container(
|
408
|
+ return Container(
|
|
461
|
width: double.infinity,
|
409
|
width: double.infinity,
|
|
462
|
height: double.infinity,
|
410
|
height: double.infinity,
|
|
463
|
color: MyColours.color_ffffff,
|
411
|
color: MyColours.color_ffffff,
|
|
@@ -484,14 +432,13 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -484,14 +432,13 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
484
|
availableGestures: AvailableGestures.none,
|
432
|
availableGestures: AvailableGestures.none,
|
|
485
|
events: _events,
|
433
|
events: _events,
|
|
486
|
locale: "zh_CN",
|
434
|
locale: "zh_CN",
|
|
487
|
- initialCalendarFormat:
|
|
|
|
488
|
- CalendarFormat.twoWeeks,
|
435
|
+ initialCalendarFormat: CalendarFormat.month,
|
|
489
|
headerStyle: HeaderStyle(
|
436
|
headerStyle: HeaderStyle(
|
|
490
|
decoration: BoxDecoration(
|
437
|
decoration: BoxDecoration(
|
|
491
|
color: MyColours.color_F9F9F9),
|
438
|
color: MyColours.color_F9F9F9),
|
|
492
|
headerPadding: EdgeInsets.zero,
|
439
|
headerPadding: EdgeInsets.zero,
|
|
493
|
formatButtonVisible: false,
|
440
|
formatButtonVisible: false,
|
|
494
|
- centerHeaderTitle: true,
|
441
|
+ centerHeaderTitle: false,
|
|
495
|
titleTextBuilder: (dateTime, _) {
|
442
|
titleTextBuilder: (dateTime, _) {
|
|
496
|
return dateTime.year.toString() +
|
443
|
return dateTime.year.toString() +
|
|
497
|
"年-" +
|
444
|
"年-" +
|
|
@@ -652,32 +599,12 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -652,32 +599,12 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
652
|
width: double.infinity,
|
599
|
width: double.infinity,
|
|
653
|
padding: EdgeInsets.only(
|
600
|
padding: EdgeInsets.only(
|
|
654
|
left: ScreenUtil().setWidth(30),
|
601
|
left: ScreenUtil().setWidth(30),
|
|
655
|
- top: ScreenUtil().setWidth(48),
|
602
|
+ top: ScreenUtil().setWidth(20),
|
|
656
|
right: ScreenUtil().setWidth(30)),
|
603
|
right: ScreenUtil().setWidth(30)),
|
|
657
|
child: Column(
|
604
|
child: Column(
|
|
658
|
crossAxisAlignment: CrossAxisAlignment.start,
|
605
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
659
|
children: <Widget>[
|
606
|
children: <Widget>[
|
|
660
|
- Container(
|
|
|
|
661
|
- height: ScreenUtil().setWidth(82),
|
|
|
|
662
|
- child: Row(
|
|
|
|
663
|
- crossAxisAlignment:
|
|
|
|
664
|
- CrossAxisAlignment.end,
|
|
|
|
665
|
- children: <Widget>[
|
|
|
|
666
|
- Text(
|
|
|
|
667
|
- "选择包间",
|
|
|
|
668
|
- style: TextStyle(
|
|
|
|
669
|
- fontSize: ScreenUtil().setSp(36),
|
|
|
|
670
|
- color: MyColours.color_333333,
|
|
|
|
671
|
- fontWeight: FontWeight.bold),
|
|
|
|
672
|
- ),
|
|
|
|
673
|
- HEmptyView(24),
|
|
|
|
674
|
- Wrap(
|
|
|
|
675
|
- children: _buildSelectRooms(),
|
|
|
|
676
|
- )
|
|
|
|
677
|
- ],
|
|
|
|
678
|
- ),
|
|
|
|
679
|
- ),
|
|
|
|
680
|
- VEmptyView(30),
|
607
|
+ VEmptyView(60),
|
|
681
|
Selector<StoreDetailModel,
|
608
|
Selector<StoreDetailModel,
|
|
682
|
List<SellerTableClassEntity>>(
|
609
|
List<SellerTableClassEntity>>(
|
|
683
|
shouldRebuild: (pre, next) => true,
|
610
|
shouldRebuild: (pre, next) => true,
|
|
@@ -695,39 +622,57 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -695,39 +622,57 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
695
|
itemBuilder: (context, index) {
|
622
|
itemBuilder: (context, index) {
|
|
696
|
return GestureDetector(
|
623
|
return GestureDetector(
|
|
697
|
onTap: () {
|
624
|
onTap: () {
|
|
698
|
- if (tables[index]
|
|
|
|
699
|
- .status
|
|
|
|
700
|
- .toString() ==
|
|
|
|
701
|
- "0") return;
|
|
|
|
702
|
- if ((tables[index]
|
|
|
|
703
|
- .status
|
|
|
|
704
|
- .toString() ==
|
|
|
|
705
|
- "1" &&
|
|
|
|
706
|
- ((tables[index].isFull !=
|
|
|
|
707
|
- null &&
|
|
|
|
708
|
- tables[index]
|
|
|
|
709
|
- .isFull
|
|
|
|
710
|
- .toString() ==
|
|
|
|
711
|
- "1") ||
|
|
|
|
712
|
- (tables[index]
|
|
|
|
713
|
- .isorderFull !=
|
|
|
|
714
|
- null &&
|
|
|
|
715
|
- tables[index]
|
|
|
|
716
|
- .isorderFull
|
|
|
|
717
|
- .toString() ==
|
|
|
|
718
|
- "1")))) return;
|
|
|
|
719
|
- int selectNum = 0;
|
|
|
|
720
|
- roomNum.forEach((index, value) {
|
|
|
|
721
|
- selectNum += value;
|
|
|
|
722
|
- });
|
|
|
|
723
|
- if (selectNum >= 3) {
|
|
|
|
724
|
- Utils.showToast("最多可选3个包间");
|
|
|
|
725
|
- return;
|
625
|
+ // if (tables[index]
|
|
|
|
626
|
+ // .status
|
|
|
|
627
|
+ // .toString() ==
|
|
|
|
628
|
+ // "0") return;
|
|
|
|
629
|
+ // if ((tables[index]
|
|
|
|
630
|
+ // .status
|
|
|
|
631
|
+ // .toString() ==
|
|
|
|
632
|
+ // "1" &&
|
|
|
|
633
|
+ // ((tables[index].isFull !=
|
|
|
|
634
|
+ // null &&
|
|
|
|
635
|
+ // tables[index]
|
|
|
|
636
|
+ // .isFull
|
|
|
|
637
|
+ // .toString() ==
|
|
|
|
638
|
+ // "1") ||
|
|
|
|
639
|
+ // (tables[index]
|
|
|
|
640
|
+ // .isorderFull !=
|
|
|
|
641
|
+ // null &&
|
|
|
|
642
|
+ // tables[index]
|
|
|
|
643
|
+ // .isorderFull
|
|
|
|
644
|
+ // .toString() ==
|
|
|
|
645
|
+ // "1")))) return;
|
|
|
|
646
|
+ // int selectNum = 0;
|
|
|
|
647
|
+ // roomNum.forEach((index, value) {
|
|
|
|
648
|
+ // selectNum += value;
|
|
|
|
649
|
+ // });
|
|
|
|
650
|
+ // if (selectNum >= 3) {
|
|
|
|
651
|
+ // Utils.showToast("最多可选3个包间");
|
|
|
|
652
|
+ // return;
|
|
|
|
653
|
+ // }
|
|
|
|
654
|
+ // setState(() {
|
|
|
|
655
|
+ // roomNum[index]++;
|
|
|
|
656
|
+ // rooms.add(index);
|
|
|
|
657
|
+ // });
|
|
|
|
658
|
+ Map<String, String> params = {
|
|
|
|
659
|
+ "classid": tables[index].id,
|
|
|
|
660
|
+ "day": (DateTime.parse(
|
|
|
|
661
|
+ "${_selectDateTime.year}-${Utils.addZeroNumber(_selectDateTime.month)}-${Utils.addZeroNumber(_selectDateTime.day)} 00:00:00")
|
|
|
|
662
|
+ .millisecondsSinceEpoch /
|
|
|
|
663
|
+ 1000)
|
|
|
|
664
|
+ .floor()
|
|
|
|
665
|
+ .toString(),
|
|
|
|
666
|
+ "interval":
|
|
|
|
667
|
+ (timeIndex + 1).toString()
|
|
|
|
668
|
+ };
|
|
|
|
669
|
+ if (tables[index].isFull == 1 &&
|
|
|
|
670
|
+ tables[index].fid != null) {
|
|
|
|
671
|
+ params['id'] =
|
|
|
|
672
|
+ tables[index].fid;
|
|
726
|
}
|
673
|
}
|
|
727
|
- setState(() {
|
|
|
|
728
|
- roomNum[index]++;
|
|
|
|
729
|
- rooms.add(index);
|
|
|
|
730
|
- });
|
674
|
+ model.setTableClassFull(
|
|
|
|
675
|
+ context, params, index);
|
|
731
|
},
|
676
|
},
|
|
732
|
child: Stack(
|
677
|
child: Stack(
|
|
733
|
children: <Widget>[
|
678
|
children: <Widget>[
|
|
@@ -750,12 +695,8 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -750,12 +695,8 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
750
|
ScreenUtil()
|
695
|
ScreenUtil()
|
|
751
|
.setWidth(10)),
|
696
|
.setWidth(10)),
|
|
752
|
border: Border.all(
|
697
|
border: Border.all(
|
|
753
|
- color: roomNum[index] >
|
|
|
|
754
|
- 0
|
|
|
|
755
|
- ? MyColours
|
|
|
|
756
|
- .color_199095
|
|
|
|
757
|
- : MyColours
|
|
|
|
758
|
- .color_cccccc,
|
698
|
+ color: MyColours
|
|
|
|
699
|
+ .color_cccccc,
|
|
759
|
width: ScreenUtil()
|
700
|
width: ScreenUtil()
|
|
760
|
.setWidth(2)),
|
701
|
.setWidth(2)),
|
|
761
|
),
|
702
|
),
|
|
@@ -824,7 +765,10 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -824,7 +765,10 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
824
|
Positioned(
|
765
|
Positioned(
|
|
825
|
right: 0,
|
766
|
right: 0,
|
|
826
|
top: 0,
|
767
|
top: 0,
|
|
827
|
- child: roomNum[index] > 0
|
768
|
+ child: tables[index].isFull !=
|
|
|
|
769
|
+ null &&
|
|
|
|
770
|
+ tables[index].isFull >
|
|
|
|
771
|
+ 0
|
|
828
|
? Container(
|
772
|
? Container(
|
|
829
|
width: ScreenUtil()
|
773
|
width: ScreenUtil()
|
|
830
|
.setWidth(92),
|
774
|
.setWidth(92),
|
|
@@ -835,14 +779,7 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -835,14 +779,7 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
835
|
decoration:
|
779
|
decoration:
|
|
836
|
BoxDecoration(
|
780
|
BoxDecoration(
|
|
837
|
color: MyColours
|
781
|
color: MyColours
|
|
838
|
- .color_F4FAFF,
|
|
|
|
839
|
- border: Border.all(
|
|
|
|
840
|
- color: MyColours
|
|
|
|
841
|
- .color_199095,
|
|
|
|
842
|
- width:
|
|
|
|
843
|
- ScreenUtil()
|
|
|
|
844
|
- .setWidth(
|
|
|
|
845
|
- 2)),
|
782
|
+ .color_dfdfdf,
|
|
846
|
borderRadius: BorderRadius.only(
|
783
|
borderRadius: BorderRadius.only(
|
|
847
|
topRight: Radius.circular(
|
784
|
topRight: Radius.circular(
|
|
848
|
ScreenUtil()
|
785
|
ScreenUtil()
|
|
@@ -854,71 +791,18 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -854,71 +791,18 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
854
|
10))),
|
791
|
10))),
|
|
855
|
),
|
792
|
),
|
|
856
|
child: Text(
|
793
|
child: Text(
|
|
857
|
- "已选${roomNum[index]}",
|
794
|
+ "置满",
|
|
858
|
style: TextStyle(
|
795
|
style: TextStyle(
|
|
859
|
- fontSize:
|
|
|
|
860
|
- ScreenUtil()
|
|
|
|
861
|
- .setSp(
|
|
|
|
862
|
- 24),
|
|
|
|
863
|
- color: MyColours
|
|
|
|
864
|
- .color_199095),
|
|
|
|
865
|
- ),
|
|
|
|
866
|
- )
|
796
|
+ fontSize:
|
|
|
|
797
|
+ ScreenUtil()
|
|
|
|
798
|
+ .setSp(
|
|
|
|
799
|
+ 24),
|
|
|
|
800
|
+ color: MyColours
|
|
|
|
801
|
+ .color_333333,
|
|
|
|
802
|
+ ),
|
|
|
|
803
|
+ ))
|
|
867
|
: Container(),
|
804
|
: Container(),
|
|
868
|
),
|
805
|
),
|
|
869
|
- (tables[index]
|
|
|
|
870
|
- .status
|
|
|
|
871
|
- .toString() ==
|
|
|
|
872
|
- "1" &&
|
|
|
|
873
|
- ((tables[index].isFull !=
|
|
|
|
874
|
- null &&
|
|
|
|
875
|
- tables[index]
|
|
|
|
876
|
- .isFull
|
|
|
|
877
|
- .toString() ==
|
|
|
|
878
|
- "1") ||
|
|
|
|
879
|
- (tables[index]
|
|
|
|
880
|
- .isorderFull !=
|
|
|
|
881
|
- null &&
|
|
|
|
882
|
- tables[index]
|
|
|
|
883
|
- .isorderFull
|
|
|
|
884
|
- .toString() ==
|
|
|
|
885
|
- "1")))
|
|
|
|
886
|
- ? Positioned(
|
|
|
|
887
|
- right: 0,
|
|
|
|
888
|
- bottom: 0,
|
|
|
|
889
|
- child: Container(
|
|
|
|
890
|
- width: ScreenUtil()
|
|
|
|
891
|
- .setWidth(90),
|
|
|
|
892
|
- height: ScreenUtil()
|
|
|
|
893
|
- .setWidth(76),
|
|
|
|
894
|
- child: Container(
|
|
|
|
895
|
- child: Text(
|
|
|
|
896
|
- "订满",
|
|
|
|
897
|
- style: TextStyle(
|
|
|
|
898
|
- color: MyColours
|
|
|
|
899
|
- .color_999999,
|
|
|
|
900
|
- fontSize:
|
|
|
|
901
|
- ScreenUtil()
|
|
|
|
902
|
- .setSp(
|
|
|
|
903
|
- 24)),
|
|
|
|
904
|
- ),
|
|
|
|
905
|
- margin: EdgeInsets.only(
|
|
|
|
906
|
- left: ScreenUtil()
|
|
|
|
907
|
- .setWidth(
|
|
|
|
908
|
- 28),
|
|
|
|
909
|
- top: ScreenUtil()
|
|
|
|
910
|
- .setWidth(
|
|
|
|
911
|
- 28)),
|
|
|
|
912
|
- ),
|
|
|
|
913
|
- decoration: BoxDecoration(
|
|
|
|
914
|
- image: DecorationImage(
|
|
|
|
915
|
- image: AssetImage(
|
|
|
|
916
|
- "assets/icon_man.png"),
|
|
|
|
917
|
- fit: BoxFit
|
|
|
|
918
|
- .cover)),
|
|
|
|
919
|
- ),
|
|
|
|
920
|
- )
|
|
|
|
921
|
- : Container()
|
|
|
|
922
|
],
|
806
|
],
|
|
923
|
),
|
807
|
),
|
|
924
|
);
|
808
|
);
|
|
@@ -938,57 +822,8 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
@@ -938,57 +822,8 @@ class StoreTypeFillManagePageState extends State<StoreTypeFillManagePage> { |
|
938
|
),
|
822
|
),
|
|
939
|
),
|
823
|
),
|
|
940
|
),
|
824
|
),
|
|
941
|
- Offstage(
|
|
|
|
942
|
- offstage: enableIndex > 2,
|
|
|
|
943
|
- child: Container(
|
|
|
|
944
|
- height: ScreenUtil().setWidth(116),
|
|
|
|
945
|
- alignment: Alignment.center,
|
|
|
|
946
|
- decoration: BoxDecoration(
|
|
|
|
947
|
- color: MyColours.color_ffffff,
|
|
|
|
948
|
- boxShadow: [
|
|
|
|
949
|
- BoxShadow(
|
|
|
|
950
|
- color: MyColours.color_EEF0F2,
|
|
|
|
951
|
- blurRadius: ScreenUtil().setWidth(8))
|
|
|
|
952
|
- ]),
|
|
|
|
953
|
- child: GestureDetector(
|
|
|
|
954
|
- onTap: () {
|
|
|
|
955
|
- if (rooms.length <= 0) {
|
|
|
|
956
|
- Utils.showToast("请选择包间");
|
|
|
|
957
|
- return;
|
|
|
|
958
|
- }
|
|
|
|
959
|
- },
|
|
|
|
960
|
- child: Container(
|
|
|
|
961
|
- width: ScreenUtil().setWidth(670),
|
|
|
|
962
|
- height: ScreenUtil().setWidth(84),
|
|
|
|
963
|
- decoration: rooms.length > 0
|
|
|
|
964
|
- ? BoxDecoration(
|
|
|
|
965
|
- gradient: LinearGradient(colors: [
|
|
|
|
966
|
- MyColours.color_2bb5b7,
|
|
|
|
967
|
- MyColours.color_199095
|
|
|
|
968
|
- ]),
|
|
|
|
969
|
- borderRadius: BorderRadius.circular(
|
|
|
|
970
|
- ScreenUtil().setWidth(44)),
|
|
|
|
971
|
- )
|
|
|
|
972
|
- : BoxDecoration(
|
|
|
|
973
|
- color: MyColours.color_cccccc,
|
|
|
|
974
|
- borderRadius: BorderRadius.circular(
|
|
|
|
975
|
- ScreenUtil().setWidth(44)),
|
|
|
|
976
|
- ),
|
|
|
|
977
|
- alignment: Alignment.center,
|
|
|
|
978
|
- child: Text(
|
|
|
|
979
|
- "选好了",
|
|
|
|
980
|
- style: TextStyle(
|
|
|
|
981
|
- fontSize: ScreenUtil().setSp(36),
|
|
|
|
982
|
- color: MyColours.color_ffffff,
|
|
|
|
983
|
- fontWeight: FontWeight.bold),
|
|
|
|
984
|
- ),
|
|
|
|
985
|
- ),
|
|
|
|
986
|
- ),
|
|
|
|
987
|
- ),
|
|
|
|
988
|
- )
|
|
|
|
989
|
],
|
825
|
],
|
|
990
|
));
|
826
|
));
|
|
991
|
- return widget;
|
|
|
|
992
|
},
|
827
|
},
|
|
993
|
),
|
828
|
),
|
|
994
|
);
|
829
|
);
|