Showing
9 changed files
with
471 additions
and
279 deletions
| @@ -13,12 +13,12 @@ if (flutterRoot == null) { | @@ -13,12 +13,12 @@ if (flutterRoot == null) { | ||
| 13 | 13 | ||
| 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') |
| 15 | if (flutterVersionCode == null) { | 15 | if (flutterVersionCode == null) { |
| 16 | - flutterVersionCode = '7' | 16 | + flutterVersionCode = '112' |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') |
| 20 | if (flutterVersionName == null) { | 20 | if (flutterVersionName == null) { |
| 21 | - flutterVersionName = '1.0.7' | 21 | + flutterVersionName = '1.1.2' |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | apply plugin: 'com.android.application' | 24 | apply plugin: 'com.android.application' |
| @@ -404,7 +404,7 @@ | @@ -404,7 +404,7 @@ | ||
| 404 | CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; | 404 | CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; |
| 405 | CODE_SIGN_IDENTITY = "Apple Development"; | 405 | CODE_SIGN_IDENTITY = "Apple Development"; |
| 406 | CODE_SIGN_STYLE = Automatic; | 406 | CODE_SIGN_STYLE = Automatic; |
| 407 | - CURRENT_PROJECT_VERSION = 8; | 407 | + CURRENT_PROJECT_VERSION = 112; |
| 408 | DEVELOPMENT_TEAM = ""; | 408 | DEVELOPMENT_TEAM = ""; |
| 409 | ENABLE_BITCODE = NO; | 409 | ENABLE_BITCODE = NO; |
| 410 | FRAMEWORK_SEARCH_PATHS = ( | 410 | FRAMEWORK_SEARCH_PATHS = ( |
| @@ -417,7 +417,7 @@ | @@ -417,7 +417,7 @@ | ||
| 417 | "$(inherited)", | 417 | "$(inherited)", |
| 418 | "$(PROJECT_DIR)/Flutter", | 418 | "$(PROJECT_DIR)/Flutter", |
| 419 | ); | 419 | ); |
| 420 | - MARKETING_VERSION = 1.0.8; | 420 | + MARKETING_VERSION = 1.1.2; |
| 421 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 421 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 422 | PRODUCT_NAME = "一键订"; | 422 | PRODUCT_NAME = "一键订"; |
| 423 | PROVISIONING_PROFILE_SPECIFIER = ""; | 423 | PROVISIONING_PROFILE_SPECIFIER = ""; |
| @@ -545,7 +545,7 @@ | @@ -545,7 +545,7 @@ | ||
| 545 | CLANG_ENABLE_MODULES = YES; | 545 | CLANG_ENABLE_MODULES = YES; |
| 546 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 546 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 547 | CODE_SIGN_STYLE = Manual; | 547 | CODE_SIGN_STYLE = Manual; |
| 548 | - CURRENT_PROJECT_VERSION = 8; | 548 | + CURRENT_PROJECT_VERSION = 112; |
| 549 | DEVELOPMENT_TEAM = 8J59HM8B82; | 549 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 550 | ENABLE_BITCODE = NO; | 550 | ENABLE_BITCODE = NO; |
| 551 | FRAMEWORK_SEARCH_PATHS = ( | 551 | FRAMEWORK_SEARCH_PATHS = ( |
| @@ -558,7 +558,7 @@ | @@ -558,7 +558,7 @@ | ||
| 558 | "$(inherited)", | 558 | "$(inherited)", |
| 559 | "$(PROJECT_DIR)/Flutter", | 559 | "$(PROJECT_DIR)/Flutter", |
| 560 | ); | 560 | ); |
| 561 | - MARKETING_VERSION = 1.0.8; | 561 | + MARKETING_VERSION = 1.1.2; |
| 562 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 562 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 563 | PRODUCT_NAME = "一键订"; | 563 | PRODUCT_NAME = "一键订"; |
| 564 | PROVISIONING_PROFILE_SPECIFIER = "Push Development Profile"; | 564 | PROVISIONING_PROFILE_SPECIFIER = "Push Development Profile"; |
| @@ -577,7 +577,7 @@ | @@ -577,7 +577,7 @@ | ||
| 577 | CLANG_ENABLE_MODULES = YES; | 577 | CLANG_ENABLE_MODULES = YES; |
| 578 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; | 578 | CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; |
| 579 | CODE_SIGN_STYLE = Manual; | 579 | CODE_SIGN_STYLE = Manual; |
| 580 | - CURRENT_PROJECT_VERSION = 8; | 580 | + CURRENT_PROJECT_VERSION = 112; |
| 581 | DEVELOPMENT_TEAM = 8J59HM8B82; | 581 | DEVELOPMENT_TEAM = 8J59HM8B82; |
| 582 | ENABLE_BITCODE = NO; | 582 | ENABLE_BITCODE = NO; |
| 583 | FRAMEWORK_SEARCH_PATHS = ( | 583 | FRAMEWORK_SEARCH_PATHS = ( |
| @@ -590,7 +590,7 @@ | @@ -590,7 +590,7 @@ | ||
| 590 | "$(inherited)", | 590 | "$(inherited)", |
| 591 | "$(PROJECT_DIR)/Flutter", | 591 | "$(PROJECT_DIR)/Flutter", |
| 592 | ); | 592 | ); |
| 593 | - MARKETING_VERSION = 1.0.8; | 593 | + MARKETING_VERSION = 1.1.2; |
| 594 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; | 594 | PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; |
| 595 | PRODUCT_NAME = "一键订"; | 595 | PRODUCT_NAME = "一键订"; |
| 596 | PROVISIONING_PROFILE_SPECIFIER = "OneKey Distribution Profile"; | 596 | PROVISIONING_PROFILE_SPECIFIER = "OneKey Distribution Profile"; |
| @@ -82,11 +82,11 @@ | @@ -82,11 +82,11 @@ | ||
| 82 | </array> | 82 | </array> |
| 83 | <key>UIViewControllerBasedStatusBarAppearance</key> | 83 | <key>UIViewControllerBasedStatusBarAppearance</key> |
| 84 | <false/> | 84 | <false/> |
| 85 | + <key>XG_ACCESS_ID</key> | ||
| 86 | + <string>1600012876</string> | ||
| 87 | + <key>XG_ACCESS_KEY</key> | ||
| 88 | + <string>INUIMFK21WGH</string> | ||
| 85 | <key>io.flutter.embedded_views_preview</key> | 89 | <key>io.flutter.embedded_views_preview</key> |
| 86 | <true/> | 90 | <true/> |
| 87 | - <key>XG_ACCESS_ID</key> | ||
| 88 | - <string>1600012876</string> | ||
| 89 | - <key>XG_ACCESS_KEY</key> | ||
| 90 | - <string>INUIMFK21WGH</string> | ||
| 91 | </dict> | 91 | </dict> |
| 92 | </plist> | 92 | </plist> |
| @@ -24,6 +24,7 @@ import 'package:one_key/widgets/table_item.dart'; | @@ -24,6 +24,7 @@ import 'package:one_key/widgets/table_item.dart'; | ||
| 24 | import 'package:one_key/widgets/v_empty_view.dart'; | 24 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 25 | import 'package:provider/provider.dart'; | 25 | import 'package:provider/provider.dart'; |
| 26 | import 'package:one_key/models/table_list.dart' as t; | 26 | import 'package:one_key/models/table_list.dart' as t; |
| 27 | +import 'dart:convert' as convert; | ||
| 27 | 28 | ||
| 28 | typedef clickCallback = void Function(String value); | 29 | typedef clickCallback = void Function(String value); |
| 29 | 30 | ||
| @@ -50,6 +51,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -50,6 +51,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 50 | FocusNode _nameNode = FocusNode(); | 51 | FocusNode _nameNode = FocusNode(); |
| 51 | FocusNode _needNode = FocusNode(); | 52 | FocusNode _needNode = FocusNode(); |
| 52 | NotebookDetailModel detailModel = NotebookDetailModel(); | 53 | NotebookDetailModel detailModel = NotebookDetailModel(); |
| 54 | + bool isRecommend = false; //可订桌位是否展示推荐桌位,无已选中包间情况下展示推荐的包间 | ||
| 53 | 55 | ||
| 54 | // //生成日期文本 | 56 | // //生成日期文本 |
| 55 | // _createDateText(DateTime day) { | 57 | // _createDateText(DateTime day) { |
| @@ -225,66 +227,82 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -225,66 +227,82 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 225 | isImage: value['isImage'], | 227 | isImage: value['isImage'], |
| 226 | isSelect: value['select'], | 228 | isSelect: value['select'], |
| 227 | onTap: () { | 229 | onTap: () { |
| 228 | - for (int j = 0; | ||
| 229 | - j < _notebookDetailChangeModel.dateList.length; | ||
| 230 | - j++) { | ||
| 231 | - _notebookDetailChangeModel.dateList[j]['select'] = false; | ||
| 232 | - | ||
| 233 | - if (_notebookDetailChangeModel.dateList[j]['title'] == | ||
| 234 | - value['title']) { | ||
| 235 | - _notebookDetailChangeModel.dateList[j]['select'] = true; | ||
| 236 | - if (j == 0 || j == 1) { | ||
| 237 | - _notebookDetailChangeModel.dateList[2]['title'] = | ||
| 238 | - '其他'; | ||
| 239 | - } | ||
| 240 | - if (j == | ||
| 241 | - _notebookDetailChangeModel.dateList.length - 1) { | ||
| 242 | - String selectStr = | ||
| 243 | - _notebookDetailChangeModel.dateList[2]['title']; | ||
| 244 | - String timeNow = DateUtil.formatDate( | ||
| 245 | - DateTime.now(), | ||
| 246 | - ); | ||
| 247 | - String selectDate = | ||
| 248 | - timeNow.replaceRange(5, 10, selectStr); | ||
| 249 | - DialogUtil.showCalendarDialog( | ||
| 250 | - context, DateUtil.getDateTime(selectDate)) | ||
| 251 | - .then((day) { | ||
| 252 | - if (day != null) { | ||
| 253 | - // _createDateText(day); | ||
| 254 | - dateTime = day; | ||
| 255 | - int dateTimeMill = day.millisecondsSinceEpoch; | ||
| 256 | - String dateText = DateUtil.formatDateMs( | ||
| 257 | - dateTimeMill, | ||
| 258 | - format: 'MM-dd'); | ||
| 259 | - bool isThird = true; | ||
| 260 | - for (int i = 0; | ||
| 261 | - i < | ||
| 262 | - _notebookDetailChangeModel | ||
| 263 | - .dateList.length; | ||
| 264 | - i++) { | ||
| 265 | - _notebookDetailChangeModel.dateList[i] | ||
| 266 | - ['select'] = false; | ||
| 267 | - | ||
| 268 | - if (_notebookDetailChangeModel.dateList[i] | ||
| 269 | - ['title'] == | ||
| 270 | - dateText) { | ||
| 271 | - _notebookDetailChangeModel.dateList[i] | ||
| 272 | - ['select'] = true; | ||
| 273 | - isThird = false; | ||
| 274 | - } | ||
| 275 | - } | ||
| 276 | - if (isThird) { | ||
| 277 | - _notebookDetailChangeModel.dateList[2] | ||
| 278 | - ['select'] = true; | ||
| 279 | - _notebookDetailChangeModel.dateList[2] | ||
| 280 | - ['title'] = dateText; | ||
| 281 | - } else { | ||
| 282 | - _notebookDetailChangeModel.dateList[2] | ||
| 283 | - ['title'] = '其他'; | ||
| 284 | - } | ||
| 285 | - } | ||
| 286 | - _notebookDetailChangeModel.notifyListeners(); | ||
| 287 | - }); | 230 | + if (_notebookDetailChangeModel.dateList.length > 2 && |
| 231 | + _notebookDetailChangeModel.dateList[2]['title'] == | ||
| 232 | + '其他') { | ||
| 233 | + _calendWidget(DateTime.now()); | ||
| 234 | + } else { | ||
| 235 | + for (int j = 0; | ||
| 236 | + j < _notebookDetailChangeModel.dateList.length; | ||
| 237 | + j++) { | ||
| 238 | + _notebookDetailChangeModel.dateList[j]['select'] = | ||
| 239 | + false; | ||
| 240 | + | ||
| 241 | + if (_notebookDetailChangeModel.dateList[j]['title'] == | ||
| 242 | + value['title']) { | ||
| 243 | + _notebookDetailChangeModel.dateList[j]['select'] = | ||
| 244 | + true; | ||
| 245 | + if (j == 0 || j == 1) { | ||
| 246 | + _notebookDetailChangeModel.dateList[2]['title'] = | ||
| 247 | + '其他'; | ||
| 248 | + } | ||
| 249 | + if (j == | ||
| 250 | + _notebookDetailChangeModel.dateList.length - 1) { | ||
| 251 | + String selectStr = | ||
| 252 | + _notebookDetailChangeModel.dateList[2]['title']; | ||
| 253 | + String timeNow = DateUtil.formatDate( | ||
| 254 | + DateTime.now(), | ||
| 255 | + ); | ||
| 256 | + String selectDate = | ||
| 257 | + timeNow.replaceRange(5, 10, selectStr); | ||
| 258 | + _calendWidget(DateUtil.getDateTime(selectDate)); | ||
| 259 | + // String selectStr = | ||
| 260 | + // _notebookDetailChangeModel.dateList[2]['title']; | ||
| 261 | + // String timeNow = DateUtil.formatDate( | ||
| 262 | + // DateTime.now(), | ||
| 263 | + // ); | ||
| 264 | + // String selectDate = | ||
| 265 | + // timeNow.replaceRange(5, 10, selectStr); | ||
| 266 | + // DialogUtil.showCalendarDialog( | ||
| 267 | + // context, DateUtil.getDateTime(selectDate)) | ||
| 268 | + // .then((day) { | ||
| 269 | + // if (day != null) { | ||
| 270 | + // // _createDateText(day); | ||
| 271 | + // dateTime = day; | ||
| 272 | + // int dateTimeMill = day.millisecondsSinceEpoch; | ||
| 273 | + // String dateText = DateUtil.formatDateMs( | ||
| 274 | + // dateTimeMill, | ||
| 275 | + // format: 'MM-dd'); | ||
| 276 | + // bool isThird = true; | ||
| 277 | + // for (int i = 0; | ||
| 278 | + // i < | ||
| 279 | + // _notebookDetailChangeModel | ||
| 280 | + // .dateList.length; | ||
| 281 | + // i++) { | ||
| 282 | + // _notebookDetailChangeModel.dateList[i] | ||
| 283 | + // ['select'] = false; | ||
| 284 | + | ||
| 285 | + // if (_notebookDetailChangeModel.dateList[i] | ||
| 286 | + // ['title'] == | ||
| 287 | + // dateText) { | ||
| 288 | + // _notebookDetailChangeModel.dateList[i] | ||
| 289 | + // ['select'] = true; | ||
| 290 | + // isThird = false; | ||
| 291 | + // } | ||
| 292 | + // } | ||
| 293 | + // if (isThird) { | ||
| 294 | + // _notebookDetailChangeModel.dateList[2] | ||
| 295 | + // ['select'] = true; | ||
| 296 | + // _notebookDetailChangeModel.dateList[2] | ||
| 297 | + // ['title'] = dateText; | ||
| 298 | + // } else { | ||
| 299 | + // _notebookDetailChangeModel.dateList[2] | ||
| 300 | + // ['title'] = '其他'; | ||
| 301 | + // } | ||
| 302 | + // } | ||
| 303 | + // _notebookDetailChangeModel.notifyListeners(); | ||
| 304 | + // }); | ||
| 305 | + } | ||
| 288 | } | 306 | } |
| 289 | } | 307 | } |
| 290 | } | 308 | } |
| @@ -385,8 +403,41 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -385,8 +403,41 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 385 | ); | 403 | ); |
| 386 | } | 404 | } |
| 387 | 405 | ||
| 406 | + _calendWidget(DateTime dateTime) { | ||
| 407 | + DialogUtil.showCalendarDialog(context, dateTime).then((day) { | ||
| 408 | + if (day != null) { | ||
| 409 | + // _createDateText(day); | ||
| 410 | + dateTime = day; | ||
| 411 | + int dateTimeMill = day.millisecondsSinceEpoch; | ||
| 412 | + String dateText = DateUtil.formatDateMs(dateTimeMill, format: 'MM-dd'); | ||
| 413 | + bool isThird = true; | ||
| 414 | + for (int i = 0; i < _notebookDetailChangeModel.dateList.length; i++) { | ||
| 415 | + _notebookDetailChangeModel.dateList[i]['select'] = false; | ||
| 416 | + | ||
| 417 | + if (_notebookDetailChangeModel.dateList[i]['title'] == dateText) { | ||
| 418 | + _notebookDetailChangeModel.dateList[i]['select'] = true; | ||
| 419 | + isThird = false; | ||
| 420 | + } | ||
| 421 | + } | ||
| 422 | + if (isThird) { | ||
| 423 | + _notebookDetailChangeModel.dateList[2]['select'] = true; | ||
| 424 | + _notebookDetailChangeModel.dateList[2]['title'] = dateText; | ||
| 425 | + } else { | ||
| 426 | + _notebookDetailChangeModel.dateList[2]['title'] = '其他'; | ||
| 427 | + } | ||
| 428 | + } | ||
| 429 | + _notebookDetailChangeModel.notifyListeners(); | ||
| 430 | + }); | ||
| 431 | + } | ||
| 432 | + | ||
| 388 | /// 可订桌位 | 433 | /// 可订桌位 |
| 389 | _middleWidget() { | 434 | _middleWidget() { |
| 435 | + List canBookTable = []; | ||
| 436 | + if (isRecommend) { | ||
| 437 | + canBookTable = _notebookDetailChangeModel.recommendList; | ||
| 438 | + } else { | ||
| 439 | + canBookTable = _notebookDetailChangeModel.tableList; | ||
| 440 | + } | ||
| 390 | return Container( | 441 | return Container( |
| 391 | padding: EdgeInsets.all(ScreenUtil().setWidth(40)), | 442 | padding: EdgeInsets.all(ScreenUtil().setWidth(40)), |
| 392 | color: MyColours.color_f5f5f5, | 443 | color: MyColours.color_f5f5f5, |
| @@ -404,22 +455,56 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -404,22 +455,56 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 404 | ), | 455 | ), |
| 405 | InkWell( | 456 | InkWell( |
| 406 | onTap: () async { | 457 | onTap: () async { |
| 458 | + //当前选中 月 日string | ||
| 459 | + String mdStr = ''; | ||
| 460 | + //今天 明天 其他天 | ||
| 461 | + for (var item in _notebookDetailChangeModel.dateList) { | ||
| 462 | + if (item['select'] == true) { | ||
| 463 | + mdStr = item['title']; | ||
| 464 | + } | ||
| 465 | + } | ||
| 466 | + String timeNowYear = | ||
| 467 | + DateUtil.formatDate(DateTime.now(), format: 'yyyy'); | ||
| 468 | + String ymyStr = timeNowYear + '-' + mdStr; //年月日 | ||
| 469 | + String timeStr = ymyStr + ' ' + "00:00:00"; | ||
| 470 | + int ddate = DateUtil.getDateMsByTimeStr(timeStr); //筛选日期时间戳 | ||
| 471 | + String ddateSolt = ''; | ||
| 472 | + for (var item in _notebookDetailChangeModel.sunDateList) { | ||
| 473 | + if (item['isSelect']) { | ||
| 474 | + ddateSolt = '${item['ddateSolt']}'; | ||
| 475 | + } | ||
| 476 | + } | ||
| 477 | + | ||
| 478 | + // String tempDdate = ymyStr + ' ' + ddateStr + ':00'; | ||
| 479 | + // int ddate = DateUtil.getDateMsByTimeStr(timeStr); | ||
| 407 | Map temp = await NavigatorUtil.goSelectTablePage( | 480 | Map temp = await NavigatorUtil.goSelectTablePage( |
| 408 | - context, | ||
| 409 | - widget.rid, | ||
| 410 | - int.parse(widget.detailEntity.ddate) * 1000, | ||
| 411 | - widget.detailEntity.ddate_solt, | 481 | + context, widget.rid, ddate, ddateSolt, |
| 412 | canChoose: true, | 482 | canChoose: true, |
| 413 | object: {'object': _notebookDetailChangeModel.tableList}); | 483 | object: {'object': _notebookDetailChangeModel.tableList}); |
| 414 | // if (temp['tid'] != null) { | 484 | // if (temp['tid'] != null) { |
| 415 | // setReserveStatus("5", tid: temp['tid']); | 485 | // setReserveStatus("5", tid: temp['tid']); |
| 416 | // } | 486 | // } |
| 417 | - _notebookDetailChangeModel.tableList = temp['object']; | ||
| 418 | - for (t.TableList item | ||
| 419 | - in _notebookDetailChangeModel.tableList) { | ||
| 420 | - item.selected = true; | 487 | + if (temp == null || temp['object'].length == 0) { |
| 488 | + isRecommend = true; | ||
| 489 | + _notebookDetailChangeModel.tableList = []; | ||
| 490 | + for (t.TableList item | ||
| 491 | + in _notebookDetailChangeModel.recommendList) { | ||
| 492 | + item.selected = false; | ||
| 493 | + } | ||
| 494 | + setState(() {}); | ||
| 495 | + } else { | ||
| 496 | + isRecommend = false; | ||
| 497 | + _notebookDetailChangeModel.tableList = temp['object']; | ||
| 498 | + // if (_notebookDetailChangeModel.tableList.length == 0) { | ||
| 499 | + // isRecommend = true; | ||
| 500 | + // } | ||
| 501 | + for (t.TableList item | ||
| 502 | + in _notebookDetailChangeModel.tableList) { | ||
| 503 | + item.selected = true; | ||
| 504 | + } | ||
| 505 | + setState(() {}); | ||
| 421 | } | 506 | } |
| 422 | - setState(() {}); | 507 | + |
| 423 | // _notebookDetailChangeModel.notifyListeners(); | 508 | // _notebookDetailChangeModel.notifyListeners(); |
| 424 | }, | 509 | }, |
| 425 | child: Row( | 510 | child: Row( |
| @@ -441,39 +526,34 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -441,39 +526,34 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 441 | ), | 526 | ), |
| 442 | VEmptyView(32), | 527 | VEmptyView(32), |
| 443 | Align( | 528 | Align( |
| 444 | - alignment: Alignment.centerRight, | ||
| 445 | - child: Offstage( | ||
| 446 | - offstage: _notebookDetailChangeModel.tableList.length > 0 | ||
| 447 | - ? false | ||
| 448 | - : true, | ||
| 449 | - child: Container( | ||
| 450 | - // height: ScreenUtil().setHeight(178), | ||
| 451 | - height: ScreenUtil().setHeight(210), | ||
| 452 | - child: ListView.builder( | ||
| 453 | - physics: const NeverScrollableScrollPhysics(), | ||
| 454 | - itemBuilder: (BuildContext contxt, int index) { | ||
| 455 | - return NewTableItem( | ||
| 456 | - _notebookDetailChangeModel.tableList[index], | ||
| 457 | - isRegionName: true, | ||
| 458 | - canSelected: true, | ||
| 459 | - onSelected: (table) { | ||
| 460 | - if ((table as t.TableList).selected) { | ||
| 461 | - _notebookDetailChangeModel.tableList.add(table); | ||
| 462 | - } else { | ||
| 463 | - _notebookDetailChangeModel.tableList | ||
| 464 | - .removeWhere((t) => t.id == table.id); | ||
| 465 | - } | ||
| 466 | - }, | ||
| 467 | - ); | 529 | + alignment: Alignment.centerRight, |
| 530 | + child: Container( | ||
| 531 | + // color: Colors.red, | ||
| 532 | + // height: ScreenUtil().setHeight(178), | ||
| 533 | + height: ScreenUtil().setHeight(170), | ||
| 534 | + child: ListView.builder( | ||
| 535 | + physics: const NeverScrollableScrollPhysics(), | ||
| 536 | + itemBuilder: (BuildContext contxt, int index) { | ||
| 537 | + return NewTableItem( | ||
| 538 | + canBookTable[index], | ||
| 539 | + isRegionName: true, | ||
| 540 | + canSelected: true, | ||
| 541 | + onSelected: (table) { | ||
| 542 | + if ((table as t.TableList).selected) { | ||
| 543 | + _notebookDetailChangeModel.tableList.add(table); | ||
| 544 | + } else { | ||
| 545 | + _notebookDetailChangeModel.tableList | ||
| 546 | + .removeWhere((t) => t.id == table.id); | ||
| 547 | + } | ||
| 468 | }, | 548 | }, |
| 469 | - itemCount: _notebookDetailChangeModel.tableList.length > 3 | ||
| 470 | - ? 3 | ||
| 471 | - : _notebookDetailChangeModel.tableList.length, | ||
| 472 | - shrinkWrap: true, | ||
| 473 | - scrollDirection: Axis.horizontal, | ||
| 474 | - ), | ||
| 475 | - ), | ||
| 476 | - )), | 549 | + ); |
| 550 | + }, | ||
| 551 | + itemCount: canBookTable.length > 3 ? 3 : canBookTable.length, | ||
| 552 | + shrinkWrap: true, | ||
| 553 | + scrollDirection: Axis.horizontal, | ||
| 554 | + ), | ||
| 555 | + ), | ||
| 556 | + ), | ||
| 477 | ], | 557 | ], |
| 478 | ), | 558 | ), |
| 479 | ); | 559 | ); |
| @@ -549,6 +629,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -549,6 +629,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 549 | Expanded( | 629 | Expanded( |
| 550 | child: TextField( | 630 | child: TextField( |
| 551 | maxLines: 1, | 631 | maxLines: 1, |
| 632 | + | ||
| 552 | //输入文本的样式 | 633 | //输入文本的样式 |
| 553 | style: TextStyle( | 634 | style: TextStyle( |
| 554 | fontSize: ScreenUtil().setSp(34), | 635 | fontSize: ScreenUtil().setSp(34), |
| @@ -599,6 +680,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -599,6 +680,7 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 599 | VEmptyView(72), | 680 | VEmptyView(72), |
| 600 | TextField( | 681 | TextField( |
| 601 | maxLines: 1, | 682 | maxLines: 1, |
| 683 | + inputFormatters: [LengthLimitingTextInputFormatter(25)], | ||
| 602 | //输入文本的样式 | 684 | //输入文本的样式 |
| 603 | style: TextStyle( | 685 | style: TextStyle( |
| 604 | fontSize: ScreenUtil().setSp(34), | 686 | fontSize: ScreenUtil().setSp(34), |
| @@ -682,8 +764,9 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -682,8 +764,9 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 682 | ScreenUtil().setWidth(40), | 764 | ScreenUtil().setWidth(40), |
| 683 | ScreenUtil().setWidth(10)), | 765 | ScreenUtil().setWidth(10)), |
| 684 | child: Image.asset( | 766 | child: Image.asset( |
| 685 | - 'assets/icon_exist.png', | 767 | + 'assets/close.png', |
| 686 | width: ScreenUtil().setWidth(32), | 768 | width: ScreenUtil().setWidth(32), |
| 769 | + height: ScreenUtil().setWidth(32), | ||
| 687 | ), | 770 | ), |
| 688 | ), | 771 | ), |
| 689 | ), | 772 | ), |
| @@ -828,6 +911,10 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -828,6 +911,10 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 828 | Utils.showToast("请填写客户姓名"); | 911 | Utils.showToast("请填写客户姓名"); |
| 829 | return; | 912 | return; |
| 830 | } | 913 | } |
| 914 | + if (_notebookDetailChangeModel.tableList.length == 0) { | ||
| 915 | + Utils.showToast("请选择桌位"); | ||
| 916 | + return; | ||
| 917 | + } | ||
| 831 | SunReserveInfoModel _model = | 918 | SunReserveInfoModel _model = |
| 832 | await _notebookDetailChangeModel | 919 | await _notebookDetailChangeModel |
| 833 | .setReserveInfo(context); | 920 | .setReserveInfo(context); |
| @@ -837,15 +924,35 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | @@ -837,15 +924,35 @@ class _NoteBookChangePageState extends State<NoteBookChangePage> { | ||
| 837 | // _notebookDetailChangeModel.clearData(); | 924 | // _notebookDetailChangeModel.clearData(); |
| 838 | bus.emit("refresh_detail"); | 925 | bus.emit("refresh_detail"); |
| 839 | String ddate_solt = ''; | 926 | String ddate_solt = ''; |
| 840 | - if (_model.row.ddateSolt == '1') { | ||
| 841 | - ddate_solt = '早餐'; | ||
| 842 | - } else if (_model.row.ddateSolt == '2') { | ||
| 843 | - ddate_solt = '午餐'; | ||
| 844 | - } else if (_model.row.ddateSolt == '3') { | ||
| 845 | - ddate_solt = '晚餐'; | 927 | + if (_model.row.isSetDdate == '1') { |
| 928 | + String createtime = _model.row.ddate.toString() + '000'; | ||
| 929 | + DateTime createTime = | ||
| 930 | + DateTime.fromMillisecondsSinceEpoch( | ||
| 931 | + int.parse(createtime)); | ||
| 932 | + ddate_solt = DateUtil.formatDate(createTime, | ||
| 933 | + format: DateFormats.h_m); | ||
| 934 | + } else { | ||
| 935 | + if (_model.row.ddateSolt == '1') { | ||
| 936 | + ddate_solt = '早餐'; | ||
| 937 | + } else if (_model.row.ddateSolt == '2') { | ||
| 938 | + ddate_solt = '午餐'; | ||
| 939 | + } else if (_model.row.ddateSolt == '3') { | ||
| 940 | + ddate_solt = '晚餐'; | ||
| 941 | + } | ||
| 942 | + } | ||
| 943 | + | ||
| 944 | + List<dynamic> tableinfo = | ||
| 945 | + convert.jsonDecode(_model.row.tableinfo); | ||
| 946 | + print(tableinfo); | ||
| 947 | + String _nameStr = _model.row.name; | ||
| 948 | + if (tableinfo.length > 1) { | ||
| 949 | + _nameStr = _model.row.name + '等${tableinfo.length}桌'; | ||
| 846 | } | 950 | } |
| 951 | + | ||
| 952 | + // t.TableList _tableList = t.TableList.fromJson(tableinfo); | ||
| 953 | + // _model.row.tableinfo | ||
| 847 | NavigatorUtil.goInvicationPage(context, _model.row.id, | 954 | NavigatorUtil.goInvicationPage(context, _model.row.id, |
| 848 | - _model.row.name, _model.row.ddate, ddate_solt, | 955 | + _nameStr, _model.row.ddate, ddate_solt, |
| 849 | replace: true); | 956 | replace: true); |
| 850 | } else { | 957 | } else { |
| 851 | Utils.showToast("变更预订订单失败,请重试!"); | 958 | Utils.showToast("变更预订订单失败,请重试!"); |
| @@ -895,6 +1002,12 @@ class _ButtonState extends State<CustomButton> { | @@ -895,6 +1002,12 @@ class _ButtonState extends State<CustomButton> { | ||
| 895 | FocusNode _cancelNode = FocusNode(); | 1002 | FocusNode _cancelNode = FocusNode(); |
| 896 | @override | 1003 | @override |
| 897 | Widget build(BuildContext context) { | 1004 | Widget build(BuildContext context) { |
| 1005 | + String imgStrSelect = widget.isImage && !widget.isTextFiled | ||
| 1006 | + ? 'assets/calender_select.png' | ||
| 1007 | + : 'assets/more_select.png'; | ||
| 1008 | + String imgStrNormal = widget.isImage && !widget.isTextFiled | ||
| 1009 | + ? 'assets/calender_narmol.png' | ||
| 1010 | + : 'assets/more_narmol.png'; | ||
| 898 | return InkWell( | 1011 | return InkWell( |
| 899 | onTap: widget.onTap, | 1012 | onTap: widget.onTap, |
| 900 | child: Container( | 1013 | child: Container( |
| @@ -978,7 +1091,9 @@ class _ButtonState extends State<CustomButton> { | @@ -978,7 +1091,9 @@ class _ButtonState extends State<CustomButton> { | ||
| 978 | ) | 1091 | ) |
| 979 | : Text(widget.dateText, | 1092 | : Text(widget.dateText, |
| 980 | style: TextStyle( | 1093 | style: TextStyle( |
| 981 | - fontWeight: FontWeight.bold, | 1094 | + fontWeight: widget.isImage && widget.dateText == "其他" |
| 1095 | + ? FontWeight.normal | ||
| 1096 | + : FontWeight.bold, | ||
| 982 | color: widget.isSelect | 1097 | color: widget.isSelect |
| 983 | ? MyColours.color_fefefe | 1098 | ? MyColours.color_fefefe |
| 984 | : MyColours.color_199095, | 1099 | : MyColours.color_199095, |
| @@ -987,10 +1102,7 @@ class _ButtonState extends State<CustomButton> { | @@ -987,10 +1102,7 @@ class _ButtonState extends State<CustomButton> { | ||
| 987 | ? HEmptyView(20) | 1102 | ? HEmptyView(20) |
| 988 | : Container(), | 1103 | : Container(), |
| 989 | widget.isImage | 1104 | widget.isImage |
| 990 | - ? Image.asset( | ||
| 991 | - widget.isSelect | ||
| 992 | - ? 'assets/calender_select.png' | ||
| 993 | - : 'assets/calender_narmol.png', | 1105 | + ? Image.asset(widget.isSelect ? imgStrSelect : imgStrNormal, |
| 994 | width: ScreenUtil().setWidth(36)) | 1106 | width: ScreenUtil().setWidth(36)) |
| 995 | : Text(widget.dayText, | 1107 | : Text(widget.dayText, |
| 996 | style: TextStyle( | 1108 | style: TextStyle( |
| @@ -8,64 +8,78 @@ import 'package:one_key/utils/utils.dart'; | @@ -8,64 +8,78 @@ import 'package:one_key/utils/utils.dart'; | ||
| 8 | import 'package:one_key/widgets/v_empty_view.dart'; | 8 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 9 | import 'package:provider/provider.dart'; | 9 | import 'package:provider/provider.dart'; |
| 10 | 10 | ||
| 11 | -class InvicationPage extends StatefulWidget{ | ||
| 12 | - | ||
| 13 | - final String rid;//预订订单id | ||
| 14 | - final String tableInfo;//桌位信息 | 11 | +class InvicationPage extends StatefulWidget { |
| 12 | + final String rid; //预订订单id | ||
| 13 | + final String tableInfo; //桌位信息 | ||
| 15 | final String ddate; | 14 | final String ddate; |
| 16 | final String ddateStr; | 15 | final String ddateStr; |
| 17 | 16 | ||
| 18 | - InvicationPage(this.rid,this.tableInfo,this.ddate,this.ddateStr); | 17 | + InvicationPage(this.rid, this.tableInfo, this.ddate, this.ddateStr); |
| 19 | 18 | ||
| 20 | @override | 19 | @override |
| 21 | State<StatefulWidget> createState() { | 20 | State<StatefulWidget> createState() { |
| 22 | // TODO: implement createState | 21 | // TODO: implement createState |
| 23 | return new InvicationPageState(); | 22 | return new InvicationPageState(); |
| 24 | } | 23 | } |
| 25 | - | ||
| 26 | } | 24 | } |
| 27 | 25 | ||
| 28 | -class InvicationPageState extends State<InvicationPage>{ | ||
| 29 | - | 26 | +class InvicationPageState extends State<InvicationPage> { |
| 30 | User user; | 27 | User user; |
| 31 | DateTime dateTime; | 28 | DateTime dateTime; |
| 32 | - String dateTimeStr=""; | 29 | + String dateTimeStr = ""; |
| 33 | 30 | ||
| 34 | @override | 31 | @override |
| 35 | void initState() { | 32 | void initState() { |
| 36 | // TODO: implement initState | 33 | // TODO: implement initState |
| 37 | super.initState(); | 34 | super.initState(); |
| 38 | - dateTime=DateTime.fromMillisecondsSinceEpoch(int.parse(widget.ddate)*1000); | ||
| 39 | - user=Provider.of<UserModel>(context,listen:false).user; | ||
| 40 | - dateTimeStr="${dateTime.year}/${Utils.addZeroNumber(dateTime.month)}/${Utils.addZeroNumber(dateTime.day)} 星期${Utils.formatWeekDayNum(dateTime.weekday)} ${widget.ddateStr}"; | 35 | + dateTime = |
| 36 | + DateTime.fromMillisecondsSinceEpoch(int.parse(widget.ddate) * 1000); | ||
| 37 | + user = Provider.of<UserModel>(context, listen: false).user; | ||
| 38 | + dateTimeStr = | ||
| 39 | + "${dateTime.year}/${Utils.addZeroNumber(dateTime.month)}/${Utils.addZeroNumber(dateTime.day)} 星期${Utils.formatWeekDayNum(dateTime.weekday)} ${widget.ddateStr}"; | ||
| 41 | } | 40 | } |
| 42 | - | ||
| 43 | - | 41 | + |
| 44 | //中间内容显示组件 | 42 | //中间内容显示组件 |
| 45 | - Widget _middleWidget(String title,String content){ | 43 | + Widget _middleWidget(String title, String content) { |
| 46 | return Column( | 44 | return Column( |
| 47 | children: <Widget>[ | 45 | children: <Widget>[ |
| 48 | VEmptyView(38), | 46 | VEmptyView(38), |
| 49 | Row( | 47 | Row( |
| 50 | mainAxisSize: MainAxisSize.min, | 48 | mainAxisSize: MainAxisSize.min, |
| 51 | children: <Widget>[ | 49 | children: <Widget>[ |
| 52 | - Image.asset("assets/invication_line_left.png",width: ScreenUtil().setWidth(44),height: ScreenUtil().setWidth(4),), | 50 | + Image.asset( |
| 51 | + "assets/invication_line_left.png", | ||
| 52 | + width: ScreenUtil().setWidth(44), | ||
| 53 | + height: ScreenUtil().setWidth(4), | ||
| 54 | + ), | ||
| 53 | Container( | 55 | Container( |
| 54 | - margin: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(13)), | ||
| 55 | - child: Text(title,style: TextStyle(color: MyColours.color_eadab9,fontSize: ScreenUtil().setSp(32))), | 56 | + margin: |
| 57 | + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(13)), | ||
| 58 | + child: Text(title, | ||
| 59 | + style: TextStyle( | ||
| 60 | + color: MyColours.color_eadab9, | ||
| 61 | + fontSize: ScreenUtil().setSp(32))), | ||
| 56 | ), | 62 | ), |
| 57 | - Image.asset("assets/invication_line_right.png",width: ScreenUtil().setWidth(44),height: ScreenUtil().setWidth(4),) | 63 | + Image.asset( |
| 64 | + "assets/invication_line_right.png", | ||
| 65 | + width: ScreenUtil().setWidth(44), | ||
| 66 | + height: ScreenUtil().setWidth(4), | ||
| 67 | + ) | ||
| 58 | ], | 68 | ], |
| 59 | ), | 69 | ), |
| 60 | Container( | 70 | Container( |
| 61 | margin: EdgeInsets.only(top: ScreenUtil().setHeight(20)), | 71 | margin: EdgeInsets.only(top: ScreenUtil().setHeight(20)), |
| 62 | - child: Text(content,style: TextStyle(color: MyColours.color_ffffff,fontSize: ScreenUtil().setSp(34)),), | 72 | + child: Text( |
| 73 | + content, | ||
| 74 | + style: TextStyle( | ||
| 75 | + color: MyColours.color_ffffff, | ||
| 76 | + fontSize: ScreenUtil().setSp(34)), | ||
| 77 | + ), | ||
| 63 | ) | 78 | ) |
| 64 | ], | 79 | ], |
| 65 | ); | 80 | ); |
| 66 | } | 81 | } |
| 67 | - | ||
| 68 | - | 82 | + |
| 69 | @override | 83 | @override |
| 70 | Widget build(BuildContext context) { | 84 | Widget build(BuildContext context) { |
| 71 | // TODO: implement build | 85 | // TODO: implement build |
| @@ -74,127 +88,168 @@ class InvicationPageState extends State<InvicationPage>{ | @@ -74,127 +88,168 @@ class InvicationPageState extends State<InvicationPage>{ | ||
| 74 | width: double.infinity, | 88 | width: double.infinity, |
| 75 | height: double.infinity, | 89 | height: double.infinity, |
| 76 | decoration: BoxDecoration( | 90 | decoration: BoxDecoration( |
| 77 | - image: DecorationImage(image: AssetImage("assets/bg_invication.png"),fit: BoxFit.cover), | 91 | + image: DecorationImage( |
| 92 | + image: AssetImage("assets/bg_invication.png"), fit: BoxFit.cover), | ||
| 78 | ), | 93 | ), |
| 79 | - child: DefaultTextStyle(style: TextStyle(decoration: TextDecoration.none), child: Column( | ||
| 80 | - children: <Widget>[ | ||
| 81 | - GestureDetector( | ||
| 82 | - onTap: (){ | ||
| 83 | - Navigator.of(context).pop(); | ||
| 84 | - }, | ||
| 85 | - behavior: HitTestBehavior.opaque, | ||
| 86 | - child: Container( | ||
| 87 | - width: double.infinity, | ||
| 88 | - alignment: Alignment.centerLeft, | ||
| 89 | - child: Padding( | ||
| 90 | - padding: EdgeInsets.symmetric( | ||
| 91 | - horizontal: ScreenUtil().setWidth(40), | ||
| 92 | - vertical: ScreenUtil().setHeight(15)), | ||
| 93 | - child: Image.asset( | ||
| 94 | - "assets/invication_back.png", | ||
| 95 | - width: ScreenUtil().setWidth(20), | ||
| 96 | - height: ScreenUtil().setHeight(31), | ||
| 97 | - ) | 94 | + child: DefaultTextStyle( |
| 95 | + style: TextStyle(decoration: TextDecoration.none), | ||
| 96 | + child: Column( | ||
| 97 | + children: <Widget>[ | ||
| 98 | + GestureDetector( | ||
| 99 | + onTap: () { | ||
| 100 | + Navigator.of(context).pop(); | ||
| 101 | + }, | ||
| 102 | + behavior: HitTestBehavior.opaque, | ||
| 103 | + child: Container( | ||
| 104 | + width: double.infinity, | ||
| 105 | + alignment: Alignment.centerLeft, | ||
| 106 | + child: Padding( | ||
| 107 | + padding: EdgeInsets.symmetric( | ||
| 108 | + horizontal: ScreenUtil().setWidth(40), | ||
| 109 | + vertical: ScreenUtil().setHeight(15)), | ||
| 110 | + child: Image.asset( | ||
| 111 | + "assets/invication_back.png", | ||
| 112 | + width: ScreenUtil().setWidth(20), | ||
| 113 | + height: ScreenUtil().setHeight(31), | ||
| 114 | + )), | ||
| 115 | + ), | ||
| 98 | ), | 116 | ), |
| 99 | - ), | ||
| 100 | - ), | ||
| 101 | - Expanded( | ||
| 102 | - child: Center( | ||
| 103 | - child: Column( | ||
| 104 | - children: <Widget>[ | ||
| 105 | - Image.asset("assets/img_ydap.png",width: ScreenUtil().setWidth(500),height: ScreenUtil().setHeight(300),), | ||
| 106 | - VEmptyView(69), | ||
| 107 | - Row( | ||
| 108 | - mainAxisSize: MainAxisSize.min, | 117 | + Expanded( |
| 118 | + child: Center( | ||
| 119 | + child: Column( | ||
| 109 | children: <Widget>[ | 120 | children: <Widget>[ |
| 110 | - Container( | ||
| 111 | - width: ScreenUtil().setWidth(108), | ||
| 112 | - height: ScreenUtil().setHeight(2), | ||
| 113 | - color: MyColours.color_ffffff, | ||
| 114 | - ), | ||
| 115 | - Container( | ||
| 116 | - width: ScreenUtil().setWidth(442), | ||
| 117 | - height: ScreenUtil().setHeight(43), | ||
| 118 | - alignment: Alignment.center, | ||
| 119 | - decoration: BoxDecoration( | ||
| 120 | - border: Border.all(color: MyColours.color_ffffff,width: ScreenUtil().setWidth(2)), | ||
| 121 | - borderRadius: BorderRadius.all(Radius.circular(ScreenUtil().setWidth(18))) | ||
| 122 | - ), | ||
| 123 | - child: Text("订包间,用周到安排",style: TextStyle(color: MyColours.color_ffffff,fontSize: ScreenUtil().setSp(28)),), | ||
| 124 | - ), | ||
| 125 | - Container( | ||
| 126 | - width: ScreenUtil().setWidth(108), | ||
| 127 | - height: ScreenUtil().setHeight(2), | ||
| 128 | - color: MyColours.color_ffffff, | 121 | + Image.asset( |
| 122 | + "assets/img_ydap.png", | ||
| 123 | + width: ScreenUtil().setWidth(500), | ||
| 124 | + height: ScreenUtil().setHeight(300), | ||
| 129 | ), | 125 | ), |
| 130 | - ], | ||
| 131 | - ), | ||
| 132 | - _middleWidget("餐厅", user.sellername), | ||
| 133 | - _middleWidget("包间", widget.tableInfo.replaceAll("\n","")), | ||
| 134 | - _middleWidget("时间", dateTimeStr), | ||
| 135 | - VEmptyView(38), | ||
| 136 | - Column( | ||
| 137 | - children: <Widget>[ | 126 | + VEmptyView(69), |
| 138 | Row( | 127 | Row( |
| 139 | mainAxisSize: MainAxisSize.min, | 128 | mainAxisSize: MainAxisSize.min, |
| 140 | children: <Widget>[ | 129 | children: <Widget>[ |
| 141 | - Image.asset("assets/invication_map.png",width: ScreenUtil().setWidth(22),height: ScreenUtil().setWidth(28),), | ||
| 142 | Container( | 130 | Container( |
| 143 | - margin: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(13)), | ||
| 144 | - child: Text("地址导航",style: TextStyle(color: MyColours.color_eadab9,fontSize: ScreenUtil().setSp(32))), | 131 | + width: ScreenUtil().setWidth(108), |
| 132 | + height: ScreenUtil().setHeight(2), | ||
| 133 | + color: MyColours.color_ffffff, | ||
| 134 | + ), | ||
| 135 | + Container( | ||
| 136 | + width: ScreenUtil().setWidth(442), | ||
| 137 | + height: ScreenUtil().setHeight(43), | ||
| 138 | + alignment: Alignment.center, | ||
| 139 | + decoration: BoxDecoration( | ||
| 140 | + border: Border.all( | ||
| 141 | + color: MyColours.color_ffffff, | ||
| 142 | + width: ScreenUtil().setWidth(2)), | ||
| 143 | + borderRadius: BorderRadius.all( | ||
| 144 | + Radius.circular( | ||
| 145 | + ScreenUtil().setWidth(18)))), | ||
| 146 | + child: Text( | ||
| 147 | + "订包间,用周到安排", | ||
| 148 | + style: TextStyle( | ||
| 149 | + color: MyColours.color_ffffff, | ||
| 150 | + fontSize: ScreenUtil().setSp(28)), | ||
| 151 | + ), | ||
| 152 | + ), | ||
| 153 | + Container( | ||
| 154 | + width: ScreenUtil().setWidth(108), | ||
| 155 | + height: ScreenUtil().setHeight(2), | ||
| 156 | + color: MyColours.color_ffffff, | ||
| 145 | ), | 157 | ), |
| 146 | - Image.asset("assets/invication_arrow_right.png",width: ScreenUtil().setWidth(14),height: ScreenUtil().setWidth(22),), | ||
| 147 | ], | 158 | ], |
| 148 | ), | 159 | ), |
| 149 | - Container( | ||
| 150 | - margin: EdgeInsets.only(top: ScreenUtil().setHeight(20)), | ||
| 151 | - child: Text(user.sellerAddr,style: TextStyle(color: MyColours.color_ffffff,fontSize: ScreenUtil().setSp(34)),), | 160 | + _middleWidget("餐厅", user.sellername), |
| 161 | + _middleWidget( | ||
| 162 | + "包间", widget.tableInfo.replaceAll("\n", "")), | ||
| 163 | + _middleWidget("时间", dateTimeStr), | ||
| 164 | + VEmptyView(38), | ||
| 165 | + Column( | ||
| 166 | + children: <Widget>[ | ||
| 167 | + Row( | ||
| 168 | + mainAxisSize: MainAxisSize.min, | ||
| 169 | + children: <Widget>[ | ||
| 170 | + Image.asset( | ||
| 171 | + "assets/invication_map.png", | ||
| 172 | + width: ScreenUtil().setWidth(22), | ||
| 173 | + height: ScreenUtil().setWidth(28), | ||
| 174 | + ), | ||
| 175 | + Container( | ||
| 176 | + margin: EdgeInsets.symmetric( | ||
| 177 | + horizontal: ScreenUtil().setWidth(13)), | ||
| 178 | + child: Text("地址导航", | ||
| 179 | + style: TextStyle( | ||
| 180 | + color: MyColours.color_eadab9, | ||
| 181 | + fontSize: ScreenUtil().setSp(32))), | ||
| 182 | + ), | ||
| 183 | + Image.asset( | ||
| 184 | + "assets/invication_arrow_right.png", | ||
| 185 | + width: ScreenUtil().setWidth(14), | ||
| 186 | + height: ScreenUtil().setWidth(22), | ||
| 187 | + ), | ||
| 188 | + ], | ||
| 189 | + ), | ||
| 190 | + Container( | ||
| 191 | + margin: EdgeInsets.only( | ||
| 192 | + top: ScreenUtil().setHeight(20)), | ||
| 193 | + child: Text( | ||
| 194 | + user.sellerAddr, | ||
| 195 | + style: TextStyle( | ||
| 196 | + color: MyColours.color_ffffff, | ||
| 197 | + fontSize: ScreenUtil().setSp(34)), | ||
| 198 | + ), | ||
| 199 | + ) | ||
| 200 | + ], | ||
| 152 | ) | 201 | ) |
| 153 | ], | 202 | ], |
| 154 | - ) | ||
| 155 | - ], | ||
| 156 | - ), | ||
| 157 | - ), | ||
| 158 | - ), | ||
| 159 | - Container( | ||
| 160 | - width: double.infinity, | ||
| 161 | - height: ScreenUtil().setHeight(99), | ||
| 162 | - child: Row( | ||
| 163 | - children: <Widget>[ | ||
| 164 | - GestureDetector( | ||
| 165 | - onTap: (){ | ||
| 166 | - NavigatorUtil.goSmsPage(context, widget.rid); | ||
| 167 | - }, | ||
| 168 | - child: Container( | ||
| 169 | - width: ScreenUtil().setWidth(232), | ||
| 170 | - height: double.infinity, | ||
| 171 | - color: MyColours.color_000000, | ||
| 172 | - alignment: Alignment.center, | ||
| 173 | - child: Text("发短信",style: TextStyle(color: MyColours.color_eadab9,fontSize: ScreenUtil().setSp(34)),), | ||
| 174 | ), | 203 | ), |
| 175 | ), | 204 | ), |
| 176 | - Expanded( | ||
| 177 | - child: | ||
| 178 | - GestureDetector( | ||
| 179 | - onTap: (){ | ||
| 180 | - Utils.goShareInvicationToWeChat(widget.rid); | ||
| 181 | - }, | ||
| 182 | - child:Container( | ||
| 183 | - width: double.infinity, | ||
| 184 | - height: double.infinity, | ||
| 185 | - color: MyColours.color_e3d2ac, | ||
| 186 | - alignment: Alignment.center, | ||
| 187 | - child: Text("通知客户",style: TextStyle(color: MyColours.color_83734d,fontSize: ScreenUtil().setSp(34)),), | 205 | + ), |
| 206 | + Container( | ||
| 207 | + width: double.infinity, | ||
| 208 | + height: ScreenUtil().setHeight(99), | ||
| 209 | + child: Row( | ||
| 210 | + children: <Widget>[ | ||
| 211 | + GestureDetector( | ||
| 212 | + onTap: () { | ||
| 213 | + NavigatorUtil.goSmsPage(context, widget.rid); | ||
| 214 | + }, | ||
| 215 | + child: Container( | ||
| 216 | + width: ScreenUtil().setWidth(232), | ||
| 217 | + height: double.infinity, | ||
| 218 | + color: MyColours.color_000000, | ||
| 219 | + alignment: Alignment.center, | ||
| 220 | + child: Text( | ||
| 221 | + "发短信", | ||
| 222 | + style: TextStyle( | ||
| 223 | + color: MyColours.color_eadab9, | ||
| 224 | + fontSize: ScreenUtil().setSp(34)), | ||
| 225 | + ), | ||
| 226 | + ), | ||
| 188 | ), | 227 | ), |
| 189 | - ), | ||
| 190 | - ) | ||
| 191 | - ], | ||
| 192 | - ), | ||
| 193 | - ) | ||
| 194 | - ], | ||
| 195 | - )), | 228 | + Expanded( |
| 229 | + child: GestureDetector( | ||
| 230 | + onTap: () { | ||
| 231 | + Utils.goShareInvicationToWeChat(widget.rid); | ||
| 232 | + }, | ||
| 233 | + child: Container( | ||
| 234 | + width: double.infinity, | ||
| 235 | + height: double.infinity, | ||
| 236 | + color: MyColours.color_e3d2ac, | ||
| 237 | + alignment: Alignment.center, | ||
| 238 | + child: Text( | ||
| 239 | + "通知客户", | ||
| 240 | + style: TextStyle( | ||
| 241 | + color: MyColours.color_83734d, | ||
| 242 | + fontSize: ScreenUtil().setSp(34)), | ||
| 243 | + ), | ||
| 244 | + ), | ||
| 245 | + ), | ||
| 246 | + ) | ||
| 247 | + ], | ||
| 248 | + ), | ||
| 249 | + ) | ||
| 250 | + ], | ||
| 251 | + )), | ||
| 196 | ), | 252 | ), |
| 197 | ); | 253 | ); |
| 198 | } | 254 | } |
| 199 | - | ||
| 200 | -} | ||
| 255 | +} |
| @@ -111,6 +111,7 @@ class SelectTablePageState extends State<SelectTablePage> { | @@ -111,6 +111,7 @@ class SelectTablePageState extends State<SelectTablePage> { | ||
| 111 | } | 111 | } |
| 112 | } | 112 | } |
| 113 | } | 113 | } |
| 114 | + print(tableMap); | ||
| 114 | initData(); | 115 | initData(); |
| 115 | } | 116 | } |
| 116 | 117 | ||
| @@ -220,22 +221,23 @@ class SelectTablePageState extends State<SelectTablePage> { | @@ -220,22 +221,23 @@ class SelectTablePageState extends State<SelectTablePage> { | ||
| 220 | crossAxisCount: 3, childAspectRatio: 0.8), | 221 | crossAxisCount: 3, childAspectRatio: 0.8), |
| 221 | itemBuilder: (context, index) { | 222 | itemBuilder: (context, index) { |
| 222 | return TableItem( | 223 | return TableItem( |
| 223 | - areaTableMap[currentArea][index], | ||
| 224 | - onSelected: (table) { | ||
| 225 | - if ((table as t.Table).selected) { | ||
| 226 | - selectTables.add(table); | ||
| 227 | - widget.tableList | ||
| 228 | - .add(tableToTableList(table)); | ||
| 229 | - } else { | ||
| 230 | - widget.tableList | ||
| 231 | - .removeWhere((t) => t.id == table.id); | ||
| 232 | - selectTables | ||
| 233 | - .removeWhere((t) => t.id == table.id); | ||
| 234 | - } | ||
| 235 | - }, | ||
| 236 | - canSelected: true, | ||
| 237 | - canChoose: widget.canChoose, | ||
| 238 | - ); | 224 | + areaTableMap[currentArea][index], |
| 225 | + onSelected: (table) { | ||
| 226 | + if ((table as t.Table).selected) { | ||
| 227 | + selectTables.add(table); | ||
| 228 | + widget.tableList | ||
| 229 | + .add(tableToTableList(table)); | ||
| 230 | + } else { | ||
| 231 | + widget.tableList | ||
| 232 | + .removeWhere((t) => t.id == table.id); | ||
| 233 | + selectTables | ||
| 234 | + .removeWhere((t) => t.id == table.id); | ||
| 235 | + } | ||
| 236 | + }, | ||
| 237 | + canSelected: true, | ||
| 238 | + canChoose: widget.canChoose, | ||
| 239 | + tableMap: tableMap, | ||
| 240 | + rid: widget.rid); | ||
| 239 | }, | 241 | }, |
| 240 | itemCount: areaTableMap[currentArea].length, | 242 | itemCount: areaTableMap[currentArea].length, |
| 241 | ), | 243 | ), |
| @@ -263,7 +265,7 @@ class SelectTablePageState extends State<SelectTablePage> { | @@ -263,7 +265,7 @@ class SelectTablePageState extends State<SelectTablePage> { | ||
| 263 | state: 1, | 265 | state: 1, |
| 264 | onPress: () { | 266 | onPress: () { |
| 265 | if (widget.canChoose) { | 267 | if (widget.canChoose) { |
| 266 | - if (widget.tableList.length > 0) { | 268 | + // if (widget.tableList.length > 0) { |
| 267 | String tid = ""; | 269 | String tid = ""; |
| 268 | for (TableList table in widget.tableList) { | 270 | for (TableList table in widget.tableList) { |
| 269 | tid += table.id + ","; | 271 | tid += table.id + ","; |
| @@ -274,7 +276,7 @@ class SelectTablePageState extends State<SelectTablePage> { | @@ -274,7 +276,7 @@ class SelectTablePageState extends State<SelectTablePage> { | ||
| 274 | 276 | ||
| 275 | Map temp = {'object': widget.tableList, 'tid': tid}; | 277 | Map temp = {'object': widget.tableList, 'tid': tid}; |
| 276 | Navigator.of(context).pop(temp); | 278 | Navigator.of(context).pop(temp); |
| 277 | - } | 279 | + // } |
| 278 | } else { | 280 | } else { |
| 279 | if (selectTables.length > 0) { | 281 | if (selectTables.length > 0) { |
| 280 | String tid = ""; | 282 | String tid = ""; |
| @@ -27,6 +27,7 @@ class NotebookDetailChangeModel with ChangeNotifier { | @@ -27,6 +27,7 @@ class NotebookDetailChangeModel with ChangeNotifier { | ||
| 27 | NotebookDetail detailEntity; | 27 | NotebookDetail detailEntity; |
| 28 | List<TableList> tableList = []; | 28 | List<TableList> tableList = []; |
| 29 | String isSetDate = '0'; | 29 | String isSetDate = '0'; |
| 30 | + List<TableList> recommendList = []; //推荐列表 | ||
| 30 | 31 | ||
| 31 | clearData() { | 32 | clearData() { |
| 32 | dateList = []; //日期选择 月-日 某天 | 33 | dateList = []; //日期选择 月-日 某天 |
| @@ -377,6 +378,7 @@ class NotebookDetailChangeModel with ChangeNotifier { | @@ -377,6 +378,7 @@ class NotebookDetailChangeModel with ChangeNotifier { | ||
| 377 | tableList = []; | 378 | tableList = []; |
| 378 | for (int i = 0; i < itemModelList.length; i++) { | 379 | for (int i = 0; i < itemModelList.length; i++) { |
| 379 | if (itemModelList[i].name == "推荐") { | 380 | if (itemModelList[i].name == "推荐") { |
| 381 | + recommendList = itemModelList[i].list; | ||
| 380 | itemModelList.removeAt(i); | 382 | itemModelList.removeAt(i); |
| 381 | } | 383 | } |
| 382 | } | 384 | } |
| @@ -47,7 +47,7 @@ class NewTableItemState extends State<NewTableItem> { | @@ -47,7 +47,7 @@ class NewTableItemState extends State<NewTableItem> { | ||
| 47 | Container( | 47 | Container( |
| 48 | width: ScreenUtil().setWidth(150), | 48 | width: ScreenUtil().setWidth(150), |
| 49 | height: ScreenUtil().setWidth(widget.height), | 49 | height: ScreenUtil().setWidth(widget.height), |
| 50 | - margin: EdgeInsets.all(ScreenUtil().setWidth(9)), | 50 | + margin: EdgeInsets.only(left:ScreenUtil().setWidth(40)), |
| 51 | decoration: BoxDecoration( | 51 | decoration: BoxDecoration( |
| 52 | color: MyColours.color_a8e2e4, | 52 | color: MyColours.color_a8e2e4, |
| 53 | borderRadius: BorderRadius.all( | 53 | borderRadius: BorderRadius.all( |
| @@ -183,8 +183,8 @@ class NewTableItemState extends State<NewTableItem> { | @@ -183,8 +183,8 @@ class NewTableItemState extends State<NewTableItem> { | ||
| 183 | ), | 183 | ), |
| 184 | ), | 184 | ), |
| 185 | Positioned( | 185 | Positioned( |
| 186 | - top: 3, | ||
| 187 | - right: 5, | 186 | + top: 0, |
| 187 | + right: 0, | ||
| 188 | child: !(table.selected ?? false) | 188 | child: !(table.selected ?? false) |
| 189 | ? Container() | 189 | ? Container() |
| 190 | : Image.asset( | 190 | : Image.asset( |
| 1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
| 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 3 | +import 'package:one_key/models/notebook.dart'; | ||
| 3 | import 'package:one_key/res/colors.dart'; | 4 | import 'package:one_key/res/colors.dart'; |
| 4 | 5 | ||
| 5 | import 'package:one_key/models/table.dart' as t; | 6 | import 'package:one_key/models/table.dart' as t; |
| @@ -9,7 +10,9 @@ class TableItem extends StatefulWidget { | @@ -9,7 +10,9 @@ class TableItem extends StatefulWidget { | ||
| 9 | final t.Table table; | 10 | final t.Table table; |
| 10 | final bool canSelected; //是否能选中 | 11 | final bool canSelected; //是否能选中 |
| 11 | final ValueChanged onSelected; | 12 | final ValueChanged onSelected; |
| 12 | - final bool canChoose; | 13 | + final bool canChoose; //从变更页面进来 = true |
| 14 | + final String rid; | ||
| 15 | + final Map<String, Notebook> tableMap; //记录已预订桌位对应的订单 | ||
| 13 | 16 | ||
| 14 | final int height; //高度 | 17 | final int height; //高度 |
| 15 | 18 | ||
| @@ -17,7 +20,9 @@ class TableItem extends StatefulWidget { | @@ -17,7 +20,9 @@ class TableItem extends StatefulWidget { | ||
| 17 | {this.onSelected, | 20 | {this.onSelected, |
| 18 | this.canSelected = false, | 21 | this.canSelected = false, |
| 19 | this.height = 183, | 22 | this.height = 183, |
| 20 | - this.canChoose = false}); | 23 | + this.canChoose = false, |
| 24 | + this.rid, | ||
| 25 | + this.tableMap}); | ||
| 21 | 26 | ||
| 22 | @override | 27 | @override |
| 23 | State<StatefulWidget> createState() { | 28 | State<StatefulWidget> createState() { |
| @@ -29,20 +34,36 @@ class TableItem extends StatefulWidget { | @@ -29,20 +34,36 @@ class TableItem extends StatefulWidget { | ||
| 29 | class TableItemState extends State<TableItem> { | 34 | class TableItemState extends State<TableItem> { |
| 30 | @override | 35 | @override |
| 31 | Widget build(BuildContext context) { | 36 | Widget build(BuildContext context) { |
| 32 | - // TODO: implement build | ||
| 33 | - | ||
| 34 | t.Table table = widget.table; | 37 | t.Table table = widget.table; |
| 35 | 38 | ||
| 36 | return GestureDetector( | 39 | return GestureDetector( |
| 37 | onTap: () { | 40 | onTap: () { |
| 38 | if (widget.canSelected && widget.canChoose) { | 41 | if (widget.canSelected && widget.canChoose) { |
| 39 | - if (table.sign == '5' || table.signStr.isEmpty) { | 42 | + //从变更页面进来 canChoose = true |
| 43 | + if (widget.canSelected && table.signStr.isEmpty) { | ||
| 40 | setState(() { | 44 | setState(() { |
| 41 | table.selected = !(table.selected ?? false); | 45 | table.selected = !(table.selected ?? false); |
| 42 | }); | 46 | }); |
| 43 | widget.onSelected(table); | 47 | widget.onSelected(table); |
| 48 | + } else { | ||
| 49 | + if (table.sign == '5') { | ||
| 50 | + //已预订状态 不是自己的不可以选择,是自己的可以选择 | ||
| 51 | + //当前桌子的预订id | ||
| 52 | + String idNow = ''; | ||
| 53 | + if (widget.tableMap.containsKey('${table.id}')) { | ||
| 54 | + //包含,证明该桌子已经被预订了 | ||
| 55 | + idNow = widget.tableMap['${table.id}'].id; | ||
| 56 | + if (idNow == widget.rid) { | ||
| 57 | + setState(() { | ||
| 58 | + table.selected = !(table.selected ?? false); | ||
| 59 | + }); | ||
| 60 | + widget.onSelected(table); | ||
| 61 | + } | ||
| 62 | + } | ||
| 63 | + } | ||
| 44 | } | 64 | } |
| 45 | } else { | 65 | } else { |
| 66 | + //从安排桌位进来 | ||
| 46 | if (widget.canSelected && table.signStr.isEmpty) { | 67 | if (widget.canSelected && table.signStr.isEmpty) { |
| 47 | setState(() { | 68 | setState(() { |
| 48 | table.selected = !(table.selected ?? false); | 69 | table.selected = !(table.selected ?? false); |
-
Please register or login to post a comment