Showing
12 changed files
with
182 additions
and
33 deletions
| @@ -22,6 +22,7 @@ import 'package:one_key/provider/message_model.dart'; | @@ -22,6 +22,7 @@ import 'package:one_key/provider/message_model.dart'; | ||
| 22 | import 'package:one_key/provider/notebook_detail_model.dart'; | 22 | import 'package:one_key/provider/notebook_detail_model.dart'; |
| 23 | import 'package:one_key/provider/online_check_edit_provider.dart'; | 23 | import 'package:one_key/provider/online_check_edit_provider.dart'; |
| 24 | import 'package:one_key/provider/other_login_provider.dart'; | 24 | import 'package:one_key/provider/other_login_provider.dart'; |
| 25 | +import 'package:one_key/provider/remark_manager_model.dart'; | ||
| 25 | import 'package:one_key/provider/tools.dart'; | 26 | import 'package:one_key/provider/tools.dart'; |
| 26 | import 'package:one_key/provider/upload_img_provider.dart'; | 27 | import 'package:one_key/provider/upload_img_provider.dart'; |
| 27 | import 'package:one_key/route/navigator_util.dart'; | 28 | import 'package:one_key/route/navigator_util.dart'; |
| @@ -102,6 +103,9 @@ Future<void> main() async { | @@ -102,6 +103,9 @@ Future<void> main() async { | ||
| 102 | ChangeNotifierProvider<CreateStoreModel>( | 103 | ChangeNotifierProvider<CreateStoreModel>( |
| 103 | create: (_) => CreateStoreModel(), | 104 | create: (_) => CreateStoreModel(), |
| 104 | ), | 105 | ), |
| 106 | + ChangeNotifierProvider<RemarkManagerModel>( | ||
| 107 | + create: (_) => RemarkManagerModel(), | ||
| 108 | + ), | ||
| 105 | ], | 109 | ], |
| 106 | child: MyApp(), | 110 | child: MyApp(), |
| 107 | )); | 111 | )); |
| @@ -16,6 +16,7 @@ class Notebook { | @@ -16,6 +16,7 @@ class Notebook { | ||
| 16 | String room_demand; | 16 | String room_demand; |
| 17 | String tid; | 17 | String tid; |
| 18 | String pnum; | 18 | String pnum; |
| 19 | + String actual_pnum; | ||
| 19 | String pnum_str; | 20 | String pnum_str; |
| 20 | String rname; | 21 | String rname; |
| 21 | String sex; | 22 | String sex; |
| @@ -61,11 +62,16 @@ class Notebook { | @@ -61,11 +62,16 @@ class Notebook { | ||
| 61 | switch (sex) { | 62 | switch (sex) { |
| 62 | case "1": //先生 | 63 | case "1": //先生 |
| 63 | return rname + "先生"; | 64 | return rname + "先生"; |
| 65 | + break; | ||
| 64 | case "2": //女士 | 66 | case "2": //女士 |
| 65 | return rname + "女士"; | 67 | return rname + "女士"; |
| 68 | + break; | ||
| 66 | case "3": //公司 | 69 | case "3": //公司 |
| 67 | return rname + "公司"; | 70 | return rname + "公司"; |
| 71 | + break; | ||
| 68 | } | 72 | } |
| 73 | + | ||
| 74 | + return rname; | ||
| 69 | } | 75 | } |
| 70 | 76 | ||
| 71 | String get ddateStr { | 77 | String get ddateStr { |
| @@ -16,6 +16,7 @@ Notebook _$NotebookFromJson(Map<String, dynamic> json) { | @@ -16,6 +16,7 @@ Notebook _$NotebookFromJson(Map<String, dynamic> json) { | ||
| 16 | ..room_demand = json['room_demand'] as String | 16 | ..room_demand = json['room_demand'] as String |
| 17 | ..tid = json['tid'] as String | 17 | ..tid = json['tid'] as String |
| 18 | ..pnum = json['pnum'] as String | 18 | ..pnum = json['pnum'] as String |
| 19 | + ..pnum = json['actual_pnum'] as String | ||
| 19 | ..pnum_str = json['pnum_str'] as String | 20 | ..pnum_str = json['pnum_str'] as String |
| 20 | ..rname = json['rname'] as String | 21 | ..rname = json['rname'] as String |
| 21 | ..sex = json['sex'] as String | 22 | ..sex = json['sex'] as String |
| @@ -60,6 +61,7 @@ Map<String, dynamic> _$NotebookToJson(Notebook instance) => <String, dynamic>{ | @@ -60,6 +61,7 @@ Map<String, dynamic> _$NotebookToJson(Notebook instance) => <String, dynamic>{ | ||
| 60 | 'room_demand': instance.room_demand, | 61 | 'room_demand': instance.room_demand, |
| 61 | 'tid': instance.tid, | 62 | 'tid': instance.tid, |
| 62 | 'pnum': instance.pnum, | 63 | 'pnum': instance.pnum, |
| 64 | + 'actual_pnum': instance.actual_pnum, | ||
| 63 | 'pnum_str': instance.pnum_str, | 65 | 'pnum_str': instance.pnum_str, |
| 64 | 'rname': instance.rname, | 66 | 'rname': instance.rname, |
| 65 | 'sex': instance.sex, | 67 | 'sex': instance.sex, |
| @@ -92,6 +92,7 @@ class NotebookDetail { | @@ -92,6 +92,7 @@ class NotebookDetail { | ||
| 92 | String type; //0 内部订单 1 在线预订 | 92 | String type; //0 内部订单 1 在线预订 |
| 93 | String note_name; | 93 | String note_name; |
| 94 | String nick_name; | 94 | String nick_name; |
| 95 | + String seller_user_phone; | ||
| 95 | String channel; | 96 | String channel; |
| 96 | String cdate; | 97 | String cdate; |
| 97 | List<t.Table> demands; //需求桌位 | 98 | List<t.Table> demands; //需求桌位 |
| @@ -152,6 +153,16 @@ class NotebookDetail { | @@ -152,6 +153,16 @@ class NotebookDetail { | ||
| 152 | return md; | 153 | return md; |
| 153 | } | 154 | } |
| 154 | 155 | ||
| 156 | +//2020-09-09 | ||
| 157 | + String get ddateYMD { | ||
| 158 | + DateTime day = DateTime.fromMillisecondsSinceEpoch(int.parse(ddate) * 1000); | ||
| 159 | + String ymd = "${day.year}-" + | ||
| 160 | + Utils.addZeroNumber(day.month) + | ||
| 161 | + "-" + | ||
| 162 | + Utils.addZeroNumber(day.day); | ||
| 163 | + return ymd; | ||
| 164 | + } | ||
| 165 | + | ||
| 155 | String get ddateF { | 166 | String get ddateF { |
| 156 | DateTime dateTime = | 167 | DateTime dateTime = |
| 157 | DateTime.fromMillisecondsSinceEpoch(int.parse(ddate) * 1000); | 168 | DateTime.fromMillisecondsSinceEpoch(int.parse(ddate) * 1000); |
| @@ -240,7 +251,7 @@ class NotebookDetail { | @@ -240,7 +251,7 @@ class NotebookDetail { | ||
| 240 | } | 251 | } |
| 241 | 252 | ||
| 242 | String get rnameStr { | 253 | String get rnameStr { |
| 243 | - if (rname.isEmpty) return ""; | 254 | + if (rname == null || rname == '') return ""; |
| 244 | switch (sex) { | 255 | switch (sex) { |
| 245 | case "1": //先生 | 256 | case "1": //先生 |
| 246 | return rname + "先生"; | 257 | return rname + "先生"; |
| @@ -249,6 +260,7 @@ class NotebookDetail { | @@ -249,6 +260,7 @@ class NotebookDetail { | ||
| 249 | case "3": //公司 | 260 | case "3": //公司 |
| 250 | return rname + "公司"; | 261 | return rname + "公司"; |
| 251 | } | 262 | } |
| 263 | + return rname; | ||
| 252 | } | 264 | } |
| 253 | 265 | ||
| 254 | String get tableinfoStr { | 266 | String get tableinfoStr { |
| @@ -263,7 +275,7 @@ class NotebookDetail { | @@ -263,7 +275,7 @@ class NotebookDetail { | ||
| 263 | 275 | ||
| 264 | @override | 276 | @override |
| 265 | String toString() { | 277 | String toString() { |
| 266 | - return 'NotebookDetail{id: $id, con_amount:$con_amount,abolition: $abolition, tableinfo: $tableinfo,actual_pum:$actual_pum, pnum: $pnum, rname: $rname, sex: $sex, phone: $phone, cusdem: $cusdem, cusman: $cusman, ddate: $ddate, is_set_ddate: $is_set_ddate, ddate_solt: $ddate_solt, status: $status, action: $action, type: $type, note_name: $note_name, , nick_name: $nick_name,channel: $channel, cdate: $cdate, demands: $demands, tables: $tables, cancel: $cancel}'; | 278 | + return 'NotebookDetail{id: $id, con_amount:$con_amount,abolition: $abolition, tableinfo: $tableinfo,actual_pum:$actual_pum, pnum: $pnum, rname: $rname, sex: $sex, phone: $phone, cusdem: $cusdem, cusman: $cusman, ddate: $ddate, is_set_ddate: $is_set_ddate, ddate_solt: $ddate_solt, status: $status, action: $action, type: $type, note_name: $note_name, seller_user_phone:$seller_user_phone, nick_name: $nick_name,channel: $channel, cdate: $cdate, demands: $demands, tables: $tables, cancel: $cancel}'; |
| 267 | } | 279 | } |
| 268 | } | 280 | } |
| 269 | 281 |
| @@ -28,6 +28,7 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) { | @@ -28,6 +28,7 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) { | ||
| 28 | ..type = json['type'] as String | 28 | ..type = json['type'] as String |
| 29 | ..note_name = json['note_name'] as String | 29 | ..note_name = json['note_name'] as String |
| 30 | ..nick_name = json['nick_name'] as String | 30 | ..nick_name = json['nick_name'] as String |
| 31 | + ..seller_user_phone = json['seller_user_phone'] as String | ||
| 31 | ..channel = json['channel'] as String | 32 | ..channel = json['channel'] as String |
| 32 | ..cdate = json['cdate'] as String | 33 | ..cdate = json['cdate'] as String |
| 33 | ..demands = (json['demands'] as List) | 34 | ..demands = (json['demands'] as List) |
| @@ -70,6 +71,7 @@ Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) => | @@ -70,6 +71,7 @@ Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) => | ||
| 70 | 'type': instance.type, | 71 | 'type': instance.type, |
| 71 | 'note_name': instance.note_name, | 72 | 'note_name': instance.note_name, |
| 72 | 'nick_name': instance.nick_name, | 73 | 'nick_name': instance.nick_name, |
| 74 | + 'seller_user_phone':instance.seller_user_phone, | ||
| 73 | 'channel': instance.channel, | 75 | 'channel': instance.channel, |
| 74 | 'cdate': instance.cdate, | 76 | 'cdate': instance.cdate, |
| 75 | 'demands': instance.demands, | 77 | 'demands': instance.demands, |
| @@ -1432,15 +1432,13 @@ Widget remarkButton({GestureTapCallback onPress, content, isSelect = false}) { | @@ -1432,15 +1432,13 @@ Widget remarkButton({GestureTapCallback onPress, content, isSelect = false}) { | ||
| 1432 | borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)), | 1432 | borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)), |
| 1433 | color: isSelect ? MyColours.color_199095 : MyColours.color_f5f5f5, | 1433 | color: isSelect ? MyColours.color_199095 : MyColours.color_f5f5f5, |
| 1434 | ), | 1434 | ), |
| 1435 | - child: Align( | ||
| 1436 | - alignment: Alignment.center, | ||
| 1437 | - child: Text( | 1435 | + child: Text( |
| 1438 | content, | 1436 | content, |
| 1439 | style: TextStyle( | 1437 | style: TextStyle( |
| 1440 | color: isSelect ? Colors.white : MyColours.color_353535, | 1438 | color: isSelect ? Colors.white : MyColours.color_353535, |
| 1441 | fontSize: ScreenUtil().setSp(28)), | 1439 | fontSize: ScreenUtil().setSp(28)), |
| 1442 | ), | 1440 | ), |
| 1443 | - ), | 1441 | + |
| 1444 | ), | 1442 | ), |
| 1445 | ); | 1443 | ); |
| 1446 | } | 1444 | } |
This diff could not be displayed because it is too large.
| 1 | +import 'package:common_utils/common_utils.dart'; | ||
| 1 | import 'package:flutter/material.dart'; | 2 | import 'package:flutter/material.dart'; |
| 2 | import 'package:one_key/constant/constant.dart'; | 3 | import 'package:one_key/constant/constant.dart'; |
| 3 | import 'package:one_key/constant/error.dart'; | 4 | import 'package:one_key/constant/error.dart'; |
| @@ -72,7 +73,7 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -72,7 +73,7 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 72 | ///获取已预订订单 | 73 | ///获取已预订订单 |
| 73 | Future<NotebookDetail> getReserveDetail( | 74 | Future<NotebookDetail> getReserveDetail( |
| 74 | BuildContext context, Map<String, String> params, | 75 | BuildContext context, Map<String, String> params, |
| 75 | - {isShowLoading = true}) async { | 76 | + {isShowLoading = true, bool showCircle = false}) async { |
| 76 | if (isShowLoading) { | 77 | if (isShowLoading) { |
| 77 | pageState = PageState.Loading; | 78 | pageState = PageState.Loading; |
| 78 | notifyListeners(); | 79 | notifyListeners(); |
| @@ -80,7 +81,7 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -80,7 +81,7 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 80 | BaseResp<Map<String, dynamic>> baseResp = await DioUtil() | 81 | BaseResp<Map<String, dynamic>> baseResp = await DioUtil() |
| 81 | .request<Map<String, dynamic>>( | 82 | .request<Map<String, dynamic>>( |
| 82 | context, Method.get, HttpUrl.reserve_detail, | 83 | context, Method.get, HttpUrl.reserve_detail, |
| 83 | - data: params, showLoading: false) | 84 | + data: params, showLoading: showCircle) |
| 84 | .catchError((error) { | 85 | .catchError((error) { |
| 85 | print(error.toString()); | 86 | print(error.toString()); |
| 86 | if (error is MyError) { | 87 | if (error is MyError) { |
| @@ -190,15 +191,15 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -190,15 +191,15 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 190 | 191 | ||
| 191 | // 编辑订单附加信息 | 192 | // 编辑订单附加信息 |
| 192 | 193 | ||
| 193 | - Future<bool> upReserveInfo(BuildContext context, | ||
| 194 | - {String rid, | ||
| 195 | - String actualPum, | 194 | + Future<bool> upReserveInfo(BuildContext context, String rid, |
| 195 | + {String actualPum, | ||
| 196 | String conAmount, | 196 | String conAmount, |
| 197 | String dateStr, | 197 | String dateStr, |
| 198 | String cusdem, | 198 | String cusdem, |
| 199 | String sex, | 199 | String sex, |
| 200 | String name, | 200 | String name, |
| 201 | - String phone}) async { | 201 | + String phone, |
| 202 | + String ymd}) async { | ||
| 202 | Map<String, dynamic> params = { | 203 | Map<String, dynamic> params = { |
| 203 | "rid": rid, | 204 | "rid": rid, |
| 204 | }; | 205 | }; |
| @@ -209,7 +210,9 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -209,7 +210,9 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 209 | params['con_amount'] = conAmount; | 210 | params['con_amount'] = conAmount; |
| 210 | } | 211 | } |
| 211 | if (dateStr != null) { | 212 | if (dateStr != null) { |
| 212 | - params['dateStr'] = dateStr; | 213 | + String timeStr = ymd + ' ' + dateStr + ':00'; |
| 214 | + int ddate = DateUtil.getDateMsByTimeStr(timeStr); | ||
| 215 | + params['ddate'] = '${ddate}'.substring(0, 10); //到店时间 | ||
| 213 | } | 216 | } |
| 214 | if (cusdem != null) { | 217 | if (cusdem != null) { |
| 215 | params['cusdem'] = cusdem; | 218 | params['cusdem'] = cusdem; |
| @@ -218,7 +221,7 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -218,7 +221,7 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 218 | params['sex'] = sex; | 221 | params['sex'] = sex; |
| 219 | } | 222 | } |
| 220 | if (name != null) { | 223 | if (name != null) { |
| 221 | - params['name'] = name; | 224 | + params['rname'] = name; |
| 222 | } | 225 | } |
| 223 | if (phone != null) { | 226 | if (phone != null) { |
| 224 | params['phone'] = phone; | 227 | params['phone'] = phone; |
| @@ -226,7 +229,9 @@ class NotebookDetailModel extends ChangeNotifier { | @@ -226,7 +229,9 @@ class NotebookDetailModel extends ChangeNotifier { | ||
| 226 | bool sucess = await _upReserveInfo(context, params); | 229 | bool sucess = await _upReserveInfo(context, params); |
| 227 | if (sucess) { | 230 | if (sucess) { |
| 228 | Utils.showToast("修改成功!"); | 231 | Utils.showToast("修改成功!"); |
| 232 | + return true; | ||
| 229 | } | 233 | } |
| 234 | + return false; | ||
| 230 | } | 235 | } |
| 231 | 236 | ||
| 232 | Future<bool> _upReserveInfo(BuildContext context, Map<String, dynamic> params, | 237 | Future<bool> _upReserveInfo(BuildContext context, Map<String, dynamic> params, |
| @@ -55,7 +55,6 @@ class TableManagerModel with ChangeNotifier { | @@ -55,7 +55,6 @@ class TableManagerModel with ChangeNotifier { | ||
| 55 | 55 | ||
| 56 | PageState pageState = PageState.Loading; | 56 | PageState pageState = PageState.Loading; |
| 57 | 57 | ||
| 58 | - | ||
| 59 | Map dailyMap = {}; // 早市对应半点钟,午市对应半点钟、晚市对应半点钟 | 58 | Map dailyMap = {}; // 早市对应半点钟,午市对应半点钟、晚市对应半点钟 |
| 60 | bool swichState = false; //仅看空座 | 59 | bool swichState = false; //仅看空座 |
| 61 | String selectDateStr = ''; | 60 | String selectDateStr = ''; |
| @@ -578,7 +577,7 @@ class TableManagerModel with ChangeNotifier { | @@ -578,7 +577,7 @@ class TableManagerModel with ChangeNotifier { | ||
| 578 | table.sign = notebook.status; | 577 | table.sign = notebook.status; |
| 579 | table.notebookId = notebook.id; | 578 | table.notebookId = notebook.id; |
| 580 | table.reserver = notebook.rnameStr; | 579 | table.reserver = notebook.rnameStr; |
| 581 | - table.pnum = notebook.pnum; | 580 | + table.pnum = notebook.actual_pnum; |
| 582 | table.nickName = notebook.nick_name; | 581 | table.nickName = notebook.nick_name; |
| 583 | 582 | ||
| 584 | //剔除已经预订的桌子,剩下空桌子(仅看空座) | 583 | //剔除已经预订的桌子,剩下空桌子(仅看空座) |
| @@ -111,14 +111,16 @@ var reserveDetailHandler = new Handler( | @@ -111,14 +111,16 @@ var reserveDetailHandler = new Handler( | ||
| 111 | String mid = params['mid'].first; | 111 | String mid = params['mid'].first; |
| 112 | String uid = params['uid'].first; | 112 | String uid = params['uid'].first; |
| 113 | bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first); | 113 | bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first); |
| 114 | - return ChangeNotifierProvider<NotebookDetailModel>( | ||
| 115 | - create: (_) => NotebookDetailModel(), | ||
| 116 | - child: NotebookDetailPage( | ||
| 117 | - rid, | ||
| 118 | - mid: mid, | ||
| 119 | - uid: uid, | ||
| 120 | - fromNotify: fromNotify, | ||
| 121 | - )); | 114 | + return ChangeNotifierProvider<RemarkManagerModel>( |
| 115 | + create: (_) => RemarkManagerModel(), | ||
| 116 | + child: ChangeNotifierProvider<NotebookDetailModel>( | ||
| 117 | + create: (_) => NotebookDetailModel(), | ||
| 118 | + child: NotebookDetailPage( | ||
| 119 | + rid, | ||
| 120 | + mid: mid, | ||
| 121 | + uid: uid, | ||
| 122 | + fromNotify: fromNotify, | ||
| 123 | + ))); | ||
| 122 | }); | 124 | }); |
| 123 | 125 | ||
| 124 | // 跳转到处理在线预订 | 126 | // 跳转到处理在线预订 |
| @@ -124,6 +124,102 @@ class DialogUtil { | @@ -124,6 +124,102 @@ class DialogUtil { | ||
| 124 | }); | 124 | }); |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | + static Future openFTablesDialog(BuildContext context, List<t.Table> tables, | ||
| 128 | + {CustomCallBack onTap}) async { | ||
| 129 | + final action = await showDialog( | ||
| 130 | + context: context, | ||
| 131 | + barrierDismissible: true, | ||
| 132 | + builder: (BuildContext context) { | ||
| 133 | + return Center( | ||
| 134 | + child: Container( | ||
| 135 | + height: ScreenUtil().setWidth(400), | ||
| 136 | + width: ScreenUtil().setWidth(280 * 2), | ||
| 137 | + decoration: BoxDecoration( | ||
| 138 | + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))), | ||
| 139 | + child: Card( | ||
| 140 | + shape: RoundedRectangleBorder( | ||
| 141 | + borderRadius: BorderRadius.all( | ||
| 142 | + Radius.circular(ScreenUtil().setWidth(10)))), //设置圆角 | ||
| 143 | + child: Column(children: [ | ||
| 144 | + Expanded( | ||
| 145 | + child: ListView( | ||
| 146 | + padding: EdgeInsets.symmetric( | ||
| 147 | + horizontal: ScreenUtil().setWidth(40), | ||
| 148 | + vertical: ScreenUtil().setWidth(40)), | ||
| 149 | + shrinkWrap: true, | ||
| 150 | + children: [ | ||
| 151 | + Wrap( | ||
| 152 | + children: tableListWidget(tables, (v) {}), | ||
| 153 | + spacing: ScreenUtil().setWidth(20), | ||
| 154 | + runSpacing: ScreenUtil().setWidth(20), | ||
| 155 | + // alignment: WrapAlignment.start, | ||
| 156 | + // runAlignment: WrapAlignment.end, | ||
| 157 | + ), | ||
| 158 | + ], | ||
| 159 | + )), | ||
| 160 | + MyDivider(double.infinity, ScreenUtil().setWidth(2)), | ||
| 161 | + InkWell( | ||
| 162 | + onTap: () { | ||
| 163 | + Navigator.pop(context); | ||
| 164 | + }, | ||
| 165 | + child: Container( | ||
| 166 | + width: double.infinity, | ||
| 167 | + alignment: Alignment.center, | ||
| 168 | + padding: EdgeInsets.symmetric( | ||
| 169 | + vertical: ScreenUtil().setWidth(40)), | ||
| 170 | + child: Text('确定', | ||
| 171 | + style: TextStyle( | ||
| 172 | + color: Color.fromRGBO(42, 96, 244, 1), | ||
| 173 | + fontSize: ScreenUtil().setSp(30))), | ||
| 174 | + ), | ||
| 175 | + ) | ||
| 176 | + ])), | ||
| 177 | + ), | ||
| 178 | + ); | ||
| 179 | + }, | ||
| 180 | + ); | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + // static Future openFTablesDialog(BuildContext context, List<t.Table> tables, | ||
| 184 | + // {CustomCallBack onTap}) async { | ||
| 185 | + // TextEditingController controller = TextEditingController(); | ||
| 186 | + // final action = await showDialog( | ||
| 187 | + // context: context, | ||
| 188 | + // barrierDismissible: false, | ||
| 189 | + // builder: (BuildContext context) { | ||
| 190 | + // return Material( | ||
| 191 | + // child: Container( | ||
| 192 | + // padding: EdgeInsets.symmetric( | ||
| 193 | + // horizontal: ScreenUtil().setWidth(40)), | ||
| 194 | + // height: ScreenUtil().setWidth(200), | ||
| 195 | + // child: Column( | ||
| 196 | + // children: [ | ||
| 197 | + // Wrap( | ||
| 198 | + // children: tableListWidget(tables, (v) {}), | ||
| 199 | + // spacing: ScreenUtil().setWidth(20), | ||
| 200 | + // runSpacing: ScreenUtil().setWidth(20), | ||
| 201 | + // // alignment: WrapAlignment.start, | ||
| 202 | + // // runAlignment: WrapAlignment.end, | ||
| 203 | + // ), | ||
| 204 | + // MyDivider(double.infinity, ScreenUtil().setWidth(2)), | ||
| 205 | + // InkWell( | ||
| 206 | + // onTap: () { | ||
| 207 | + // Navigator.pop(context); | ||
| 208 | + // }, | ||
| 209 | + // child: Container( | ||
| 210 | + // padding: EdgeInsets.symmetric( | ||
| 211 | + // vertical: ScreenUtil().setWidth(40)), | ||
| 212 | + // child: Text('确定', | ||
| 213 | + // style: TextStyle( | ||
| 214 | + // color: Color.fromRGBO(42, 96, 244, 1), | ||
| 215 | + // fontSize: ScreenUtil().setSp(28))), | ||
| 216 | + // ), | ||
| 217 | + // ) | ||
| 218 | + // ], | ||
| 219 | + // ))); | ||
| 220 | + // }); | ||
| 221 | + // } | ||
| 222 | + | ||
| 127 | static Future openCreateAreaDialog(BuildContext context, | 223 | static Future openCreateAreaDialog(BuildContext context, |
| 128 | {CustomCallBack onTap}) async { | 224 | {CustomCallBack onTap}) async { |
| 129 | TextEditingController controller = TextEditingController(); | 225 | TextEditingController controller = TextEditingController(); |
| @@ -905,6 +1001,21 @@ class DialogUtil { | @@ -905,6 +1001,21 @@ class DialogUtil { | ||
| 905 | }); | 1001 | }); |
| 906 | } | 1002 | } |
| 907 | 1003 | ||
| 1004 | + static tableListWidget(List<t.Table> tables, CustomCallBack callback) { | ||
| 1005 | + List<Widget> lists = tables.map((item) { | ||
| 1006 | + return remarkButton( | ||
| 1007 | + content: item.name, | ||
| 1008 | + isSelect: true, | ||
| 1009 | + onPress: () { | ||
| 1010 | + // state(() { | ||
| 1011 | + // item.selected = !item.selected; | ||
| 1012 | + // }); | ||
| 1013 | + // callback(item); | ||
| 1014 | + }); | ||
| 1015 | + }).toList(); | ||
| 1016 | + return lists; | ||
| 1017 | + } | ||
| 1018 | + | ||
| 908 | static listWidget( | 1019 | static listWidget( |
| 909 | List<Remark> remarks, StateSetter state, CustomCallBack callback) { | 1020 | List<Remark> remarks, StateSetter state, CustomCallBack callback) { |
| 910 | List<Widget> lists = remarks.map((item) { | 1021 | List<Widget> lists = remarks.map((item) { |
| @@ -163,19 +163,27 @@ class FTableItemState extends State<FTableItem> { | @@ -163,19 +163,27 @@ class FTableItemState extends State<FTableItem> { | ||
| 163 | // overflow: TextOverflow.ellipsis, | 163 | // overflow: TextOverflow.ellipsis, |
| 164 | // ), | 164 | // ), |
| 165 | ), | 165 | ), |
| 166 | - ((table.reserver == null || table.reserver.isEmpty) | ||
| 167 | - ? table.tableNum | ||
| 168 | - : table.reserver) != | ||
| 169 | - '' | 166 | + ((table.reserver != null && table.reserver != '') || |
| 167 | + (table.pnum != '' && | ||
| 168 | + table.pnum != null && | ||
| 169 | + table.pnum != '0')) | ||
| 170 | ? VEmptyView(8) | 170 | ? VEmptyView(8) |
| 171 | : SizedBox(), | 171 | : SizedBox(), |
| 172 | Text( | 172 | Text( |
| 173 | - (table.reserver == null || table.reserver.isEmpty) | ||
| 174 | - ? table.tableNum | ||
| 175 | - : '${table.reserver}' + | ||
| 176 | - (table.pnum != '' && table.pnum != '0' | 173 | + signStr == '已预订' |
| 174 | + ? (table.reserver == null || table.reserver.isEmpty) | ||
| 175 | + ? (table.pnum != '' && | ||
| 176 | + table.pnum != null && | ||
| 177 | + table.pnum != '0') | ||
| 177 | ? '(${table.pnum}人)' | 178 | ? '(${table.pnum}人)' |
| 178 | - : ''), | 179 | + : '' |
| 180 | + : '${table.reserver}' + | ||
| 181 | + (table.pnum != '' && | ||
| 182 | + table.pnum != null && | ||
| 183 | + table.pnum != '0' | ||
| 184 | + ? '(${table.pnum}人)' | ||
| 185 | + : '') | ||
| 186 | + : table.tableNum, | ||
| 179 | style: TextStyle( | 187 | style: TextStyle( |
| 180 | color: signStr == '已预订' || | 188 | color: signStr == '已预订' || |
| 181 | (widget.canSelected && table.selected) | 189 | (widget.canSelected && table.selected) |
-
Please register or login to post a comment