Commit f28cfebd625bf0913a9c8bfa99414060aa86617f

Authored by wdn127929
1 parent b5a59c6d

选择桌位页面桌子选中状态(bug),上一版修改宴会添加桌位页面时导致的&&选择桌位页面 仅看空座 功能bug && 选中桌子的时候更新 全部 里面的选中状态

... ... @@ -108,22 +108,23 @@ class SelectTableFPageOrReserveState extends State<SelectTableFPageOrReserve> {
}
///
_getTableListOrReserve() async {
_getTableListOrReserve({bool showLoading = false}) async {
await tableManagerModel.getTableListOrReserve(
context, int.parse(widget.ddate_slot), widget.dateTime, _selectNumber);
context, int.parse(widget.ddate_slot), widget.dateTime, _selectNumber,
showLoading: showLoading);
tableManagerModel.tablesOrReserveDataShow.forEach((element) {
if (element.name == '全部') {
element.tableList.forEach((element) {
element.selected = false;
for (var table in widget.tableList) {
if (element.id == table.id) {
element.selected = true;
element.tableList.forEach((element) {
element.selected = false;
for (var table in widget.tableList) {
if (element.id == table.id) {
element.selected = true;
if (element.name == '全部') {
selectNum++;
tableManagerModel.selectTablesOrReserve.add(element);
}
}
});
}
}
});
});
tableManagerModel.notifyListeners();
}
... ... @@ -262,11 +263,27 @@ class SelectTableFPageOrReserveState extends State<SelectTableFPageOrReserve> {
tableManagerModel.selectTablesOrReserve.add(table);
selectNum++;
widget.tableList.add(table);
tableManagerModel.tablesOrReserveDataShow
.forEach((element) {
element.tableList.forEach((element1) {
if (element1.id == table.id) {
element1.selected = true;
}
});
});
} else {
widget.tableList.removeWhere((t) => t.id == table.id);
selectNum--;
tableManagerModel.selectTablesOrReserve
.removeWhere((t) => t.id == table.id);
tableManagerModel.tablesOrReserveDataShow
.forEach((element) {
element.tableList.forEach((element1) {
if (element1.id == table.id) {
element1.selected = false;
}
});
});
}
setState(() {});
}
... ... @@ -299,12 +316,14 @@ class SelectTableFPageOrReserveState extends State<SelectTableFPageOrReserve> {
child: ExceptionPage(
pageState: model.pageStateOrReserve,
callback: () {
tableManagerModel.getTableListOrReserve(
context,
int.parse(widget.ddate_slot),
widget.dateTime,
_selectNumber,
showLoading: true);
// tableManagerModel.getTableListOrReserve(
// context,
// int.parse(widget.ddate_slot),
// widget.dateTime,
// _selectNumber,
// showLoading: true);
_getTableListOrReserve(showLoading: true);
},
emptyMsg: "暂时没有桌位哦",
emptyImg: "empty_search",
... ... @@ -473,12 +492,13 @@ class SelectTableFPageOrReserveState extends State<SelectTableFPageOrReserve> {
} else {
// model.tablesOrReserveDataShow =
// model.tablesOrReserveData.toList();
tableManagerModel.getTableListOrReserve(
context,
int.parse(widget.ddate_slot),
widget.dateTime,
_selectNumber,
showLoading: true);
// tableManagerModel.getTableListOrReserve(
// context,
// int.parse(widget.ddate_slot),
// widget.dateTime,
// _selectNumber,
// showLoading: true);
_getTableListOrReserve(showLoading: true);
}
setState(() {});
... ...
... ... @@ -2619,6 +2619,14 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
xuantaiData[xuantaiSelIndex].dateTimext,
showLoading: true);
if (xuantaiData[xuantaiSelIndex].cdSelIndex ==
-1) {
// xuantaiData[xuantaiSelIndex].cdShow
Utils.showToast(
'当前选中餐段【${xuantaiData[xuantaiSelIndex].cdShow}】不存在,请重新选择!');
return;
}
//带餐
int ddate = xuantaiData[xuantaiSelIndex]
.dateTimext
... ...
... ... @@ -515,12 +515,12 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
return;
}
}
if(cuisineIds.length == 0){
Utils.showToast('请至少选择一个菜系!');
return;
}
setSellerCuisine();
setAverage();
// if(cuisineIds.length == 0){
// Utils.showToast('请至少选择一个菜系!');
// return;
// }
// setSellerCuisine();
// setAverage();
await _setReceiveTime();
_refreshMarketingInfo();
await _setSellerInfoById();
... ... @@ -2385,115 +2385,115 @@ class _StoreBaseInfoPageState extends State<StoreBaseInfoPage> {
keyboardType: TextInputType.multiline,
)),
VEmptyView(152),
Text('其他信息',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_515151)),
VEmptyView(34),
timeWidget('经营菜系', cuisine, highted: false,
onTap: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //隐藏键盘
// 存储
DialogUtil.openCuisineSelectModalBottomSheet(
context,
List.from(_baseIndoProvider.allCuisineData),
cuisineIds, rCallback: (value) async {
if (value != null) {
cuisineIds = value;
cuisine = '';
_baseIndoProvider.allCuisineData
.forEach((element) {
if (cuisineIds.contains(element.id)) {
cuisine += element.name + ' ';
}
});
if (cuisine.endsWith(' ')) {
cuisine = cuisine.substring(
0, cuisine.length - 1);
}
setState(() {});
}
});
}),
VEmptyView(40),
///应收金额
Container(
// color: Colors.white,
padding: EdgeInsets.only(
left: ScreenUtil().setWidth(24),
right: w(10)),
child: Row(
children: [
Text(
'人均消费',
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_999999),
),
// HEmptyView(40),
Expanded(
child: Container(
child: TextField(
maxLines: 1,
textAlign: TextAlign.right,
//输入文本的样式
style: TextStyle(
fontSize:
ScreenUtil().setSp(28),
color:
MyColours.color_438E93),
controller: _averageC,
// focusNode: _focusNode,
keyboardType: TextInputType
.numberWithOptions(
decimal: true),
// textAlignVertical: TextAlignVertical.bottom,
decoration: InputDecoration(
isCollapsed: false,
hintText: "请输入",
hintStyle: TextStyle(
color:
MyColours.color_999999,
fontSize:
ScreenUtil().setSp(28),
),
// contentPadding:
// EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
contentPadding:
EdgeInsets.zero,
border: OutlineInputBorder(
borderSide:
BorderSide.none),
),
onChanged: (value) {
// print(value);
// // currentRemark = value;
// // print();
// setState(() {
// if (value != '¥' && value.trim().length > 0) {
// btnState = 1;
// } else {
// btnState = -1;
// }
// });
},
onEditingComplete: () {
print('fff');
// _focusNode.unfocus();
// VEmptyView(152),
// Text('其他信息',
// style: TextStyle(
// fontWeight: FontWeight.bold,
// fontSize: ScreenUtil().setSp(32),
// color: MyColours.color_515151)),
// VEmptyView(34),
// timeWidget('经营菜系', cuisine, highted: false,
// onTap: () {
// FocusScope.of(context)
// .requestFocus(FocusNode()); //隐藏键盘
// // 存储
// DialogUtil.openCuisineSelectModalBottomSheet(
// context,
// List.from(_baseIndoProvider.allCuisineData),
// cuisineIds, rCallback: (value) async {
// if (value != null) {
// cuisineIds = value;
// cuisine = '';
// _baseIndoProvider.allCuisineData
// .forEach((element) {
// if (cuisineIds.contains(element.id)) {
// cuisine += element.name + ' ';
// }
// });
// if (cuisine.endsWith(' ')) {
// cuisine = cuisine.substring(
// 0, cuisine.length - 1);
// }
// setState(() {});
// }
// });
// }),
// VEmptyView(40),
// ///应收金额
// _editingController.text = '';
// _needNode.unfocus();
})))
],
)),
// Container(
// // color: Colors.white,
// padding: EdgeInsets.only(
// left: ScreenUtil().setWidth(24),
// right: w(10)),
// child: Row(
// children: [
// Text(
// '人均消费',
// style: TextStyle(
// fontSize: ScreenUtil().setSp(28),
// color: MyColours.color_999999),
// ),
// // HEmptyView(40),
// Expanded(
// child: Container(
// child: TextField(
// maxLines: 1,
// textAlign: TextAlign.right,
// //输入文本的样式
// style: TextStyle(
// fontSize:
// ScreenUtil().setSp(28),
// color:
// MyColours.color_438E93),
// controller: _averageC,
// // focusNode: _focusNode,
// keyboardType: TextInputType
// .numberWithOptions(
// decimal: true),
// // textAlignVertical: TextAlignVertical.bottom,
// decoration: InputDecoration(
// isCollapsed: false,
// hintText: "请输入",
// hintStyle: TextStyle(
// color:
// MyColours.color_999999,
// fontSize:
// ScreenUtil().setSp(28),
// ),
// // contentPadding:
// // EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
// contentPadding:
// EdgeInsets.zero,
// border: OutlineInputBorder(
// borderSide:
// BorderSide.none),
// ),
// onChanged: (value) {
// // print(value);
// // // currentRemark = value;
// // // print();
// // setState(() {
// // if (value != '¥' && value.trim().length > 0) {
// // btnState = 1;
// // } else {
// // btnState = -1;
// // }
// // });
// },
// onEditingComplete: () {
// print('fff');
// // _focusNode.unfocus();
// // _editingController.text = '';
// // _needNode.unfocus();
// })))
// ],
// )),
// Padding(
// padding: EdgeInsets.symmetric(
... ...