Commit f6ebd178d313c25f6eca3a23c366279fce4cc1da

Authored by wdn127929
1 parent c0a1d201

变更桌位页面、桌位已被删除提醒

@@ -548,7 +548,7 @@ @@ -548,7 +548,7 @@
548 CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; 548 CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
549 CODE_SIGN_IDENTITY = "Apple Development"; 549 CODE_SIGN_IDENTITY = "Apple Development";
550 CODE_SIGN_STYLE = Automatic; 550 CODE_SIGN_STYLE = Automatic;
551 - CURRENT_PROJECT_VERSION = 52690; 551 + CURRENT_PROJECT_VERSION = 52691;
552 DEVELOPMENT_TEAM = 8J59HM8B82; 552 DEVELOPMENT_TEAM = 8J59HM8B82;
553 ENABLE_BITCODE = NO; 553 ENABLE_BITCODE = NO;
554 FLUTTER_BUILD_MODE = release; 554 FLUTTER_BUILD_MODE = release;
@@ -696,7 +696,7 @@ @@ -696,7 +696,7 @@
696 CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements"; 696 CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements";
697 CODE_SIGN_IDENTITY = "Apple Development"; 697 CODE_SIGN_IDENTITY = "Apple Development";
698 CODE_SIGN_STYLE = Automatic; 698 CODE_SIGN_STYLE = Automatic;
699 - CURRENT_PROJECT_VERSION = 52690; 699 + CURRENT_PROJECT_VERSION = 52691;
700 DEVELOPMENT_TEAM = 8J59HM8B82; 700 DEVELOPMENT_TEAM = 8J59HM8B82;
701 ENABLE_BITCODE = NO; 701 ENABLE_BITCODE = NO;
702 FLUTTER_BUILD_MODE = release; 702 FLUTTER_BUILD_MODE = release;
@@ -732,7 +732,7 @@ @@ -732,7 +732,7 @@
732 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; 732 CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
733 CODE_SIGN_IDENTITY = "Apple Development"; 733 CODE_SIGN_IDENTITY = "Apple Development";
734 CODE_SIGN_STYLE = Automatic; 734 CODE_SIGN_STYLE = Automatic;
735 - CURRENT_PROJECT_VERSION = 52690; 735 + CURRENT_PROJECT_VERSION = 52691;
736 DEVELOPMENT_TEAM = 8J59HM8B82; 736 DEVELOPMENT_TEAM = 8J59HM8B82;
737 ENABLE_BITCODE = NO; 737 ENABLE_BITCODE = NO;
738 FLUTTER_BUILD_MODE = release; 738 FLUTTER_BUILD_MODE = release;
@@ -37,6 +37,8 @@ import 'package:provider/provider.dart'; @@ -37,6 +37,8 @@ import 'package:provider/provider.dart';
37 import 'package:one_key/models/table_list.dart' as t; 37 import 'package:one_key/models/table_list.dart' as t;
38 import 'dart:convert' as convert; 38 import 'dart:convert' as convert;
39 import 'package:easy_contact_picker/easy_contact_picker.dart'; 39 import 'package:easy_contact_picker/easy_contact_picker.dart';
  40 +import '../../app.dart';
  41 +import '../../models/tableOuter.dart';
40 import '../../models/user_history_entity.dart'; 42 import '../../models/user_history_entity.dart';
41 import '../../provider/marketing_center_provider.dart'; 43 import '../../provider/marketing_center_provider.dart';
42 import '../../utils/call_log_utils.dart'; 44 import '../../utils/call_log_utils.dart';
@@ -45,6 +47,7 @@ import '../../utils/screen_util.dart'; @@ -45,6 +47,7 @@ import '../../utils/screen_util.dart';
45 import '../../widgets/special_text/my_extended_text_selection_controls.dart'; 47 import '../../widgets/special_text/my_extended_text_selection_controls.dart';
46 import 'package:flutter_picker/flutter_picker.dart' as Picker; 48 import 'package:flutter_picker/flutter_picker.dart' as Picker;
47 49
  50 +
48 typedef clickCallback = void Function(String value); 51 typedef clickCallback = void Function(String value);
49 52
50 class NoteBookChangeFPage extends StatefulWidget { 53 class NoteBookChangeFPage extends StatefulWidget {
@@ -537,6 +540,8 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -537,6 +540,8 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
537 } 540 }
538 } 541 }
539 542
  543 +
  544 +
