|
...
|
...
|
@@ -359,8 +359,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
: tableManagerModel.currentArea == '全部'
|
|
|
|
? tableManagerModel.tablesShow.length
|
|
|
|
: tableManagerModel
|
|
|
|
.areaTableMapShow[tableManagerModel.currentArea].length +
|
|
|
|
1,
|
|
|
|
.areaTableMapShow[tableManagerModel.currentArea].length,
|
|
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
crossAxisCount: 4,
|
|
|
|
childAspectRatio: 1,
|
|
...
|
...
|
@@ -375,203 +374,202 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
? tableManagerModel.tablesShow
|
|
|
|
: tableManagerModel
|
|
|
|
.areaTableMapShow[tableManagerModel.areas[i].name];
|
|
|
|
if (index == data.length || data.length == 0) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () async {
|
|
|
|
List<String> areas = [];
|
|
|
|
for (int i = 0; i < tableManagerModel.areas.length; i++) {
|
|
|
|
areas.add(tableManagerModel.areas[i].name);
|
|
|
|
// if (index == data.length || data.length == 0) {
|
|
|
|
// return InkWell(
|
|
|
|
// onTap: () async {
|
|
|
|
// List<String> areas = [];
|
|
|
|
// for (int i = 0; i < tableManagerModel.areas.length; i++) {
|
|
|
|
// areas.add(tableManagerModel.areas[i].name);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //添加桌位弹框
|
|
|
|
// await DialogUtil.openCreateTableDialog(
|
|
|
|
// context, areas, i, personNumList,
|
|
|
|
// onTap: (Map<String, String> value) async {
|
|
|
|
// print(value);
|
|
|
|
// // 'areaname':
|
|
|
|
// // areas[currentAreaIndex],
|
|
|
|
// // 'name': controller.text,
|
|
|
|
// // 'pnumMin': pnumMin,
|
|
|
|
// // 'pnumMax': pnumMax
|
|
|
|
// //添加桌位 接口参数带整合???
|
|
|
|
// // 以下是旧的不去,明天添加桌位接口
|
|
|
|
// String rid;
|
|
|
|
// for (Area item in tableManagerModel.areas) {
|
|
|
|
// if (item.name == value['areaname']) {
|
|
|
|
// rid = item.rid;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// Map<String, String> params = {
|
|
|
|
// 'rid': rid,
|
|
|
|
// 'name': value['name'],
|
|
|
|
// };
|
|
|
|
// if (value['pnumMin'] != '') {
|
|
|
|
// params['pnum'] = value['pnumMin'];
|
|
|
|
// }
|
|
|
|
// if (value['pnumMax'] != '') {
|
|
|
|
// params['most_pnum'] = value['pnumMax'];
|
|
|
|
// }
|
|
|
|
// bool success =
|
|
|
|
// await tableManagerModel.addTable(context, params);
|
|
|
|
// print(success);
|
|
|
|
// if (success) {
|
|
|
|
// Utils.showToast('添加成功!');
|
|
|
|
// // TableOuter tableOuter = TableOuter();
|
|
|
|
// // tableOuter.name = value;
|
|
|
|
// // tableOuter.list = [];
|
|
|
|
// // tableManagerModel.tableOuterList.add(tableOuter);
|
|
|
|
// // tableManagerModel.initData();
|
|
|
|
// // Timer(
|
|
|
|
// // Duration(milliseconds: 500),
|
|
|
|
// // () => _areaController.jumpTo(
|
|
|
|
// // _areaController.position.maxScrollExtent));
|
|
|
|
|
|
|
|
// // await tableManagerModel
|
|
|
|
// // .getTableList(context);
|
|
|
|
// // await tableManagerModel
|
|
|
|
// // .initData();
|
|
|
|
// await tableManagerModel.refreshTable(context);
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: Container(
|
|
|
|
// child: DottedBorder(
|
|
|
|
// dashPattern: [5, 5, 5, 5],
|
|
|
|
// borderType: BorderType.RRect,
|
|
|
|
// radius: Radius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
// // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
// color: MyColours.color_E0E0E0,
|
|
|
|
// strokeWidth: ScreenUtil().setWidth(2),
|
|
|
|
// child: ClipRRect(
|
|
|
|
// borderRadius: BorderRadius.all(
|
|
|
|
// Radius.circular(ScreenUtil().setWidth(20))),
|
|
|
|
// child: Container(
|
|
|
|
// height: ScreenUtil().screenWidth -
|
|
|
|
// ScreenUtil().setWidth(12 * 3 - 10 * 2),
|
|
|
|
// width: ScreenUtil().screenWidth -
|
|
|
|
// ScreenUtil().setWidth(12 * 3 - 10 * 2),
|
|
|
|
// child: Column(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// Image.asset(Utils.getImgPath('add_store'),
|
|
|
|
// width: ScreenUtil().setWidth(32)),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// )));
|
|
|
|
// } else {
|
|
|
|
return Selector<TableManagerModel, t.Table>(
|
|
|
|
shouldRebuild: (pre, next) => true,
|
|
|
|
selector: (context, model) => data[index],
|
|
|
|
builder: (context, table, _) {
|
|
|
|
return FTableItem(table,
|
|
|
|
canSelected: true, selectTables: tableManagerModel.selectTables,
|
|
|
|
onSelected: (table) {
|
|
|
|
if (table.signStr == '已预订') {
|
|
|
|
if (table.sign == '10') {
|
|
|
|
//宴会订单
|
|
|
|
NavigatorUtil.goFeastDetailPage(context, table.notebookId,
|
|
|
|
canEdit: false);
|
|
|
|
} else {
|
|
|
|
//进入订座详情页面
|
|
|
|
NavigatorUtil.goNotebookDetailPage(
|
|
|
|
context,
|
|
|
|
tableManagerModel.tableMap[table.id].id,
|
|
|
|
tableManagerModel.tableMap[table.id].uid);
|
|
|
|
}
|
|
|
|
|
|
|
|
//添加桌位弹框
|
|
|
|
await DialogUtil.openCreateTableDialog(
|
|
|
|
context, areas, i, personNumList,
|
|
|
|
onTap: (Map<String, String> value) async {
|
|
|
|
print(value);
|
|
|
|
// 'areaname':
|
|
|
|
// areas[currentAreaIndex],
|
|
|
|
// 'name': controller.text,
|
|
|
|
// 'pnumMin': pnumMin,
|
|
|
|
// 'pnumMax': pnumMax
|
|
|
|
//添加桌位 接口参数带整合???
|
|
|
|
// 以下是旧的不去,明天添加桌位接口
|
|
|
|
String rid;
|
|
|
|
for (Area item in tableManagerModel.areas) {
|
|
|
|
if (item.name == value['areaname']) {
|
|
|
|
rid = item.rid;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Map<String, String> params = {
|
|
|
|
'rid': rid,
|
|
|
|
'name': value['name'],
|
|
|
|
};
|
|
|
|
if (value['pnumMin'] != '') {
|
|
|
|
params['pnum'] = value['pnumMin'];
|
|
|
|
}
|
|
|
|
if (value['pnumMax'] != '') {
|
|
|
|
params['most_pnum'] = value['pnumMax'];
|
|
|
|
} else {
|
|
|
|
setState(() {
|
|
|
|
if ((table as t.Table).selected) {
|
|
|
|
tableManagerModel.selectTables.add(table);
|
|
|
|
} else {
|
|
|
|
tableManagerModel.selectTables
|
|
|
|
.removeWhere((t) => t.id == table.id);
|
|
|
|
}
|
|
|
|
bool success =
|
|
|
|
await tableManagerModel.addTable(context, params);
|
|
|
|
print(success);
|
|
|
|
if (success) {
|
|
|
|
Utils.showToast('添加成功!');
|
|
|
|
// TableOuter tableOuter = TableOuter();
|
|
|
|
// tableOuter.name = value;
|
|
|
|
// tableOuter.list = [];
|
|
|
|
// tableManagerModel.tableOuterList.add(tableOuter);
|
|
|
|
// tableManagerModel.initData();
|
|
|
|
// Timer(
|
|
|
|
// Duration(milliseconds: 500),
|
|
|
|
// () => _areaController.jumpTo(
|
|
|
|
// _areaController.position.maxScrollExtent));
|
|
|
|
|
|
|
|
// await tableManagerModel
|
|
|
|
// .getTableList(context);
|
|
|
|
// await tableManagerModel
|
|
|
|
// .initData();
|
|
|
|
await tableManagerModel.refreshTable(context);
|
|
|
|
if (tableManagerModel.selectTables.length == 0) {
|
|
|
|
// wechatNotification = true;
|
|
|
|
_clearData();
|
|
|
|
}
|
|
|
|
// if (tableManagerModel.selectTables.length > 1) {
|
|
|
|
// _scrollCrl.position
|
|
|
|
// .didUpdateScrollPositionBy(0); //这里触发更新滚动条
|
|
|
|
// }
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
child: DottedBorder(
|
|
|
|
dashPattern: [5, 5, 5, 5],
|
|
|
|
borderType: BorderType.RRect,
|
|
|
|
radius: Radius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
// padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
color: MyColours.color_E0E0E0,
|
|
|
|
strokeWidth: ScreenUtil().setWidth(2),
|
|
|
|
child: ClipRRect(
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
Radius.circular(ScreenUtil().setWidth(20))),
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().screenWidth -
|
|
|
|
ScreenUtil().setWidth(12 * 3 - 10 * 2),
|
|
|
|
width: ScreenUtil().screenWidth -
|
|
|
|
ScreenUtil().setWidth(12 * 3 - 10 * 2),
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Image.asset(Utils.getImgPath('add_store'),
|
|
|
|
width: ScreenUtil().setWidth(32)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)));
|
|
|
|
} else {
|
|
|
|
return Selector<TableManagerModel, t.Table>(
|
|
|
|
shouldRebuild: (pre, next) => true,
|
|
|
|
selector: (context, model) => data[index],
|
|
|
|
builder: (context, table, _) {
|
|
|
|
return FTableItem(table,
|
|
|
|
canSelected: true,
|
|
|
|
selectTables: tableManagerModel.selectTables,
|
|
|
|
onSelected: (table) {
|
|
|
|
if (table.signStr == '已预订') {
|
|
|
|
if (table.sign == '10') {
|
|
|
|
//宴会订单
|
|
|
|
NavigatorUtil.goFeastDetailPage(context, table.notebookId,
|
|
|
|
canEdit: false);
|
|
|
|
} else {
|
|
|
|
//进入订座详情页面
|
|
|
|
NavigatorUtil.goNotebookDetailPage(
|
|
|
|
context,
|
|
|
|
tableManagerModel.tableMap[table.id].id,
|
|
|
|
tableManagerModel.tableMap[table.id].uid);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
setState(() {
|
|
|
|
if ((table as t.Table).selected) {
|
|
|
|
tableManagerModel.selectTables.add(table);
|
|
|
|
} else {
|
|
|
|
tableManagerModel.selectTables
|
|
|
|
.removeWhere((t) => t.id == table.id);
|
|
|
|
}
|
|
|
|
if (tableManagerModel.selectTables.length == 0) {
|
|
|
|
// wechatNotification = true;
|
|
|
|
_clearData();
|
|
|
|
}
|
|
|
|
// if (tableManagerModel.selectTables.length > 1) {
|
|
|
|
// _scrollCrl.position
|
|
|
|
// .didUpdateScrollPositionBy(0); //这里触发更新滚动条
|
|
|
|
// }
|
|
|
|
});
|
|
|
|
}
|
|
|
|
// DialogUtil.showTableManagerDialog(context, table).then((value) {
|
|
|
|
// if (value != null) {
|
|
|
|
// switch (value) {
|
|
|
|
// case 1: //查看详情
|
|
|
|
// NavigatorUtil.goNotebookDetailPage(
|
|
|
|
// context,
|
|
|
|
// tableManagerModel.tableMap[table.id].id,
|
|
|
|
// tableManagerModel.tableMap[table.id].uid);
|
|
|
|
// break;
|
|
|
|
// case 2: //订座
|
|
|
|
// NavigatorUtil.goNoteBookChangePage(
|
|
|
|
// context,
|
|
|
|
// NotebookDetail.fromTableManager(
|
|
|
|
// tableManagerModel.getCurrDdateStr(),
|
|
|
|
// tableManagerModel.currTimeIndex.toString(),
|
|
|
|
// table),
|
|
|
|
// "");
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// case 3: //停用,启用桌位
|
|
|
|
// Map<String, String> params = {
|
|
|
|
// "id": (table as t.Table).id,
|
|
|
|
// "status": (table as t.Table).enable == "1" ? "0" : "1"
|
|
|
|
// };
|
|
|
|
// tableManagerModel
|
|
|
|
// .setSwitchStatus(context, params)
|
|
|
|
// .then((value) {
|
|
|
|
// if (value != null) {
|
|
|
|
// (table as t.Table).enable =
|
|
|
|
// ((int.parse((table as t.Table).enable) + 1) % 2)
|
|
|
|
// .toString();
|
|
|
|
// if ((table as t.Table).enable == "1") {
|
|
|
|
// for (Area area in tableManagerModel.areas) {
|
|
|
|
// if (area.name ==
|
|
|
|
// tableManagerModel.currentArea) {
|
|
|
|
// if (table.sign != '5' && table.sign != '1') {
|
|
|
|
// //已预订
|
|
|
|
// area.count++;
|
|
|
|
// }
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// for (Area area in tableManagerModel.areas) {
|
|
|
|
// if (area.name ==
|
|
|
|
// tableManagerModel.currentArea) {
|
|
|
|
// if (table.sign != '5' && table.sign != '1') {
|
|
|
|
// //已预订
|
|
|
|
// area.count--;
|
|
|
|
// }
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// tableManagerModel.notifyListeners();
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// break;
|
|
|
|
// case 4: //照片管理
|
|
|
|
// NavigatorUtil.goTablePhotoManagerPage(context,
|
|
|
|
// tid: (table as t.Table).id,
|
|
|
|
// tname: (table as t.Table).name);
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
},
|
|
|
|
fromPage: 'table_manage',
|
|
|
|
tableMap: tableManagerModel.tableMap,
|
|
|
|
rid: "");
|
|
|
|
}
|
|
|
|
// DialogUtil.showTableManagerDialog(context, table).then((value) {
|
|
|
|
// if (value != null) {
|
|
|
|
// switch (value) {
|
|
|
|
// case 1: //查看详情
|
|
|
|
// NavigatorUtil.goNotebookDetailPage(
|
|
|
|
// context,
|
|
|
|
// tableManagerModel.tableMap[table.id].id,
|
|
|
|
// tableManagerModel.tableMap[table.id].uid);
|
|
|
|
// break;
|
|
|
|
// case 2: //订座
|
|
|
|
// NavigatorUtil.goNoteBookChangePage(
|
|
|
|
// context,
|
|
|
|
// NotebookDetail.fromTableManager(
|
|
|
|
// tableManagerModel.getCurrDdateStr(),
|
|
|
|
// tableManagerModel.currTimeIndex.toString(),
|
|
|
|
// table),
|
|
|
|
// "");
|
|
|
|
// break;
|
|
|
|
|
|
|
|
// case 3: //停用,启用桌位
|
|
|
|
// Map<String, String> params = {
|
|
|
|
// "id": (table as t.Table).id,
|
|
|
|
// "status": (table as t.Table).enable == "1" ? "0" : "1"
|
|
|
|
// };
|
|
|
|
// tableManagerModel
|
|
|
|
// .setSwitchStatus(context, params)
|
|
|
|
// .then((value) {
|
|
|
|
// if (value != null) {
|
|
|
|
// (table as t.Table).enable =
|
|
|
|
// ((int.parse((table as t.Table).enable) + 1) % 2)
|
|
|
|
// .toString();
|
|
|
|
// if ((table as t.Table).enable == "1") {
|
|
|
|
// for (Area area in tableManagerModel.areas) {
|
|
|
|
// if (area.name ==
|
|
|
|
// tableManagerModel.currentArea) {
|
|
|
|
// if (table.sign != '5' && table.sign != '1') {
|
|
|
|
// //已预订
|
|
|
|
// area.count++;
|
|
|
|
// }
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// for (Area area in tableManagerModel.areas) {
|
|
|
|
// if (area.name ==
|
|
|
|
// tableManagerModel.currentArea) {
|
|
|
|
// if (table.sign != '5' && table.sign != '1') {
|
|
|
|
// //已预订
|
|
|
|
// area.count--;
|
|
|
|
// }
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// tableManagerModel.notifyListeners();
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// break;
|
|
|
|
// case 4: //照片管理
|
|
|
|
// NavigatorUtil.goTablePhotoManagerPage(context,
|
|
|
|
// tid: (table as t.Table).id,
|
|
|
|
// tname: (table as t.Table).name);
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
fromPage: 'table_manage',
|
|
|
|
tableMap: tableManagerModel.tableMap,
|
|
|
|
rid: "");
|
|
|
|
},
|
|
|
|
);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
...
|
...
|
@@ -3318,168 +3316,166 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
child: ListView.builder(
|
|
|
|
itemCount: tableManagerModel.areas.length ==
|
|
|
|
0
|
|
|
|
? 1
|
|
|
|
: tableManagerModel.areas.length + 2,
|
|
|
|
? 0
|
|
|
|
: tableManagerModel.areas.length + 1,
|
|
|
|
shrinkWrap: true,
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
itemBuilder:
|
|
|
|
(BuildContext contxt, int index) {
|
|
|
|
if (index ==
|
|
|
|
tableManagerModel.areas.length +
|
|
|
|
1 ||
|
|
|
|
tableManagerModel.areas.length == 0) {
|
|
|
|
// if (index ==
|
|
|
|
// tableManagerModel.areas.length +
|
|
|
|
// 1 ||
|
|
|
|
// tableManagerModel.areas.length == 0) {
|
|
|
|
// return InkWell(
|
|
|
|
// onTap: () async {
|
|
|
|
// //添加区域弹框
|
|
|
|
// await DialogUtil
|
|
|
|
// .openCreateAreaDialog(context,
|
|
|
|
// onTap: (value) async {
|
|
|
|
// print(value);
|
|
|
|
// //添加区域
|
|
|
|
// bool success =
|
|
|
|
// await tableManagerModel
|
|
|
|
// .addTableAreas(
|
|
|
|
// context, value);
|
|
|
|
// print(success);
|
|
|
|
// if (success) {
|
|
|
|
// Utils.showToast('添加成功!');
|
|
|
|
// tableManagerModel.currentArea =
|
|
|
|
// value;
|
|
|
|
|
|
|
|
// await tableManagerModel
|
|
|
|
// .refreshTable(context);
|
|
|
|
// // await tableManagerModel
|
|
|
|
// // .getTableList(context,
|
|
|
|
// // needLoading: false);
|
|
|
|
// // tableManagerModel.initData();
|
|
|
|
|
|
|
|
// // setState(() {
|
|
|
|
// // updateMenu();
|
|
|
|
// // });
|
|
|
|
// // _scrollToIndex(widget
|
|
|
|
// // .tableManagerModel
|
|
|
|
// // .areas
|
|
|
|
// // .length);
|
|
|
|
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: Column(
|
|
|
|
// children: [
|
|
|
|
// VEmptyView(20),
|
|
|
|
// DottedBorder(
|
|
|
|
// dashPattern: [5, 5, 5, 5],
|
|
|
|
// borderType: BorderType.RRect,
|
|
|
|
// // radius: Radius.circular(
|
|
|
|
// // ScreenUtil().setWidth(10)),
|
|
|
|
// // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
// color: MyColours.color_199095,
|
|
|
|
// strokeWidth:
|
|
|
|
// ScreenUtil().setWidth(2),
|
|
|
|
// child: ClipRRect(
|
|
|
|
// borderRadius: BorderRadius
|
|
|
|
// .all(Radius.circular(
|
|
|
|
// ScreenUtil()
|
|
|
|
// .setWidth(10))),
|
|
|
|
// child: Container(
|
|
|
|
// height: ScreenUtil()
|
|
|
|
// .setWidth(25 * 2),
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(70 * 2),
|
|
|
|
// child: Column(
|
|
|
|
// mainAxisAlignment:
|
|
|
|
// MainAxisAlignment
|
|
|
|
// .center,
|
|
|
|
// children: [
|
|
|
|
// Image.asset(
|
|
|
|
// Utils.getImgPath(
|
|
|
|
// 'add_area'),
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(24)),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// )
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// );
|
|
|
|
// } else {
|
|
|
|
if (index == 0) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () async {
|
|
|
|
//添加区域弹框
|
|
|
|
await DialogUtil
|
|
|
|
.openCreateAreaDialog(context,
|
|
|
|
onTap: (value) async {
|
|
|
|
print(value);
|
|
|
|
//添加区域
|
|
|
|
bool success =
|
|
|
|
await tableManagerModel
|
|
|
|
.addTableAreas(
|
|
|
|
context, value);
|
|
|
|
print(success);
|
|
|
|
if (success) {
|
|
|
|
Utils.showToast('添加成功!');
|
|
|
|
tableManagerModel.currentArea =
|
|
|
|
value;
|
|
|
|
|
|
|
|
await tableManagerModel
|
|
|
|
.refreshTable(context);
|
|
|
|
// await tableManagerModel
|
|
|
|
// .getTableList(context,
|
|
|
|
// needLoading: false);
|
|
|
|
// tableManagerModel.initData();
|
|
|
|
|
|
|
|
// setState(() {
|
|
|
|
// updateMenu();
|
|
|
|
// });
|
|
|
|
// _scrollToIndex(widget
|
|
|
|
// .tableManagerModel
|
|
|
|
// .areas
|
|
|
|
// .length);
|
|
|
|
|
|
|
|
}
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
isSelected = true;
|
|
|
|
tableManagerModel.currentArea =
|
|
|
|
'全部';
|
|
|
|
// tableManagerModel.tablesShow =
|
|
|
|
// tableManagerModel
|
|
|
|
// .tabl;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
VEmptyView(20),
|
|
|
|
DottedBorder(
|
|
|
|
dashPattern: [5, 5, 5, 5],
|
|
|
|
borderType: BorderType.RRect,
|
|
|
|
// radius: Radius.circular(
|
|
|
|
// ScreenUtil().setWidth(10)),
|
|
|
|
// padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
strokeWidth:
|
|
|
|
ScreenUtil().setWidth(2),
|
|
|
|
child: ClipRRect(
|
|
|
|
borderRadius: BorderRadius
|
|
|
|
.all(Radius.circular(
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(10))),
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(25 * 2),
|
|
|
|
child: Container(
|
|
|
|
// width: ScreenUtil().setWidth(104 * 2),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
right: ScreenUtil().setWidth(15),
|
|
|
|
top: ScreenUtil().setWidth(20),
|
|
|
|
),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal:
|
|
|
|
ScreenUtil().setWidth(14),
|
|
|
|
vertical:
|
|
|
|
ScreenUtil().setWidth(10)),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
// borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
color: isSelected
|
|
|
|
? MyColours.color_199095
|
|
|
|
: MyColours.color_ffffff,
|
|
|
|
border: Border.all(
|
|
|
|
color:
|
|
|
|
MyColours.color_E0E0E0,
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(70 * 2),
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment
|
|
|
|
.center,
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
'add_area'),
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(24)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
.setWidth(2))),
|
|
|
|
child: Text(
|
|
|
|
'全部',
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
color: isSelected
|
|
|
|
? MyColours.color_ffffff
|
|
|
|
: MyColours.color_333333,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(24),
|
|
|
|
decoration:
|
|
|
|
TextDecoration.none,
|
|
|
|
fontWeight:
|
|
|
|
FontWeight.normal),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
if (index == 0) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
isSelected = true;
|
|
|
|
tableManagerModel.currentArea =
|
|
|
|
'全部';
|
|
|
|
// tableManagerModel.tablesShow =
|
|
|
|
// tableManagerModel
|
|
|
|
// .tabl;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
// width: ScreenUtil().setWidth(104 * 2),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
right:
|
|
|
|
ScreenUtil().setWidth(15),
|
|
|
|
top: ScreenUtil().setWidth(20),
|
|
|
|
),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal:
|
|
|
|
ScreenUtil().setWidth(14),
|
|
|
|
vertical: ScreenUtil()
|
|
|
|
.setWidth(10)),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
// borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
color: isSelected
|
|
|
|
? MyColours.color_199095
|
|
|
|
: MyColours.color_ffffff,
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours
|
|
|
|
.color_E0E0E0,
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(2))),
|
|
|
|
child: Text(
|
|
|
|
'全部',
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
color: isSelected
|
|
|
|
? MyColours.color_ffffff
|
|
|
|
: MyColours
|
|
|
|
.color_333333,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(24),
|
|
|
|
decoration:
|
|
|
|
TextDecoration.none,
|
|
|
|
fontWeight:
|
|
|
|
FontWeight.normal),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return AreaItemTable(
|
|
|
|
model.areas[index - 1],
|
|
|
|
tableManagerModel.currentArea,
|
|
|
|
(area) {
|
|
|
|
setState(() {
|
|
|
|
isSelected = false;
|
|
|
|
tableManagerModel.selectNumber =
|
|
|
|
index - 1;
|
|
|
|
tableManagerModel.currentArea =
|
|
|
|
tableManagerModel
|
|
|
|
.areas[index - 1].name;
|
|
|
|
// tableManagerModel.currentTables =
|
|
|
|
// tableManagerModel
|
|
|
|
// .areaTableMapShow[
|
|
|
|
// tableManagerModel
|
|
|
|
// .currentArea];
|
|
|
|
// _anmationMenu();
|
|
|
|
});
|
|
|
|
return AreaItemTable(
|
|
|
|
model.areas[index - 1],
|
|
|
|
tableManagerModel.currentArea,
|
|
|
|
(area) {
|
|
|
|
setState(() {
|
|
|
|
isSelected = false;
|
|
|
|
tableManagerModel.selectNumber =
|
|
|
|
index - 1;
|
|
|
|
tableManagerModel.currentArea =
|
|
|
|
tableManagerModel
|
|
|
|
.areas[index - 1].name;
|
|
|
|
// tableManagerModel.currentTables =
|
|
|
|
// tableManagerModel
|
|
|
|
// .areaTableMapShow[
|
|
|
|
// tableManagerModel
|
|
|
|
// .currentArea];
|
|
|
|
// _anmationMenu();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
InkWell(
|
|
...
|
...
|
@@ -3505,6 +3501,23 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
// Container(
|
|
|
|
// width:
|
|
|
|
// ScreenUtil().setWidth(2),
|
|
|
|
// height:
|
|
|
|
// ScreenUtil().setWidth(80),
|
|
|
|
// decoration: BoxDecoration(
|
|
|
|
// gradient: LinearGradient(
|
|
|
|
// stops: [0, 1, 0],
|
|
|
|
// begin: Alignment.centerLeft,
|
|
|
|
// end: Alignment.centerRight,
|
|
|
|
// colors: [
|
|
|
|
// MyColours.color_F8F9FD,
|
|
|
|
// MyColours.color_F1F0F4,
|
|
|
|
// MyColours.color_F8F9FD,
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// )),
|
|
|
|
MyDivider(ScreenUtil().setWidth(15),
|
|
|
|
ScreenUtil().setWidth(80),
|
|
|
|
color: MyColours.color_F1F0F4),
|
...
|
...
|
|