|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
import 'package:common_utils/common_utils.dart';
|
|
|
|
import 'package:dotted_border/dotted_border.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/constant/state.dart';
|
|
|
|
import 'package:one_key/models/area.dart';
|
|
|
|
import 'package:one_key/models/guest_info_model.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/models/reserve_info_model.dart';
|
|
|
|
import 'package:one_key/pages/my/table_manage/table_manage_area_item.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/pages/table/area_item_table.dart';
|
|
|
|
import 'package:one_key/provider/my_table_manage_home_model.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
|
|
import 'package:one_key/res/colors.dart';
|
|
|
|
import 'package:one_key/utils/dialog_util.dart';
|
|
|
|
import 'package:one_key/utils/event_bus.dart';
|
|
|
|
import 'package:one_key/route/navigator_util.dart';
|
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
|
|
import 'package:one_key/widgets/MyDivider.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/widgets/common_button_flat.dart';
|
|
|
|
import 'package:one_key/widgets/f_table_item.dart';
|
|
|
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
import 'package:one_key/widgets/page_exception.dart';
|
|
|
|
import 'package:one_key/widgets/round_button.dart';
|
|
|
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/models/table.dart' as t;
|
|
|
|
import 'package:one_key/widgets/table_manage_item.dart';
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'dart:convert' as convert;
|
|
|
|
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
|
|
|
import 'package:one_key/models/table_list.dart' as table;
|
|
|
|
|
|
|
|
const scrollDuration = Duration(microseconds: 500);
|
|
|
|
|
|
|
|
class MyTableManagerHomePage extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
State<StatefulWidget> createState() {
|
|
|
|
// TODO: implement createState
|
|
|
|
return new MyTableManagerHomePageState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class MyTableManagerHomePageState extends State<MyTableManagerHomePage> {
|
|
|
|
MyTableManageHomeModel tableManagerModel;
|
|
|
|
final ItemScrollController itemScrollController = ItemScrollController();
|
|
|
|
bool isTap = false;
|
|
|
|
// 进度监听对象
|
|
|
|
int min;
|
|
|
|
int max;
|
|
|
|
int _selectIndex = 0;
|
|
|
|
ScrollController _areaController = ScrollController();
|
|
|
|
List<String> personNumList = [];
|
|
|
|
|
|
|
|
// ScrollController _scrollCrl = ScrollController();
|
|
|
|
final ItemPositionsListener itemPositionsListener =
|
|
|
|
ItemPositionsListener.create();
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
// TODO: implement initState
|
|
|
|
super.initState();
|
|
|
|
|
|
|
|
LogUtil.v("table_manager_page initState");
|
|
|
|
for (int i = 1; i < 31; i++) {
|
|
|
|
personNumList.add(i.toString());
|
|
|
|
}
|
|
|
|
|
|
|
|
// personNumList.add('30以上');
|
|
|
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
tableManagerModel.initTime(context);
|
|
|
|
// EventBus().on("refresh_tablemanager", (arg) {
|
|
|
|
// //订座-完成预订 刷新管理桌位
|
|
|
|
// tableManagerModel.getReserveList(context,
|
|
|
|
// needLoading: false, needKeep: true);
|
|
|
|
// print(tableManagerModel);
|
|
|
|
// });
|
|
|
|
// EventBus().on("refresh_tablePhoto", (arg) {
|
|
|
|
// ///刷新图片显示
|
|
|
|
// _refreshTablePhoto();
|
|
|
|
// });
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
void dispose() {
|
|
|
|
// TODO: implement dispose
|
|
|
|
super.dispose();
|
|
|
|
// EventBus().off("refresh_tablemanager");
|
|
|
|
// EventBus().off("refresh_tablePhoto");
|
|
|
|
}
|
|
|
|
|
|
|
|
///刷新图片显示
|
|
|
|
// _refreshTablePhoto() async {
|
|
|
|
// List temp =
|
|
|
|
// await tableManagerModel.getTableList(context, needLoading: false);
|
|
|
|
// if (temp.length > 0) {
|
|
|
|
// tableManagerModel.getReserveList(context,
|
|
|
|
// needLoading: false, needKeep: true);
|
|
|
|
// tableManagerModel.notifyListeners();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
Widget list(List data) => ScrollablePositionedList.builder(
|
|
|
|
itemCount: data.length,
|
|
|
|
itemBuilder: (context, index) => item(index),
|
|
|
|
itemScrollController: itemScrollController,
|
|
|
|
itemPositionsListener: itemPositionsListener,
|
|
|
|
reverse: false,
|
|
|
|
scrollDirection: Axis.vertical,
|
|
|
|
);
|
|
|
|
|
|
|
|
void scrollTo(int index) => itemScrollController
|
|
|
|
.scrollTo(
|
|
|
|
index: index,
|
|
|
|
duration: scrollDuration,
|
|
|
|
curve: Curves.easeInOutCubic,
|
|
|
|
alignment: 0)
|
|
|
|
.then((value) {
|
|
|
|
print(_selectIndex);
|
|
|
|
// _selectIndex = _selectIndex;
|
|
|
|
// // }
|
|
|
|
// isTap = false;
|
|
|
|
this.setState(() {});
|
|
|
|
}).whenComplete(() {
|
|
|
|
// print('');
|
|
|
|
});
|
|
|
|
|
|
|
|
void jumpTo(int index) =>
|
|
|
|
itemScrollController.jumpTo(index: index, alignment: 0);
|
|
|
|
|
|
|
|
/// Generate item number [i].
|
|
|
|
Widget item(int i) {
|
|
|
|
return GridView.builder(
|
|
|
|
// controller: _areaController,
|
|
|
|
// physics: NeverScrollableScrollPhysics(),
|
|
|
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
itemCount: tableManagerModel.tableOuterList[i].list.length + 1,
|
|
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
crossAxisCount: 4,
|
|
|
|
childAspectRatio: 1,
|
|
|
|
mainAxisSpacing: ScreenUtil().setWidth(28),
|
|
|
|
crossAxisSpacing: ScreenUtil().setWidth(48),
|
|
|
|
),
|
|
|
|
|
|
|
|
itemBuilder: (BuildContext context, int index) {
|
|
|
|
if (index == tableManagerModel.tableOuterList[i].list.length ||
|
|
|
|
tableManagerModel.tableOuterList[i].list.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: [8, 8, 8, 8],
|
|
|
|
borderType: BorderType.RRect,
|
|
|
|
radius: Radius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
// padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
color: MyColours.color_438E93,
|
|
|
|
strokeWidth: ScreenUtil().setWidth(2),
|
|
|
|
child: ClipRRect(
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
Radius.circular(ScreenUtil().setWidth(10))),
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil.screenWidthDp -
|
|
|
|
ScreenUtil().setWidth(48 * 3 + 32 * 2),
|
|
|
|
width: ScreenUtil.screenWidthDp -
|
|
|
|
ScreenUtil().setWidth(48 * 3 + 32 * 2),
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Image.asset(Utils.getImgPath('add_area'),
|
|
|
|
width: ScreenUtil().setWidth(60)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)));
|
|
|
|
} else {
|
|
|
|
return Selector<MyTableManageHomeModel, t.Table>(
|
|
|
|
shouldRebuild: (pre, next) => true,
|
|
|
|
selector: (context, model) =>
|
|
|
|
tableManagerModel.tableOuterList[i].list[index],
|
|
|
|
builder: (context, table, _) {
|
|
|
|
return ManageTableItem(table,
|
|
|
|
canMulSelected: tableManagerModel.tableOuterList[i].isSelect,
|
|
|
|
onSelected: (table) {
|
|
|
|
if (tableManagerModel.tableOuterList[i].isSelect) {
|
|
|
|
//多选
|
|
|
|
setState(() {
|
|
|
|
table.selected = !(table.selected ?? false);
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
for (t.Table item
|
|
|
|
in tableManagerModel.tableOuterList[i].list) {
|
|
|
|
item.selected = false;
|
|
|
|
}
|
|
|
|
//单选
|
|
|
|
setState(() {
|
|
|
|
table.selected = true;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
tableManagerModel =
|
|
|
|
Provider.of<MyTableManageHomeModel>(context, listen: true);
|
|
|
|
return WillPopScope(
|
|
|
|
onWillPop: () async {
|
|
|
|
EventBus().emit('changeStatusColor');
|
|
|
|
return true;
|
|
|
|
},
|
|
|
|
child: Scaffold(
|
|
|
|
appBar: SystemAppBar(
|
|
|
|
"桌位管理",
|
|
|
|
showLeading: true,
|
|
|
|
onTap: () {
|
|
|
|
EventBus().emit('changeStatusColor');
|
|
|
|
Navigator.pop(context);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
body: SafeArea(child: Consumer<MyTableManageHomeModel>(
|
|
|
|
builder: (context, model, child) {
|
|
|
|
return Column(
|
|
|
|
children: <Widget>[
|
|
|
|
model.pageState != PageState.Success
|
|
|
|
? Expanded(
|
|
|
|
child: ExceptionPage(
|
|
|
|
pageState: model.pageState,
|
|
|
|
callback: () {
|
|
|
|
// if (tableManagerModel.tableOuterList.isEmpty) {
|
|
|
|
// tableManagerModel.getTableList(context);
|
|
|
|
// } else {
|
|
|
|
// tableManagerModel.getReserveList(context);
|
|
|
|
// }
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有桌位哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
))
|
|
|
|
: Expanded(
|
|
|
|
child: Column(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
VEmptyView(48),
|
|
|
|
Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
height: ScreenUtil().setWidth(92),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
bottom: ScreenUtil().setWidth(24)),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
HEmptyView(48),
|
|
|
|
Expanded(
|
|
|
|
child: ListView.builder(
|
|
|
|
itemCount:
|
|
|
|
tableManagerModel.areas.length == 0
|
|
|
|
? 1
|
|
|
|
: tableManagerModel
|
|
|
|
.areas.length +
|
|
|
|
1,
|
|
|
|
shrinkWrap: true,
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
itemBuilder:
|
|
|
|
(BuildContext contxt, int index) {
|
|
|
|
if (index ==
|
|
|
|
tableManagerModel
|
|
|
|
.areas.length ||
|
|
|
|
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: [2, 2, 2, 2],
|
|
|
|
borderType:
|
|
|
|
BorderType.RRect,
|
|
|
|
radius: Radius.circular(
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(10)),
|
|
|
|
// padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
|
|
|
|
color:
|
|
|
|
MyColours.color_999999,
|
|
|
|
strokeWidth: ScreenUtil()
|
|
|
|
.setWidth(2),
|
|
|
|
child: ClipRRect(
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.all(
|
|
|
|
Radius.circular(
|
|
|
|
ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
10))),
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(28 * 2),
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(48 * 2),
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment
|
|
|
|
.center,
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
'add_store'),
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(
|
|
|
|
24)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return TableManageAreaItem(
|
|
|
|
model.areas[index],
|
|
|
|
tableManagerModel.currentArea,
|
|
|
|
(area) {
|
|
|
|
setState(() {
|
|
|
|
tableManagerModel.selectNumber =
|
|
|
|
index;
|
|
|
|
tableManagerModel.currentArea =
|
|
|
|
tableManagerModel
|
|
|
|
.areas[index].name;
|
|
|
|
// tableManagerModel.currentTables =
|
|
|
|
// tableManagerModel
|
|
|
|
// .areaTableMapShow[
|
|
|
|
// tableManagerModel
|
|
|
|
// .currentArea];
|
|
|
|
// _anmationMenu();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
if (tableManagerModel
|
|
|
|
.tableOuterList.length >
|
|
|
|
0) {
|
|
|
|
//区域管理页面跳转
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
top: ScreenUtil().setWidth(20),
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
HEmptyView(20),
|
|
|
|
MyDivider(
|
|
|
|
ScreenUtil().setWidth(2),
|
|
|
|
ScreenUtil().setWidth(36),
|
|
|
|
color:
|
|
|
|
MyColours.color_BFC4D4),
|
|
|
|
HEmptyView(20),
|
|
|
|
Text(
|
|
|
|
'区域管理',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(28),
|
|
|
|
color: tableManagerModel
|
|
|
|
.tableOuterList
|
|
|
|
.length ==
|
|
|
|
0
|
|
|
|
? MyColours
|
|
|
|
.color_BFC4D4
|
|
|
|
: MyColours
|
|
|
|
.color_000000,
|
|
|
|
decoration: TextDecoration
|
|
|
|
.underline),
|
|
|
|
),
|
|
|
|
HEmptyView(40)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
tableManagerModel.tableOuterList.length == 0
|
|
|
|
? Padding(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: ScreenUtil().setWidth(100)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
VEmptyView(180),
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'1、',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(32),
|
|
|
|
color: MyColours
|
|
|
|
.color_BFC4D4),
|
|
|
|
),
|
|
|
|
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: Text('添加区域',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(32),
|
|
|
|
color: MyColours
|
|
|
|
.color_438E93,
|
|
|
|
decoration:
|
|
|
|
TextDecoration
|
|
|
|
.underline)),
|
|
|
|
),
|
|
|
|
Text('(如:一楼、二楼、东厅等)',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil()
|
|
|
|
.setSp(32),
|
|
|
|
color: MyColours
|
|
|
|
.color_BFC4D4))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
Text('2、选择要添加桌位的区域',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(32),
|
|
|
|
color: MyColours
|
|
|
|
.color_BFC4D4)),
|
|
|
|
VEmptyView(40),
|
|
|
|
Text('3、点击“+”号添加桌位',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(32),
|
|
|
|
color: MyColours
|
|
|
|
.color_BFC4D4)),
|
|
|
|
VEmptyView(120),
|
|
|
|
Image.asset(
|
|
|
|
"assets/empty_search.png",
|
|
|
|
width: ScreenUtil().setWidth(520),
|
|
|
|
height:
|
|
|
|
ScreenUtil().setWidth(384),
|
|
|
|
),
|
|
|
|
VEmptyView(40),
|
|
|
|
],
|
|
|
|
))
|
|
|
|
: SizedBox(),
|
|
|
|
Expanded(
|
|
|
|
// flex: 2,
|
|
|
|
child: Container(
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
minHeight:
|
|
|
|
ScreenUtil().setWidth(100)),
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
vertical: ScreenUtil().setWidth(20),
|
|
|
|
horizontal:
|
|
|
|
ScreenUtil().setWidth(48)),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
VEmptyView(26),
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.list
|
|
|
|
.length ==
|
|
|
|
0
|
|
|
|
? SizedBox()
|
|
|
|
: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
for (t.Table item
|
|
|
|
in tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.list) {
|
|
|
|
item.selected = false;
|
|
|
|
}
|
|
|
|
setState(() {
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isSelect =
|
|
|
|
!tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isSelect;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.isSelect
|
|
|
|
? 'base_radio_sel'
|
|
|
|
: 'base_radio_un'),
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(40),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
Text(
|
|
|
|
'批量选择桌位',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil()
|
|
|
|
.setSp(
|
|
|
|
32),
|
|
|
|
color: MyColours
|
|
|
|
.color_000000),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
tableManagerModel
|
|
|
|
.tableOuterList[
|
|
|
|
tableManagerModel
|
|
|
|
.selectNumber]
|
|
|
|
.list
|
|
|
|
.length ==
|
|
|
|
0
|
|
|
|
? VEmptyView(20)
|
|
|
|
: VEmptyView(60),
|
|
|
|
item(tableManagerModel.selectNumber)
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
]))
|
|
|
|
],
|
|
|
|
);
|
|
|
|
},
|
|
|
|
))));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|