540 _addNameSuffix(String name, String suffix) { 545 _addNameSuffix(String name, String suffix) {
541 if (name == _notebookDetailChangeModel.nameController.text && 546 if (name == _notebookDetailChangeModel.nameController.text &&
542 _notebookDetailChangeModel.nameController.text.endsWith(suffix)) { 547 _notebookDetailChangeModel.nameController.text.endsWith(suffix)) {
  1 +import 'dart:convert';
  2 +
1 import 'package:common_utils/common_utils.dart'; 3 import 'package:common_utils/common_utils.dart';
2 import 'package:flutter/material.dart'; 4 import 'package:flutter/material.dart';
3 import 'package:one_key/app.dart'; 5 import 'package:one_key/app.dart';
@@ -15,6 +17,9 @@ import 'package:one_key/provider/notebook_detail_model.dart'; @@ -15,6 +17,9 @@ import 'package:one_key/provider/notebook_detail_model.dart';
15 import 'package:one_key/provider/user_model.dart'; 17 import 'package:one_key/provider/user_model.dart';
16 import 'package:one_key/utils/utils.dart'; 18 import 'package:one_key/utils/utils.dart';
17 import 'package:provider/provider.dart'; 19 import 'package:provider/provider.dart';
  20 +import 'package:one_key/models/table.dart' as t;
  21 +
  22 +import '../models/tableOuter.dart';
18 23
19 class NotebookDetailChangeModel with ChangeNotifier { 24 class NotebookDetailChangeModel with ChangeNotifier {
20 List dateList = []; //日期选择 月-日 某天 25 List dateList = []; //日期选择 月-日 某天
@@ -401,6 +406,20 @@ class NotebookDetailChangeModel with ChangeNotifier { @@ -401,6 +406,20 @@ class NotebookDetailChangeModel with ChangeNotifier {
401 LogUtil.v(dailyMap); 406 LogUtil.v(dailyMap);
402 } 407 }
403 408
  409 + List<t.Table> getSpTableList() {
  410 + List<t.Table> tables = [];
  411 + String tableList = App.sp.getString('table_list');
  412 + if (tableList != null) {
  413 + List list = json.decode(tableList);
  414 + if (list.length > 0) {
  415 + list.forEach((element) {
  416 + tables.addAll(TableOuter.fromJson2(element).list);
  417 + });
  418 + }
  419 + }
  420 + return tables;
  421 + }
  422 +
404 /// 根据时间和分钟组装 格式:11:00 423 /// 根据时间和分钟组装 格式:11:00
405 _dealTime(int begin, int mm) { 424 _dealTime(int begin, int mm) {
406 String sb = ''; 425 String sb = '';
@@ -493,18 +512,21 @@ class NotebookDetailChangeModel with ChangeNotifier { @@ -493,18 +512,21 @@ class NotebookDetailChangeModel with ChangeNotifier {
493 512
494 List<String> tableIds = []; //所有桌位的id 513 List<String> tableIds = []; //所有桌位的id
495 List<String> tableIdsOld = []; //带过来所有桌位的id 514 List<String> tableIdsOld = []; //带过来所有桌位的id
496 - for (var table in oldTableList) {  
497 - tableIdsOld.add(table.id);  
498 - } 515 +
  516 + List<t.Table> tableS = getSpTableList(); //缓存的所有桌子
  517 + for (t.Table elementT in tableS) {
  518 + tableIds.add(elementT.id);
  519 + }
  520 + for (var table in oldTableList) {
  521 + tableIdsOld.add(table.id);
  522 + }
499 for (TableListSunModel item in itemModelList) { 523 for (TableListSunModel item in itemModelList) {
500 if (item.name == "推荐") { 524 if (item.name == "推荐") {
501 itemModelList.remove(item); 525 itemModelList.remove(item);
502 } 526 }
503 527
504 for (var item in item.list) { 528 for (var item in item.list) {
505 - tableIds.add(item.id);  
506 for (var table in oldTableList) { 529 for (var table in oldTableList) {
507 -  
508 if (item.id == table.id) { 530 if (item.id == table.id) {
509 item.selected = true; 531 item.selected = true;
510 if (!tableList.contains(item)) { 532 if (!tableList.contains(item)) {
@@ -573,7 +595,6 @@ class NotebookDetailChangeModel with ChangeNotifier { @@ -573,7 +595,6 @@ class NotebookDetailChangeModel with ChangeNotifier {
573 msg += '${item.name},'; 595 msg += '${item.name},';
574 } 596 }
575 if (delTablesid.contains(item.id)) { 597 if (delTablesid.contains(item.id)) {
576 -  
577 msgDel += '${item.name},'; 598 msgDel += '${item.name},';
578 } 599 }
579 } 600 }
@@ -586,10 +607,10 @@ class NotebookDetailChangeModel with ChangeNotifier { @@ -586,10 +607,10 @@ class NotebookDetailChangeModel with ChangeNotifier {
586 607
587 if (msg != '' && msgDel == '') { 608 if (msg != '' && msgDel == '') {
588 Utils.showToast('${msg}已被占用啦'); 609 Utils.showToast('${msg}已被占用啦');
589 - }else if(msg == '' && msgDel != '') { 610 + } else if (msg == '' && msgDel != '') {
590 Utils.showToast('${msgDel}已被删除啦'); 611 Utils.showToast('${msgDel}已被删除啦');
591 - }else if(msg != '' && msgDel != '') {  
592 - Utils.showToast('${msg}已被占用啦\n'+'${msgDel}已被删除啦'); 612 + } else if (msg != '' && msgDel != '') {
  613 + Utils.showToast('${msg}已被占用啦\n' + '${msgDel}已被删除啦');
593 } 614 }
594 } 615 }
595 616