Commit c03a4e4ebb051d306af399b272785dd3a637ac6d

Authored by wdn127929
1 parent 4a0369c3

已预订列表排序

@@ -361,44 +361,44 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -361,44 +361,44 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
361 ); 361 );
362 } 362 }
363 363
364 - _edateShow() {  
365 - //店铺过期提醒  
366 - // 计算时间差  
367 - //店铺过期日期  
368 - DateTime edate = DateTime.fromMillisecondsSinceEpoch(  
369 - int.parse(sellerInfoSunModel.data.edate) * 1000);  
370 -  
371 - //当前日期  
372 - final datenow = DateTime.now();  
373 -  
374 - //比较相差的天数  
375 - int difference = edate.difference(datenow).inDays;  
376 -  
377 - int differenceSeconds = edate.difference(datenow).inSeconds;  
378 - if (difference == 7) {  
379 - _showSellerAlert('7', edate);  
380 - } else if (difference == 3) {  
381 - //过期差3天,提醒一次  
382 - _showSellerAlert('3', edate);  
383 - } else if (difference == 2) {  
384 - //过期差2天,提醒一次  
385 - _showSellerAlert('2', edate);  
386 - } else if (difference == 1) {  
387 - //过期差1天,提醒一次  
388 - _showSellerAlert('1', edate);  
389 - } else if (difference == 0 && differenceSeconds > 0) {  
390 - //剩余不足一天  
391 - _showSellerAlert('0', edate);  
392 - } else if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) {  
393 - //已到期  
394 - _showSellerAlert('-1', edate);  
395 - } else if (difference > 7) {  
396 - //没到期  
397 - App.sp.remove('sellerEdate');  
398 - } 364 + // _edateShow() {
  365 + // //店铺过期提醒
  366 + // // 计算时间差
  367 + // //店铺过期日期
  368 + // DateTime edate = DateTime.fromMillisecondsSinceEpoch(
  369 + // int.parse(sellerInfoSunModel.data.edate) * 1000);
  370 +
  371 + // //当前日期
  372 + // final datenow = DateTime.now();
  373 +
  374 + // //比较相差的天数
  375 + // int difference = edate.difference(datenow).inDays;
  376 +
  377 + // int differenceSeconds = edate.difference(datenow).inSeconds;
  378 + // if (difference == 7) {
  379 + // _showSellerAlert('7', edate);
  380 + // } else if (difference == 3) {
  381 + // //过期差3天,提醒一次
  382 + // _showSellerAlert('3', edate);
  383 + // } else if (difference == 2) {
  384 + // //过期差2天,提醒一次
  385 + // _showSellerAlert('2', edate);
  386 + // } else if (difference == 1) {
  387 + // //过期差1天,提醒一次
  388 + // _showSellerAlert('1', edate);
  389 + // } else if (difference == 0 && differenceSeconds > 0) {
  390 + // //剩余不足一天
  391 + // _showSellerAlert('0', edate);
  392 + // } else if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) {
  393 + // //已到期
  394 + // _showSellerAlert('-1', edate);
  395 + // } else if (difference > 7) {
  396 + // //没到期
  397 + // App.sp.remove('sellerEdate');
  398 + // }
399 399
400 - //  
401 - } 400 + // //
  401 + // }
402 402
403 _setSpSellerModule(String day, SellerVersionSunModel sellerVersionSunModel) { 403 _setSpSellerModule(String day, SellerVersionSunModel sellerVersionSunModel) {
404 Map<String, dynamic> data = Map(); 404 Map<String, dynamic> data = Map();
@@ -66,50 +66,45 @@ class NoteBookModel extends ChangeNotifier { @@ -66,50 +66,45 @@ class NoteBookModel extends ChangeNotifier {
66 Provider.of<TableManagerModel>(context, listen: false); 66 Provider.of<TableManagerModel>(context, listen: false);
67 67
68 await tableManagerModel.getTableList(context); 68 await tableManagerModel.getTableList(context);
69 - List<Notebook> temp = [];  
70 - 69 + List<Notebook> temp = []; //其余订单排序
  70 + List<Notebook> tempLast = []; //3、4、6订单放在最后
71 notebooks.forEach((notebook) { 71 notebooks.forEach((notebook) {
72 if (notebook.tableinfoList.length > 0) { 72 if (notebook.tableinfoList.length > 0) {
73 - tableManagerModel.tableOuterList.forEach((elementAll) {  
74 - if (notebook.tableinfoList[0].rid == elementAll.rid) {  
75 - elementAll.list.forEach((element) {  
76 - if(notebook.tableinfoList[0].id == element.id){ 73 + if (notebook.status != '3' &&
  74 + notebook.status != '4' &&
  75 + notebook.status != '6') {
  76 + tableManagerModel.tableOuterList.forEach((elementAll) {
  77 + if (notebook.tableinfoList[0].rid == elementAll.rid) {
  78 + elementAll.list.forEach((element) {
  79 + if (notebook.tableinfoList[0].id == element.id) {
77 //桌子ID 80 //桌子ID
78 -element.notebook = notebook; 81 + element.notebook = notebook;
79 // 82 //
80 - }  
81 - });  
82 - }  
83 - });  
84 -  
85 - // // if( elementTable.rid == element.tableinfoList[0].rid){  
86 - // // //区域ID  
87 -  
88 - // // element.orderRID = elementTable.orderId;  
89 -  
90 - // // } 83 + }
  84 + });
  85 + }
  86 + });
  87 + } else {
  88 + tempLast.add(notebook);
  89 + }
91 } 90 }
92 }); 91 });
93 92
94 - for(int i=0;i<tableManagerModel.tableOuterList.length;i++){  
95 -  
96 -for(int j=0;j<tableManagerModel.tableOuterList[i].list.length;j++){  
97 -if(tableManagerModel.tableOuterList[i].list[j].notebook != null){  
98 - temp.add(tableManagerModel.tableOuterList[i].list[j].notebook);  
99 -}  
100 -  
101 -  
102 -} 93 + for (int i = 0; i < tableManagerModel.tableOuterList.length; i++) {
  94 + for (int j = 0;
  95 + j < tableManagerModel.tableOuterList[i].list.length;
  96 + j++) {
  97 + if (tableManagerModel.tableOuterList[i].list[j].notebook != null) {
  98 + temp.add(tableManagerModel.tableOuterList[i].list[j].notebook);
  99 + }
  100 + }
103 } 101 }
104 102
105 -  
106 -  
107 print(temp); 103 print(temp);
108 print(notebooks); 104 print(notebooks);
109 105
110 notebooks = temp.toList(); 106 notebooks = temp.toList();
111 -  
112 - 107 + notebooks.addAll(tempLast);
113 108
114 // tableManagerModel.tableOuterList //桌子 109 // tableManagerModel.tableOuterList //桌子
115 // tableManagerModel.areaSunModelList //区域 110 // tableManagerModel.areaSunModelList //区域