Commit c03a4e4ebb051d306af399b272785dd3a637ac6d

Authored by wdn127929
1 parent 4a0369c3

已预订列表排序

... ... @@ -361,44 +361,44 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
);
}
_edateShow() {
//店铺过期提醒
// 计算时间差
//店铺过期日期
DateTime edate = DateTime.fromMillisecondsSinceEpoch(
int.parse(sellerInfoSunModel.data.edate) * 1000);
//当前日期
final datenow = DateTime.now();
//比较相差的天数
int difference = edate.difference(datenow).inDays;
int differenceSeconds = edate.difference(datenow).inSeconds;
if (difference == 7) {
_showSellerAlert('7', edate);
} else if (difference == 3) {
//过期差3天,提醒一次
_showSellerAlert('3', edate);
} else if (difference == 2) {
//过期差2天,提醒一次
_showSellerAlert('2', edate);
} else if (difference == 1) {
//过期差1天,提醒一次
_showSellerAlert('1', edate);
} else if (difference == 0 && differenceSeconds > 0) {
//剩余不足一天
_showSellerAlert('0', edate);
} else if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) {
//已到期
_showSellerAlert('-1', edate);
} else if (difference > 7) {
//没到期
App.sp.remove('sellerEdate');
}
// _edateShow() {
// //店铺过期提醒
// // 计算时间差
// //店铺过期日期
// DateTime edate = DateTime.fromMillisecondsSinceEpoch(
// int.parse(sellerInfoSunModel.data.edate) * 1000);
// //当前日期
// final datenow = DateTime.now();
// //比较相差的天数
// int difference = edate.difference(datenow).inDays;
// int differenceSeconds = edate.difference(datenow).inSeconds;
// if (difference == 7) {
// _showSellerAlert('7', edate);
// } else if (difference == 3) {
// //过期差3天,提醒一次
// _showSellerAlert('3', edate);
// } else if (difference == 2) {
// //过期差2天,提醒一次
// _showSellerAlert('2', edate);
// } else if (difference == 1) {
// //过期差1天,提醒一次
// _showSellerAlert('1', edate);
// } else if (difference == 0 && differenceSeconds > 0) {
// //剩余不足一天
// _showSellerAlert('0', edate);
// } else if (difference < 0 || (difference == 0 && differenceSeconds <= 0)) {
// //已到期
// _showSellerAlert('-1', edate);
// } else if (difference > 7) {
// //没到期
// App.sp.remove('sellerEdate');
// }
//
}
// //
// }
_setSpSellerModule(String day, SellerVersionSunModel sellerVersionSunModel) {
Map<String, dynamic> data = Map();
... ...
... ... @@ -66,50 +66,45 @@ class NoteBookModel extends ChangeNotifier {
Provider.of<TableManagerModel>(context, listen: false);
await tableManagerModel.getTableList(context);
List<Notebook> temp = [];
List<Notebook> temp = []; //其余订单排序
List<Notebook> tempLast = []; //3、4、6订单放在最后
notebooks.forEach((notebook) {
if (notebook.tableinfoList.length > 0) {
tableManagerModel.tableOuterList.forEach((elementAll) {
if (notebook.tableinfoList[0].rid == elementAll.rid) {
elementAll.list.forEach((element) {
if(notebook.tableinfoList[0].id == element.id){
if (notebook.status != '3' &&
notebook.status != '4' &&
notebook.status != '6') {
tableManagerModel.tableOuterList.forEach((elementAll) {
if (notebook.tableinfoList[0].rid == elementAll.rid) {
elementAll.list.forEach((element) {
if (notebook.tableinfoList[0].id == element.id) {
//桌子ID
element.notebook = notebook;
element.notebook = notebook;
//
}
});
}
});
// // if( elementTable.rid == element.tableinfoList[0].rid){
// // //区域ID
// // element.orderRID = elementTable.orderId;
// // }
}
});
}
});
} else {
tempLast.add(notebook);
}
}
});
for(int i=0;i<tableManagerModel.tableOuterList.length;i++){
for(int j=0;j<tableManagerModel.tableOuterList[i].list.length;j++){
if(tableManagerModel.tableOuterList[i].list[j].notebook != null){
temp.add(tableManagerModel.tableOuterList[i].list[j].notebook);
}
}
for (int i = 0; i < tableManagerModel.tableOuterList.length; i++) {
for (int j = 0;
j < tableManagerModel.tableOuterList[i].list.length;
j++) {
if (tableManagerModel.tableOuterList[i].list[j].notebook != null) {
temp.add(tableManagerModel.tableOuterList[i].list[j].notebook);
}
}
}
print(temp);
print(notebooks);
notebooks = temp.toList();
notebooks.addAll(tempLast);
// tableManagerModel.tableOuterList //桌子
// tableManagerModel.areaSunModelList //区域
... ...