|
@@ -32,6 +32,7 @@ import 'package:one_key/widgets/v_empty_view.dart'; |
|
@@ -32,6 +32,7 @@ import 'package:one_key/widgets/v_empty_view.dart'; |
|
32
|
import 'package:provider/provider.dart';
|
32
|
import 'package:provider/provider.dart';
|
|
33
|
import 'dart:convert' as convert;
|
33
|
import 'dart:convert' as convert;
|
|
34
|
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
34
|
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
|
|
|
35
|
+import 'package:one_key/models/table_list.dart' as table;
|
|
35
|
|
36
|
|
|
36
|
const scrollDuration = Duration(microseconds: 500);
|
37
|
const scrollDuration = Duration(microseconds: 500);
|
|
37
|
|
38
|
|
|
@@ -55,7 +56,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -55,7 +56,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
55
|
List<String> personNumList = [];
|
56
|
List<String> personNumList = [];
|
|
56
|
bool isSelected = true; //全部按钮
|
57
|
bool isSelected = true; //全部按钮
|
|
57
|
|
58
|
|
|
58
|
- ScrollController _scrollCrl = ScrollController();
|
59
|
+ // ScrollController _scrollCrl = ScrollController();
|
|
59
|
final ItemPositionsListener itemPositionsListener =
|
60
|
final ItemPositionsListener itemPositionsListener =
|
|
60
|
ItemPositionsListener.create();
|
61
|
ItemPositionsListener.create();
|
|
61
|
|
62
|
|
|
@@ -264,10 +265,10 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -264,10 +265,10 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
264
|
tableManagerModel.selectTables
|
265
|
tableManagerModel.selectTables
|
|
265
|
.removeWhere((t) => t.id == table.id);
|
266
|
.removeWhere((t) => t.id == table.id);
|
|
266
|
}
|
267
|
}
|
|
267
|
- if (tableManagerModel.selectTables.length > 1) {
|
|
|
|
268
|
- _scrollCrl.position
|
|
|
|
269
|
- .didUpdateScrollPositionBy(0); //这里触发更新滚动条
|
|
|
|
270
|
- }
|
268
|
+ // if (tableManagerModel.selectTables.length > 1) {
|
|
|
|
269
|
+ // _scrollCrl.position
|
|
|
|
270
|
+ // .didUpdateScrollPositionBy(0); //这里触发更新滚动条
|
|
|
|
271
|
+ // }
|
|
271
|
});
|
272
|
});
|
|
272
|
}
|
273
|
}
|
|
273
|
// DialogUtil.showTableManagerDialog(context, table).then((value) {
|
274
|
// DialogUtil.showTableManagerDialog(context, table).then((value) {
|
|
@@ -349,268 +350,455 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -349,268 +350,455 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
349
|
|
350
|
|
|
350
|
///选中的桌子widget
|
351
|
///选中的桌子widget
|
|
351
|
Widget _selectTableWidget() {
|
352
|
Widget _selectTableWidget() {
|
|
352
|
- return Expanded(
|
|
|
|
353
|
- flex: 1,
|
|
|
|
354
|
- child: Container(
|
|
|
|
355
|
- // constraints: BoxConstraints(minHeight: ScreenUtil().setWidth(600)),
|
|
|
|
356
|
- // height: ScreenUtil().setWidth(400),
|
|
|
|
357
|
- width: double.infinity,
|
|
|
|
358
|
- padding: EdgeInsets.only(
|
|
|
|
359
|
- left: ScreenUtil().setWidth(40),
|
|
|
|
360
|
- right: ScreenUtil().setWidth(40),
|
|
|
|
361
|
- top: ScreenUtil().setWidth(30)),
|
|
|
|
362
|
- decoration: BoxDecoration(
|
|
|
|
363
|
- color: MyColours.color_ffffff,
|
|
|
|
364
|
- boxShadow: [
|
|
|
|
365
|
- BoxShadow(
|
|
|
|
366
|
- color: MyColours.color_333333,
|
|
|
|
367
|
- blurRadius: ScreenUtil().setWidth(14))
|
|
|
|
368
|
- ],
|
|
|
|
369
|
- borderRadius: BorderRadius.only(
|
|
|
|
370
|
- topLeft: Radius.circular(ScreenUtil().setWidth(30)),
|
|
|
|
371
|
- topRight: Radius.circular(ScreenUtil().setWidth(30)),
|
|
|
|
372
|
- )),
|
|
|
|
373
|
- child: Row(
|
|
|
|
374
|
- // mainAxisSize: MainAxisSize.min,
|
353
|
+ return Container(
|
|
|
|
354
|
+ // constraints: BoxConstraints(maxHeight: ScreenUtil().setWidth(760)),
|
|
|
|
355
|
+ // height: ScreenUtil().setWidth(400),
|
|
|
|
356
|
+ width: double.infinity,
|
|
|
|
357
|
+ padding: EdgeInsets.only(
|
|
|
|
358
|
+ left: ScreenUtil().setWidth(40),
|
|
|
|
359
|
+ right: ScreenUtil().setWidth(40),
|
|
|
|
360
|
+ top: ScreenUtil().setWidth(15)),
|
|
|
|
361
|
+ decoration: BoxDecoration(
|
|
|
|
362
|
+ color: MyColours.color_ffffff,
|
|
|
|
363
|
+ boxShadow: [
|
|
|
|
364
|
+ BoxShadow(
|
|
|
|
365
|
+ color: MyColours.color_333333,
|
|
|
|
366
|
+ blurRadius: ScreenUtil().setWidth(14))
|
|
|
|
367
|
+ ],
|
|
|
|
368
|
+ borderRadius: BorderRadius.only(
|
|
|
|
369
|
+ topLeft: Radius.circular(ScreenUtil().setWidth(30)),
|
|
|
|
370
|
+ topRight: Radius.circular(ScreenUtil().setWidth(30)),
|
|
|
|
371
|
+ )),
|
|
|
|
372
|
+ child: Column(
|
|
|
|
373
|
+ // mainAxisSize: MainAxisSize.min,
|
|
|
|
374
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
375
|
+ children: [
|
|
|
|
376
|
+ Row(
|
|
|
|
377
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
375
|
children: [
|
378
|
children: [
|
|
376
|
Column(
|
379
|
Column(
|
|
|
|
380
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
377
|
crossAxisAlignment: CrossAxisAlignment.start,
|
381
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
378
|
children: [
|
382
|
children: [
|
|
379
|
Text(
|
383
|
Text(
|
|
380
|
tableManagerModel.selectDateStr,
|
384
|
tableManagerModel.selectDateStr,
|
|
381
|
style: TextStyle(
|
385
|
style: TextStyle(
|
|
382
|
color: MyColours.color_333333,
|
386
|
color: MyColours.color_333333,
|
|
383
|
- fontSize: ScreenUtil().setSp(28)),
|
387
|
+ fontSize: ScreenUtil().setSp(45),
|
|
|
|
388
|
+ fontWeight: FontWeight.bold),
|
|
384
|
),
|
389
|
),
|
|
385
|
- VEmptyView(15),
|
|
|
|
386
|
Text(
|
390
|
Text(
|
|
387
|
- '已选桌位:',
|
391
|
+ tableManagerModel.selectWeekAndLunarCalendar,
|
|
388
|
style: TextStyle(
|
392
|
style: TextStyle(
|
|
389
|
color: MyColours.color_333333,
|
393
|
color: MyColours.color_333333,
|
|
390
|
- fontSize: ScreenUtil().setSp(26)),
|
394
|
+ fontSize: ScreenUtil().setSp(30)),
|
|
391
|
),
|
395
|
),
|
|
392
|
- VEmptyView(15),
|
|
|
|
393
|
- Expanded(
|
|
|
|
394
|
- child: Container(
|
|
|
|
395
|
- width: ScreenUtil.screenWidthDp -
|
|
|
|
396
|
- ScreenUtil().setWidth(100 + 180),
|
|
|
|
397
|
- // height: ScreenUtil().setWidth(200),
|
|
|
|
398
|
- // color: Colors.blueAccent,
|
|
|
|
399
|
- child:
|
|
|
|
400
|
- // ListView.builder(
|
|
|
|
401
|
- // shrinkWrap: true,
|
|
|
|
402
|
- // itemBuilder: (BuildContext context, int index) {
|
|
|
|
403
|
- // return
|
|
|
|
404
|
- Scrollbar(
|
|
|
|
405
|
- isAlwaysShown: true, //设置滚动条常亮
|
|
|
|
406
|
- controller: _scrollCrl, //必须设置一个controller
|
|
|
|
407
|
-
|
|
|
|
408
|
- ///添加进度条
|
|
|
|
409
|
- child: SingleChildScrollView(
|
|
|
|
410
|
- controller: _scrollCrl,
|
|
|
|
411
|
- child: Container(
|
|
|
|
412
|
- width: ScreenUtil.screenWidthDp -
|
|
|
|
413
|
- ScreenUtil().setWidth(100 + 180),
|
|
|
|
414
|
- child: Wrap(
|
|
|
|
415
|
- spacing: ScreenUtil().setWidth(20),
|
|
|
|
416
|
- runSpacing:
|
|
|
|
417
|
- ScreenUtil().setWidth(20),
|
|
|
|
418
|
- children: _buildAlwayItems())),
|
|
|
|
419
|
- ))
|
|
|
|
420
|
- // },
|
|
|
|
421
|
- // itemCount: 1,
|
|
|
|
422
|
- // ),
|
|
|
|
423
|
- ))
|
|
|
|
424
|
],
|
396
|
],
|
|
425
|
),
|
397
|
),
|
|
426
|
- HEmptyView(20),
|
398
|
+ Spacer(),
|
|
|
|
399
|
+ Padding(
|
|
|
|
400
|
+ padding: EdgeInsets.only(
|
|
|
|
401
|
+ top: ScreenUtil().setWidth(6),
|
|
|
|
402
|
+ ),
|
|
|
|
403
|
+ child: Text(
|
|
|
|
404
|
+ tableManagerModel.doltStr,
|
|
|
|
405
|
+ style: TextStyle(
|
|
|
|
406
|
+ color: MyColours.color_333333,
|
|
|
|
407
|
+ fontSize: ScreenUtil().setSp(48),
|
|
|
|
408
|
+ fontWeight: FontWeight.bold),
|
|
|
|
409
|
+ ),
|
|
|
|
410
|
+ ),
|
|
|
|
411
|
+ ],
|
|
|
|
412
|
+ ),
|
|
|
|
413
|
+ VEmptyView(40),
|
|
|
|
414
|
+ Row(
|
|
|
|
415
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
416
|
+ children: [
|
|
|
|
417
|
+ // HEmptyView(15),
|
|
|
|
418
|
+ Padding(
|
|
|
|
419
|
+ // width: ScreenUtil().setWidth(120),
|
|
|
|
420
|
+ padding: EdgeInsets.only(top: ScreenUtil().setWidth(10)),
|
|
|
|
421
|
+ child: Text(
|
|
|
|
422
|
+ '已选桌位:',
|
|
|
|
423
|
+ style: TextStyle(
|
|
|
|
424
|
+ color: MyColours.color_333333,
|
|
|
|
425
|
+ fontSize: ScreenUtil().setSp(26)),
|
|
|
|
426
|
+ )),
|
|
|
|
427
|
+ HEmptyView(15),
|
|
|
|
428
|
+ // Expanded(
|
|
|
|
429
|
+ // child:
|
|
|
|
430
|
+ // width: ScreenUtil.screenWidthDp -
|
|
|
|
431
|
+ // ScreenUtil().setWidth(160),
|
|
|
|
432
|
+ // constraints:
|
|
|
|
433
|
+ // BoxConstraints(maxHeight: ScreenUtil().setWidth(140)),
|
|
|
|
434
|
+ // color: Colors.blueAccent,
|
|
|
|
435
|
+
|
|
|
|
436
|
+ // ListView.builder(
|
|
|
|
437
|
+ // shrinkWrap: true,
|
|
|
|
438
|
+ // itemBuilder: (BuildContext context, int index) {
|
|
|
|
439
|
+ // return
|
|
|
|
440
|
+ // Scrollbar(
|
|
|
|
441
|
+ // isAlwaysShown: true, //设置滚动条常亮
|
|
|
|
442
|
+ // controller: _scrollCrl, //必须设置一个controller
|
|
|
|
443
|
+
|
|
|
|
444
|
+ // ///添加进度条
|
|
|
|
445
|
+ // child:
|
|
|
|
446
|
+ // SingleChildScrollView(
|
|
|
|
447
|
+ // controller: _scrollCrl,
|
|
|
|
448
|
+ // child:
|
|
427
|
Container(
|
449
|
Container(
|
|
428
|
- // width: ScreenUtil().setWidth(100),
|
|
|
|
429
|
- // color: Colors.red,
|
|
|
|
430
|
- constraints: BoxConstraints(
|
|
|
|
431
|
- minHeight: ScreenUtil().setWidth(500),
|
450
|
+ // color: Colors.red,
|
|
|
|
451
|
+ width: ScreenUtil.screenWidthDp -
|
|
|
|
452
|
+ ScreenUtil().setWidth(100 + 130),
|
|
|
|
453
|
+ child: Wrap(
|
|
|
|
454
|
+ spacing: ScreenUtil().setWidth(20),
|
|
|
|
455
|
+ runSpacing: ScreenUtil().setWidth(20),
|
|
|
|
456
|
+ children: _buildAlwayItems())),
|
|
|
|
457
|
+ // )
|
|
|
|
458
|
+ // )
|
|
|
|
459
|
+ // },
|
|
|
|
460
|
+ // itemCount: 1,
|
|
|
|
461
|
+ // ),
|
|
|
|
462
|
+ // )
|
|
|
|
463
|
+ ],
|
|
|
|
464
|
+ ),
|
|
|
|
465
|
+ VEmptyView(40),
|
|
|
|
466
|
+ Container(
|
|
|
|
467
|
+ // width: ScreenUtil().setWidth(100),
|
|
|
|
468
|
+ // color: Colors.red,
|
|
|
|
469
|
+ // constraints: BoxConstraints(
|
|
|
|
470
|
+ // minHeight: ScreenUtil().setWidth(500),
|
|
|
|
471
|
+ // ),
|
|
|
|
472
|
+ child: Row(
|
|
|
|
473
|
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
474
|
+ children: [
|
|
|
|
475
|
+ InkWell(
|
|
|
|
476
|
+ onTap: () {
|
|
|
|
477
|
+ tableManagerModel.selectTables = [];
|
|
|
|
478
|
+ for (t.Table item in tableManagerModel.tablesShow) {
|
|
|
|
479
|
+ item.selected = false;
|
|
|
|
480
|
+ }
|
|
|
|
481
|
+ tableManagerModel.areaTableMapShow.forEach((key, value) {
|
|
|
|
482
|
+ value.forEach((element) {
|
|
|
|
483
|
+ element.selected = false;
|
|
|
|
484
|
+ });
|
|
|
|
485
|
+ });
|
|
|
|
486
|
+
|
|
|
|
487
|
+ tableManagerModel.notifyListeners();
|
|
|
|
488
|
+ },
|
|
|
|
489
|
+ child: Container(
|
|
|
|
490
|
+ padding: EdgeInsets.all(
|
|
|
|
491
|
+ ScreenUtil().setWidth(30),
|
|
|
|
492
|
+ ),
|
|
|
|
493
|
+ child: Text(
|
|
|
|
494
|
+ '取消重置',
|
|
|
|
495
|
+ style: TextStyle(
|
|
|
|
496
|
+ color: MyColours.color_199095,
|
|
|
|
497
|
+ fontSize: ScreenUtil().setSp(26)),
|
|
|
|
498
|
+ ),
|
|
|
|
499
|
+ ),
|
|
432
|
),
|
500
|
),
|
|
433
|
- child: Column(
|
|
|
|
434
|
- children: [
|
|
|
|
435
|
- RoundButton(
|
|
|
|
436
|
- onPressed: () async {
|
|
|
|
437
|
- SunReserveInfoModel _model = await tableManagerModel
|
|
|
|
438
|
- .setReserveInfo(context, needKeep: true);
|
|
|
|
439
|
- if (_model != null &&
|
|
|
|
440
|
- ObjectUtil.isNotEmpty(_model.row) &&
|
|
|
|
441
|
- ObjectUtil.isNotEmpty(_model.row.id)) {
|
|
|
|
442
|
- print('成功');
|
|
|
|
443
|
- tableManagerModel.selectTables = [];
|
|
|
|
444
|
- // _homeEnterModel.clearData();
|
|
|
|
445
|
- bus.emit("refresh_tablemanager"); //刷新当前页面
|
|
|
|
446
|
- bus.emit("refresh_book_list"); //刷新已预订列表
|
|
|
|
447
|
- //进入订座详情页面
|
|
|
|
448
|
- NavigatorUtil.goNotebookDetailPage(
|
|
|
|
449
|
- context,
|
|
|
|
450
|
- _model.row.id,
|
|
|
|
451
|
- Provider.of<UserModel>(context, listen: false)
|
|
|
|
452
|
- .user
|
|
|
|
453
|
- .openid,
|
|
|
|
454
|
- );
|
|
|
|
455
|
- // String ddate_solt = '';
|
|
|
|
456
|
- // if (_model.row.isSetDdate == '1') {
|
|
|
|
457
|
- // String createtime =
|
|
|
|
458
|
- // _model.row.ddate.toString() + '000';
|
|
|
|
459
|
- // DateTime createTime =
|
|
|
|
460
|
- // DateTime.fromMillisecondsSinceEpoch(
|
|
|
|
461
|
- // int.parse(createtime));
|
|
|
|
462
|
- // ddate_solt = DateUtil.formatDate(createTime,
|
|
|
|
463
|
- // format: DateFormats.h_m);
|
|
|
|
464
|
- // } else {
|
|
|
|
465
|
- // if (_model.row.ddateSolt == '1') {
|
|
|
|
466
|
- // ddate_solt = '早餐';
|
|
|
|
467
|
- // } else if (_model.row.ddateSolt == '2') {
|
|
|
|
468
|
- // ddate_solt = '午餐';
|
|
|
|
469
|
- // } else if (_model.row.ddateSolt == '3') {
|
|
|
|
470
|
- // ddate_solt = '晚餐';
|
|
|
|
471
|
- // }
|
|
|
|
472
|
- // }
|
|
|
|
473
|
- // List<dynamic> tableinfo =
|
|
|
|
474
|
- // convert.jsonDecode(_model.row.tableinfo);
|
|
|
|
475
|
- // print(tableinfo);
|
501
|
+ RoundButton(
|
|
|
|
502
|
+ onPressed: () async {
|
|
|
|
503
|
+ SunReserveInfoModel _model = await tableManagerModel
|
|
|
|
504
|
+ .setReserveInfo(context, needKeep: true);
|
|
|
|
505
|
+ if (_model != null &&
|
|
|
|
506
|
+ ObjectUtil.isNotEmpty(_model.row) &&
|
|
|
|
507
|
+ ObjectUtil.isNotEmpty(_model.row.id)) {
|
|
|
|
508
|
+ print('成功');
|
|
|
|
509
|
+ tableManagerModel.selectTables = [];
|
|
|
|
510
|
+ // _homeEnterModel.clearData();
|
|
|
|
511
|
+ bus.emit("refresh_tablemanager"); //刷新当前页面
|
|
|
|
512
|
+ bus.emit("refresh_book_list"); //刷新已预订列表
|
|
|
|
513
|
+ //进入订座详情页面
|
|
|
|
514
|
+ NavigatorUtil.goNotebookDetailPage(
|
|
|
|
515
|
+ context,
|
|
|
|
516
|
+ _model.row.id,
|
|
|
|
517
|
+ Provider.of<UserModel>(context, listen: false)
|
|
|
|
518
|
+ .user
|
|
|
|
519
|
+ .openid,
|
|
|
|
520
|
+ );
|
|
|
|
521
|
+ // String ddate_solt = '';
|
|
|
|
522
|
+ // if (_model.row.isSetDdate == '1') {
|
|
|
|
523
|
+ // String createtime =
|
|
|
|
524
|
+ // _model.row.ddate.toString() + '000';
|
|
|
|
525
|
+ // DateTime createTime =
|
|
|
|
526
|
+ // DateTime.fromMillisecondsSinceEpoch(
|
|
|
|
527
|
+ // int.parse(createtime));
|
|
|
|
528
|
+ // ddate_solt = DateUtil.formatDate(createTime,
|
|
|
|
529
|
+ // format: DateFormats.h_m);
|
|
|
|
530
|
+ // } else {
|
|
|
|
531
|
+ // if (_model.row.ddateSolt == '1') {
|
|
|
|
532
|
+ // ddate_solt = '早餐';
|
|
|
|
533
|
+ // } else if (_model.row.ddateSolt == '2') {
|
|
|
|
534
|
+ // ddate_solt = '午餐';
|
|
|
|
535
|
+ // } else if (_model.row.ddateSolt == '3') {
|
|
|
|
536
|
+ // ddate_solt = '晚餐';
|
|
|
|
537
|
+ // }
|
|
|
|
538
|
+ // }
|
|
|
|
539
|
+ // List<dynamic> tableinfo =
|
|
|
|
540
|
+ // convert.jsonDecode(_model.row.tableinfo);
|
|
|
|
541
|
+ // print(tableinfo);
|
|
476
|
|
542
|
|
|
477
|
- // String _nameStr =
|
|
|
|
478
|
- // t.TableList.fromJson(tableinfo[0]).name;
|
|
|
|
479
|
- // if (tableinfo.length > 1) {
|
|
|
|
480
|
- // _nameStr = t.TableList.fromJson(tableinfo[0]).name +
|
|
|
|
481
|
- // '等${tableinfo.length}桌';
|
|
|
|
482
|
- // }
|
|
|
|
483
|
- // LogUtil.v(_nameStr);
|
|
|
|
484
|
- // String _tid = '';
|
|
|
|
485
|
- // for (int i = 0; i < tableinfo.length; i++) {
|
|
|
|
486
|
- // _tid += '${t.TableList.fromJson(tableinfo[i]).id},';
|
|
|
|
487
|
- // }
|
|
|
|
488
|
- // if (_tid.endsWith(',')) {
|
|
|
|
489
|
- // _tid = _tid.substring(0, _tid.length - 1);
|
|
|
|
490
|
- // }
|
|
|
|
491
|
- // NavigatorUtil.goInvicationPage(
|
|
|
|
492
|
- // context,
|
|
|
|
493
|
- // _model.row.id,
|
|
|
|
494
|
- // _nameStr,
|
|
|
|
495
|
- // _model.row.ddate,
|
|
|
|
496
|
- // ddate_solt,
|
|
|
|
497
|
- // _model.row.phone,
|
|
|
|
498
|
- // _model.row.ddateSolt,
|
|
|
|
499
|
- // tid: _tid,
|
|
|
|
500
|
- // replace: false);
|
|
|
|
501
|
- // //今天 明天 其他天
|
|
|
|
502
|
- // String tempTime = _homeEnterModel.ddateStr;
|
|
|
|
503
|
- // if (_homeEnterModel.ddateStr == '') {
|
|
|
|
504
|
- // if (currTimeIndex == 1) {
|
|
|
|
505
|
- // tempTime = '08:00';
|
|
|
|
506
|
- // } else if (currTimeIndex == 2) {
|
|
|
|
507
|
- // tempTime = '12:00';
|
|
|
|
508
|
- // } else if (currTimeIndex == 3) {
|
|
|
|
509
|
- // tempTime = '18:00';
|
|
|
|
510
|
- // }
|
|
|
|
511
|
- // }
|
|
|
|
512
|
- // print(_model.row.tableinfo);
|
|
|
|
513
|
- // _clearData();
|
|
|
|
514
|
- // String timeStr = dateText + ' ' + tempTime + ':00';
|
543
|
+ // String _nameStr =
|
|
|
|
544
|
+ // t.TableList.fromJson(tableinfo[0]).name;
|
|
|
|
545
|
+ // if (tableinfo.length > 1) {
|
|
|
|
546
|
+ // _nameStr = t.TableList.fromJson(tableinfo[0]).name +
|
|
|
|
547
|
+ // '等${tableinfo.length}桌';
|
|
|
|
548
|
+ // }
|
|
|
|
549
|
+ // LogUtil.v(_nameStr);
|
|
|
|
550
|
+ // String _tid = '';
|
|
|
|
551
|
+ // for (int i = 0; i < tableinfo.length; i++) {
|
|
|
|
552
|
+ // _tid += '${t.TableList.fromJson(tableinfo[i]).id},';
|
|
|
|
553
|
+ // }
|
|
|
|
554
|
+ // if (_tid.endsWith(',')) {
|
|
|
|
555
|
+ // _tid = _tid.substring(0, _tid.length - 1);
|
|
|
|
556
|
+ // }
|
|
|
|
557
|
+ // NavigatorUtil.goInvicationPage(
|
|
|
|
558
|
+ // context,
|
|
|
|
559
|
+ // _model.row.id,
|
|
|
|
560
|
+ // _nameStr,
|
|
|
|
561
|
+ // _model.row.ddate,
|
|
|
|
562
|
+ // ddate_solt,
|
|
|
|
563
|
+ // _model.row.phone,
|
|
|
|
564
|
+ // _model.row.ddateSolt,
|
|
|
|
565
|
+ // tid: _tid,
|
|
|
|
566
|
+ // replace: false);
|
|
|
|
567
|
+ // //今天 明天 其他天
|
|
|
|
568
|
+ // String tempTime = _homeEnterModel.ddateStr;
|
|
|
|
569
|
+ // if (_homeEnterModel.ddateStr == '') {
|
|
|
|
570
|
+ // if (currTimeIndex == 1) {
|
|
|
|
571
|
+ // tempTime = '08:00';
|
|
|
|
572
|
+ // } else if (currTimeIndex == 2) {
|
|
|
|
573
|
+ // tempTime = '12:00';
|
|
|
|
574
|
+ // } else if (currTimeIndex == 3) {
|
|
|
|
575
|
+ // tempTime = '18:00';
|
|
|
|
576
|
+ // }
|
|
|
|
577
|
+ // }
|
|
|
|
578
|
+ // print(_model.row.tableinfo);
|
|
|
|
579
|
+ // _clearData();
|
|
|
|
580
|
+ // String timeStr = dateText + ' ' + tempTime + ':00';
|
|
515
|
|
581
|
|
|
516
|
- // LogUtil.v(timeStr);
|
|
|
|
517
|
- // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
|
582
|
+ // LogUtil.v(timeStr);
|
|
|
|
583
|
+ // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
|
|
518
|
|
584
|
|
|
519
|
- // _homeEnterModel.getNewTableList(context, '${ddate}',
|
|
|
|
520
|
- // currTimeIndex.toString(), pnum);
|
585
|
+ // _homeEnterModel.getNewTableList(context, '${ddate}',
|
|
|
|
586
|
+ // currTimeIndex.toString(), pnum);
|
|
521
|
|
587
|
|
|
522
|
- // EventBus().emit("refresh_tablemanager"); //刷新桌位
|
|
|
|
523
|
- } else {
|
|
|
|
524
|
- Utils.showToast("预订失败!");
|
|
|
|
525
|
- }
|
|
|
|
526
|
- },
|
|
|
|
527
|
- text: '预订',
|
|
|
|
528
|
- fontSize: 48,
|
|
|
|
529
|
- isBold: true,
|
|
|
|
530
|
- width: ScreenUtil().setWidth(180),
|
|
|
|
531
|
- height: ScreenUtil().setWidth(140),
|
|
|
|
532
|
- padding: EdgeInsets.symmetric(
|
|
|
|
533
|
- horizontal: ScreenUtil().setWidth(20),
|
|
|
|
534
|
- vertical: ScreenUtil().setWidth(4)),
|
|
|
|
535
|
- textColor: MyColours.color_ffffff,
|
|
|
|
536
|
- gradientStart: MyColours.color_199095,
|
|
|
|
537
|
- gradientEnd: MyColours.color_199095,
|
|
|
|
538
|
- radius: ScreenUtil().setWidth(10),
|
|
|
|
539
|
- borderColor: MyColours.color_199095,
|
|
|
|
540
|
- ),
|
|
|
|
541
|
- InkWell(
|
|
|
|
542
|
- onTap: () {
|
|
|
|
543
|
- tableManagerModel.selectTables = [];
|
|
|
|
544
|
- for (t.Table item in tableManagerModel.tablesShow) {
|
|
|
|
545
|
- item.selected = false;
|
588
|
+ // EventBus().emit("refresh_tablemanager"); //刷新桌位
|
|
|
|
589
|
+ } else {
|
|
|
|
590
|
+ Utils.showToast("预订失败!");
|
|
|
|
591
|
+ }
|
|
|
|
592
|
+ },
|
|
|
|
593
|
+ text: '仅预订',
|
|
|
|
594
|
+ fontSize: 32,
|
|
|
|
595
|
+ isBold: false,
|
|
|
|
596
|
+ width: ScreenUtil().setWidth(180),
|
|
|
|
597
|
+ height: ScreenUtil().setWidth(90),
|
|
|
|
598
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
599
|
+ horizontal: ScreenUtil().setWidth(20),
|
|
|
|
600
|
+ vertical: ScreenUtil().setWidth(4)),
|
|
|
|
601
|
+ textColor: MyColours.color_199095,
|
|
|
|
602
|
+ gradientStart: MyColours.color_ffffff,
|
|
|
|
603
|
+ gradientEnd: MyColours.color_ffffff,
|
|
|
|
604
|
+ radius: ScreenUtil().setWidth(10),
|
|
|
|
605
|
+ borderColor: MyColours.color_199095,
|
|
|
|
606
|
+ ),
|
|
|
|
607
|
+ RoundButton(
|
|
|
|
608
|
+ onPressed: () async {
|
|
|
|
609
|
+ SunReserveInfoModel _model = await tableManagerModel
|
|
|
|
610
|
+ .setReserveInfo(context, needKeep: true);
|
|
|
|
611
|
+ if (_model != null &&
|
|
|
|
612
|
+ ObjectUtil.isNotEmpty(_model.row) &&
|
|
|
|
613
|
+ ObjectUtil.isNotEmpty(_model.row.id)) {
|
|
|
|
614
|
+ print('成功');
|
|
|
|
615
|
+ tableManagerModel.selectTables = [];
|
|
|
|
616
|
+ // _homeEnterModel.clearData();
|
|
|
|
617
|
+ bus.emit("refresh_tablemanager"); //刷新当前页面
|
|
|
|
618
|
+ bus.emit("refresh_book_list"); //刷新已预订列表
|
|
|
|
619
|
+ // //进入订座详情页面
|
|
|
|
620
|
+ // NavigatorUtil.goNotebookDetailPage(
|
|
|
|
621
|
+ // context,
|
|
|
|
622
|
+ // _model.row.id,
|
|
|
|
623
|
+ // Provider.of<UserModel>(context, listen: false)
|
|
|
|
624
|
+ // .user
|
|
|
|
625
|
+ // .openid,
|
|
|
|
626
|
+ // );
|
|
|
|
627
|
+ String ddate_solt = '';
|
|
|
|
628
|
+ if (_model.row.isSetDdate == '1') {
|
|
|
|
629
|
+ String createtime = _model.row.ddate.toString() + '000';
|
|
|
|
630
|
+ DateTime createTime =
|
|
|
|
631
|
+ DateTime.fromMillisecondsSinceEpoch(
|
|
|
|
632
|
+ int.parse(createtime));
|
|
|
|
633
|
+ ddate_solt = DateUtil.formatDate(createTime,
|
|
|
|
634
|
+ format: DateFormats.h_m);
|
|
|
|
635
|
+ } else {
|
|
|
|
636
|
+ if (_model.row.ddateSolt == '1') {
|
|
|
|
637
|
+ ddate_solt = '早餐';
|
|
|
|
638
|
+ } else if (_model.row.ddateSolt == '2') {
|
|
|
|
639
|
+ ddate_solt = '午餐';
|
|
|
|
640
|
+ } else if (_model.row.ddateSolt == '3') {
|
|
|
|
641
|
+ ddate_solt = '晚餐';
|
|
546
|
}
|
642
|
}
|
|
547
|
- tableManagerModel.areaTableMapShow
|
|
|
|
548
|
- .forEach((key, value) {
|
|
|
|
549
|
- value.forEach((element) {
|
|
|
|
550
|
- element.selected = false;
|
|
|
|
551
|
- });
|
|
|
|
552
|
- });
|
643
|
+ }
|
|
|
|
644
|
+ List<dynamic> tableinfo =
|
|
|
|
645
|
+ convert.jsonDecode(_model.row.tableinfo);
|
|
|
|
646
|
+ print(tableinfo);
|
|
553
|
|
647
|
|
|
554
|
- tableManagerModel.notifyListeners();
|
|
|
|
555
|
- },
|
|
|
|
556
|
- child: Padding(
|
|
|
|
557
|
- padding: EdgeInsets.only(
|
|
|
|
558
|
- left: ScreenUtil().setWidth(30),
|
|
|
|
559
|
- right: ScreenUtil().setWidth(30),
|
|
|
|
560
|
- top: ScreenUtil().setWidth(15)),
|
|
|
|
561
|
- child: Text(
|
|
|
|
562
|
- '取消重置',
|
|
|
|
563
|
- style: TextStyle(
|
|
|
|
564
|
- color: MyColours.color_199095,
|
|
|
|
565
|
- fontSize: ScreenUtil().setSp(26)),
|
|
|
|
566
|
- ),
|
|
|
|
567
|
- ),
|
|
|
|
568
|
- ),
|
|
|
|
569
|
- ],
|
648
|
+ String _nameStr =
|
|
|
|
649
|
+ table.TableList.fromJson(tableinfo[0]).name;
|
|
|
|
650
|
+ if (tableinfo.length > 1) {
|
|
|
|
651
|
+ _nameStr = table.TableList.fromJson(tableinfo[0]).name +
|
|
|
|
652
|
+ '等${tableinfo.length}桌';
|
|
|
|
653
|
+ }
|
|
|
|
654
|
+ LogUtil.v(_nameStr);
|
|
|
|
655
|
+ String _tid = '';
|
|
|
|
656
|
+ for (int i = 0; i < tableinfo.length; i++) {
|
|
|
|
657
|
+ _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
|
|
|
|
658
|
+ }
|
|
|
|
659
|
+ if (_tid.endsWith(',')) {
|
|
|
|
660
|
+ _tid = _tid.substring(0, _tid.length - 1);
|
|
|
|
661
|
+ }
|
|
|
|
662
|
+ NavigatorUtil.goInvicationPage(
|
|
|
|
663
|
+ context,
|
|
|
|
664
|
+ _model.row.id,
|
|
|
|
665
|
+ _nameStr,
|
|
|
|
666
|
+ _model.row.ddate,
|
|
|
|
667
|
+ ddate_solt,
|
|
|
|
668
|
+ _model.row.phone,
|
|
|
|
669
|
+ _model.row.ddateSolt,
|
|
|
|
670
|
+ tid: _tid,
|
|
|
|
671
|
+ replace: false);
|
|
|
|
672
|
+ // //今天 明天 其他天
|
|
|
|
673
|
+ // String tempTime = _homeEnterModel.ddateStr;
|
|
|
|
674
|
+ // if (_homeEnterModel.ddateStr == '') {
|
|
|
|
675
|
+ // if (currTimeIndex == 1) {
|
|
|
|
676
|
+ // tempTime = '08:00';
|
|
|
|
677
|
+ // } else if (currTimeIndex == 2) {
|
|
|
|
678
|
+ // tempTime = '12:00';
|
|
|
|
679
|
+ // } else if (currTimeIndex == 3) {
|
|
|
|
680
|
+ // tempTime = '18:00';
|
|
|
|
681
|
+ // }
|
|
|
|
682
|
+ // }
|
|
|
|
683
|
+ // print(_model.row.tableinfo);
|
|
|
|
684
|
+ // _clearData();
|
|
|
|
685
|
+ // String timeStr = dateText + ' ' + tempTime + ':00';
|
|
|
|
686
|
+
|
|
|
|
687
|
+ // LogUtil.v(timeStr);
|
|
|
|
688
|
+ // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
|
|
|
|
689
|
+
|
|
|
|
690
|
+ // _homeEnterModel.getNewTableList(context, '${ddate}',
|
|
|
|
691
|
+ // currTimeIndex.toString(), pnum);
|
|
|
|
692
|
+
|
|
|
|
693
|
+ // EventBus().emit("refresh_tablemanager"); //刷新桌位
|
|
|
|
694
|
+ } else {
|
|
|
|
695
|
+ Utils.showToast("预订失败!");
|
|
|
|
696
|
+ }
|
|
|
|
697
|
+ },
|
|
|
|
698
|
+ text: '预订并通知',
|
|
|
|
699
|
+ fontSize: 32,
|
|
|
|
700
|
+ isBold: false,
|
|
|
|
701
|
+ width: ScreenUtil().setWidth(220),
|
|
|
|
702
|
+ height: ScreenUtil().setWidth(90),
|
|
|
|
703
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
704
|
+ horizontal: ScreenUtil().setWidth(20),
|
|
|
|
705
|
+ vertical: ScreenUtil().setWidth(4)),
|
|
|
|
706
|
+ textColor: MyColours.color_ffffff,
|
|
|
|
707
|
+ gradientStart: MyColours.color_199095,
|
|
|
|
708
|
+ gradientEnd: MyColours.color_199095,
|
|
|
|
709
|
+ radius: ScreenUtil().setWidth(10),
|
|
|
|
710
|
+ borderColor: MyColours.color_199095,
|
|
570
|
),
|
711
|
),
|
|
571
|
- )
|
|
|
|
572
|
- ],
|
712
|
+ ],
|
|
|
|
713
|
+ ),
|
|
573
|
),
|
714
|
),
|
|
574
|
- ));
|
715
|
+ VEmptyView(40),
|
|
|
|
716
|
+ ],
|
|
|
|
717
|
+ ),
|
|
|
|
718
|
+ );
|
|
575
|
}
|
719
|
}
|
|
576
|
|
720
|
|
|
577
|
//构建常用备注
|
721
|
//构建常用备注
|
|
578
|
List<Widget> _buildAlwayItems() {
|
722
|
List<Widget> _buildAlwayItems() {
|
|
579
|
List<Widget> tables = [];
|
723
|
List<Widget> tables = [];
|
|
580
|
- for (t.Table table in tableManagerModel.selectTables) {
|
|
|
|
581
|
- tables.add(Container(
|
724
|
+ if (tableManagerModel.selectTables.length < 6) {
|
|
|
|
725
|
+ for (t.Table table in tableManagerModel.selectTables) {
|
|
|
|
726
|
+ tables.add(Container(
|
|
|
|
727
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
728
|
+ horizontal: ScreenUtil().setWidth(10),
|
|
|
|
729
|
+ vertical: ScreenUtil().setWidth(6)),
|
|
|
|
730
|
+ decoration: BoxDecoration(
|
|
|
|
731
|
+ color: MyColours.color_199095,
|
|
|
|
732
|
+ // border: Border.all(
|
|
|
|
733
|
+ // color: MyColours.color_E0E0E0,
|
|
|
|
734
|
+ // width: ScreenUtil().setWidth(2)),
|
|
|
|
735
|
+ borderRadius:
|
|
|
|
736
|
+ BorderRadius.circular(ScreenUtil().setWidth(10))),
|
|
|
|
737
|
+ child: Text(
|
|
|
|
738
|
+ table.name,
|
|
|
|
739
|
+ style: TextStyle(
|
|
|
|
740
|
+ fontSize: ScreenUtil().setSp(36),
|
|
|
|
741
|
+ color: MyColours.color_ffffff,
|
|
|
|
742
|
+ fontWeight: FontWeight.bold),
|
|
|
|
743
|
+ ))
|
|
|
|
744
|
+ // RoundButton(
|
|
|
|
745
|
+ // onPressed: () async {},
|
|
|
|
746
|
+ // text: table.name,
|
|
|
|
747
|
+ // fontSize: 26,
|
|
|
|
748
|
+ // isBold: false,
|
|
|
|
749
|
+ // padding: EdgeInsets.symmetric(
|
|
|
|
750
|
+ // horizontal: ScreenUtil().setWidth(20),
|
|
|
|
751
|
+ // vertical: ScreenUtil().setWidth(4)),
|
|
|
|
752
|
+ // height: ScreenUtil().setWidth(48),
|
|
|
|
753
|
+ // textColor: MyColours.color_333333,
|
|
|
|
754
|
+ // gradientStart: MyColours.color_ffffff,
|
|
|
|
755
|
+ // gradientEnd: MyColours.color_ffffff,
|
|
|
|
756
|
+ // radius: ScreenUtil().setWidth(10),
|
|
|
|
757
|
+ // borderColor: MyColours.color_E0E0E0,
|
|
|
|
758
|
+ // )
|
|
|
|
759
|
+ );
|
|
|
|
760
|
+ }
|
|
|
|
761
|
+ } else {
|
|
|
|
762
|
+ for (int i = 0; i < 6; i++) {
|
|
|
|
763
|
+ if (i == 5) {
|
|
|
|
764
|
+ tables.add(Container(
|
|
|
|
765
|
+ padding: EdgeInsets.only(
|
|
|
|
766
|
+ left: ScreenUtil().setWidth(10),
|
|
|
|
767
|
+ right: ScreenUtil().setWidth(10),
|
|
|
|
768
|
+ top: ScreenUtil().setWidth(10)),
|
|
|
|
769
|
+ decoration: BoxDecoration(
|
|
|
|
770
|
+ color: MyColours.color_ffffff,
|
|
|
|
771
|
+ // border: Border.all(
|
|
|
|
772
|
+ // color: MyColours.color_E0E0E0,
|
|
|
|
773
|
+ // width: ScreenUtil().setWidth(2)),
|
|
|
|
774
|
+ borderRadius:
|
|
|
|
775
|
+ BorderRadius.circular(ScreenUtil().setWidth(10))),
|
|
|
|
776
|
+ child: Text(
|
|
|
|
777
|
+ '等${tableManagerModel.selectTables.length}个桌位',
|
|
|
|
778
|
+ style: TextStyle(
|
|
|
|
779
|
+ fontSize: ScreenUtil().setSp(26),
|
|
|
|
780
|
+ color: MyColours.color_199095,
|
|
|
|
781
|
+ ),
|
|
|
|
782
|
+ )));
|
|
|
|
783
|
+ return tables;
|
|
|
|
784
|
+ } else {
|
|
|
|
785
|
+ tables.add(Container(
|
|
582
|
padding: EdgeInsets.symmetric(
|
786
|
padding: EdgeInsets.symmetric(
|
|
583
|
- horizontal: ScreenUtil().setWidth(20),
|
|
|
|
584
|
- vertical: ScreenUtil().setWidth(4)),
|
787
|
+ horizontal: ScreenUtil().setWidth(10),
|
|
|
|
788
|
+ vertical: ScreenUtil().setWidth(6)),
|
|
585
|
decoration: BoxDecoration(
|
789
|
decoration: BoxDecoration(
|
|
586
|
- border: Border.all(
|
|
|
|
587
|
- color: MyColours.color_E0E0E0,
|
|
|
|
588
|
- width: ScreenUtil().setWidth(2)),
|
790
|
+ color: MyColours.color_199095,
|
|
589
|
borderRadius:
|
791
|
borderRadius:
|
|
590
|
BorderRadius.circular(ScreenUtil().setWidth(10))),
|
792
|
BorderRadius.circular(ScreenUtil().setWidth(10))),
|
|
591
|
child: Text(
|
793
|
child: Text(
|
|
592
|
- table.name,
|
794
|
+ tableManagerModel.selectTables[i].name,
|
|
593
|
style: TextStyle(
|
795
|
style: TextStyle(
|
|
594
|
- fontSize: ScreenUtil().setSp(26),
|
|
|
|
595
|
- color: MyColours.color_333333,
|
796
|
+ fontSize: ScreenUtil().setSp(36),
|
|
|
|
797
|
+ color: MyColours.color_ffffff,
|
|
596
|
fontWeight: FontWeight.bold),
|
798
|
fontWeight: FontWeight.bold),
|
|
597
|
- ))
|
|
|
|
598
|
- // RoundButton(
|
|
|
|
599
|
- // onPressed: () async {},
|
|
|
|
600
|
- // text: table.name,
|
|
|
|
601
|
- // fontSize: 26,
|
|
|
|
602
|
- // isBold: false,
|
|
|
|
603
|
- // padding: EdgeInsets.symmetric(
|
|
|
|
604
|
- // horizontal: ScreenUtil().setWidth(20),
|
|
|
|
605
|
- // vertical: ScreenUtil().setWidth(4)),
|
|
|
|
606
|
- // height: ScreenUtil().setWidth(48),
|
|
|
|
607
|
- // textColor: MyColours.color_333333,
|
|
|
|
608
|
- // gradientStart: MyColours.color_ffffff,
|
|
|
|
609
|
- // gradientEnd: MyColours.color_ffffff,
|
|
|
|
610
|
- // radius: ScreenUtil().setWidth(10),
|
|
|
|
611
|
- // borderColor: MyColours.color_E0E0E0,
|
|
|
|
612
|
- // )
|
|
|
|
613
|
- );
|
799
|
+ )));
|
|
|
|
800
|
+ }
|
|
|
|
801
|
+ }
|
|
614
|
}
|
802
|
}
|
|
615
|
|
803
|
|
|
616
|
return tables;
|
804
|
return tables;
|
|
@@ -618,10 +806,12 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -618,10 +806,12 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
618
|
|
806
|
|
|
619
|
///早餐、午餐、晚餐点击方法
|
807
|
///早餐、午餐、晚餐点击方法
|
|
620
|
_clickMorAndNoonAndNig() async {
|
808
|
_clickMorAndNoonAndNig() async {
|
|
621
|
- tableManagerModel.selectDateStr = tableManagerModel.returnDayDateWeekStr(
|
|
|
|
622
|
- tableManagerModel.dateTimeSelect, tableManagerModel.currTimeIndex);
|
|
|
|
623
|
-
|
|
|
|
624
|
- await tableManagerModel.getReserveList(context, needLoading: true);
|
809
|
+ tableManagerModel.selectDateStr =
|
|
|
|
810
|
+ tableManagerModel.returnDayDateStr(tableManagerModel.dateTimeSelect);
|
|
|
|
811
|
+ tableManagerModel.selectWeekAndLunarCalendar = tableManagerModel
|
|
|
|
812
|
+ .returnWeekAndLunarCalendar(tableManagerModel.dateTimeSelect);
|
|
|
|
813
|
+ await tableManagerModel.getReserveList(context,
|
|
|
|
814
|
+ needLoading: true, showMsg: true);
|
|
625
|
}
|
815
|
}
|
|
626
|
|
816
|
|
|
627
|
@override
|
817
|
@override
|
|
@@ -629,8 +819,9 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -629,8 +819,9 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
629
|
tableManagerModel = Provider.of<TableManagerModel>(context, listen: true);
|
819
|
tableManagerModel = Provider.of<TableManagerModel>(context, listen: true);
|
|
630
|
return Scaffold(
|
820
|
return Scaffold(
|
|
631
|
backgroundColor: MyColours.color_ffffff,
|
821
|
backgroundColor: MyColours.color_ffffff,
|
|
632
|
- appBar: SystemAppBar("桌位", showLeading: false),
|
|
|
|
633
|
- body: Consumer<TableManagerModel>(
|
822
|
+ body: SafeArea(child:
|
|
|
|
823
|
+ // appBar: SystemAppBar("桌位", showLeading: false),
|
|
|
|
824
|
+ Consumer<TableManagerModel>(
|
|
634
|
builder: (context, model, child) {
|
825
|
builder: (context, model, child) {
|
|
635
|
int sum = 3;
|
826
|
int sum = 3;
|
|
636
|
int hide = 0;
|
827
|
int hide = 0;
|
|
@@ -647,6 +838,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -647,6 +838,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
647
|
btnNum = sum - hide;
|
838
|
btnNum = sum - hide;
|
|
648
|
return Column(
|
839
|
return Column(
|
|
649
|
children: <Widget>[
|
840
|
children: <Widget>[
|
|
|
|
841
|
+ VEmptyView(40),
|
|
650
|
Container(
|
842
|
Container(
|
|
651
|
color: MyColours.color_ffffff,
|
843
|
color: MyColours.color_ffffff,
|
|
652
|
padding: EdgeInsets.symmetric(
|
844
|
padding: EdgeInsets.symmetric(
|
|
@@ -658,9 +850,11 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -658,9 +850,11 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
658
|
onTap: () {
|
850
|
onTap: () {
|
|
659
|
DialogUtil.showCalendarDialog(
|
851
|
DialogUtil.showCalendarDialog(
|
|
660
|
context, tableManagerModel.dateTime)
|
852
|
context, tableManagerModel.dateTime)
|
|
661
|
- .then((day) {
|
853
|
+ .then((day) async {
|
|
662
|
if (day != null) {
|
854
|
if (day != null) {
|
|
663
|
tableManagerModel.createDateText(context, day);
|
855
|
tableManagerModel.createDateText(context, day);
|
|
|
|
856
|
+ await tableManagerModel.getReserveList(context,
|
|
|
|
857
|
+ needLoading: true, showMsg: true);
|
|
664
|
}
|
858
|
}
|
|
665
|
});
|
859
|
});
|
|
666
|
},
|
860
|
},
|
|
@@ -684,7 +878,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -684,7 +878,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
684
|
color: MyColours.color_ffffff,
|
878
|
color: MyColours.color_ffffff,
|
|
685
|
fontSize: ScreenUtil().setSp(28)),
|
879
|
fontSize: ScreenUtil().setSp(28)),
|
|
686
|
)),
|
880
|
)),
|
|
687
|
- HEmptyView(10),
|
881
|
+ // HEmptyView(10),
|
|
688
|
Image.asset(
|
882
|
Image.asset(
|
|
689
|
Utils.getImgPath('f_arrow_right'),
|
883
|
Utils.getImgPath('f_arrow_right'),
|
|
690
|
width: ScreenUtil().setWidth(25),
|
884
|
width: ScreenUtil().setWidth(25),
|
|
@@ -704,9 +898,9 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -704,9 +898,9 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
704
|
width: btnNum == 3 &&
|
898
|
width: btnNum == 3 &&
|
|
705
|
(tableManagerModel.currTimeIndex == 3 ||
|
899
|
(tableManagerModel.currTimeIndex == 3 ||
|
|
706
|
tableManagerModel.currTimeIndex == 1)
|
900
|
tableManagerModel.currTimeIndex == 1)
|
|
707
|
- ? ScreenUtil().setWidth(206) +
|
901
|
+ ? ScreenUtil().setWidth(300) +
|
|
708
|
ScreenUtil().setWidth(4)
|
902
|
ScreenUtil().setWidth(4)
|
|
709
|
- : ScreenUtil().setWidth(206),
|
903
|
+ : ScreenUtil().setWidth(300),
|
|
710
|
height: ScreenUtil().setWidth(74),
|
904
|
height: ScreenUtil().setWidth(74),
|
|
711
|
decoration: BoxDecoration(
|
905
|
decoration: BoxDecoration(
|
|
712
|
color: Color.fromRGBO(232, 232, 232, 1),
|
906
|
color: Color.fromRGBO(232, 232, 232, 1),
|
|
@@ -734,7 +928,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -734,7 +928,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
734
|
"00:00-00:00"
|
928
|
"00:00-00:00"
|
|
735
|
? true
|
929
|
? true
|
|
736
|
: false,
|
930
|
: false,
|
|
737
|
- width: ScreenUtil().setWidth(206) / btnNum,
|
931
|
+ width: ScreenUtil().setWidth(300) / btnNum,
|
|
738
|
onPress: () {
|
932
|
onPress: () {
|
|
739
|
if (tableManagerModel.currTimeIndex == 1)
|
933
|
if (tableManagerModel.currTimeIndex == 1)
|
|
740
|
return;
|
934
|
return;
|
|
@@ -763,7 +957,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -763,7 +957,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
763
|
? 1
|
957
|
? 1
|
|
764
|
: 0,
|
958
|
: 0,
|
|
765
|
fontSize: 28,
|
959
|
fontSize: 28,
|
|
766
|
- width: ScreenUtil().setWidth(206) / btnNum,
|
960
|
+ width: ScreenUtil().setWidth(300) / btnNum,
|
|
767
|
left:
|
961
|
left:
|
|
768
|
tableManagerModel.morning == "00:00-00:00"
|
962
|
tableManagerModel.morning == "00:00-00:00"
|
|
769
|
? true
|
963
|
? true
|
|
@@ -804,7 +998,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -804,7 +998,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
804
|
? 1
|
998
|
? 1
|
|
805
|
: 0,
|
999
|
: 0,
|
|
806
|
fontSize: 28,
|
1000
|
fontSize: 28,
|
|
807
|
- width: ScreenUtil().setWidth(206) / btnNum,
|
1001
|
+ width: ScreenUtil().setWidth(300) / btnNum,
|
|
808
|
onPress: () {
|
1002
|
onPress: () {
|
|
809
|
if (tableManagerModel.currTimeIndex == 3)
|
1003
|
if (tableManagerModel.currTimeIndex == 3)
|
|
810
|
return;
|
1004
|
return;
|
|
@@ -822,7 +1016,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -822,7 +1016,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
822
|
],
|
1016
|
],
|
|
823
|
),
|
1017
|
),
|
|
824
|
),
|
1018
|
),
|
|
825
|
- VEmptyView(30),
|
1019
|
+ VEmptyView(10),
|
|
826
|
|
1020
|
|
|
827
|
model.pageState != PageState.Success
|
1021
|
model.pageState != PageState.Success
|
|
828
|
? Expanded(
|
1022
|
? Expanded(
|
|
@@ -845,9 +1039,9 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -845,9 +1039,9 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
845
|
children: [
|
1039
|
children: [
|
|
846
|
Container(
|
1040
|
Container(
|
|
847
|
color: MyColours.color_ffffff,
|
1041
|
color: MyColours.color_ffffff,
|
|
848
|
- height: ScreenUtil().setWidth(92),
|
1042
|
+ height: ScreenUtil().setWidth(82),
|
|
849
|
margin: EdgeInsets.only(
|
1043
|
margin: EdgeInsets.only(
|
|
850
|
- bottom: ScreenUtil().setWidth(30)),
|
1044
|
+ bottom: ScreenUtil().setWidth(24)),
|
|
851
|
child: Row(
|
1045
|
child: Row(
|
|
852
|
children: [
|
1046
|
children: [
|
|
853
|
HEmptyView(20),
|
1047
|
HEmptyView(20),
|
|
@@ -907,8 +1101,8 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -907,8 +1101,8 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
907
|
DottedBorder(
|
1101
|
DottedBorder(
|
|
908
|
dashPattern: [5, 5, 5, 5],
|
1102
|
dashPattern: [5, 5, 5, 5],
|
|
909
|
borderType: BorderType.RRect,
|
1103
|
borderType: BorderType.RRect,
|
|
910
|
- radius: Radius.circular(
|
|
|
|
911
|
- ScreenUtil().setWidth(10)),
|
1104
|
+ // radius: Radius.circular(
|
|
|
|
1105
|
+ // ScreenUtil().setWidth(10)),
|
|
912
|
// padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
1106
|
// padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
913
|
color: MyColours.color_199095,
|
1107
|
color: MyColours.color_199095,
|
|
914
|
strokeWidth:
|
1108
|
strokeWidth:
|
|
@@ -922,7 +1116,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -922,7 +1116,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
922
|
height: ScreenUtil()
|
1116
|
height: ScreenUtil()
|
|
923
|
.setWidth(25 * 2),
|
1117
|
.setWidth(25 * 2),
|
|
924
|
width: ScreenUtil()
|
1118
|
width: ScreenUtil()
|
|
925
|
- .setWidth(104 * 2),
|
1119
|
+ .setWidth(70 * 2),
|
|
926
|
child: Column(
|
1120
|
child: Column(
|
|
927
|
mainAxisAlignment:
|
1121
|
mainAxisAlignment:
|
|
928
|
MainAxisAlignment
|
1122
|
MainAxisAlignment
|
|
@@ -959,12 +1153,12 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -959,12 +1153,12 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
959
|
height: ScreenUtil().setWidth(80),
|
1153
|
height: ScreenUtil().setWidth(80),
|
|
960
|
margin: EdgeInsets.only(
|
1154
|
margin: EdgeInsets.only(
|
|
961
|
right:
|
1155
|
right:
|
|
962
|
- ScreenUtil().setWidth(20),
|
1156
|
+ ScreenUtil().setWidth(15),
|
|
963
|
top: ScreenUtil().setWidth(20),
|
1157
|
top: ScreenUtil().setWidth(20),
|
|
964
|
),
|
1158
|
),
|
|
965
|
padding: EdgeInsets.symmetric(
|
1159
|
padding: EdgeInsets.symmetric(
|
|
966
|
horizontal:
|
1160
|
horizontal:
|
|
967
|
- ScreenUtil().setWidth(20),
|
1161
|
+ ScreenUtil().setWidth(14),
|
|
968
|
vertical: ScreenUtil()
|
1162
|
vertical: ScreenUtil()
|
|
969
|
.setWidth(10)),
|
1163
|
.setWidth(10)),
|
|
970
|
alignment: Alignment.center,
|
1164
|
alignment: Alignment.center,
|
|
@@ -987,7 +1181,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -987,7 +1181,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
987
|
: MyColours
|
1181
|
: MyColours
|
|
988
|
.color_333333,
|
1182
|
.color_333333,
|
|
989
|
fontSize:
|
1183
|
fontSize:
|
|
990
|
- ScreenUtil().setSp(28),
|
1184
|
+ ScreenUtil().setSp(24),
|
|
991
|
decoration:
|
1185
|
decoration:
|
|
992
|
TextDecoration.none,
|
1186
|
TextDecoration.none,
|
|
993
|
fontWeight:
|
1187
|
fontWeight:
|
|
@@ -1055,7 +1249,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -1055,7 +1249,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
1055
|
'f_swich_on')
|
1249
|
'f_swich_on')
|
|
1056
|
: Utils.getImgPath(
|
1250
|
: Utils.getImgPath(
|
|
1057
|
'f_swich_off'),
|
1251
|
'f_swich_off'),
|
|
1058
|
- width: ScreenUtil().setWidth(90),
|
1252
|
+ width: ScreenUtil().setWidth(60),
|
|
1059
|
// height: ScreenUtil().setWidth(82),
|
1253
|
// height: ScreenUtil().setWidth(82),
|
|
1060
|
),
|
1254
|
),
|
|
1061
|
HEmptyView(20),
|
1255
|
HEmptyView(20),
|
|
@@ -1063,7 +1257,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -1063,7 +1257,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
1063
|
'仅看\n空座',
|
1257
|
'仅看\n空座',
|
|
1064
|
style: TextStyle(
|
1258
|
style: TextStyle(
|
|
1065
|
fontSize:
|
1259
|
fontSize:
|
|
1066
|
- ScreenUtil().setSp(28),
|
1260
|
+ ScreenUtil().setSp(23),
|
|
1067
|
color: MyColours.color_333333,
|
1261
|
color: MyColours.color_333333,
|
|
1068
|
),
|
1262
|
),
|
|
1069
|
),
|
1263
|
),
|
|
@@ -1075,7 +1269,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -1075,7 +1269,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
1075
|
),
|
1269
|
),
|
|
1076
|
),
|
1270
|
),
|
|
1077
|
Expanded(
|
1271
|
Expanded(
|
|
1078
|
- flex: 2,
|
1272
|
+ // flex: 2,
|
|
1079
|
child: Container(
|
1273
|
child: Container(
|
|
1080
|
constraints: BoxConstraints(
|
1274
|
constraints: BoxConstraints(
|
|
1081
|
minHeight: ScreenUtil().setWidth(100)),
|
1275
|
minHeight: ScreenUtil().setWidth(100)),
|
|
@@ -1137,6 +1331,6 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -1137,6 +1331,6 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
1137
|
],
|
1331
|
],
|
|
1138
|
);
|
1332
|
);
|
|
1139
|
},
|
1333
|
},
|
|
1140
|
- ));
|
1334
|
+ )));
|
|
1141
|
}
|
1335
|
}
|
|
1142
|
} |
1336
|
} |