|
...
|
...
|
@@ -26,6 +26,7 @@ import 'package:one_key/widgets/common_button.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/system_app_bar.dart';
|
|
|
|
import 'package:one_key/widgets/table_item.dart';
|
|
|
|
import 'package:one_key/models/table.dart' as t;
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
...
|
...
|
@@ -543,271 +544,284 @@ class PhotoManagerPageState extends State<PhotoManagerPage> { |
|
|
|
body: SafeArea(
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
MyAppBar(
|
|
|
|
SystemAppBar(
|
|
|
|
"照片管理",
|
|
|
|
showBack: true,
|
|
|
|
onTap: () {
|
|
|
|
EventBus().emit('changeStatusColor');
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Consumer<ChooseTableModel>(builder: (context, model, _) {
|
|
|
|
if (model.pageState != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageState,
|
|
|
|
callback: () {
|
|
|
|
getTableList();
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有桌位哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return Column(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
height: ScreenUtil().setWidth(92),
|
|
|
|
margin:
|
|
|
|
EdgeInsets.only(bottom: ScreenUtil().setWidth(30)),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
HEmptyView(20),
|
|
|
|
Expanded(
|
|
|
|
child: ListView.builder(
|
|
|
|
itemCount: areas.length == 0
|
|
|
|
? 0
|
|
|
|
: areas.length + 1,
|
|
|
|
shrinkWrap: true,
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
itemBuilder:
|
|
|
|
(BuildContext contxt, int index) {
|
|
|
|
// if (index == areas.length + 1 ||
|
|
|
|
// areas.length == 0) {
|
|
|
|
// return InkWell(
|
|
|
|
// onTap: () async {
|
|
|
|
// //添加区域弹框
|
|
|
|
// await DialogUtil.openCreateAreaDialog(
|
|
|
|
// context, onTap: (value) async {
|
|
|
|
// print(value);
|
|
|
|
// //添加区域
|
|
|
|
// bool success = await _chooseTableModel
|
|
|
|
// .addTableAreas(context, value);
|
|
|
|
// print(success);
|
|
|
|
// if (success) {
|
|
|
|
// Utils.showToast('添加成功!');
|
|
|
|
// UserModel userModel =
|
|
|
|
// Provider.of<UserModel>(context,
|
|
|
|
// listen: false);
|
|
|
|
// Map<String, String> params = {
|
|
|
|
// "sellerid": userModel.user.sellerid
|
|
|
|
// };
|
|
|
|
// await _chooseTableModel.getTableList(
|
|
|
|
// context, params,
|
|
|
|
// needLoading: false);
|
|
|
|
// 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(104 * 2),
|
|
|
|
// child: Column(
|
|
|
|
// mainAxisAlignment:
|
|
|
|
// MainAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// Image.asset(
|
|
|
|
// Utils.getImgPath(
|
|
|
|
// 'add_area'),
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(24)),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// )
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// );
|
|
|
|
// } else {
|
|
|
|
if (index == 0) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
isSelected = true;
|
|
|
|
currentArea = '全部';
|
|
|
|
_chooseTableModel.currentTables =
|
|
|
|
_chooseTableModel
|
|
|
|
.areaTableMapShow[
|
|
|
|
currentArea];
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
// width: ScreenUtil().setWidth(104 * 2),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
right: ScreenUtil().setWidth(20),
|
|
|
|
top: ScreenUtil().setWidth(20),
|
|
|
|
),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal:
|
|
|
|
WillPopScope(
|
|
|
|
onWillPop: () {
|
|
|
|
EventBus().emit('changeStatusColor');
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
child: Expanded(
|
|
|
|
child: Consumer<ChooseTableModel>(builder: (context, model, _) {
|
|
|
|
if (model.pageState != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageState,
|
|
|
|
callback: () {
|
|
|
|
getTableList();
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有桌位哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return Column(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
height: ScreenUtil().setWidth(92),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
bottom: ScreenUtil().setWidth(30)),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
HEmptyView(20),
|
|
|
|
Expanded(
|
|
|
|
child: ListView.builder(
|
|
|
|
itemCount: areas.length == 0
|
|
|
|
? 0
|
|
|
|
: areas.length + 1,
|
|
|
|
shrinkWrap: true,
|
|
|
|
scrollDirection: Axis.horizontal,
|
|
|
|
itemBuilder:
|
|
|
|
(BuildContext contxt, int index) {
|
|
|
|
// if (index == areas.length + 1 ||
|
|
|
|
// areas.length == 0) {
|
|
|
|
// return InkWell(
|
|
|
|
// onTap: () async {
|
|
|
|
// //添加区域弹框
|
|
|
|
// await DialogUtil.openCreateAreaDialog(
|
|
|
|
// context, onTap: (value) async {
|
|
|
|
// print(value);
|
|
|
|
// //添加区域
|
|
|
|
// bool success = await _chooseTableModel
|
|
|
|
// .addTableAreas(context, value);
|
|
|
|
// print(success);
|
|
|
|
// if (success) {
|
|
|
|
// Utils.showToast('添加成功!');
|
|
|
|
// UserModel userModel =
|
|
|
|
// Provider.of<UserModel>(context,
|
|
|
|
// listen: false);
|
|
|
|
// Map<String, String> params = {
|
|
|
|
// "sellerid": userModel.user.sellerid
|
|
|
|
// };
|
|
|
|
// await _chooseTableModel.getTableList(
|
|
|
|
// context, params,
|
|
|
|
// needLoading: false);
|
|
|
|
// 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(104 * 2),
|
|
|
|
// child: Column(
|
|
|
|
// mainAxisAlignment:
|
|
|
|
// MainAxisAlignment.center,
|
|
|
|
// children: [
|
|
|
|
// Image.asset(
|
|
|
|
// Utils.getImgPath(
|
|
|
|
// 'add_area'),
|
|
|
|
// width: ScreenUtil()
|
|
|
|
// .setWidth(24)),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// )
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// );
|
|
|
|
// } else {
|
|
|
|
if (index == 0) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
isSelected = true;
|
|
|
|
currentArea = '全部';
|
|
|
|
_chooseTableModel
|
|
|
|
.currentTables =
|
|
|
|
_chooseTableModel
|
|
|
|
.areaTableMapShow[
|
|
|
|
currentArea];
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
// width: ScreenUtil().setWidth(104 * 2),
|
|
|
|
height: ScreenUtil().setWidth(80),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
right:
|
|
|
|
ScreenUtil().setWidth(20),
|
|
|
|
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(
|
|
|
|
top: ScreenUtil().setWidth(20),
|
|
|
|
),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal:
|
|
|
|
ScreenUtil().setWidth(20),
|
|
|
|
vertical: ScreenUtil()
|
|
|
|
.setWidth(10)),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
// borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
color: isSelected
|
|
|
|
? MyColours.color_ffffff
|
|
|
|
: MyColours.color_333333,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(28),
|
|
|
|
decoration:
|
|
|
|
TextDecoration.none,
|
|
|
|
fontWeight:
|
|
|
|
FontWeight.normal),
|
|
|
|
? 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(28),
|
|
|
|
decoration:
|
|
|
|
TextDecoration.none,
|
|
|
|
fontWeight:
|
|
|
|
FontWeight.normal),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return AreaItemTable(
|
|
|
|
areas[index - 1],
|
|
|
|
currentArea,
|
|
|
|
(area) {
|
|
|
|
setState(() {
|
|
|
|
isSelected = false;
|
|
|
|
_selectNumber = index - 1;
|
|
|
|
currentArea =
|
|
|
|
areas[index - 1].name;
|
|
|
|
_chooseTableModel.currentTables =
|
|
|
|
_chooseTableModel
|
|
|
|
.areaTableMapShow[
|
|
|
|
currentArea];
|
|
|
|
// _anmationMenu();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
showBadge: false,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return AreaItemTable(
|
|
|
|
areas[index - 1],
|
|
|
|
currentArea,
|
|
|
|
(area) {
|
|
|
|
setState(() {
|
|
|
|
isSelected = false;
|
|
|
|
_selectNumber = index - 1;
|
|
|
|
currentArea =
|
|
|
|
areas[index - 1].name;
|
|
|
|
_chooseTableModel
|
|
|
|
.currentTables =
|
|
|
|
_chooseTableModel
|
|
|
|
.areaTableMapShow[
|
|
|
|
currentArea];
|
|
|
|
// _anmationMenu();
|
|
|
|
});
|
|
|
|
},
|
|
|
|
showBadge: false,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// },
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
// },
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
flex: 2,
|
|
|
|
child: Container(
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
minHeight: ScreenUtil().setWidth(100)),
|
|
|
|
color: Color.fromRGBO(249, 249, 249, 1),
|
|
|
|
child: item(_selectNumber))),
|
|
|
|
// Container(
|
|
|
|
// width: double.infinity,
|
|
|
|
// height: ScreenUtil().setHeight(84),
|
|
|
|
// margin: EdgeInsets.only(
|
|
|
|
// bottom: ScreenUtil().setWidth(50)),
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: ScreenUtil().setWidth(31)),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// color: MyColours.color_ffffff,
|
|
|
|
// child: CommonButton(
|
|
|
|
// // content: widget.fromPage == 'tablePhoto'
|
|
|
|
// // ? '确定'
|
|
|
|
// // : "已选${selectNum}个 确定",
|
|
|
|
// content: '确定',
|
|
|
|
// width: 300,
|
|
|
|
// height: 84,
|
|
|
|
// fontSize: 34,
|
|
|
|
// state: 1,
|
|
|
|
// onPress: () {
|
|
|
|
// if (widget.fromPage == "tablePhoto") {
|
|
|
|
// Map temp = {
|
|
|
|
// 'tid': selectTables.length > 0
|
|
|
|
// ? selectTables[0].id
|
|
|
|
// : '',
|
|
|
|
// 'tname': selectTables.length > 0
|
|
|
|
// ? selectTables[0].name
|
|
|
|
// : ''
|
|
|
|
// };
|
|
|
|
// Navigator.of(context).pop(temp);
|
|
|
|
// } else {
|
|
|
|
// if (widget.canChoose) {
|
|
|
|
// // if (widget.tableList.length > 0) {
|
|
|
|
// String tid = "";
|
|
|
|
// for (TableList table in widget.tableList) {
|
|
|
|
// tid += table.id + ",";
|
|
|
|
// }
|
|
|
|
// if (widget.tableList.length > 0) {
|
|
|
|
// tid = tid.substring(0, tid.length - 1);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// Map temp = {
|
|
|
|
// 'object': widget.tableList,
|
|
|
|
// 'tid': tid
|
|
|
|
// };
|
|
|
|
// Navigator.of(context).pop(temp);
|
|
|
|
// // }
|
|
|
|
// } else {
|
|
|
|
// if (selectTables.length > 0) {
|
|
|
|
// String tid = "";
|
|
|
|
// for (t.Table table in selectTables) {
|
|
|
|
// tid += table.id + ",";
|
|
|
|
// }
|
|
|
|
// if (selectTables.length > 0) {
|
|
|
|
// tid = tid.substring(0, tid.length - 1);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// Map temp = {
|
|
|
|
// 'object': widget.tableList,
|
|
|
|
// 'tid': tid
|
|
|
|
// };
|
|
|
|
// Navigator.of(context).pop(temp);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// )),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
flex: 2,
|
|
|
|
child: Container(
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
minHeight: ScreenUtil().setWidth(100)),
|
|
|
|
color: Color.fromRGBO(249, 249, 249, 1),
|
|
|
|
child: item(_selectNumber))),
|
|
|
|
// Container(
|
|
|
|
// width: double.infinity,
|
|
|
|
// height: ScreenUtil().setHeight(84),
|
|
|
|
// margin: EdgeInsets.only(
|
|
|
|
// bottom: ScreenUtil().setWidth(50)),
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: ScreenUtil().setWidth(31)),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// color: MyColours.color_ffffff,
|
|
|
|
// child: CommonButton(
|
|
|
|
// // content: widget.fromPage == 'tablePhoto'
|
|
|
|
// // ? '确定'
|
|
|
|
// // : "已选${selectNum}个 确定",
|
|
|
|
// content: '确定',
|
|
|
|
// width: 300,
|
|
|
|
// height: 84,
|
|
|
|
// fontSize: 34,
|
|
|
|
// state: 1,
|
|
|
|
// onPress: () {
|
|
|
|
// if (widget.fromPage == "tablePhoto") {
|
|
|
|
// Map temp = {
|
|
|
|
// 'tid': selectTables.length > 0
|
|
|
|
// ? selectTables[0].id
|
|
|
|
// : '',
|
|
|
|
// 'tname': selectTables.length > 0
|
|
|
|
// ? selectTables[0].name
|
|
|
|
// : ''
|
|
|
|
// };
|
|
|
|
// Navigator.of(context).pop(temp);
|
|
|
|
// } else {
|
|
|
|
// if (widget.canChoose) {
|
|
|
|
// // if (widget.tableList.length > 0) {
|
|
|
|
// String tid = "";
|
|
|
|
// for (TableList table in widget.tableList) {
|
|
|
|
// tid += table.id + ",";
|
|
|
|
// }
|
|
|
|
// if (widget.tableList.length > 0) {
|
|
|
|
// tid = tid.substring(0, tid.length - 1);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// Map temp = {
|
|
|
|
// 'object': widget.tableList,
|
|
|
|
// 'tid': tid
|
|
|
|
// };
|
|
|
|
// Navigator.of(context).pop(temp);
|
|
|
|
// // }
|
|
|
|
// } else {
|
|
|
|
// if (selectTables.length > 0) {
|
|
|
|
// String tid = "";
|
|
|
|
// for (t.Table table in selectTables) {
|
|
|
|
// tid += table.id + ",";
|
|
|
|
// }
|
|
|
|
// if (selectTables.length > 0) {
|
|
|
|
// tid = tid.substring(0, tid.length - 1);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// Map temp = {
|
|
|
|
// 'object': widget.tableList,
|
|
|
|
// 'tid': tid
|
|
|
|
// };
|
|
|
|
// Navigator.of(context).pop(temp);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// )),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
));
|
...
|
...
|
|