Commit 3b9cdf6bbff0fc8ed51a7ea24690233ea6ab44b7

Authored by wdn127929
1 parent 01f7dad4

照片管理

@@ -11,14 +11,14 @@ if (flutterRoot == null) { @@ -11,14 +11,14 @@ if (flutterRoot == null) {
11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 } 12 }
13 13
14 -def flutterVersionCode = "312" 14 +def flutterVersionCode = "314"
15 if (flutterVersionCode == null) { 15 if (flutterVersionCode == null) {
16 - flutterVersionCode = '312' 16 + flutterVersionCode = '314'
17 } 17 }
18 18
19 -def flutterVersionName = "3.1.2" 19 +def flutterVersionName = "3.1.4"
20 if (flutterVersionName == null) { 20 if (flutterVersionName == null) {
21 - flutterVersionName = '3.1.2' 21 + flutterVersionName = '3.1.4'
22 } 22 }
23 23
24 apply plugin: 'com.android.application' 24 apply plugin: 'com.android.application'
@@ -1038,6 +1038,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -1038,6 +1038,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
1038 ymd: detailEntity.ddateYMD); 1038 ymd: detailEntity.ddateYMD);
1039 1039
1040 if (sucess) { 1040 if (sucess) {
  1041 + bus.emit("refresh_book_list"); //刷新已预订列表
1041 await _getReserveDetail(showCicle: false); 1042 await _getReserveDetail(showCicle: false);
1042 } 1043 }
1043 }, 1044 },
@@ -2195,6 +2196,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -2195,6 +2196,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
2195 phone: detailModel.phoneController.text); 2196 phone: detailModel.phoneController.text);
2196 if (sucess) { 2197 if (sucess) {
2197 EventBus().emit("refresh_tablemanager"); //刷新桌位 2198 EventBus().emit("refresh_tablemanager"); //刷新桌位
  2199 + bus.emit("refresh_book_list"); //刷新已预订列表
2198 await _getReserveDetail(showCicle: true); 2200 await _getReserveDetail(showCicle: true);
2199 setState(() { 2201 setState(() {
2200 setTop = false; 2202 setTop = false;
@@ -830,289 +830,6 @@ class SelectTableFPageState extends State<SelectTableFPage> { @@ -830,289 +830,6 @@ class SelectTableFPageState extends State<SelectTableFPage> {
830 }, 830 },
831 )), 831 )),
832 ]); 832 ]);
833 - return Container(  
834 - color: MyColours.color_ffffff,  
835 - child: Row(  
836 - children: <Widget>[  
837 - Container(  
838 - width: ScreenUtil().setWidth(170),  
839 - height: double.infinity,  
840 - color: MyColours.color_f1f1f1,  
841 - child: ListView.builder(  
842 - itemBuilder: (context, index) {  
843 - if (areas.isEmpty || index == areas.length) {  
844 - return InkWell(  
845 - onTap: () async {  
846 - //添加区域弹框  
847 - await DialogUtil.openCreateAreaDialog(context,  
848 - onTap: (value) async {  
849 - print(value);  
850 - //添加区域  
851 - bool success = await _chooseTableModel  
852 - .addTableAreas(context, value);  
853 - print(success);  
854 - if (success) {  
855 - Utils.showToast('添加成功!');  
856 -  
857 - await getTableList(needLoading: false);  
858 - }  
859 - });  
860 - },  
861 - child: Center(  
862 - child: Image.asset(  
863 - Utils.getImgPath('add_area'),  
864 - width: ScreenUtil().setWidth(32)),  
865 - ),  
866 - );  
867 - } else {  
868 - return AreaItem(areas[index], currentArea,  
869 - (area) {  
870 - setState(() {  
871 - currentArea = (area as Area).name;  
872 - });  
873 - });  
874 - }  
875 - },  
876 - itemExtent: ScreenUtil().setHeight(207),  
877 - itemCount: areas.length + 1,  
878 - ),  
879 - ),  
880 - Expanded(  
881 - child: Padding(  
882 - padding: EdgeInsets.symmetric(  
883 - vertical: ScreenUtil().setHeight(10),  
884 - horizontal: ScreenUtil().setWidth(9)),  
885 - child: Column(  
886 - children: [  
887 - Expanded(  
888 - child: GridView.builder(  
889 - gridDelegate:  
890 - SliverGridDelegateWithFixedCrossAxisCount(  
891 - crossAxisCount: 3,  
892 - childAspectRatio: 8 / 9),  
893 - itemBuilder: (context, index) {  
894 - if (index ==  
895 - areaTableMap[currentArea].length ||  
896 - areaTableMap[currentArea].length == 0) {  
897 - return InkWell(  
898 - onTap: () async {  
899 - List<String> areasTemp = [];  
900 - for (int i = 0;  
901 - i < areas.length;  
902 - i++) {  
903 - areasTemp.add(areas[i].name);  
904 - }  
905 -  
906 - //添加桌位弹框  
907 - await DialogUtil  
908 - .openCreateTableDialog(  
909 - context,  
910 - areasTemp,  
911 - areasTemp  
912 - .indexOf(currentArea),  
913 - personNumList, onTap:  
914 - (Map<String, String>  
915 - value) async {  
916 - print(value);  
917 - // 'areaname':  
918 - // areas[currentAreaIndex],  
919 - // 'name': controller.text,  
920 - // 'pnumMin': pnumMin,  
921 - // 'pnumMax': pnumMax  
922 - //添加桌位 接口参数带整合???  
923 - // 以下是旧的不去,明天添加桌位接口  
924 - String rid;  
925 - for (Area item in areas) {  
926 - if (item.name ==  
927 - value['areaname']) {  
928 - rid = item.rid;  
929 - }  
930 - }  
931 - Map<String, String> params = {  
932 - 'rid': rid,  
933 - 'name': value['name'],  
934 - };  
935 - if (value['pnumMin'] != '') {  
936 - params['pnum'] =  
937 - value['pnumMin'];  
938 - }  
939 - if (value['pnumMax'] != '') {  
940 - params['most_pnum'] =  
941 - value['pnumMax'];  
942 - }  
943 - bool success =  
944 - await _chooseTableModel  
945 - .addTable(  
946 - context, params);  
947 - print(success);  
948 - if (success) {  
949 - Utils.showToast('添加成功!');  
950 - refreshTable(context);  
951 - }  
952 - });  
953 - },  
954 - child: Container(  
955 - margin: EdgeInsets.all(  
956 - ScreenUtil().setWidth(15)),  
957 - child: DottedBorder(  
958 - dashPattern: [5, 5, 5, 5],  
959 - borderType: BorderType.RRect,  
960 - radius: Radius.circular(  
961 - ScreenUtil().setWidth(10)),  
962 - // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),  
963 - color: MyColours.color_199095,  
964 - strokeWidth:  
965 - ScreenUtil().setWidth(2),  
966 - child: ClipRRect(  
967 - borderRadius: BorderRadius  
968 - .all(Radius.circular(  
969 - ScreenUtil()  
970 - .setWidth(10))),  
971 - child: Container(  
972 - height: ScreenUtil()  
973 - .setWidth(90 * 2),  
974 - width: ScreenUtil()  
975 - .setWidth(80 * 2),  
976 - child: Column(  
977 - mainAxisAlignment:  
978 - MainAxisAlignment  
979 - .center,  
980 - children: [  
981 - Image.asset(  
982 - Utils.getImgPath(  
983 - 'add_area'),  
984 - width: ScreenUtil()  
985 - .setWidth(32)),  
986 - ],  
987 - ),  
988 - ),  
989 - ),  
990 - )));  
991 - } else {  
992 - return TableItem(  
993 - areaTableMap[currentArea][index],  
994 - onSelected: (t.Table table) {  
995 - if (widget.fromPage == 'tablePhoto') {  
996 - for (String item  
997 - in areaTableMap.keys) {  
998 - for (t.Table item  
999 - in areaTableMap[item]) {  
1000 - item.selected = false;  
1001 - selectNum = 0;  
1002 - if (table.id == item.id) {  
1003 - item.selected = true;  
1004 - selectTables = [];  
1005 - selectNum++;  
1006 - selectTables.add(table);  
1007 - }  
1008 - }  
1009 - }  
1010 - setState(() {});  
1011 - } else {  
1012 - if ((table as t.Table).selected) {  
1013 - selectTables.add(table);  
1014 -  
1015 - selectNum++;  
1016 -  
1017 - widget.tableList  
1018 - .add(tableToTableList(table));  
1019 - } else {  
1020 - widget.tableList.removeWhere(  
1021 - (t) => t.id == table.id);  
1022 -  
1023 - selectNum--;  
1024 -  
1025 - selectTables.removeWhere(  
1026 - (t) => t.id == table.id);  
1027 - }  
1028 - setState(() {});  
1029 - }  
1030 - },  
1031 - canSelected: true,  
1032 - fromPage: widget.fromPage,  
1033 - tableMap: tableMap,  
1034 - rid: widget.rid);  
1035 - }  
1036 - },  
1037 - itemCount: currentArea == null  
1038 - ? 0  
1039 - : areaTableMap[currentArea].length + 1,  
1040 - )),  
1041 - Container(  
1042 - width: double.infinity,  
1043 - height: ScreenUtil().setHeight(84),  
1044 - margin: EdgeInsets.only(  
1045 - bottom: ScreenUtil().setWidth(50)),  
1046 - padding: EdgeInsets.symmetric(  
1047 - horizontal: ScreenUtil().setWidth(31)),  
1048 - alignment: Alignment.center,  
1049 - color: MyColours.color_ffffff,  
1050 - child: CommonButton(  
1051 - content: widget.fromPage == 'tablePhoto'  
1052 - ? '确定'  
1053 - : "已选${selectNum}个 确定",  
1054 - width: 500,  
1055 - height: 84,  
1056 - fontSize: 34,  
1057 - state: 1,  
1058 - onPress: () {  
1059 - if (widget.fromPage == "tablePhoto") {  
1060 - Map temp = {  
1061 - 'tid': selectTables.length > 0  
1062 - ? selectTables[0].id  
1063 - : '',  
1064 - 'tname': selectTables.length > 0  
1065 - ? selectTables[0].name  
1066 - : ''  
1067 - };  
1068 - Navigator.of(context).pop(temp);  
1069 - } else {  
1070 - if (widget.canChoose) {  
1071 - // if (widget.tableList.length > 0) {  
1072 - String tid = "";  
1073 - for (TableList table  
1074 - in widget.tableList) {  
1075 - tid += table.id + ",";  
1076 - }  
1077 - if (widget.tableList.length > 0) {  
1078 - tid = tid.substring(  
1079 - 0, tid.length - 1);  
1080 - }  
1081 -  
1082 - Map temp = {  
1083 - 'object': widget.tableList,  
1084 - 'tid': tid  
1085 - };  
1086 - Navigator.of(context).pop(temp);  
1087 - // }  
1088 - } else {  
1089 - if (selectTables.length > 0) {  
1090 - String tid = "";  
1091 - for (t.Table table  
1092 - in selectTables) {  
1093 - tid += table.id + ",";  
1094 - }  
1095 - if (selectTables.length > 0) {  
1096 - tid = tid.substring(  
1097 - 0, tid.length - 1);  
1098 - }  
1099 -  
1100 - Map temp = {  
1101 - 'object': widget.tableList,  
1102 - 'tid': tid  
1103 - };  
1104 - Navigator.of(context).pop(temp);  
1105 - }  
1106 - }  
1107 - }  
1108 - },  
1109 - )),  
1110 - ],  
1111 - )),  
1112 - )  
1113 - ],  
1114 - ),  
1115 - );  
1116 } 833 }
1117 }), 834 }),
1118 ), 835 ),
@@ -345,6 +345,38 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { @@ -345,6 +345,38 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
345 ), 345 ),
346 346
347 MyItem( 347 MyItem(
  348 + title: "照片管理",
  349 + content: "",
  350 + callback: () async {
  351 + // Map temp =
  352 + await NavigatorUtil.goPhotoManagerSelectTablePage(
  353 + context, "", DateTime.now().millisecondsSinceEpoch, "1",
  354 + canChoose: true,
  355 + object: null,
  356 + fromPage: "tablePhoto",
  357 + tid: '');
  358 + // if (temp != null && temp['tid'] != '') {
  359 + // // print(temp['tid']);
  360 + // // print(temp['tname']);
  361 + // // tname = temp['tname'];
  362 + // // tid = temp['tid'];
  363 + // // _getTablePhoto(context, temp['tid'], showLoading: true);
  364 + // }
  365 + },
  366 + ),
  367 +
  368 + MyDivider(
  369 + double.infinity,
  370 + ScreenUtil().setHeight(1),
  371 + color: MyColours.color_f3f3f3,
  372 + ),
  373 + MyDivider(
  374 + double.infinity,
  375 + ScreenUtil().setHeight(1),
  376 + color: MyColours.color_f3f3f3,
  377 + ),
  378 +
  379 + MyItem(
348 title: "员工管理", 380 title: "员工管理",
349 content: "", 381 content: "",
350 callback: () { 382 callback: () {
  1 +import 'dart:ffi';
  2 +
  3 +import 'package:common_utils/common_utils.dart';
  4 +import 'package:dotted_border/dotted_border.dart';
  5 +import 'package:flutter/material.dart';
  6 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  7 +import 'package:one_key/constant/state.dart';
  8 +import 'package:one_key/models/area.dart';
  9 +import 'package:one_key/models/notebook.dart';
  10 +import 'package:one_key/models/tableOuter.dart';
  11 +import 'package:one_key/models/table_list.dart';
  12 +import 'package:one_key/pages/table/area_item_table.dart';
  13 +import 'package:one_key/provider/choose_table_model.dart';
  14 +import 'package:one_key/provider/notebook_detail_change_model.dart';
  15 +import 'package:one_key/provider/notebook_model.dart';
  16 +import 'package:one_key/provider/user_model.dart';
  17 +import 'package:one_key/res/colors.dart';
  18 +import 'package:one_key/route/navigator_util.dart';
  19 +import 'package:one_key/utils/dialog_util.dart';
  20 +import 'package:one_key/utils/event_bus.dart';
  21 +import 'package:one_key/utils/utils.dart';
  22 +import 'package:one_key/widgets/MyDivider.dart';
  23 +import 'package:one_key/widgets/app_bar.dart';
  24 +import 'package:one_key/widgets/area_item.dart';
  25 +import 'package:one_key/widgets/common_button.dart';
  26 +import 'package:one_key/widgets/f_table_item.dart';
  27 +import 'package:one_key/widgets/h_empty_view.dart';
  28 +import 'package:one_key/widgets/page_exception.dart';
  29 +import 'package:one_key/widgets/table_item.dart';
  30 +import 'package:one_key/models/table.dart' as t;
  31 +import 'package:one_key/widgets/v_empty_view.dart';
  32 +import 'package:provider/provider.dart';
  33 +import 'dart:convert' as convert;
  34 +
  35 +class PhotoManagerPage extends StatefulWidget {
  36 + final String rid; //预订id
  37 + final DateTime dateTime; //日期
  38 + final String ddate_slot; //时段
  39 + final bool canChoose; //变更预订可以取消原来已预订的选中状态
  40 + final List<TableList> tableList;
  41 + final String fromPage;
  42 + final String tid;
  43 +
  44 + PhotoManagerPage(this.rid, this.dateTime, this.ddate_slot,
  45 + {this.canChoose = false, this.tableList, this.fromPage, this.tid});
  46 +
  47 + @override
  48 + State<StatefulWidget> createState() {
  49 + // TODO: implement createState
  50 + return new PhotoManagerPageState();
  51 + }
  52 +}
  53 +
  54 +class PhotoManagerPageState extends State<PhotoManagerPage> {
  55 + List<Area> areas = []; //区域列表
  56 + List<t.Table> selectTables = []; //选择的桌位
  57 +
  58 + List<TableOuter> tableOuterList = []; //区域-桌位列表
  59 +
  60 + Map<String, List<t.Table>> areaTableMap = {}; //区域-桌位Map
  61 +
  62 + ChooseTableModel _chooseTableModel;
  63 +
  64 + Map<String, Notebook> tableMap = {}; //记录已预订桌位对应的订单
  65 +
  66 + String currentArea; //当前选中区域
  67 + List<String> personNumList = [];
  68 +
  69 + int selectNum = 0;
  70 + bool isSelected = true; //全部按钮
  71 + int _selectNumber;
  72 + Map dailyMap = {}; // 早市对应半点钟,午市对应半点钟、晚市对应半点钟
  73 +
  74 + String selectTableId;
  75 +
  76 + @override
  77 + void initState() {
  78 + // TODO: implement initState
  79 + super.initState();
  80 + // for (int i = 1; i < 31; i++) {
  81 + // personNumList.add(i.toString());
  82 + // }
  83 + // initDateHourMinuteList(context);
  84 +
  85 + WidgetsBinding.instance.addPostFrameCallback((_) {
  86 + getTableList();
  87 + });
  88 + bus.on("refresh_photo_manager", (args) {
  89 + getTableList();
  90 + });
  91 + }
  92 +
  93 + @override
  94 + void dispose() {
  95 + super.dispose();
  96 + bus.off("refresh_photo_manager");
  97 + }
  98 +
  99 + /// 早市、午市、晚市对应的半个小时间隔时间段
  100 + initDateHourMinuteList(BuildContext context) async {
  101 + UserModel userModel = Provider.of<UserModel>(context, listen: false);
  102 + String morning =
  103 + userModel.user.morning.isEmpty ? "00:00-00:00" : userModel.user.morning;
  104 + String noon =
  105 + userModel.user.noon.isEmpty ? "00:00-00:00" : userModel.user.noon;
  106 + String night =
  107 + userModel.user.night.isEmpty ? "00:00-00:00" : userModel.user.night;
  108 + userModel.user.morning == ''
  109 + ? dailyMap.putIfAbsent('morning', () => '')
  110 + : dailyMap.putIfAbsent(
  111 + 'morning', () => _getHourAndMinute(userModel.user.morning, 1));
  112 + userModel.user.noon == ''
  113 + ? dailyMap.putIfAbsent('noon', () => '')
  114 + : dailyMap.putIfAbsent(
  115 + 'noon', () => _getHourAndMinute(userModel.user.noon, 2));
  116 + userModel.user.night == ''
  117 + ? dailyMap.putIfAbsent('night', () => '')
  118 + : dailyMap.putIfAbsent(
  119 + 'night', () => _getHourAndMinute(userModel.user.night, 3));
  120 + // _initSunDateList(
  121 + // userModel.user.morning, userModel.user.noon, userModel.user.night);
  122 + }
  123 +
  124 + //根据获取时间 11:00-12:30 获取30分钟间隔组装的数组
  125 + _getHourAndMinute(String hourAndMinuteStr, int mnd) {
  126 + List tempDate = hourAndMinuteStr.split("-");
  127 + String beginDate = tempDate[0];
  128 + String endDate = tempDate[1];
  129 + List tempHour = beginDate.split(':');
  130 +
  131 + /*获取开始小时*/
  132 + int beginHour = int.parse(tempHour[0]);
  133 + /*获取开始分钟*/
  134 + int beginMinute = int.parse(tempHour[1]);
  135 + List res = [];
  136 + bool tempLimit = true;
  137 + while (tempLimit) {
  138 + String temp = _dealTime(beginHour, beginMinute);
  139 +
  140 + // bool tempSelect = false;
  141 +
  142 + // Map tempMap = {'title': temp, 'select': tempSelect};
  143 + res.add(temp);
  144 + if (temp == endDate) {
  145 + tempLimit = false;
  146 + break;
  147 + }
  148 + if (beginMinute == 30) {
  149 + beginHour++;
  150 + if (beginHour >= 24) {
  151 + beginHour = 0;
  152 + }
  153 + }
  154 + beginMinute = (beginMinute + 30) % 60;
  155 + }
  156 + return res;
  157 + }
  158 +
  159 + /// 根据时间和分钟组装 格式:11:00
  160 + _dealTime(int begin, int mm) {
  161 + String sb = '';
  162 + if (begin < 10) {
  163 + sb = '0$begin';
  164 + } else {
  165 + sb = '$begin';
  166 + }
  167 + sb = '$sb:';
  168 + if (mm < 10) {
  169 + sb = '${sb}0${mm}';
  170 + } else {
  171 + sb = '${sb}${mm}';
  172 + }
  173 + return sb;
  174 + }
  175 +
  176 + //获取桌位列表
  177 + getTableList({needLoading = true}) async {
  178 + UserModel userModel = Provider.of<UserModel>(context, listen: false);
  179 + Map<String, String> params = {"sellerid": userModel.user.sellerid};
  180 + tableOuterList = await _chooseTableModel.getTableList(context, params,
  181 + needLoading: needLoading);
  182 + _chooseTableModel.tablesAll = [];
  183 + for (TableOuter item in tableOuterList) {
  184 + // if (item.name == "推荐") {
  185 + // itemModelList.remove(item);
  186 + // }
  187 + for (var item1 in item.list) {
  188 + item1.selected = false;
  189 + for (var table in widget.tableList) {
  190 + if (item1.id == table.id) {
  191 + item1.selected = true;
  192 + selectNum++;
  193 + // if (!tableList.contains(item)) {
  194 + // tableList.add(item);
  195 + // }
  196 + }
  197 + }
  198 + }
  199 + _chooseTableModel.tablesAll.addAll(item.list);
  200 + }
  201 +
  202 + if (tableOuterList.isEmpty) {
  203 + _chooseTableModel.pageState = PageState.Success;
  204 + _chooseTableModel.notifyListeners();
  205 + } else {
  206 + initData();
  207 + // _getReserveList(userModel.user.sellerid, needLoading: needLoading);
  208 + }
  209 + // if (_chooseTableModel.pageState == PageState.Success) {
  210 +
  211 + // }
  212 + }
  213 +
  214 + refreshTable(context) async {
  215 + await getTableList(needLoading: false);
  216 + // if (temp.length > 0) {
  217 + // _getReserveList(context, needLoading: false);
  218 + // } else {
  219 + // // pageState = PageState.Empty;
  220 + // _chooseTableModel.pageState = PageState.Success;
  221 + // _chooseTableModel.notifyListeners();
  222 + // }
  223 + }
  224 +
  225 + //获取已预订列表
  226 + _getReserveList(String sid, {needLoading = true}) async {
  227 + NoteBookModel model = new NoteBookModel();
  228 + Map<String, String> params = {
  229 + "sid": sid,
  230 + "rdate": _getRdate(),
  231 + "ddate_solt": widget.ddate_slot,
  232 + "y": "200",
  233 + "x": "1",
  234 + "keywords": "",
  235 + "sort": "1"
  236 + };
  237 + List<Notebook> noteBooks =
  238 + await model.getReserveList(context, params, needLoading: needLoading);
  239 + for (Notebook notebook in noteBooks) {
  240 + if (notebook.tid.isEmpty) continue;
  241 + if (notebook.status == "1" ||
  242 + notebook.status == "2" ||
  243 + notebook.status == "5") {
  244 + //已预订,用餐中,已安排
  245 + List<String> tids = notebook.tid.split(",");
  246 + for (String tid in tids) {
  247 + tableMap["$tid"] = notebook;
  248 + }
  249 + }
  250 + }
  251 + print(tableMap);
  252 + if (needLoading) {
  253 + initData();
  254 + } else {
  255 + initData(needRetain: true);
  256 + }
  257 + }
  258 +
  259 + //初始桌位数据
  260 + initData({bool needRetain = false}) {
  261 + areas.clear();
  262 + areaTableMap.clear();
  263 + List<t.Table> tempTableAll = [];
  264 + tempTableAll.addAll(_chooseTableModel.tablesAll);
  265 + for (TableOuter outer in tableOuterList) {
  266 + int count = 0;
  267 + List<t.Table> tempList = [];
  268 + tempList.addAll(outer.list);
  269 + for (t.Table table in outer.list) {
  270 + // table.selected = false;
  271 + if (widget.tid != '' && table.id == widget.tid) {
  272 + table.selected = true;
  273 + currentArea = outer.name;
  274 + }
  275 + if (table.id == selectTableId) {
  276 + table.selected = true;
  277 + currentArea = outer.name;
  278 + }
  279 + // if (table.tablestatus == "0") {
  280 + // //没有用餐中
  281 + // if (tableMap["${table.id}"] != null) {
  282 + // Notebook notebook = tableMap["${table.id}"];
  283 + // table.sign = notebook.status;
  284 + // table.notebookId = notebook.id;
  285 + // table.reserver = notebook.rnameStr;
  286 + // table.pnum = notebook.actual_pnum;
  287 + // table.nickName = notebook.nick_name;
  288 + // table.noteName = notebook.note_name;
  289 + // //(不能移除自己定的桌子)
  290 + // String idNow = '';
  291 + // if (tableMap.containsKey('${table.id}')) {
  292 + // //包含,证明该桌子已经被预订了
  293 + // idNow = tableMap['${table.id}'].id;
  294 + // if (idNow != widget.rid) {
  295 + // //不是自己的当前订单
  296 + // //剔除已经预订的桌子,剩下空桌子(仅看空座)
  297 + // tempList.remove(table);
  298 + // //全部
  299 + // tempTableAll.remove(table);
  300 + // }
  301 + // }
  302 + // } else {
  303 + // table.sign = "";
  304 + // table.notebookId = "";
  305 + // if (table.enable == "1") {
  306 + // count++;
  307 + // }
  308 + // }
  309 + // } else {
  310 + // table.sign = "2";
  311 + // table.notebookId = "";
  312 + // }
  313 + }
  314 +
  315 + areaTableMap["${outer.name}"] = outer.list;
  316 + _chooseTableModel.areaTableMapCanNote["${outer.name}"] = tempList;
  317 + Area area = Area();
  318 + area.name = outer.name;
  319 + area.count = outer.list.length == 0 ? -1 : count;
  320 + area.rid = outer.list.length == 0 ? outer.rid : outer.list[0].rid;
  321 + areas.add(area);
  322 + }
  323 + _chooseTableModel.tablesCanNote = tempTableAll;
  324 + // if (_chooseTableModel.swichState) {
  325 + // _chooseTableModel.areaTableMapShow =
  326 + // _chooseTableModel.areaTableMapCanNote;
  327 + // _chooseTableModel.tablesShow = _chooseTableModel.tablesCanNote;
  328 + // } else {
  329 + _chooseTableModel.areaTableMapShow = areaTableMap;
  330 + _chooseTableModel.tablesShow = _chooseTableModel.tablesAll;
  331 + // }
  332 + if (widget.tid == '') {
  333 + if (!needRetain) {
  334 + // currentArea = areaTableMap.keys.first;
  335 + currentArea = '全部';
  336 + _chooseTableModel.currentTables = _chooseTableModel.tablesAll;
  337 + }
  338 + if (areas.length == 1) {
  339 + currentArea = areaTableMap.keys.first;
  340 + }
  341 + }
  342 +
  343 + _chooseTableModel.pageState = PageState.Success;
  344 + _chooseTableModel.notifyListeners();
  345 + }
  346 +
  347 + //获取一天开始-结束时间字符串
  348 + String _getRdate() {
  349 + String keys = '';
  350 +
  351 + if (widget.ddate_slot == '1') {
  352 + //早市
  353 + keys = 'morning';
  354 + } else if (widget.ddate_slot == '2') {
  355 + //午市
  356 + keys = 'noon';
  357 + } else if (widget.ddate_slot == '3') {
  358 + //晚市
  359 + keys = 'night';
  360 + }
  361 + String ymd =
  362 + DateUtil.formatDate(widget.dateTime, format: DateFormats.y_mo_d);
  363 + String timeStrStart = '';
  364 + String timeStrEnd = '';
  365 + //一天开始时间
  366 + double startDay;
  367 + //一天结束时间
  368 + double endDay;
  369 + if (keys != '') {
  370 + List temp = dailyMap[keys];
  371 + timeStrStart = ymd + ' ' + temp.first + ':00';
  372 + timeStrEnd = ymd + ' ' + temp.last + ':00';
  373 + } else {
  374 + timeStrStart = widget.dateTime.year.toString() +
  375 + "-" +
  376 + Utils.addZeroNumber(widget.dateTime.month) +
  377 + "-" +
  378 + Utils.addZeroNumber(widget.dateTime.day) +
  379 + " 00:00:00";
  380 + timeStrEnd = widget.dateTime.year.toString() +
  381 + "-" +
  382 + Utils.addZeroNumber(widget.dateTime.month) +
  383 + "-" +
  384 + Utils.addZeroNumber(widget.dateTime.day) +
  385 + " 23:59:59";
  386 + }
  387 + startDay = (DateTime.parse(timeStrStart).millisecondsSinceEpoch) / 1000;
  388 + endDay = (DateTime.parse(timeStrEnd).millisecondsSinceEpoch) / 1000;
  389 + return startDay.floor().toString() + "-" + endDay.floor().toString();
  390 + }
  391 +
  392 + Widget item(int i) {
  393 + return GridView.builder(
  394 + // controller: _areaController,
  395 + // physics: NeverScrollableScrollPhysics(),
  396 + padding: EdgeInsets.symmetric(
  397 + vertical: ScreenUtil().setWidth(20),
  398 + horizontal: ScreenUtil().setWidth(10)),
  399 + shrinkWrap: true,
  400 + itemCount: currentArea == '全部'
  401 + ? _chooseTableModel.tablesShow.length
  402 + : _chooseTableModel.areaTableMapShow[areas[i].name].length,
  403 + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  404 + crossAxisCount: 4,
  405 + childAspectRatio: 1,
  406 + mainAxisSpacing: ScreenUtil().setWidth(30),
  407 + crossAxisSpacing: ScreenUtil().setWidth(12),
  408 + ),
  409 +
  410 + itemBuilder: (BuildContext context, int index) {
  411 + List<t.Table> data = currentArea == '全部'
  412 + ? _chooseTableModel.tablesShow
  413 + : _chooseTableModel.areaTableMapShow[areas[i].name];
  414 + // if (index == data.length || data.length == 0) {
  415 + // return InkWell(
  416 + // onTap: () async {
  417 + // List<String> areasTemp = [];
  418 + // for (int i = 0; i < areas.length; i++) {
  419 + // areasTemp.add(areas[i].name);
  420 + // }
  421 +
  422 + // //添加桌位弹框
  423 + // await DialogUtil.openCreateTableDialog(
  424 + // context, areasTemp, i, personNumList,
  425 + // onTap: (Map<String, String> value) async {
  426 + // print(value);
  427 + // // 'areaname':
  428 + // // areas[currentAreaIndex],
  429 + // // 'name': controller.text,
  430 + // // 'pnumMin': pnumMin,
  431 + // // 'pnumMax': pnumMax
  432 + // //添加桌位 接口参数带整合???
  433 + // // 以下是旧的不去,明天添加桌位接口
  434 + // String rid;
  435 + // for (Area item in areas) {
  436 + // if (item.name == value['areaname']) {
  437 + // rid = item.rid;
  438 + // }
  439 + // }
  440 + // Map<String, String> params = {
  441 + // 'rid': rid,
  442 + // 'name': value['name'],
  443 + // };
  444 + // if (value['pnumMin'] != '') {
  445 + // params['pnum'] = value['pnumMin'];
  446 + // }
  447 + // if (value['pnumMax'] != '') {
  448 + // params['most_pnum'] = value['pnumMax'];
  449 + // }
  450 + // bool success =
  451 + // await _chooseTableModel.addTable(context, params);
  452 + // print(success);
  453 + // if (success) {
  454 + // Utils.showToast('添加成功!');
  455 + // // TableOuter tableOuter = TableOuter();
  456 + // // tableOuter.name = value;
  457 + // // tableOuter.list = [];
  458 + // // tableManagerModel.tableOuterList.add(tableOuter);
  459 + // // tableManagerModel.initData();
  460 + // // Timer(
  461 + // // Duration(milliseconds: 500),
  462 + // // () => _areaController.jumpTo(
  463 + // // _areaController.position.maxScrollExtent));
  464 +
  465 + // // await tableManagerModel
  466 + // // .getTableList(context);
  467 + // // await tableManagerModel
  468 + // // .initData();
  469 + // refreshTable(context);
  470 + // }
  471 + // });
  472 + // },
  473 + // child: Container(
  474 + // child: DottedBorder(
  475 + // dashPattern: [5, 5, 5, 5],
  476 + // borderType: BorderType.RRect,
  477 + // radius: Radius.circular(ScreenUtil().setWidth(20)),
  478 + // // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
  479 + // color: MyColours.color_E0E0E0,
  480 + // strokeWidth: ScreenUtil().setWidth(2),
  481 + // child: ClipRRect(
  482 + // borderRadius: BorderRadius.all(
  483 + // Radius.circular(ScreenUtil().setWidth(20))),
  484 + // child: Container(
  485 + // height: ScreenUtil.screenWidthDp -
  486 + // ScreenUtil().setWidth(12 * 3 - 10 * 2),
  487 + // width: ScreenUtil.screenWidthDp -
  488 + // ScreenUtil().setWidth(12 * 3 - 10 * 2),
  489 + // child: Column(
  490 + // mainAxisAlignment: MainAxisAlignment.center,
  491 + // children: [
  492 + // Image.asset(Utils.getImgPath('add_store'),
  493 + // width: ScreenUtil().setWidth(32)),
  494 + // ],
  495 + // ),
  496 + // ),
  497 + // ),
  498 + // )));
  499 + // } else {
  500 + return Selector<ChooseTableModel, t.Table>(
  501 + shouldRebuild: (pre, next) => true,
  502 + selector: (context, model) => data[index],
  503 + builder: (context, table, _) {
  504 + return FTableItem(data[index], canSelected: true,
  505 + onSelected: (t.Table table) {
  506 + print(areaTableMap.keys);
  507 + for (String item in areaTableMap.keys) {
  508 + for (t.Table tableItem in areaTableMap[item]) {
  509 + tableItem.selected = false;
  510 + selectNum = 0;
  511 + if (table.id == tableItem.id) {
  512 + selectTableId = table.id;
  513 + setState(() {
  514 + tableItem.selected = true;
  515 + });
  516 +
  517 + // selectTables = [];
  518 + // selectNum++;
  519 + // selectTables.add(table);
  520 + // Map temp = {
  521 + // 'tid': selectTables.length > 0 ? selectTables[0].id : '',
  522 + // 'tname':
  523 + // selectTables.length > 0 ? selectTables[0].name : ''
  524 + // };
  525 +
  526 + NavigatorUtil.goTablePhotoManagerPage(context,
  527 + tid: table.id, tname: table.name);
  528 + }
  529 + }
  530 + }
  531 + }, fromPage: widget.fromPage, tableMap: tableMap, rid: widget.rid);
  532 + },
  533 + );
  534 + // }
  535 + },
  536 + );
  537 + }
  538 +
  539 + @override
  540 + Widget build(BuildContext context) {
  541 + _chooseTableModel = Provider.of<ChooseTableModel>(context);
  542 + return Scaffold(
  543 + body: SafeArea(
  544 + child: Column(
  545 + children: <Widget>[
  546 + MyAppBar(
  547 + "照片管理",
  548 + showBack: true,
  549 + ),
  550 + Expanded(
  551 + child: Consumer<ChooseTableModel>(builder: (context, model, _) {
  552 + if (model.pageState != PageState.Success) {
  553 + return ExceptionPage(
  554 + pageState: model.pageState,
  555 + callback: () {
  556 + getTableList();
  557 + },
  558 + emptyMsg: "暂时没有桌位哦",
  559 + emptyImg: "empty_search",
  560 + showMsg: "加载中,请稍后...",
  561 + );
  562 + } else {
  563 + return Column(
  564 + // crossAxisAlignment: CrossAxisAlignment.center,
  565 + children: [
  566 + Container(
  567 + color: MyColours.color_ffffff,
  568 + height: ScreenUtil().setWidth(92),
  569 + margin:
  570 + EdgeInsets.only(bottom: ScreenUtil().setWidth(30)),
  571 + child: Row(
  572 + children: [
  573 + HEmptyView(20),
  574 + Expanded(
  575 + child: ListView.builder(
  576 + itemCount: areas.length == 0
  577 + ? 0
  578 + : areas.length + 1,
  579 + shrinkWrap: true,
  580 + scrollDirection: Axis.horizontal,
  581 + itemBuilder:
  582 + (BuildContext contxt, int index) {
  583 + // if (index == areas.length + 1 ||
  584 + // areas.length == 0) {
  585 + // return InkWell(
  586 + // onTap: () async {
  587 + // //添加区域弹框
  588 + // await DialogUtil.openCreateAreaDialog(
  589 + // context, onTap: (value) async {
  590 + // print(value);
  591 + // //添加区域
  592 + // bool success = await _chooseTableModel
  593 + // .addTableAreas(context, value);
  594 + // print(success);
  595 + // if (success) {
  596 + // Utils.showToast('添加成功!');
  597 + // UserModel userModel =
  598 + // Provider.of<UserModel>(context,
  599 + // listen: false);
  600 + // Map<String, String> params = {
  601 + // "sellerid": userModel.user.sellerid
  602 + // };
  603 + // await _chooseTableModel.getTableList(
  604 + // context, params,
  605 + // needLoading: false);
  606 + // initData();
  607 +
  608 + // // setState(() {
  609 + // // updateMenu();
  610 + // // });
  611 + // // _scrollToIndex(widget
  612 + // // .tableManagerModel
  613 + // // .areas
  614 + // // .length);
  615 +
  616 + // }
  617 + // });
  618 + // },
  619 + // child: Column(
  620 + // children: [
  621 + // VEmptyView(20),
  622 + // DottedBorder(
  623 + // dashPattern: [5, 5, 5, 5],
  624 + // borderType: BorderType.RRect,
  625 + // radius: Radius.circular(
  626 + // ScreenUtil().setWidth(10)),
  627 + // // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
  628 + // color: MyColours.color_199095,
  629 + // strokeWidth: ScreenUtil().setWidth(2),
  630 + // child: ClipRRect(
  631 + // borderRadius: BorderRadius.all(
  632 + // Radius.circular(
  633 + // ScreenUtil().setWidth(10))),
  634 + // child: Container(
  635 + // height:
  636 + // ScreenUtil().setWidth(25 * 2),
  637 + // width: ScreenUtil()
  638 + // .setWidth(104 * 2),
  639 + // child: Column(
  640 + // mainAxisAlignment:
  641 + // MainAxisAlignment.center,
  642 + // children: [
  643 + // Image.asset(
  644 + // Utils.getImgPath(
  645 + // 'add_area'),
  646 + // width: ScreenUtil()
  647 + // .setWidth(24)),
  648 + // ],
  649 + // ),
  650 + // ),
  651 + // ),
  652 + // )
  653 + // ],
  654 + // ),
  655 + // );
  656 + // } else {
  657 + if (index == 0) {
  658 + return InkWell(
  659 + onTap: () {
  660 + setState(() {
  661 + isSelected = true;
  662 + currentArea = '全部';
  663 + _chooseTableModel.currentTables =
  664 + _chooseTableModel
  665 + .areaTableMapShow[
  666 + currentArea];
  667 + });
  668 + },
  669 + child: Container(
  670 + // width: ScreenUtil().setWidth(104 * 2),
  671 + height: ScreenUtil().setWidth(80),
  672 + margin: EdgeInsets.only(
  673 + right: ScreenUtil().setWidth(20),
  674 + top: ScreenUtil().setWidth(20),
  675 + ),
  676 + padding: EdgeInsets.symmetric(
  677 + horizontal:
  678 + ScreenUtil().setWidth(20),
  679 + vertical:
  680 + ScreenUtil().setWidth(10)),
  681 + alignment: Alignment.center,
  682 + decoration: BoxDecoration(
  683 + // borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
  684 + color: isSelected
  685 + ? MyColours.color_199095
  686 + : MyColours.color_ffffff,
  687 + border: Border.all(
  688 + color:
  689 + MyColours.color_E0E0E0,
  690 + width: ScreenUtil()
  691 + .setWidth(2))),
  692 + child: Text(
  693 + '全部',
  694 + overflow: TextOverflow.ellipsis,
  695 + style: TextStyle(
  696 + color: isSelected
  697 + ? MyColours.color_ffffff
  698 + : MyColours.color_333333,
  699 + fontSize:
  700 + ScreenUtil().setSp(28),
  701 + decoration:
  702 + TextDecoration.none,
  703 + fontWeight:
  704 + FontWeight.normal),
  705 + ),
  706 + ),
  707 + );
  708 + } else {
  709 + return AreaItemTable(
  710 + areas[index - 1],
  711 + currentArea,
  712 + (area) {
  713 + setState(() {
  714 + isSelected = false;
  715 + _selectNumber = index - 1;
  716 + currentArea =
  717 + areas[index - 1].name;
  718 + _chooseTableModel.currentTables =
  719 + _chooseTableModel
  720 + .areaTableMapShow[
  721 + currentArea];
  722 + // _anmationMenu();
  723 + });
  724 + },
  725 + showBadge: false,
  726 + );
  727 + }
  728 + }
  729 + // },
  730 + )),
  731 + ],
  732 + ),
  733 + ),
  734 + Expanded(
  735 + flex: 2,
  736 + child: Container(
  737 + constraints: BoxConstraints(
  738 + minHeight: ScreenUtil().setWidth(100)),
  739 + color: Color.fromRGBO(249, 249, 249, 1),
  740 + child: item(_selectNumber))),
  741 + // Container(
  742 + // width: double.infinity,
  743 + // height: ScreenUtil().setHeight(84),
  744 + // margin: EdgeInsets.only(
  745 + // bottom: ScreenUtil().setWidth(50)),
  746 + // padding: EdgeInsets.symmetric(
  747 + // horizontal: ScreenUtil().setWidth(31)),
  748 + // alignment: Alignment.center,
  749 + // color: MyColours.color_ffffff,
  750 + // child: CommonButton(
  751 + // // content: widget.fromPage == 'tablePhoto'
  752 + // // ? '确定'
  753 + // // : "已选${selectNum}个 确定",
  754 + // content: '确定',
  755 + // width: 300,
  756 + // height: 84,
  757 + // fontSize: 34,
  758 + // state: 1,
  759 + // onPress: () {
  760 + // if (widget.fromPage == "tablePhoto") {
  761 + // Map temp = {
  762 + // 'tid': selectTables.length > 0
  763 + // ? selectTables[0].id
  764 + // : '',
  765 + // 'tname': selectTables.length > 0
  766 + // ? selectTables[0].name
  767 + // : ''
  768 + // };
  769 + // Navigator.of(context).pop(temp);
  770 + // } else {
  771 + // if (widget.canChoose) {
  772 + // // if (widget.tableList.length > 0) {
  773 + // String tid = "";
  774 + // for (TableList table in widget.tableList) {
  775 + // tid += table.id + ",";
  776 + // }
  777 + // if (widget.tableList.length > 0) {
  778 + // tid = tid.substring(0, tid.length - 1);
  779 + // }
  780 +
  781 + // Map temp = {
  782 + // 'object': widget.tableList,
  783 + // 'tid': tid
  784 + // };
  785 + // Navigator.of(context).pop(temp);
  786 + // // }
  787 + // } else {
  788 + // if (selectTables.length > 0) {
  789 + // String tid = "";
  790 + // for (t.Table table in selectTables) {
  791 + // tid += table.id + ",";
  792 + // }
  793 + // if (selectTables.length > 0) {
  794 + // tid = tid.substring(0, tid.length - 1);
  795 + // }
  796 +
  797 + // Map temp = {
  798 + // 'object': widget.tableList,
  799 + // 'tid': tid
  800 + // };
  801 + // Navigator.of(context).pop(temp);
  802 + // }
  803 + // }
  804 + // }
  805 + // },
  806 + // )),
  807 + ]);
  808 + }
  809 + }),
  810 + ),
  811 + ],
  812 + ),
  813 + ));
  814 + }
  815 +
  816 + tableToTableList(t.Table table) {
  817 + TableList _tableList = TableList(
  818 + '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
  819 + _tableList.id = table.id;
  820 + _tableList.rid = table.rid;
  821 + _tableList.tid = table.tid;
  822 + _tableList.name = table.name;
  823 + _tableList.tablePnum = table.table_pnum;
  824 + _tableList.sellerid = null;
  825 + _tableList.qrcode = null;
  826 + _tableList.mostPnum = table.most_pnum;
  827 + _tableList.hot = null;
  828 + _tableList.orderO = table.order_o;
  829 + _tableList.status = table.status;
  830 + _tableList.enable = table.enable;
  831 + _tableList.spell = table.spell;
  832 + _tableList.cdate = null;
  833 + _tableList.rname = table.rname;
  834 + _tableList.regionName = table.rname;
  835 + _tableList.selected = true;
  836 + return _tableList;
  837 + }
  838 +}
@@ -76,6 +76,7 @@ class _TablePhotoManagerPageState extends State<TablePhotoManagerPage> { @@ -76,6 +76,7 @@ class _TablePhotoManagerPageState extends State<TablePhotoManagerPage> {
76 } 76 }
77 } 77 }
78 } 78 }
  79 + bus.emit("refresh_photo_manager");
