|
@@ -339,318 +339,331 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -339,318 +339,331 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
339
|
|
339
|
|
|
340
|
@override
|
340
|
@override
|
|
341
|
Widget build(BuildContext context) {
|
341
|
Widget build(BuildContext context) {
|
|
342
|
- return Consumer<TableManagerModel>(
|
|
|
|
343
|
- builder: (context, model, child) {
|
|
|
|
344
|
- int sum = 3;
|
|
|
|
345
|
- int hide = 0;
|
|
|
|
346
|
- int btnNum = 0;
|
|
|
|
347
|
- if (tableManagerModel.morning == "00:00-00:00") {
|
|
|
|
348
|
- hide++;
|
|
|
|
349
|
- }
|
|
|
|
350
|
- if (tableManagerModel.noon == "00:00-00:00") {
|
|
|
|
351
|
- hide++;
|
|
|
|
352
|
- }
|
|
|
|
353
|
- if (tableManagerModel.night == "00:00-00:00") {
|
|
|
|
354
|
- hide++;
|
|
|
|
355
|
- }
|
|
|
|
356
|
- btnNum = sum - hide;
|
|
|
|
357
|
- return Column(
|
|
|
|
358
|
- children: <Widget>[
|
|
|
|
359
|
- SystemAppBar("桌位", showLeading: false),
|
|
|
|
360
|
- Container(
|
|
|
|
361
|
- color: MyColours.color_ffffff,
|
|
|
|
362
|
- padding:
|
|
|
|
363
|
- EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(15)),
|
|
|
|
364
|
- child: Row(
|
|
|
|
365
|
- children: <Widget>[
|
|
|
|
366
|
- Expanded(
|
|
|
|
367
|
- child: GestureDetector(
|
|
|
|
368
|
- onTap: () {
|
|
|
|
369
|
- DialogUtil.showCalendarDialog(
|
|
|
|
370
|
- context, tableManagerModel.dateTime)
|
|
|
|
371
|
- .then((day) {
|
|
|
|
372
|
- if (day != null) {
|
|
|
|
373
|
- tableManagerModel.createDateText(context, day);
|
|
|
|
374
|
- }
|
|
|
|
375
|
- });
|
|
|
|
376
|
- },
|
|
|
|
377
|
- child: Container(
|
|
|
|
378
|
- // height: ScreenUtil().setWidth(80),
|
|
|
|
379
|
- padding: EdgeInsets.symmetric(
|
|
|
|
380
|
- horizontal: ScreenUtil().setWidth(15),
|
|
|
|
381
|
- vertical: ScreenUtil().setWidth(20)),
|
342
|
+ return Scaffold(
|
|
|
|
343
|
+ appBar: SystemAppBar("桌位", showLeading: false),
|
|
|
|
344
|
+ body: Consumer<TableManagerModel>(
|
|
|
|
345
|
+ builder: (context, model, child) {
|
|
|
|
346
|
+ int sum = 3;
|
|
|
|
347
|
+ int hide = 0;
|
|
|
|
348
|
+ int btnNum = 0;
|
|
|
|
349
|
+ if (tableManagerModel.morning == "00:00-00:00") {
|
|
|
|
350
|
+ hide++;
|
|
|
|
351
|
+ }
|
|
|
|
352
|
+ if (tableManagerModel.noon == "00:00-00:00") {
|
|
|
|
353
|
+ hide++;
|
|
|
|
354
|
+ }
|
|
|
|
355
|
+ if (tableManagerModel.night == "00:00-00:00") {
|
|
|
|
356
|
+ hide++;
|
|
|
|
357
|
+ }
|
|
|
|
358
|
+ btnNum = sum - hide;
|
|
|
|
359
|
+ return Column(
|
|
|
|
360
|
+ children: <Widget>[
|
|
|
|
361
|
+ Container(
|
|
|
|
362
|
+ color: MyColours.color_ffffff,
|
|
|
|
363
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
364
|
+ horizontal: ScreenUtil().setWidth(15)),
|
|
|
|
365
|
+ child: Row(
|
|
|
|
366
|
+ children: <Widget>[
|
|
|
|
367
|
+ Expanded(
|
|
|
|
368
|
+ child: GestureDetector(
|
|
|
|
369
|
+ onTap: () {
|
|
|
|
370
|
+ DialogUtil.showCalendarDialog(
|
|
|
|
371
|
+ context, tableManagerModel.dateTime)
|
|
|
|
372
|
+ .then((day) {
|
|
|
|
373
|
+ if (day != null) {
|
|
|
|
374
|
+ tableManagerModel.createDateText(context, day);
|
|
|
|
375
|
+ }
|
|
|
|
376
|
+ });
|
|
|
|
377
|
+ },
|
|
|
|
378
|
+ child: Container(
|
|
|
|
379
|
+ // height: ScreenUtil().setWidth(80),
|
|
|
|
380
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
381
|
+ horizontal: ScreenUtil().setWidth(15),
|
|
|
|
382
|
+ vertical: ScreenUtil().setWidth(20)),
|
|
|
|
383
|
+ decoration: BoxDecoration(
|
|
|
|
384
|
+ color: MyColours.color_199095,
|
|
|
|
385
|
+ borderRadius: BorderRadius.circular(
|
|
|
|
386
|
+ ScreenUtil().setWidth(20))),
|
|
|
|
387
|
+ child: Row(
|
|
|
|
388
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
389
|
+ children: [
|
|
|
|
390
|
+ Expanded(
|
|
|
|
391
|
+ child: Text(
|
|
|
|
392
|
+ tableManagerModel.dateText,
|
|
|
|
393
|
+ textAlign: TextAlign.center,
|
|
|
|
394
|
+ style: TextStyle(
|
|
|
|
395
|
+ color: MyColours.color_ffffff,
|
|
|
|
396
|
+ fontSize: ScreenUtil().setSp(28)),
|
|
|
|
397
|
+ )),
|
|
|
|
398
|
+ HEmptyView(10),
|
|
|
|
399
|
+ Image.asset(
|
|
|
|
400
|
+ Utils.getImgPath('f_arrow_right'),
|
|
|
|
401
|
+ width: ScreenUtil().setWidth(25),
|
|
|
|
402
|
+ // height: ScreenUtil().setWidth(10),
|
|
|
|
403
|
+ )
|
|
|
|
404
|
+ ],
|
|
|
|
405
|
+ )),
|
|
|
|
406
|
+ )),
|
|
|
|
407
|
+
|
|
|
|
408
|
+ // MyDivider(
|
|
|
|
409
|
+ // ScreenUtil().setWidth(2),
|
|
|
|
410
|
+ // ScreenUtil().setHeight(68),
|
|
|
|
411
|
+ // color: MyColours.color_E0E0E0,
|
|
|
|
412
|
+ // ),
|
|
|
|
413
|
+ HEmptyView(20),
|
|
|
|
414
|
+ Container(
|
|
|
|
415
|
+ width: ScreenUtil().setWidth(206),
|
|
|
|
416
|
+ height: ScreenUtil().setWidth(74),
|
|
382
|
decoration: BoxDecoration(
|
417
|
decoration: BoxDecoration(
|
|
383
|
- color: MyColours.color_199095,
|
418
|
+ color: Color.fromRGBO(232, 232, 232, 1),
|
|
384
|
borderRadius: BorderRadius.circular(
|
419
|
borderRadius: BorderRadius.circular(
|
|
385
|
- ScreenUtil().setWidth(20))),
|
|
|
|
386
|
- child: Row(
|
|
|
|
387
|
- children: [
|
|
|
|
388
|
- Expanded(
|
|
|
|
389
|
- child: Text(
|
|
|
|
390
|
- tableManagerModel.dateText,
|
|
|
|
391
|
- style: TextStyle(
|
|
|
|
392
|
- color: MyColours.color_ffffff,
|
|
|
|
393
|
- fontSize: ScreenUtil().setSp(28)),
|
420
|
+ ScreenUtil().setWidth(20),
|
|
394
|
)),
|
421
|
)),
|
|
395
|
- HEmptyView(10),
|
|
|
|
396
|
- Image.asset(
|
|
|
|
397
|
- Utils.getImgPath('f_arrow_right'),
|
|
|
|
398
|
- width: ScreenUtil().setWidth(25),
|
|
|
|
399
|
- // height: ScreenUtil().setWidth(10),
|
|
|
|
400
|
- )
|
|
|
|
401
|
- ],
|
|
|
|
402
|
- )),
|
|
|
|
403
|
- )),
|
|
|
|
404
|
-
|
|
|
|
405
|
- // MyDivider(
|
|
|
|
406
|
- // ScreenUtil().setWidth(2),
|
|
|
|
407
|
- // ScreenUtil().setHeight(68),
|
|
|
|
408
|
- // color: MyColours.color_E0E0E0,
|
|
|
|
409
|
- // ),
|
|
|
|
410
|
- HEmptyView(20),
|
|
|
|
411
|
- Container(
|
|
|
|
412
|
- width: ScreenUtil().setWidth(206),
|
|
|
|
413
|
- height: ScreenUtil().setWidth(74),
|
|
|
|
414
|
- decoration: BoxDecoration(
|
|
|
|
415
|
- color: Color.fromRGBO(232, 232, 232, 1),
|
|
|
|
416
|
- borderRadius: BorderRadius.circular(
|
|
|
|
417
|
- ScreenUtil().setWidth(20),
|
|
|
|
418
|
- )),
|
|
|
|
419
|
- child: Row(
|
|
|
|
420
|
- // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
421
|
- // crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
422
|
- children: <Widget>[
|
|
|
|
423
|
- Offstage(
|
|
|
|
424
|
- offstage: tableManagerModel.morning == "00:00-00:00"
|
|
|
|
425
|
- ? true
|
|
|
|
426
|
- : false,
|
|
|
|
427
|
- child: CommonButtonFlat(
|
|
|
|
428
|
- content: "早市",
|
|
|
|
429
|
- state:
|
|
|
|
430
|
- tableManagerModel.currTimeIndex == 1 ? 1 : 0,
|
|
|
|
431
|
- fontSize: 28,
|
|
|
|
432
|
- right: tableManagerModel.noon == "00:00-00:00" &&
|
422
|
+ child: Row(
|
|
|
|
423
|
+ // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
424
|
+ // crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
425
|
+ children: <Widget>[
|
|
|
|
426
|
+ Offstage(
|
|
|
|
427
|
+ offstage:
|
|
|
|
428
|
+ tableManagerModel.morning == "00:00-00:00"
|
|
|
|
429
|
+ ? true
|
|
|
|
430
|
+ : false,
|
|
|
|
431
|
+ child: CommonButtonFlat(
|
|
|
|
432
|
+ content: "早餐",
|
|
|
|
433
|
+ state: tableManagerModel.currTimeIndex == 1
|
|
|
|
434
|
+ ? 1
|
|
|
|
435
|
+ : 0,
|
|
|
|
436
|
+ fontSize: 28,
|
|
|
|
437
|
+ right:
|
|
|
|
438
|
+ tableManagerModel.noon == "00:00-00:00" &&
|
|
|
|
439
|
+ tableManagerModel.night ==
|
|
|
|
440
|
+ "00:00-00:00"
|
|
|
|
441
|
+ ? true
|
|
|
|
442
|
+ : false,
|
|
|
|
443
|
+ width: ScreenUtil().setWidth(200) / btnNum,
|
|
|
|
444
|
+ onPress: () {
|
|
|
|
445
|
+ if (tableManagerModel.currTimeIndex == 1)
|
|
|
|
446
|
+ return;
|
|
|
|
447
|
+ tableManagerModel.currTimeIndex = 1;
|
|
|
|
448
|
+ tableManagerModel.getReserveList(context);
|
|
|
|
449
|
+ },
|
|
|
|
450
|
+ )),
|
|
|
|
451
|
+ btnNum == 3 && tableManagerModel.currTimeIndex == 3
|
|
|
|
452
|
+ ? MyDivider(
|
|
|
|
453
|
+ ScreenUtil().setWidth(4),
|
|
|
|
454
|
+ ScreenUtil().setWidth(46),
|
|
|
|
455
|
+ color: MyColours.color_dfdfdf,
|
|
|
|
456
|
+ )
|
|
|
|
457
|
+ : SizedBox(),
|
|
|
|
458
|
+ Offstage(
|
|
|
|
459
|
+ offstage:
|
|
|
|
460
|
+ tableManagerModel.noon == "00:00-00:00"
|
|
|
|
461
|
+ ? true
|
|
|
|
462
|
+ : false,
|
|
|
|
463
|
+ child: CommonButtonFlat(
|
|
|
|
464
|
+ content: "午餐",
|
|
|
|
465
|
+ state: tableManagerModel.currTimeIndex == 2
|
|
|
|
466
|
+ ? 1
|
|
|
|
467
|
+ : 0,
|
|
|
|
468
|
+ fontSize: 28,
|
|
|
|
469
|
+ width: ScreenUtil().setWidth(200) / btnNum,
|
|
|
|
470
|
+ left:
|
|
|
|
471
|
+ tableManagerModel.morning == "00:00-00:00"
|
|
|
|
472
|
+ ? true
|
|
|
|
473
|
+ : false,
|
|
|
|
474
|
+ right:
|
|
433
|
tableManagerModel.night == "00:00-00:00"
|
475
|
tableManagerModel.night == "00:00-00:00"
|
|
|
|
476
|
+ ? true
|
|
|
|
477
|
+ : false,
|
|
|
|
478
|
+ onPress: () {
|
|
|
|
479
|
+ if (tableManagerModel.currTimeIndex == 2)
|
|
|
|
480
|
+ return;
|
|
|
|
481
|
+ tableManagerModel.currTimeIndex = 2;
|
|
|
|
482
|
+ tableManagerModel.getReserveList(context);
|
|
|
|
483
|
+ },
|
|
|
|
484
|
+ )),
|
|
|
|
485
|
+ btnNum == 3 && tableManagerModel.currTimeIndex == 1
|
|
|
|
486
|
+ ? MyDivider(
|
|
|
|
487
|
+ ScreenUtil().setWidth(4),
|
|
|
|
488
|
+ ScreenUtil().setWidth(46),
|
|
|
|
489
|
+ color: MyColours.color_dfdfdf,
|
|
|
|
490
|
+ )
|
|
|
|
491
|
+ : SizedBox(),
|
|
|
|
492
|
+ Offstage(
|
|
|
|
493
|
+ offstage: tableManagerModel.night == "00:00-00:00"
|
|
434
|
? true
|
494
|
? true
|
|
435
|
: false,
|
495
|
: false,
|
|
436
|
- width: ScreenUtil().setWidth(200) / btnNum,
|
|
|
|
437
|
- onPress: () {
|
|
|
|
438
|
- if (tableManagerModel.currTimeIndex == 1)
|
|
|
|
439
|
- return;
|
|
|
|
440
|
- tableManagerModel.currTimeIndex = 1;
|
|
|
|
441
|
- tableManagerModel.getReserveList(context);
|
|
|
|
442
|
- },
|
|
|
|
443
|
- )),
|
|
|
|
444
|
- btnNum == 3 && tableManagerModel.currTimeIndex == 3
|
|
|
|
445
|
- ? MyDivider(
|
|
|
|
446
|
- ScreenUtil().setWidth(4),
|
|
|
|
447
|
- ScreenUtil().setWidth(46),
|
|
|
|
448
|
- color: MyColours.color_dfdfdf,
|
|
|
|
449
|
- )
|
|
|
|
450
|
- : SizedBox(),
|
|
|
|
451
|
- Offstage(
|
|
|
|
452
|
- offstage: tableManagerModel.noon == "00:00-00:00"
|
|
|
|
453
|
- ? true
|
|
|
|
454
|
- : false,
|
|
|
|
455
|
- child: CommonButtonFlat(
|
|
|
|
456
|
- content: "午市",
|
|
|
|
457
|
- state:
|
|
|
|
458
|
- tableManagerModel.currTimeIndex == 2 ? 1 : 0,
|
|
|
|
459
|
- fontSize: 28,
|
|
|
|
460
|
- width: ScreenUtil().setWidth(200) / btnNum,
|
|
|
|
461
|
- left: tableManagerModel.morning == "00:00-00:00"
|
|
|
|
462
|
- ? true
|
|
|
|
463
|
- : false,
|
|
|
|
464
|
- right: tableManagerModel.night == "00:00-00:00"
|
|
|
|
465
|
- ? true
|
|
|
|
466
|
- : false,
|
|
|
|
467
|
- onPress: () {
|
|
|
|
468
|
- if (tableManagerModel.currTimeIndex == 2)
|
|
|
|
469
|
- return;
|
|
|
|
470
|
- tableManagerModel.currTimeIndex = 2;
|
|
|
|
471
|
- tableManagerModel.getReserveList(context);
|
|
|
|
472
|
- },
|
|
|
|
473
|
- )),
|
|
|
|
474
|
- btnNum == 3 && tableManagerModel.currTimeIndex == 1
|
|
|
|
475
|
- ? MyDivider(
|
|
|
|
476
|
- ScreenUtil().setWidth(4),
|
|
|
|
477
|
- ScreenUtil().setWidth(46),
|
|
|
|
478
|
- color: MyColours.color_dfdfdf,
|
|
|
|
479
|
- )
|
|
|
|
480
|
- : SizedBox(),
|
|
|
|
481
|
- Offstage(
|
|
|
|
482
|
- offstage: tableManagerModel.night == "00:00-00:00"
|
|
|
|
483
|
- ? true
|
|
|
|
484
|
- : false,
|
|
|
|
485
|
- child: Container(
|
|
|
|
486
|
- child: CommonButtonFlat(
|
|
|
|
487
|
- content: "晚市",
|
|
|
|
488
|
- left: tableManagerModel.morning == "00:00-00:00" &&
|
|
|
|
489
|
- tableManagerModel.noon == "00:00-00:00"
|
|
|
|
490
|
- ? true
|
|
|
|
491
|
- : false,
|
|
|
|
492
|
- state: tableManagerModel.currTimeIndex == 3 ? 1 : 0,
|
|
|
|
493
|
- fontSize: 28,
|
|
|
|
494
|
- width: ScreenUtil().setWidth(200) / btnNum,
|
|
|
|
495
|
- onPress: () {
|
|
|
|
496
|
- if (tableManagerModel.currTimeIndex == 3) return;
|
|
|
|
497
|
- tableManagerModel.currTimeIndex = 3;
|
|
|
|
498
|
- tableManagerModel.getReserveList(context);
|
|
|
|
499
|
- },
|
|
|
|
500
|
- )),
|
496
|
+ child: Container(
|
|
|
|
497
|
+ child: CommonButtonFlat(
|
|
|
|
498
|
+ content: "晚餐",
|
|
|
|
499
|
+ left: tableManagerModel.morning ==
|
|
|
|
500
|
+ "00:00-00:00" &&
|
|
|
|
501
|
+ tableManagerModel.noon == "00:00-00:00"
|
|
|
|
502
|
+ ? true
|
|
|
|
503
|
+ : false,
|
|
|
|
504
|
+ state: tableManagerModel.currTimeIndex == 3
|
|
|
|
505
|
+ ? 1
|
|
|
|
506
|
+ : 0,
|
|
|
|
507
|
+ fontSize: 28,
|
|
|
|
508
|
+ width: ScreenUtil().setWidth(200) / btnNum,
|
|
|
|
509
|
+ onPress: () {
|
|
|
|
510
|
+ if (tableManagerModel.currTimeIndex == 3)
|
|
|
|
511
|
+ return;
|
|
|
|
512
|
+ tableManagerModel.currTimeIndex = 3;
|
|
|
|
513
|
+ tableManagerModel.getReserveList(context);
|
|
|
|
514
|
+ },
|
|
|
|
515
|
+ )),
|
|
|
|
516
|
+ ),
|
|
|
|
517
|
+ ],
|
|
501
|
),
|
518
|
),
|
|
502
|
- ],
|
|
|
|
503
|
- ),
|
519
|
+ ),
|
|
|
|
520
|
+ ],
|
|
504
|
),
|
521
|
),
|
|
505
|
- ],
|
|
|
|
506
|
- ),
|
|
|
|
507
|
- ),
|
|
|
|
508
|
- Expanded(
|
|
|
|
509
|
- child: Consumer<TableManagerModel>(
|
|
|
|
510
|
- builder: (context, model, child) {
|
|
|
|
511
|
- if (model.pageState != PageState.Success) {
|
|
|
|
512
|
- return ExceptionPage(
|
|
|
|
513
|
- pageState: model.pageState,
|
|
|
|
514
|
- callback: () {
|
|
|
|
515
|
- if (tableManagerModel.tableOuterList.isEmpty) {
|
|
|
|
516
|
- tableManagerModel.getTableList(context);
|
|
|
|
517
|
- } else {
|
|
|
|
518
|
- tableManagerModel.getReserveList(context);
|
|
|
|
519
|
- }
|
|
|
|
520
|
- },
|
|
|
|
521
|
- emptyMsg: "暂时没有桌位哦",
|
|
|
|
522
|
- emptyImg: "empty_search",
|
|
|
|
523
|
- showMsg: "加载中,请稍后...",
|
|
|
|
524
|
- );
|
|
|
|
525
|
- } else {
|
|
|
|
526
|
- return CCMenuPage.builder(
|
|
|
|
527
|
- tableManagerModel: tableManagerModel,
|
|
|
|
528
|
- itemCount: tableManagerModel.areas.length,
|
|
|
|
529
|
- onTap: (index) async {
|
|
|
|
530
|
- // //添加区域弹框
|
|
|
|
531
|
- // await DialogUtil.openCreateAreaDialog(context,
|
|
|
|
532
|
- // onTap: (value) async {
|
|
|
|
533
|
- // print(value);
|
|
|
|
534
|
- // //添加区域
|
|
|
|
535
|
- // bool success = await tableManagerModel.addTableAreas(
|
|
|
|
536
|
- // context, value);
|
|
|
|
537
|
- // print(success);
|
|
|
|
538
|
- // if (success) {
|
|
|
|
539
|
- // Utils.showToast('添加成功!');
|
|
|
|
540
|
-
|
|
|
|
541
|
- // await tableManagerModel.getTableList(context,
|
|
|
|
542
|
- // needLoading: false);
|
|
|
|
543
|
- // tableManagerModel.initData();
|
|
|
|
544
|
-
|
|
|
|
545
|
- // setState(() {});
|
|
|
|
546
|
-
|
|
|
|
547
|
- // Timer(
|
|
|
|
548
|
- // Duration(milliseconds: 500),
|
|
|
|
549
|
- // () => _areaController.jumpTo(
|
|
|
|
550
|
- // _areaController.position.maxScrollExtent));
|
|
|
|
551
|
- // }
|
|
|
|
552
|
- // });
|
|
|
|
553
|
- },
|
|
|
|
554
|
- tabBuilder: (BuildContext context, int index) {
|
|
|
|
555
|
- if (index == tableManagerModel.areas.length ||
|
|
|
|
556
|
- tableManagerModel.areas.length == 0) {
|
|
|
|
557
|
- // return InkWell(
|
|
|
|
558
|
- // onTap: () async {
|
|
|
|
559
|
- // //添加区域弹框
|
|
|
|
560
|
- // await DialogUtil.openCreateAreaDialog(context,
|
|
|
|
561
|
- // onTap: (value) async {
|
|
|
|
562
|
- // print(value);
|
|
|
|
563
|
- // //添加区域
|
|
|
|
564
|
- // bool success = await tableManagerModel
|
|
|
|
565
|
- // .addTableAreas(context, value);
|
|
|
|
566
|
- // print(success);
|
|
|
|
567
|
- // if (success) {
|
|
|
|
568
|
- // Utils.showToast('添加成功!');
|
|
|
|
569
|
- // // TableOuter tableOuter =
|
|
|
|
570
|
- // // TableOuter();
|
|
|
|
571
|
- // // tableOuter.name = value;
|
|
|
|
572
|
- // // tableOuter.list = [];
|
|
|
|
573
|
- // // tableManagerModel.tableOuterList
|
|
|
|
574
|
- // // .add(tableOuter);
|
|
|
|
575
|
- // await tableManagerModel.getTableList(
|
|
|
|
576
|
- // context,
|
|
|
|
577
|
- // needLoading: false);
|
|
|
|
578
|
- // tableManagerModel.initData();
|
|
|
|
579
|
- // Timer(
|
|
|
|
580
|
- // Duration(milliseconds: 500),
|
|
|
|
581
|
- // () => _areaController.jumpTo(
|
|
|
|
582
|
- // _areaController
|
|
|
|
583
|
- // .position.maxScrollExtent));
|
|
|
|
584
|
-
|
|
|
|
585
|
- // // await tableManagerModel
|
|
|
|
586
|
- // // .getTableList(context);
|
|
|
|
587
|
- // // await tableManagerModel
|
|
|
|
588
|
- // // .initData();
|
|
|
|
589
|
- // }
|
|
|
|
590
|
- // });
|
|
|
|
591
|
- // },
|
|
|
|
592
|
- return Column(
|
|
|
|
593
|
- children: [
|
|
|
|
594
|
- VEmptyView(20),
|
|
|
|
595
|
- DottedBorder(
|
|
|
|
596
|
- dashPattern: [5, 5, 5, 5],
|
|
|
|
597
|
- borderType: BorderType.RRect,
|
|
|
|
598
|
- radius:
|
|
|
|
599
|
- Radius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
600
|
- // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
601
|
- color: MyColours.color_199095,
|
|
|
|
602
|
- strokeWidth: ScreenUtil().setWidth(2),
|
|
|
|
603
|
- child: ClipRRect(
|
|
|
|
604
|
- borderRadius: BorderRadius.all(
|
|
|
|
605
|
- Radius.circular(
|
|
|
|
606
|
- ScreenUtil().setWidth(10))),
|
|
|
|
607
|
- child: Container(
|
|
|
|
608
|
- height: ScreenUtil().setWidth(25 * 2),
|
|
|
|
609
|
- width: ScreenUtil().setWidth(104 * 2),
|
|
|
|
610
|
- child: Column(
|
|
|
|
611
|
- mainAxisAlignment:
|
|
|
|
612
|
- MainAxisAlignment.center,
|
|
|
|
613
|
- children: [
|
|
|
|
614
|
- Image.asset(
|
|
|
|
615
|
- Utils.getImgPath('add_area'),
|
|
|
|
616
|
- width: ScreenUtil().setWidth(24)),
|
|
|
|
617
|
- ],
|
|
|
|
618
|
- ),
|
|
|
|
619
|
- ),
|
|
|
|
620
|
- ),
|
|
|
|
621
|
- )
|
|
|
|
622
|
- ],
|
|
|
|
623
|
- );
|
|
|
|
624
|
- } else {
|
|
|
|
625
|
- return AreaItemTable(
|
|
|
|
626
|
- model.areas[index], tableManagerModel.currentArea,
|
|
|
|
627
|
- (area) {
|
|
|
|
628
|
- // isTap = true;
|
|
|
|
629
|
-
|
|
|
|
630
|
- // _selectIndex = index;
|
|
|
|
631
|
-
|
|
|
|
632
|
- // // scrollTo(index);
|
|
|
|
633
|
-
|
|
|
|
634
|
- // tableManagerModel.currentArea =
|
|
|
|
635
|
- // tableManagerModel.areas[index].name;
|
|
|
|
636
|
- // tableManagerModel.currentTables =
|
|
|
|
637
|
- // tableManagerModel.areaTableMap[
|
|
|
|
638
|
- // tableManagerModel.currentArea];
|
|
|
|
639
|
- });
|
|
|
|
640
|
- }
|
|
|
|
641
|
- },
|
|
|
|
642
|
- itemBuilder: (BuildContext context, int index) {
|
|
|
|
643
|
- return item(index);
|
|
|
|
644
|
- },
|
|
|
|
645
|
- );
|
|
|
|
646
|
- }
|
|
|
|
647
|
- },
|
|
|
|
648
|
- ),
|
|
|
|
649
|
- ),
|
|
|
|
650
|
- ],
|
|
|
|
651
|
- );
|
|
|
|
652
|
- },
|
|
|
|
653
|
- );
|
522
|
+ ),
|
|
|
|
523
|
+ VEmptyView(40),
|
|
|
|
524
|
+ Consumer<TableManagerModel>(
|
|
|
|
525
|
+ builder: (context, model, child) {
|
|
|
|
526
|
+ if (model.pageState != PageState.Success) {
|
|
|
|
527
|
+ return Expanded(
|
|
|
|
528
|
+ child: ExceptionPage(
|
|
|
|
529
|
+ pageState: model.pageState,
|
|
|
|
530
|
+ callback: () {
|
|
|
|
531
|
+ if (tableManagerModel.tableOuterList.isEmpty) {
|
|
|
|
532
|
+ tableManagerModel.getTableList(context);
|
|
|
|
533
|
+ } else {
|
|
|
|
534
|
+ tableManagerModel.getReserveList(context);
|
|
|
|
535
|
+ }
|
|
|
|
536
|
+ },
|
|
|
|
537
|
+ emptyMsg: "暂时没有桌位哦",
|
|
|
|
538
|
+ emptyImg: "empty_search",
|
|
|
|
539
|
+ showMsg: "加载中,请稍后...",
|
|
|
|
540
|
+ ));
|
|
|
|
541
|
+ } else {
|
|
|
|
542
|
+ return Column(
|
|
|
|
543
|
+ children: [
|
|
|
|
544
|
+ Container(
|
|
|
|
545
|
+ height: ScreenUtil().setWidth(100),
|
|
|
|
546
|
+ child: Row(
|
|
|
|
547
|
+ children: [
|
|
|
|
548
|
+ Expanded(
|
|
|
|
549
|
+ child: ListView.builder(
|
|
|
|
550
|
+ itemCount: tableManagerModel.areas.length + 1,
|
|
|
|
551
|
+ shrinkWrap: true,
|
|
|
|
552
|
+ scrollDirection: Axis.horizontal,
|
|
|
|
553
|
+ itemBuilder:
|
|
|
|
554
|
+ (BuildContext contxt, int index) {
|
|
|
|
555
|
+ if (index ==
|
|
|
|
556
|
+ tableManagerModel.areas.length ||
|
|
|
|
557
|
+ tableManagerModel.areas.length == 0) {
|
|
|
|
558
|
+ return Column(
|
|
|
|
559
|
+ children: [
|
|
|
|
560
|
+ VEmptyView(20),
|
|
|
|
561
|
+ DottedBorder(
|
|
|
|
562
|
+ dashPattern: [5, 5, 5, 5],
|
|
|
|
563
|
+ borderType: BorderType.RRect,
|
|
|
|
564
|
+ radius: Radius.circular(
|
|
|
|
565
|
+ ScreenUtil().setWidth(10)),
|
|
|
|
566
|
+ // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
567
|
+ color: MyColours.color_199095,
|
|
|
|
568
|
+ strokeWidth:
|
|
|
|
569
|
+ ScreenUtil().setWidth(2),
|
|
|
|
570
|
+ child: ClipRRect(
|
|
|
|
571
|
+ borderRadius: BorderRadius.all(
|
|
|
|
572
|
+ Radius.circular(ScreenUtil()
|
|
|
|
573
|
+ .setWidth(10))),
|
|
|
|
574
|
+ child: Container(
|
|
|
|
575
|
+ height: ScreenUtil()
|
|
|
|
576
|
+ .setWidth(25 * 2),
|
|
|
|
577
|
+ width: ScreenUtil()
|
|
|
|
578
|
+ .setWidth(104 * 2),
|
|
|
|
579
|
+ child: Column(
|
|
|
|
580
|
+ mainAxisAlignment:
|
|
|
|
581
|
+ MainAxisAlignment.center,
|
|
|
|
582
|
+ children: [
|
|
|
|
583
|
+ Image.asset(
|
|
|
|
584
|
+ Utils.getImgPath(
|
|
|
|
585
|
+ 'add_area'),
|
|
|
|
586
|
+ width: ScreenUtil()
|
|
|
|
587
|
+ .setWidth(24)),
|
|
|
|
588
|
+ ],
|
|
|
|
589
|
+ ),
|
|
|
|
590
|
+ ),
|
|
|
|
591
|
+ ),
|
|
|
|
592
|
+ )
|
|
|
|
593
|
+ ],
|
|
|
|
594
|
+ );
|
|
|
|
595
|
+ } else {
|
|
|
|
596
|
+ return AreaItemTable(
|
|
|
|
597
|
+ model.areas[index],
|
|
|
|
598
|
+ tableManagerModel.currentArea,
|
|
|
|
599
|
+ (area) {});
|
|
|
|
600
|
+ }
|
|
|
|
601
|
+ },
|
|
|
|
602
|
+ )),
|
|
|
|
603
|
+ HEmptyView(40),
|
|
|
|
604
|
+ MyDivider(ScreenUtil().setWidth(2),
|
|
|
|
605
|
+ ScreenUtil().setWidth(40),
|
|
|
|
606
|
+ color: MyColours.color_F1F0F4),
|
|
|
|
607
|
+ ],
|
|
|
|
608
|
+ ),
|
|
|
|
609
|
+ )
|
|
|
|
610
|
+ ],
|
|
|
|
611
|
+ );
|
|
|
|
612
|
+ // return CCMenuPage.builder(
|
|
|
|
613
|
+ // tableManagerModel: tableManagerModel,
|
|
|
|
614
|
+ // itemCount: tableManagerModel.areas.length,
|
|
|
|
615
|
+ // onTap: (index) async {},
|
|
|
|
616
|
+ // tabBuilder: (BuildContext context, int index) {
|
|
|
|
617
|
+ // if (index == tableManagerModel.areas.length ||
|
|
|
|
618
|
+ // tableManagerModel.areas.length == 0) {
|
|
|
|
619
|
+ // return Column(
|
|
|
|
620
|
+ // children: [
|
|
|
|
621
|
+ // VEmptyView(20),
|
|
|
|
622
|
+ // DottedBorder(
|
|
|
|
623
|
+ // dashPattern: [5, 5, 5, 5],
|
|
|
|
624
|
+ // borderType: BorderType.RRect,
|
|
|
|
625
|
+ // radius:
|
|
|
|
626
|
+ // Radius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
627
|
+ // // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
628
|
+ // color: MyColours.color_199095,
|
|
|
|
629
|
+ // strokeWidth: ScreenUtil().setWidth(2),
|
|
|
|
630
|
+ // child: ClipRRect(
|
|
|
|
631
|
+ // borderRadius: BorderRadius.all(
|
|
|
|
632
|
+ // Radius.circular(
|
|
|
|
633
|
+ // ScreenUtil().setWidth(10))),
|
|
|
|
634
|
+ // child: Container(
|
|
|
|
635
|
+ // height: ScreenUtil().setWidth(25 * 2),
|
|
|
|
636
|
+ // width: ScreenUtil().setWidth(104 * 2),
|
|
|
|
637
|
+ // child: Column(
|
|
|
|
638
|
+ // mainAxisAlignment:
|
|
|
|
639
|
+ // MainAxisAlignment.center,
|
|
|
|
640
|
+ // children: [
|
|
|
|
641
|
+ // Image.asset(
|
|
|
|
642
|
+ // Utils.getImgPath('add_area'),
|
|
|
|
643
|
+ // width: ScreenUtil().setWidth(24)),
|
|
|
|
644
|
+ // ],
|
|
|
|
645
|
+ // ),
|
|
|
|
646
|
+ // ),
|
|
|
|
647
|
+ // ),
|
|
|
|
648
|
+ // )
|
|
|
|
649
|
+ // ],
|
|
|
|
650
|
+ // );
|
|
|
|
651
|
+ // } else {
|
|
|
|
652
|
+ // return AreaItemTable(model.areas[index],
|
|
|
|
653
|
+ // tableManagerModel.currentArea, (area) {});
|
|
|
|
654
|
+ // }
|
|
|
|
655
|
+ // },
|
|
|
|
656
|
+ // itemBuilder: (BuildContext context, int index) {
|
|
|
|
657
|
+ // return item(index);
|
|
|
|
658
|
+ // },
|
|
|
|
659
|
+ // );
|
|
|
|
660
|
+ }
|
|
|
|
661
|
+ },
|
|
|
|
662
|
+ ),
|
|
|
|
663
|
+ ],
|
|
|
|
664
|
+ );
|
|
|
|
665
|
+ },
|
|
|
|
666
|
+ ));
|
|
654
|
}
|
667
|
}
|
|
655
|
|
668
|
|
|
656
|
@override
|
669
|
@override
|