Showing
4 changed files
with
41 additions
and
39 deletions
| @@ -327,15 +327,15 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { | @@ -327,15 +327,15 @@ class HandleOnlinePageState extends State<HandleOnlinePage> { | ||
| 327 | height: 76, | 327 | height: 76, |
| 328 | fontSize: 34, | 328 | fontSize: 34, |
| 329 | onPress: () async { | 329 | onPress: () async { |
| 330 | - String tid = await NavigatorUtil | 330 | + Map map = await NavigatorUtil |
| 331 | .goSelectTablePage( | 331 | .goSelectTablePage( |
| 332 | context, | 332 | context, |
| 333 | widget.rid, | 333 | widget.rid, |
| 334 | int.parse(detailEntity.ddate) * | 334 | int.parse(detailEntity.ddate) * |
| 335 | 1000, | 335 | 1000, |
| 336 | detailEntity.ddate_solt); | 336 | detailEntity.ddate_solt); |
| 337 | - if (tid != null) { | ||
| 338 | - setReserveStatus("5", tid: tid); | 337 | + if (map['tid'] != null) { |
| 338 | + setReserveStatus("5", tid: map['tid']); | ||
| 339 | } | 339 | } |
| 340 | }, | 340 | }, |
| 341 | ), | 341 | ), |
| @@ -224,11 +224,8 @@ class SelectTablePageState extends State<SelectTablePage> { | @@ -224,11 +224,8 @@ class SelectTablePageState extends State<SelectTablePage> { | ||
| 224 | onSelected: (table) { | 224 | onSelected: (table) { |
| 225 | if ((table as t.Table).selected) { | 225 | if ((table as t.Table).selected) { |
| 226 | selectTables.add(table); | 226 | selectTables.add(table); |
| 227 | - Map<String, dynamic> temp = | ||
| 228 | - modelToJson(table); | ||
| 229 | - TableList tableList = | ||
| 230 | - TableList.fromJson(temp); | ||
| 231 | - widget.tableList.add(tableList); | 227 | + widget.tableList |
| 228 | + .add(tableToTableList(table)); | ||
| 232 | } else { | 229 | } else { |
| 233 | widget.tableList | 230 | widget.tableList |
| 234 | .removeWhere((t) => t.id == table.id); | 231 | .removeWhere((t) => t.id == table.id); |
| @@ -281,25 +278,24 @@ class SelectTablePageState extends State<SelectTablePage> { | @@ -281,25 +278,24 @@ class SelectTablePageState extends State<SelectTablePage> { | ||
| 281 | ); | 278 | ); |
| 282 | } | 279 | } |
| 283 | 280 | ||
| 284 | - modelToJson(t.Table table) { | ||
| 285 | - Map res = { | ||
| 286 | - 'id': table.id, | ||
| 287 | - 'rid': table.rid, | ||
| 288 | - 'tid': table.tid, | ||
| 289 | - 'name': table.name, | ||
| 290 | - 'tablePnum': table.table_pnum, | ||
| 291 | - 'sellerid': null, | ||
| 292 | - 'qrcode': null, | ||
| 293 | - 'mostPnum': table.most_pnum, | ||
| 294 | - 'hot': null, | ||
| 295 | - 'orderO': table.order_o, | ||
| 296 | - 'status': table.status, | ||
| 297 | - 'enable': table.enable, | ||
| 298 | - 'spell': table.spell, | ||
| 299 | - 'cdate': null, | ||
| 300 | - 'rname': table.rname, | ||
| 301 | - 'regionName': null | ||
| 302 | - }; | ||
| 303 | - return res; | 281 | + tableToTableList(t.Table table) { |
| 282 | + TableList _tableList; | ||
| 283 | + _tableList.id = table.id; | ||
| 284 | + _tableList.rid = table.rid; | ||
| 285 | + _tableList.tid = table.tid; | ||
| 286 | + _tableList.name = table.name; | ||
| 287 | + _tableList.tablePnum = table.table_pnum; | ||
| 288 | + _tableList.sellerid = null; | ||
| 289 | + _tableList.qrcode = null; | ||
| 290 | + _tableList.mostPnum = table.most_pnum; | ||
| 291 | + _tableList.hot = null; | ||
| 292 | + _tableList.orderO = table.order_o; | ||
| 293 | + _tableList.status = table.status; | ||
| 294 | + _tableList.enable = table.enable; | ||
| 295 | + _tableList.spell = table.spell; | ||
| 296 | + _tableList.cdate = null; | ||
| 297 | + _tableList.rname = table.rname; | ||
| 298 | + _tableList.regionName = null; | ||
| 299 | + return _tableList; | ||
| 304 | } | 300 | } |
| 305 | } | 301 | } |
| @@ -59,11 +59,14 @@ var handleSelectTableHandler = new Handler( | @@ -59,11 +59,14 @@ var handleSelectTableHandler = new Handler( | ||
| 59 | DateTime.fromMillisecondsSinceEpoch(int.parse(params["dateTime"].first)); | 59 | DateTime.fromMillisecondsSinceEpoch(int.parse(params["dateTime"].first)); |
| 60 | String ddate_slot = params["ddate_slot"].first; | 60 | String ddate_slot = params["ddate_slot"].first; |
| 61 | bool canChoose = params["canChoose"].first == "true" ? true : false; | 61 | bool canChoose = params["canChoose"].first == "true" ? true : false; |
| 62 | - Map object = FluroConvertUtils.string2map(params["object"].first); | ||
| 63 | - List temp = object['object']; | ||
| 64 | List<TableList> res = []; | 62 | List<TableList> res = []; |
| 65 | - for (var item in temp) { | ||
| 66 | - res.add(TableList.fromJson(item)); | 63 | + if (params.keys.contains('object')) { |
| 64 | + Map object = FluroConvertUtils.string2map(params["object"].first); | ||
| 65 | + List temp = object['object']; | ||
| 66 | + | ||
| 67 | + for (var item in temp) { | ||
| 68 | + res.add(TableList.fromJson(item)); | ||
| 69 | + } | ||
| 67 | } | 70 | } |
| 68 | 71 | ||
| 69 | // return SelectTablePage(rid, dateTime, ddate_slot,canChoose: canChoose); | 72 | // return SelectTablePage(rid, dateTime, ddate_slot,canChoose: canChoose); |
| @@ -101,10 +104,10 @@ var handleWebviewHandler = new Handler( | @@ -101,10 +104,10 @@ var handleWebviewHandler = new Handler( | ||
| 101 | // 协议 | 104 | // 协议 |
| 102 | var webPageHandler = new Handler( | 105 | var webPageHandler = new Handler( |
| 103 | handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | 106 | handlerFunc: (BuildContext context, Map<String, List<Object>> params) { |
| 104 | - String _title = params["title"].first; | ||
| 105 | - String _url = params["url"].first; | ||
| 106 | - return WebPage(title: _title, url: _url); | ||
| 107 | - }); | 107 | + String _title = params["title"].first; |
| 108 | + String _url = params["url"].first; | ||
| 109 | + return WebPage(title: _title, url: _url); | ||
| 110 | +}); | ||
| 108 | 111 | ||
| 109 | // 跳转到变更预订 | 112 | // 跳转到变更预订 |
| 110 | var handleChangeDetailHandler = new Handler( | 113 | var handleChangeDetailHandler = new Handler( |
| @@ -54,8 +54,13 @@ class NavigatorUtil { | @@ -54,8 +54,13 @@ class NavigatorUtil { | ||
| 54 | static Future goSelectTablePage( | 54 | static Future goSelectTablePage( |
| 55 | BuildContext context, String rid, int dateTime, String ddate_slot, | 55 | BuildContext context, String rid, int dateTime, String ddate_slot, |
| 56 | {bool canChoose = false, Map object}) { | 56 | {bool canChoose = false, Map object}) { |
| 57 | + if (object != null) { | ||
| 58 | + return _navigateTo(context, | ||
| 59 | + "${Routes.select_table}?rid=$rid&dateTime=$dateTime&ddate_slot=$ddate_slot&canChoose=$canChoose&object=${FluroConvertUtils.object2string(object)}"); | ||
| 60 | + } | ||
| 61 | + // object = {'object': [], "tid": ''}; | ||
| 57 | return _navigateTo(context, | 62 | return _navigateTo(context, |
| 58 | - "${Routes.select_table}?rid=$rid&dateTime=$dateTime&ddate_slot=$ddate_slot&canChoose=$canChoose&object=${FluroConvertUtils.object2string(object)}"); | 63 | + "${Routes.select_table}?rid=$rid&dateTime=$dateTime&ddate_slot=$ddate_slot&canChoose=$canChoose"); |
| 59 | } | 64 | } |
| 60 | 65 | ||
| 61 | /// 邀请函 | 66 | /// 邀请函 |
| @@ -77,8 +82,6 @@ class NavigatorUtil { | @@ -77,8 +82,6 @@ class NavigatorUtil { | ||
| 77 | _navigateTo(context, "${Routes.webview}"); | 82 | _navigateTo(context, "${Routes.webview}"); |
| 78 | } | 83 | } |
| 79 | 84 | ||
| 80 | - | ||
| 81 | - | ||
| 82 | ///协议 | 85 | ///协议 |
| 83 | static Future<dynamic> goWebPage( | 86 | static Future<dynamic> goWebPage( |
| 84 | BuildContext context, String title, String url) { | 87 | BuildContext context, String title, String url) { |
-
Please register or login to post a comment