79 } 80 }
80 81
81 print(_uploadImageProvider.tableImageList); 82 print(_uploadImageProvider.tableImageList);
@@ -178,25 +179,26 @@ class _TablePhotoManagerPageState extends State<TablePhotoManagerPage> { @@ -178,25 +179,26 @@ class _TablePhotoManagerPageState extends State<TablePhotoManagerPage> {
178 fontWeight: FontWeight.bold)), 179 fontWeight: FontWeight.bold)),
179 InkWell( 180 InkWell(
180 onTap: () async { 181 onTap: () async {
181 - Map temp =  
182 - await NavigatorUtil.goSelectTablePage(  
183 - context,  
184 - "",  
185 - DateTime.now()  
186 - .millisecondsSinceEpoch,  
187 - "1",  
188 - canChoose: true,  
189 - object: null,  
190 - fromPage: "tablePhoto",  
191 - tid: tid);  
192 - if (temp != null && temp['tid'] != '') {  
193 - print(temp['tid']);  
194 - print(temp['tname']);  
195 - tname = temp['tname'];  
196 - tid = temp['tid'];  
197 - _getTablePhoto(context, temp['tid'],  
198 - showLoading: true);  
199 - } 182 + Navigator.pop(context);
  183 + // Map temp = await NavigatorUtil
  184 + // .goPhotoManagerSelectTablePage(
  185 + // context,
  186 + // "",
  187 + // DateTime.now()
  188 + // .millisecondsSinceEpoch,
  189 + // "1",
  190 + // canChoose: true,
  191 + // object: null,
  192 + // fromPage: "tablePhoto",
  193 + // tid: tid);
  194 + // if (temp != null && temp['tid'] != '') {
  195 + // print(temp['tid']);
  196 + // print(temp['tname']);
  197 + // tname = temp['tname'];
  198 + // tid = temp['tid'];
  199 + // _getTablePhoto(context, temp['tid'],
  200 + // showLoading: true);
  201 + // }
200 }, 202 },
201 child: Text('切换桌位', 203 child: Text('切换桌位',
202 style: TextStyle( 204 style: TextStyle(
@@ -8,8 +8,10 @@ class AreaItemTable extends StatefulWidget { @@ -8,8 +8,10 @@ class AreaItemTable extends StatefulWidget {
8 final String currentArea; //当前选中区域名称 8 final String currentArea; //当前选中区域名称
9 final Area area; 9 final Area area;
10 final ValueChanged selectCallback; 10 final ValueChanged selectCallback;
  11 + final bool showBadge;
11 12
12 - AreaItemTable(this.area, this.currentArea, this.selectCallback); 13 + AreaItemTable(this.area, this.currentArea, this.selectCallback,
  14 + {this.showBadge = true});
13 15
14 @override 16 @override
15 State<StatefulWidget> createState() { 17 State<StatefulWidget> createState() {
@@ -65,36 +67,38 @@ class AreaItemTableState extends State<AreaItemTable> { @@ -65,36 +67,38 @@ class AreaItemTableState extends State<AreaItemTable> {
65 fontWeight: FontWeight.normal), 67 fontWeight: FontWeight.normal),
66 ), 68 ),
67 ), 69 ),
68 - area.count == -1  
69 - ? Container()  
70 - : Positioned(  
71 - right: ScreenUtil().setWidth(12),  
72 - top: ScreenUtil().setWidth(6),  
73 - child: Container(  
74 - padding: EdgeInsets.symmetric(  
75 - vertical: ScreenUtil().setWidth(6),  
76 - horizontal: ScreenUtil().setWidth(4)),  
77 - // width: ScreenUtil().setWidth(78),  
78 - // height: ScreenUtil().setWidth(30),  
79 - alignment: Alignment.center,  
80 - decoration: BoxDecoration(  
81 - color: area.count <= 0  
82 - ? MyColours.color_999999  
83 - : MyColours.color_199095,  
84 - // borderRadius: BorderRadius.only(  
85 - // topLeft: Radius.circular(ScreenUtil().setWidth(10)),  
86 - // topRight: Radius.circular(ScreenUtil().setWidth(15)),  
87 - // bottomRight:  
88 - // Radius.circular(ScreenUtil().setWidth(15))) 70 + !widget.showBadge
  71 + ? SizedBox()
  72 + : area.count == -1
  73 + ? Container()
  74 + : Positioned(
  75 + right: ScreenUtil().setWidth(12),
  76 + top: ScreenUtil().setWidth(6),
  77 + child: Container(
  78 + padding: EdgeInsets.symmetric(
  79 + vertical: ScreenUtil().setWidth(6),
  80 + horizontal: ScreenUtil().setWidth(4)),
  81 + // width: ScreenUtil().setWidth(78),
  82 + // height: ScreenUtil().setWidth(30),
  83 + alignment: Alignment.center,
  84 + decoration: BoxDecoration(
  85 + color: area.count <= 0
  86 + ? MyColours.color_999999
  87 + : MyColours.color_199095,
  88 + // borderRadius: BorderRadius.only(
  89 + // topLeft: Radius.circular(ScreenUtil().setWidth(10)),
  90 + // topRight: Radius.circular(ScreenUtil().setWidth(15)),
  91 + // bottomRight:
  92 + // Radius.circular(ScreenUtil().setWidth(15)))
  93 + ),
  94 + child: Text(area.count <= 0 ? "满座" : "${area.count}",
  95 + style: TextStyle(
  96 + color: MyColours.color_ffffff,
  97 + fontSize: ScreenUtil().setSp(26),
  98 + decoration: TextDecoration.none,
  99 + fontWeight: FontWeight.normal)),
  100 + ),
89 ), 101 ),
90 - child: Text(area.count <= 0 ? "满座" : "${area.count}",  
91 - style: TextStyle(  
92 - color: MyColours.color_ffffff,  
93 - fontSize: ScreenUtil().setSp(26),  
94 - decoration: TextDecoration.none,  
95 - fontWeight: FontWeight.normal)),  
96 - ),  
97 - ),  
98 ], 102 ],
99 )); 103 ));
100 } 104 }
@@ -76,6 +76,22 @@ class NavigatorUtil { @@ -76,6 +76,22 @@ class NavigatorUtil {
76 "${Routes.select_table}?rid=$rid&tid=$tid&dateTime=$dateTime&fromPage=$fromPage&ddate_slot=$ddate_slot&canChoose=$canChoose"); 76 "${Routes.select_table}?rid=$rid&tid=$tid&dateTime=$dateTime&fromPage=$fromPage&ddate_slot=$ddate_slot&canChoose=$canChoose");
77 } 77 }
78 78
  79 + /// 选择桌位-照片管理
  80 + static Future goPhotoManagerSelectTablePage(
  81 + BuildContext context, String rid, int dateTime, String ddate_slot,
  82 + {bool canChoose = false,
  83 + Map object,
  84 + String fromPage = 'change',
  85 + String tid = ''}) {
  86 + if (object != null) {
  87 + return _navigateTo(context,
  88 + "${Routes.photo_manager_page}?rid=$rid&tid=$tid&dateTime=$dateTime&fromPage=$fromPage&ddate_slot=$ddate_slot&canChoose=$canChoose&object=${FluroConvertUtils.object2string(object)}");
  89 + }
  90 + // object = {'object': [], "tid": ''};
  91 + return _navigateTo(context,
  92 + "${Routes.photo_manager_page}?rid=$rid&tid=$tid&dateTime=$dateTime&fromPage=$fromPage&ddate_slot=$ddate_slot&canChoose=$canChoose");
  93 + }
  94 +
79 /// 选择桌位——方硕新修改的选择桌位页面 95 /// 选择桌位——方硕新修改的选择桌位页面
80 static Future goSelectTableFPage( 96 static Future goSelectTableFPage(
81 BuildContext context, String rid, int dateTime, String ddate_slot, 97 BuildContext context, String rid, int dateTime, String ddate_slot,
@@ -49,6 +49,7 @@ import 'package:one_key/pages/my/menu_type/menu_add_dishes_page.dart'; @@ -49,6 +49,7 @@ import 'package:one_key/pages/my/menu_type/menu_add_dishes_page.dart';
49 import 'package:one_key/pages/my/menu_type/menu_category_page.dart'; 49 import 'package:one_key/pages/my/menu_type/menu_category_page.dart';
50 import 'package:one_key/pages/my/menu_type/menu_manage_page.dart'; 50 import 'package:one_key/pages/my/menu_type/menu_manage_page.dart';
51 import 'package:one_key/pages/my/my_integral_page.dart'; 51 import 'package:one_key/pages/my/my_integral_page.dart';
  52 +import 'package:one_key/pages/my/photo_type/photo_manager_page.dart';
52 import 'package:one_key/pages/my/receive_orders_time_set.dart'; 53 import 'package:one_key/pages/my/receive_orders_time_set.dart';
53 import 'package:one_key/pages/my/remark_manager_page.dart'; 54 import 'package:one_key/pages/my/remark_manager_page.dart';
54 import 'package:one_key/pages/my/room_type/room_type_create_page.dart'; 55 import 'package:one_key/pages/my/room_type/room_type_create_page.dart';
@@ -65,7 +66,7 @@ import 'package:one_key/pages/online_check/online_check_detail_page.dart'; @@ -65,7 +66,7 @@ import 'package:one_key/pages/online_check/online_check_detail_page.dart';
65 import 'package:one_key/pages/online_check/online_check_edit_page.dart'; 66 import 'package:one_key/pages/online_check/online_check_edit_page.dart';
66 import 'package:one_key/pages/sms/sms_page.dart'; 67 import 'package:one_key/pages/sms/sms_page.dart';
67 import 'package:one_key/pages/table/select_table_page.dart'; 68 import 'package:one_key/pages/table/select_table_page.dart';
68 -import 'package:one_key/pages/table/table_photo_manager_page.dart'; 69 +import 'package:one_key/pages/my/photo_type/table_photo_manager_page.dart';
69 import 'package:one_key/pages/webview/webview_page.dart'; 70 import 'package:one_key/pages/webview/webview_page.dart';
70 import 'package:one_key/provider/base_info_provider.dart'; 71 import 'package:one_key/provider/base_info_provider.dart';
71 import 'package:one_key/provider/book_set_time_model.dart'; 72 import 'package:one_key/provider/book_set_time_model.dart';
@@ -191,6 +192,33 @@ var handleSelectTableFHandler = new Handler( @@ -191,6 +192,33 @@ var handleSelectTableFHandler = new Handler(
191 canChoose: canChoose, tableList: res, fromPage: fromPage, tid: tid)); 192 canChoose: canChoose, tableList: res, fromPage: fromPage, tid: tid));
192 }); 193 });
193 194
  195 +// 跳转到照片管理的选择桌位_方硕新修改的页面
  196 +var photoManagerPageHandle = new Handler(
  197 + handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
  198 + String rid = params['rid'].first;
  199 + String tid = params['tid'].first;
  200 + DateTime dateTime =
  201 + DateTime.fromMillisecondsSinceEpoch(int.parse(params["dateTime"].first));
  202 + String ddate_slot = params["ddate_slot"].first;
  203 + String fromPage = params["fromPage"].first;
  204 + bool canChoose = params["canChoose"].first == "true" ? true : false;
  205 + List<TableList> res = [];
  206 + if (params.keys.contains('object')) {
  207 + Map object = FluroConvertUtils.string2map(params["object"].first);
  208 + List temp = object['object'];
  209 +
  210 + for (var item in temp) {
  211 + res.add(TableList.fromJson(item));
  212 + }
  213 + }
  214 +
  215 + // return SelectTablePage(rid, dateTime, ddate_slot,canChoose: canChoose);
  216 + return ChangeNotifierProvider<ChooseTableModel>(
  217 + create: (_) => ChooseTableModel(),
  218 + child: PhotoManagerPage(rid, dateTime, ddate_slot,
  219 + canChoose: canChoose, tableList: res, fromPage: fromPage, tid: tid));
  220 +});
  221 +
194 // 跳转到邀请函页面 222 // 跳转到邀请函页面
195 var handleInvicationHandler = new Handler( 223 var handleInvicationHandler = new Handler(
196 handlerFunc: (BuildContext context, Map<String, List<Object>> params) { 224 handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
@@ -65,6 +65,7 @@ class Routes { @@ -65,6 +65,7 @@ class Routes {
65 static String personnel_password_edit_page = 65 static String personnel_password_edit_page =
66 "/personnel_password_edit_page"; //密码修改页 66 "/personnel_password_edit_page"; //密码修改页
67 static String change_detail_f = "/change_detail_f"; //变更预订_方硕新修改页面 67 static String change_detail_f = "/change_detail_f"; //变更预订_方硕新修改页面
  68 + static String photo_manager_page = "/photo_manager_page"; //照片管理
68 69
69 static void configureRoutes(FluroRouter router) { 70 static void configureRoutes(FluroRouter router) {
70 router.notFoundHandler = new Handler( 71 router.notFoundHandler = new Handler(
@@ -77,7 +78,7 @@ class Routes { @@ -77,7 +78,7 @@ class Routes {
77 router.define(handle_online_page, handler: handleOnlineHandler); 78 router.define(handle_online_page, handler: handleOnlineHandler);
78 router.define(reserve_detail, handler: reserveDetailHandler); 79 router.define(reserve_detail, handler: reserveDetailHandler);
79 router.define(select_table, handler: handleSelectTableHandler); 80 router.define(select_table, handler: handleSelectTableHandler);
80 - router.define(select_table_f, handler: handleSelectTableFHandler); 81 + router.define(select_table_f, handler: handleSelectTableFHandler);
81 router.define(invication, handler: handleInvicationHandler); 82 router.define(invication, handler: handleInvicationHandler);
82 router.define(sms, handler: handleSmsHandler); 83 router.define(sms, handler: handleSmsHandler);
83 router.define(webview, handler: handleWebviewHandler); 84 router.define(webview, handler: handleWebviewHandler);
@@ -138,5 +139,6 @@ class Routes { @@ -138,5 +139,6 @@ class Routes {
138 router.define(personnel_password_edit_page, 139 router.define(personnel_password_edit_page,
139 handler: personnelPasswordEditPageHandle); 140 handler: personnelPasswordEditPageHandle);
140 router.define(change_detail_f, handler: noteBookChangeFPageHandle); 141 router.define(change_detail_f, handler: noteBookChangeFPageHandle);
  142 + router.define(photo_manager_page, handler: photoManagerPageHandle);
141 } 143 }
142 } 144 }