Commit c5ba68b069395874ce52355c2e8b866618260a4d

Authored by wdn127929
1 parent 934db4a4

部分桌位弹窗

@@ -14,6 +14,7 @@ import 'package:one_key/pages/message/message_page.dart'; @@ -14,6 +14,7 @@ import 'package:one_key/pages/message/message_page.dart';
14 import 'package:one_key/pages/my/my_page.dart'; 14 import 'package:one_key/pages/my/my_page.dart';
15 import 'package:one_key/pages/notebook/notebook_page.dart'; 15 import 'package:one_key/pages/notebook/notebook_page.dart';
16 import 'package:one_key/pages/table/table_manager_page.dart'; 16 import 'package:one_key/pages/table/table_manager_page.dart';
  17 +import 'package:one_key/provider/base_info_provider.dart';
17 import 'package:one_key/provider/contact_model.dart'; 18 import 'package:one_key/provider/contact_model.dart';
18 19
19 import 'package:one_key/provider/message_dialog_model.dart'; 20 import 'package:one_key/provider/message_dialog_model.dart';
@@ -131,9 +132,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -131,9 +132,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
131 solt: widget.solt, 132 solt: widget.solt,
132 )), 133 )),
133 )) 134 ))
134 - ..add(ChangeNotifierProvider<TableManagerModel>(  
135 - create: (_) => TableManagerModel(),  
136 - child: TableManagerPage(), 135 + ..add(ChangeNotifierProvider<BaseIndoProvider>(
  136 + create: (_) => BaseIndoProvider(),
  137 + child: ChangeNotifierProvider<TableManagerModel>(
  138 + create: (_) => TableManagerModel(), child: TableManagerPage()),
137 )) 139 ))
138 ..add(ChangeNotifierProvider<MyModel>( 140 ..add(ChangeNotifierProvider<MyModel>(
139 create: (_) => MyModel(), 141 create: (_) => MyModel(),
@@ -3,6 +3,7 @@ import 'dart:async'; @@ -3,6 +3,7 @@ import 'dart:async';
3 import 'package:device_info/device_info.dart'; 3 import 'package:device_info/device_info.dart';
4 import 'package:dio/dio.dart'; 4 import 'package:dio/dio.dart';
5 import 'package:flutter/material.dart'; 5 import 'package:flutter/material.dart';
  6 +import 'package:flutter_inappwebview/flutter_inappwebview.dart';
6 import 'package:one_key/net/dio_util.dart'; 7 import 'package:one_key/net/dio_util.dart';
7 import 'package:one_key/res/colors.dart'; 8 import 'package:one_key/res/colors.dart';
8 import 'package:one_key/utils/event_bus.dart'; 9 import 'package:one_key/utils/event_bus.dart';
@@ -22,7 +23,7 @@ import 'package:one_key/widgets/app_bar.dart'; @@ -22,7 +23,7 @@ import 'package:one_key/widgets/app_bar.dart';
22 import 'package:one_key/widgets/system_app_bar.dart'; 23 import 'package:one_key/widgets/system_app_bar.dart';
23 import 'package:webview_flutter/webview_flutter.dart'; 24 import 'package:webview_flutter/webview_flutter.dart';
24 25
25 -import 'package:flutter_inappwebview/flutter_inappwebview.dart'; 26 +// import 'package:flutter_inappwebview/flutter_inappwebview.dart';
26 import 'package:url_launcher/url_launcher.dart'; 27 import 'package:url_launcher/url_launcher.dart';
27 import 'dart:collection'; 28 import 'dart:collection';
28 // import 'package:open_file/open_file.dart'; 29 // import 'package:open_file/open_file.dart';
@@ -2,6 +2,7 @@ import 'dart:async'; @@ -2,6 +2,7 @@ import 'dart:async';
2 2
3 import 'package:common_utils/common_utils.dart'; 3 import 'package:common_utils/common_utils.dart';
4 import 'package:dotted_border/dotted_border.dart'; 4 import 'package:dotted_border/dotted_border.dart';
  5 +import 'package:easy_contact_picker/easy_contact_picker.dart';
5 import 'package:flutter/material.dart'; 6 import 'package:flutter/material.dart';
6 import 'package:flutter_screenutil/flutter_screenutil.dart'; 7 import 'package:flutter_screenutil/flutter_screenutil.dart';
7 import 'package:one_key/constant/state.dart'; 8 import 'package:one_key/constant/state.dart';
@@ -11,6 +12,7 @@ import 'package:one_key/models/guest_info_model.dart'; @@ -11,6 +12,7 @@ import 'package:one_key/models/guest_info_model.dart';
11 import 'package:one_key/models/reserve_info_model.dart'; 12 import 'package:one_key/models/reserve_info_model.dart';
12 13
13 import 'package:one_key/pages/table/area_item_table.dart'; 14 import 'package:one_key/pages/table/area_item_table.dart';
  15 +import 'package:one_key/provider/base_info_provider.dart';
14 16
15 import 'package:one_key/provider/table_manager_model.dart'; 17 import 'package:one_key/provider/table_manager_model.dart';
16 import 'package:one_key/provider/user_model.dart'; 18 import 'package:one_key/provider/user_model.dart';
@@ -18,6 +20,7 @@ import 'package:one_key/res/colors.dart'; @@ -18,6 +20,7 @@ import 'package:one_key/res/colors.dart';
18 import 'package:one_key/utils/dialog_util.dart'; 20 import 'package:one_key/utils/dialog_util.dart';
19 import 'package:one_key/utils/event_bus.dart'; 21 import 'package:one_key/utils/event_bus.dart';
20 import 'package:one_key/route/navigator_util.dart'; 22 import 'package:one_key/route/navigator_util.dart';
  23 +import 'package:one_key/utils/misc.dart';
21 import 'package:one_key/utils/utils.dart'; 24 import 'package:one_key/utils/utils.dart';
22 import 'package:one_key/widgets/MyDivider.dart'; 25 import 'package:one_key/widgets/MyDivider.dart';
23 26
@@ -30,6 +33,7 @@ import 'package:one_key/widgets/system_app_bar.dart'; @@ -30,6 +33,7 @@ import 'package:one_key/widgets/system_app_bar.dart';
30 33
31 import 'package:one_key/models/table.dart' as t; 34 import 'package:one_key/models/table.dart' as t;
32 import 'package:one_key/widgets/v_empty_view.dart'; 35 import 'package:one_key/widgets/v_empty_view.dart';
  36 +import 'package:permission_handler/permission_handler.dart';
33 import 'package:provider/provider.dart'; 37 import 'package:provider/provider.dart';
34 import 'dart:convert' as convert; 38 import 'dart:convert' as convert;
35 import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; 39 import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
@@ -58,6 +62,18 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -58,6 +62,18 @@ class TableManagerPageState extends State<TableManagerPage> {
58 ScrollController _areaController = ScrollController(); 62 ScrollController _areaController = ScrollController();
59 List<String> personNumList = []; 63 List<String> personNumList = [];
60 bool isSelected = true; //全部按钮 64 bool isSelected = true; //全部按钮
  65 + String nameStr;
  66 + FocusNode _nameNode = FocusNode();
  67 + FocusNode _phoneNode = FocusNode();
  68 + bool showPhoneHistory = false; //显示客户历史记录
  69 + EasyContactPicker _contactPicker = EasyContactPicker();
  70 + BaseIndoProvider _baseIndoProvider;
  71 + int sexSelectIndex = 0;
  72 + String sexStr = '先生';
  73 + String actualPnum = '选填';
  74 + String ddateHm = '选填';
  75 + int actualPnumIndex;
  76 + int ddateIndex;
61 77
62 // ScrollController _scrollCrl = ScrollController(); 78 // ScrollController _scrollCrl = ScrollController();
63 final ItemPositionsListener itemPositionsListener = 79 final ItemPositionsListener itemPositionsListener =
@@ -69,9 +85,10 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -69,9 +85,10 @@ class TableManagerPageState extends State<TableManagerPage> {
69 super.initState(); 85 super.initState();
70 86
71 LogUtil.v("table_manager_page initState"); 87 LogUtil.v("table_manager_page initState");
72 - for (int i = 1; i < 31; i++) {  
73 - personNumList.add(i.toString());  
74 - } 88 + // for (int i = 1; i < 31; i++) {
  89 + // personNumList.add(i.toString());
  90 + // }
  91 + personNumList = Utils.getPersonNumList();
75 92
76 // personNumList.add('30以上'); 93 // personNumList.add('30以上');
77 94
@@ -355,16 +372,665 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -355,16 +372,665 @@ class TableManagerPageState extends State<TableManagerPage> {
355 ); 372 );
356 } 373 }
357 374
  375 + _openAddressBook() async {
  376 + if (!(await checkContactPermission())) {
  377 + PermissionStatus permissionStatus = await contactPermissionStatus();
  378 + if (permissionStatus == PermissionStatus.permanentlyDenied) {
  379 + //用户选择不在弹出权限提示框
  380 + print('never');
  381 + DialogUtil.openAlertDialog(
  382 + context, '未获得通讯录权限', "请在手机的权限管理里,将通讯录权限开启", '去设置', 340.0,
  383 + onTap: () {
  384 + openSetting();
  385 + Navigator.pop(context, '');
  386 + });
  387 + } else {
  388 + // 申请权限
  389 + bool canContacts = await requestContactPermission();
  390 + if (canContacts) {
  391 + _getContactData();
  392 + } else {
  393 + //拒绝通讯录权限 , 苹果拒绝权限后,不再提示权限框,进入此处
  394 + DialogUtil.openAlertDialog(
  395 + context, '未获得通讯录权限', "请在手机的权限管理里,将通讯录权限开启。", '去设置', 340.0,
  396 + onTap: () {
  397 + openSetting();
  398 + Navigator.pop(context, '');
  399 + });
  400 + }
  401 + }
  402 + } else {
  403 + _getContactData();
  404 + }
  405 + }
  406 +
  407 + _getContactData() async {
  408 + Contact contact = await _contactPicker.selectContactWithNative();
  409 +
  410 + setState(() {
  411 + String fullName =
  412 + contact.fullName.replaceAll(new RegExp(r"\s+\b|\b\s"), "");
  413 + String phone =
  414 + contact.phoneNumber.replaceAll(new RegExp(r"\s+\b|\b\s"), "");
  415 + if (fullName.compareTo(phone) == 0) {
  416 + fullName = '';
  417 + } else {
  418 + fullName = contact.fullName;
  419 + }
  420 + _baseIndoProvider.phoneController.text =
  421 + contact.phoneNumber.replaceAll(new RegExp(r"\s+"), "");
  422 + nameStr = fullName;
  423 + // _homeEnterModel.nameController.text = fullName + _nameSuffix();
  424 + _addNameSuffix(fullName, _nameSuffix());
  425 + });
  426 + }
  427 +
  428 + _addNameSuffix(String name, String suffix) {
  429 + if (name == _baseIndoProvider.nameController.text &&
  430 + _baseIndoProvider.nameController.text.endsWith(suffix)) {
  431 + return;
  432 + }
  433 + _baseIndoProvider.nameController.text = name + suffix;
  434 + }
  435 +
  436 + //姓名后缀
  437 + _nameSuffix() {
  438 + for (var item in _baseIndoProvider.sexList) {
  439 + if (item['select'] == true) {
  440 + return item['title'];
  441 + }
  442 + }
  443 + }
  444 +
  445 + // ///底部弹框,设置时间30分钟间隔布局
  446 + // _showDateChooseWidget(BuildContext context) async {
  447 + // String title = '早餐';
  448 + // if (detailEntity.ddate_solt == '2') {
  449 + // title = '午餐';
  450 + // } else if (detailEntity.ddate_solt == '3') {
  451 + // title = '晚餐';
  452 + // }
  453 +
  454 + // for (var itemSun in dailyList) {
  455 + // itemSun['select'] = false;
  456 + // if (itemSun['title'] == detailEntity.ddateStr) {
  457 + // itemSun['select'] = true;
  458 + // }
  459 + // }
  460 + // // if (item['isSelect'] == true) {
  461 +
  462 + // // }
  463 +
  464 + // final option = await showModalBottomSheet(
  465 + // context: context,
  466 + // isScrollControlled: true,
  467 + // backgroundColor: Colors.white,
  468 + // builder: (context) {
  469 + // return StatefulBuilder(builder: (context, state) {
  470 + // return SafeArea(
  471 + // child: Container(
  472 + // decoration: BoxDecoration(
  473 + // borderRadius:
  474 + // BorderRadius.circular(ScreenUtil().setWidth(10))),
  475 + // child: Column(
  476 + // mainAxisSize: MainAxisSize.min,
  477 + // children: [
  478 + // InkWell(
  479 + // onTap: () {
  480 + // Navigator.pop(context);
  481 + // },
  482 + // child: Align(
  483 + // alignment: Alignment.centerRight,
  484 + // child: Container(
  485 + // padding: EdgeInsets.fromLTRB(
  486 + // ScreenUtil().setWidth(40),
  487 + // ScreenUtil().setWidth(40),
  488 + // ScreenUtil().setWidth(40),
  489 + // ScreenUtil().setWidth(10)),
  490 + // child: Image.asset(
  491 + // 'assets/close.png',
  492 + // width: ScreenUtil().setWidth(32),
  493 + // height: ScreenUtil().setWidth(32),
  494 + // ),
  495 + // ),
  496 + // ),
  497 + // ),
  498 + // Center(
  499 + // child: Text(title,
  500 + // style: TextStyle(
  501 + // fontSize: ScreenUtil().setSp(34),
  502 + // fontWeight: FontWeight.bold,
  503 + // color: MyColours.color_353535)),
  504 + // ),
  505 + // Padding(
  506 + // padding: EdgeInsets.symmetric(
  507 + // horizontal: ScreenUtil().setWidth(60),
  508 + // vertical: ScreenUtil().setWidth(40)),
  509 + // child: GridView.builder(
  510 + // padding:
  511 + // EdgeInsets.only(top: ScreenUtil().setWidth(20)),
  512 + // shrinkWrap: true,
  513 + // cacheExtent: ScreenUtil().setWidth(0),
  514 + // itemCount: dailyList.length,
  515 + // gridDelegate:
  516 + // SliverGridDelegateWithFixedCrossAxisCount(
  517 + // crossAxisCount: 3,
  518 + // childAspectRatio: 80 / 36,
  519 + // mainAxisSpacing:
  520 + // ScreenUtil().setWidth(15 * 2),
  521 + // crossAxisSpacing:
  522 + // ScreenUtil().setWidth(38 * 2)),
  523 + // itemBuilder: (BuildContext context, int index) {
  524 + // // locationState = state;
  525 + // return CustomButton(
  526 + // onTap: () async {
  527 + // // state(() {
  528 + // for (var item in dailyList) {
  529 + // item['select'] = false;
  530 + // if (item['title'] ==
  531 + // dailyList[index]['title']) {
  532 + // item['select'] = true;
  533 +
  534 + // // _homeEnterModel.isSetDate = "1";
  535 + // ddateHm = item['title'];
  536 + // }
  537 + // }
  538 +
  539 + // detailModel.notifyListeners();
  540 + // Navigator.pop(context);
  541 + // // setState(() {
  542 + // // selectPnum = value.first;
  543 + // // pnum = pnumlist[value.first];
  544 + // // });
  545 + // bool sucess = await detailModel.upReserveInfo(
  546 + // context, widget.rid,
  547 + // dateStr: ddateHm,
  548 + // ymd: detailEntity.ddateYMD);
  549 +
  550 + // if (sucess) {
  551 + // EventBus()
  552 + // .emit("refresh_tablemanager"); //刷新桌位
  553 + // bus.emit("refresh_book_list"); //刷新已预订列表
  554 + // bus.emit("refresh_detail");
  555 + // await _getReserveDetail(showCicle: false);
  556 + // }
  557 + // },
  558 + // width: 80,
  559 + // height: 36,
  560 + // dateText: dailyList[index]['title'].toString(),
  561 + // dayText: '',
  562 + // isSelect: dailyList[index]['select'],
  563 + // );
  564 + // }))
  565 + // ],
  566 + // ),
  567 + // ));
  568 + // });
  569 + // });
  570 + // }
  571 +
  572 + _customerInfoWidget() {
  573 + return Container(
  574 + padding: EdgeInsets.symmetric(
  575 + horizontal: ScreenUtil().setWidth(48),
  576 + ),
  577 + child: Column(
  578 + children: [
  579 + // VEmptyView(30),
  580 + // MyDivider(double.infinity,
  581 + // ScreenUtil().setWidth(2),
  582 + // color:
  583 + // MyColours.color_efefef),
  584 + //电话
  585 + Container(
  586 + height: ScreenUtil().setWidth(68),
  587 + margin: EdgeInsets.only(top: ScreenUtil().setWidth(44)),
  588 + padding:
  589 + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(16)),
  590 + decoration: BoxDecoration(
  591 + borderRadius:
  592 + BorderRadius.circular(ScreenUtil().setWidth(12)),
  593 + // color: Colors.red,
  594 + border: Border.all(
  595 + width: ScreenUtil().setWidth(2),
  596 + color: MyColours.color_DBDBDB)),
  597 + child: Row(
  598 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  599 + crossAxisAlignment: CrossAxisAlignment.center,
  600 + children: [
  601 + Expanded(
  602 + child: TextField(
  603 + maxLines: 1,
  604 + //输入文本的样式
  605 + style: TextStyle(
  606 + fontSize: ScreenUtil().setSp(30),
  607 + color: MyColours.color_353535),
  608 + controller: _baseIndoProvider.phoneController,
  609 + focusNode: _phoneNode,
  610 + // textAlignVertical: TextAlignVertical.top,
  611 + decoration: InputDecoration(
  612 + hintText: "预留电话",
  613 + hintStyle: TextStyle(
  614 + color: MyColours.color_999999,
  615 + fontSize: ScreenUtil().setSp(28),
  616 + ),
  617 + contentPadding: EdgeInsets.zero,
  618 + border: OutlineInputBorder(borderSide: BorderSide.none),
  619 + ),
  620 + onChanged: (value) {
  621 + if (value.isEmpty || value.length > 11) {
  622 + //内容为空,或 超过11位
  623 + setState(() {
  624 + _baseIndoProvider.userHistorys.clear();
  625 + });
  626 + return;
  627 + }
  628 + Map<String, String> params = {
  629 + "keywords": value,
  630 + "sid": Provider.of<UserModel>(context, listen: false)
  631 + .user
  632 + .sellerid,
  633 + };
  634 + _baseIndoProvider.getUserHistorys(context, params);
  635 + },
  636 + onEditingComplete: () {
  637 + _phoneNode.unfocus();
  638 + },
  639 + onTap: () {
  640 + setState(() {
  641 + showPhoneHistory = true;
  642 + });
  643 + // Future.delayed(Duration(milliseconds: 300), () {
  644 + // _controller.jumpTo(_controller.position.maxScrollExtent);
  645 + // });
  646 + },
  647 + keyboardType: TextInputType.number,
  648 + )),
  649 + InkWell(
  650 + onTap: () {
  651 + _openAddressBook();
  652 + },
  653 + child: Container(
  654 + width: ScreenUtil().setWidth(84) * 3,
  655 + height: ScreenUtil().setWidth(48),
  656 + alignment: Alignment.centerRight,
  657 + child: Text('一键录入',
  658 + style: TextStyle(
  659 + color: MyColours.color_515151,
  660 + fontSize: ScreenUtil().setSp(28),
  661 + )),
  662 + ),
  663 + ),
  664 + ],
  665 + )),
  666 + Stack(
  667 + clipBehavior: Clip.none,
  668 + children: [
  669 + Column(
  670 + children: [
  671 + //电话
  672 + Container(
  673 + margin: EdgeInsets.only(top: ScreenUtil().setWidth(40)),
  674 + height: ScreenUtil().setWidth(68),
  675 + padding: EdgeInsets.symmetric(
  676 + horizontal: ScreenUtil().setWidth(16)),
  677 + decoration: BoxDecoration(
  678 + borderRadius: BorderRadius.circular(
  679 + ScreenUtil().setWidth(12)),
  680 + // color: Colors.red,
  681 + border: Border.all(
  682 + width: ScreenUtil().setWidth(2),
  683 + color: MyColours.color_DBDBDB)),
  684 + child: Row(
  685 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  686 + crossAxisAlignment: CrossAxisAlignment.center,
  687 + children: [
  688 + Expanded(
  689 + child: TextField(
  690 + maxLines: 1,
  691 +
  692 + //输入文本的样式
  693 + style: TextStyle(
  694 + fontSize: ScreenUtil().setSp(30),
  695 + color: MyColours.color_353535),
  696 + controller: _baseIndoProvider.nameController,
  697 + focusNode: _nameNode,
  698 + // textAlignVertical: TextAlignVertical.top,
  699 + decoration: InputDecoration(
  700 + hintText: "顾客姓名",
  701 + hintStyle: TextStyle(
  702 + color: MyColours.color_999999,
  703 + fontSize: ScreenUtil().setSp(28),
  704 + ),
  705 + // contentPadding:
  706 + // EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
  707 + // border: InputBorder.none,
  708 + contentPadding: EdgeInsets.zero,
  709 + border: OutlineInputBorder(
  710 + borderSide: BorderSide.none),
  711 + ),
  712 + onChanged: (value) {
  713 + print('ggg');
  714 +
  715 + nameStr = value;
  716 + },
  717 + onEditingComplete: () {
  718 + print('fff');
  719 + _nameNode.unfocus();
  720 + // _homeEnterModel.nameController.text =
  721 + // nameStr + _nameSuffix();
  722 + _addNameSuffix(nameStr, _nameSuffix());
  723 + },
  724 + keyboardType: TextInputType.text,
  725 + ),
  726 + ),
  727 + HEmptyView(40),
  728 + InkWell(
  729 + onTap: () {
  730 + FocusScope.of(context)
  731 + .requestFocus(FocusNode()); //隐藏键盘
  732 + List<String> list = [];
  733 + for (Map item in _baseIndoProvider.sexList) {
  734 + list.add(item['title']);
  735 + }
  736 + DialogUtil.showSelectCusmanDialog(context, list,
  737 + (value) async {
  738 + if (value != null) {
  739 + sexSelectIndex = value.first;
  740 + sexStr = list[sexSelectIndex];
  741 + setState(() {});
  742 + }
  743 + }, selecteds: [sexSelectIndex])
  744 + .then((value) {});
  745 + },
  746 + child: Row(children: [
  747 + Text(
  748 + sexStr,
  749 + style: TextStyle(
  750 + color: MyColours.color_515151,
  751 + fontSize: ScreenUtil().setSp(28),
  752 + ),
  753 + ),
  754 + Image.asset(Utils.getImgPath('quan_down_f'),
  755 + width: ScreenUtil().setWidth(28),
  756 + height: ScreenUtil().setWidth(28)),
  757 + ]),
  758 + // Row(
  759 + // children: _baseIndoProvider.sexList.map((value) {
  760 + // return _callButton(
  761 + // onPress: () {
  762 + // for (var item in _baseIndoProvider.sexList) {
  763 + // item['select'] = false;
  764 + // if (item['title'] == value['title']) {
  765 + // item['select'] = true;
  766 + // if (oldSex != item['code']) {
  767 + // if (nameStr != null && nameStr != '') {
  768 + // _addNameSuffix(nameStr, item['title']);
  769 + // }
  770 + // if (nameStr != null && nameStr != '') {
  771 + // _showConfirmWidget(needSex: true);
  772 + // }
  773 + // }
  774 + // }
  775 + // }
  776 + // _baseIndoProvider.notifyListeners();
  777 + // },
  778 + // content: value['title'],
  779 + // hasLeftBorder: value['hasLeftBorder'],
  780 + // isSelect: value['select']);
  781 + // }).toList()),
  782 + )
  783 + ],
  784 + )),
  785 + Container(
  786 + margin: EdgeInsets.only(top: ScreenUtil().setWidth(40)),
  787 + height: ScreenUtil().setWidth(68),
  788 + padding: EdgeInsets.symmetric(
  789 + horizontal: ScreenUtil().setWidth(16)),
  790 + decoration: BoxDecoration(
  791 + borderRadius:
  792 + BorderRadius.circular(ScreenUtil().setWidth(12)),
  793 + // color: Colors.red,
  794 + border: Border.all(
  795 + width: ScreenUtil().setWidth(2),
  796 + color: MyColours.color_DBDBDB)),
  797 + child: Row(
  798 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  799 + children: [
  800 + Row(children: [
  801 + Text(
  802 + '就餐人数:',
  803 + style: TextStyle(
  804 + // letterSpacing: ScreenUtil().setWidth(1.8 * 2),
  805 + color: MyColours.color_515151,
  806 + fontSize: ScreenUtil().setSp(28)),
  807 + ),
  808 + InkWell(
  809 + onTap: () {
  810 + FocusScope.of(context)
  811 + .requestFocus(FocusNode()); //隐藏键盘
  812 + DialogUtil.showSelectCusmanDialog(
  813 + context, personNumList, (value) async {
  814 + if (value != null) {
  815 + actualPnumIndex = value.first;
  816 + actualPnum = personNumList[value.first];
  817 + setState(() {});
  818 + }
  819 + },
  820 + selecteds: actualPnumIndex == null
  821 + ? []
  822 + : [actualPnumIndex])
  823 + .then((value) {});
  824 + },
  825 + child: Expanded(
  826 + child: Text(actualPnum,
  827 + style: TextStyle(
  828 + fontSize: ScreenUtil().setSp(28),
  829 + color: actualPnum == '选填'
  830 + ? MyColours.color_999999
  831 + : MyColours.color_515151)),
  832 + ),
  833 +
  834 + // HEmptyView(6),
  835 + // Image.asset(
  836 + // Utils.getImgPath(
  837 + // false ? 'c_arrow_up' : 'c_arrow_down'),
  838 + // width: ScreenUtil().setWidth(28),
  839 + // // height: ScreenUtil().setWidth(10),
  840 + // ),
  841 + )
  842 + ]),
  843 + MyDivider(ScreenUtil().setWidth(2),
  844 + ScreenUtil().setWidth(46),
  845 + color: MyColours.color_BFC4D4),
  846 + Row(
  847 + mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  848 + children: [
  849 + Text(
  850 + '就餐时间:',
  851 + style: TextStyle(
  852 + // letterSpacing: ScreenUtil().setWidth(1.8 * 2),
  853 + color: MyColours.color_333333,
  854 + fontSize: ScreenUtil().setSp(26)),
  855 + ),
  856 + InkWell(
  857 + onTap: () {
  858 + FocusScope.of(context)
  859 + .requestFocus(FocusNode()); //隐藏键盘
  860 + DialogUtil.showSelectCusmanDialog(
  861 + context, tableManagerModel.dailyList,
  862 + (value) async {
  863 + if (value != null) {
  864 + ddateIndex = value.first;
  865 + ddateHm = tableManagerModel
  866 + .dailyList[value.first];
  867 + setState(() {});
  868 + }
  869 + },
  870 + selecteds: ddateIndex == null
  871 + ? []
  872 + : [ddateIndex])
  873 + .then((value) {});
  874 + },
  875 + child: Expanded(
  876 + child: Text(ddateHm,
  877 + style: TextStyle(
  878 + fontSize: ScreenUtil().setSp(28),
  879 + color: ddateHm == '选填'
  880 + ? MyColours.color_999999
  881 + : MyColours.color_515151)),
  882 + ),
  883 +
  884 + // HEmptyView(6),
  885 + // Image.asset(
  886 + // Utils.getImgPath(
  887 + // false ? 'c_arrow_up' : 'c_arrow_down'),
  888 + // width: ScreenUtil().setWidth(28),
  889 + // // height: ScreenUtil().setWidth(10),
  890 + // ),
  891 + ),
  892 + ],
  893 + )
  894 + ],
  895 + ),
  896 + )
  897 + ],
  898 + ),
  899 + Positioned(
  900 + top: 0,
  901 + left: 0,
  902 + child: Offstage(
  903 + offstage: !(showPhoneHistory &&
  904 + _baseIndoProvider.userHistorys.length > 0),
  905 + child: Container(
  906 + decoration: BoxDecoration(
  907 + borderRadius: BorderRadius.circular(8),
  908 + border: Border.all(color: Colors.white),
  909 + color: MyColours.color_ffffff,
  910 + // color: Colors.red,
  911 + boxShadow: [
  912 + BoxShadow(
  913 + color: MyColours.color_e5e5e5,
  914 + blurRadius: ScreenUtil().setWidth(20))
  915 + ]),
  916 + width: ScreenUtil().setWidth(440),
  917 + height: _baseIndoProvider.userHistorys.length > 1
  918 + ? ScreenUtil().setWidth(140)
  919 + : ScreenUtil().setWidth(104),
  920 + padding: EdgeInsets.symmetric(
  921 + horizontal: ScreenUtil().setWidth(30)),
  922 + child: Align(
  923 + alignment: Alignment.topCenter,
  924 + child: MediaQuery.removePadding(
  925 + context: context,
  926 + removeTop: true,
  927 + child: ListView.builder(
  928 + shrinkWrap: true,
  929 + itemBuilder: (context, index) {
  930 + return GestureDetector(
  931 + onTap: () {
  932 + setState(() {
  933 + showPhoneHistory = false;
  934 + _baseIndoProvider.phoneController
  935 + .text = _baseIndoProvider
  936 + .userHistorys[index]
  937 + .phone !=
  938 + null
  939 + ? _baseIndoProvider
  940 + .userHistorys[index].phone
  941 + : '';
  942 + // _homeEnterModel.nameController.text =
  943 + // _homeEnterModel
  944 + // .userHistorys[index].rname +
  945 + // _nameSuffix();
  946 + _addNameSuffix(
  947 + _baseIndoProvider
  948 + .userHistorys[index].rname,
  949 + _nameSuffix());
  950 + nameStr = _baseIndoProvider
  951 + .userHistorys[index].rname;
  952 + _phoneNode.unfocus();
  953 + _baseIndoProvider.userHistorys
  954 + .clear();
  955 + });
  956 + },
  957 + child: Container(
  958 + width: double.infinity,
  959 + height: ScreenUtil().setWidth(102),
  960 + decoration: BoxDecoration(
  961 + border: Border(
  962 + bottom: (index !=
  963 + (_baseIndoProvider
  964 + .userHistorys
  965 + .length -
  966 + 1) &&
  967 + _baseIndoProvider
  968 + .userHistorys
  969 + .length >
  970 + 1)
  971 + ? BorderSide(
  972 + color: MyColours
  973 + .color_e5e5e5,
  974 + width: ScreenUtil()
  975 + .setWidth(2))
  976 + : BorderSide.none)),
  977 + child: Row(
  978 + mainAxisAlignment:
  979 + MainAxisAlignment.spaceBetween,
  980 + children: [
  981 + Text(
  982 + _baseIndoProvider
  983 + .userHistorys[index]
  984 + .phone ==
  985 + null
  986 + ? ''
  987 + : _baseIndoProvider
  988 + .userHistorys[index]
  989 + .phone,
  990 + style: TextStyle(
  991 + color: MyColours.color_333333,
  992 + fontSize:
  993 + ScreenUtil().setSp(32)),
  994 + ),
  995 + Expanded(
  996 + child: Text(
  997 + _baseIndoProvider
  998 + .userHistorys[index]
  999 + .rname ==
  1000 + null
  1001 + ? ''
  1002 + : _baseIndoProvider
  1003 + .userHistorys[index]
  1004 + .rname,
  1005 + style: TextStyle(
  1006 + color: MyColours.color_333333,
  1007 + fontSize:
  1008 + ScreenUtil().setSp(32)),
  1009 + ))
  1010 + ],
  1011 + ),
  1012 + ),
  1013 + );
  1014 + },
  1015 + itemExtent: ScreenUtil().setWidth(104),
  1016 + itemCount:
  1017 + _baseIndoProvider.userHistorys.length,
  1018 + ))),
  1019 + ),
  1020 + )),
  1021 + ],
  1022 + ),
  1023 + ],
  1024 + ));
  1025 + }
  1026 +
358 ///选中的桌子widget 1027 ///选中的桌子widget
359 Widget _selectTableWidget() { 1028 Widget _selectTableWidget() {
360 return Container( 1029 return Container(
361 // constraints: BoxConstraints(maxHeight: ScreenUtil().setWidth(760)), 1030 // constraints: BoxConstraints(maxHeight: ScreenUtil().setWidth(760)),
362 // height: ScreenUtil().setWidth(400), 1031 // height: ScreenUtil().setWidth(400),
363 width: double.infinity, 1032 width: double.infinity,
364 - padding: EdgeInsets.only(  
365 - left: ScreenUtil().setWidth(40),  
366 - right: ScreenUtil().setWidth(40),  
367 - top: ScreenUtil().setWidth(15)), 1033 +
368 decoration: BoxDecoration( 1034 decoration: BoxDecoration(
369 color: MyColours.color_ffffff, 1035 color: MyColours.color_ffffff,
370 boxShadow: [ 1036 boxShadow: [
@@ -373,50 +1039,99 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -373,50 +1039,99 @@ class TableManagerPageState extends State<TableManagerPage> {
373 blurRadius: ScreenUtil().setWidth(14)) 1039 blurRadius: ScreenUtil().setWidth(14))
374 ], 1040 ],
375 borderRadius: BorderRadius.only( 1041 borderRadius: BorderRadius.only(
376 - topLeft: Radius.circular(ScreenUtil().setWidth(30)),  
377 - topRight: Radius.circular(ScreenUtil().setWidth(30)), 1042 + topLeft: Radius.circular(ScreenUtil().setWidth(24)),
  1043 + topRight: Radius.circular(ScreenUtil().setWidth(24)),
378 )), 1044 )),
379 child: Column( 1045 child: Column(
380 // mainAxisSize: MainAxisSize.min, 1046 // mainAxisSize: MainAxisSize.min,
381 mainAxisAlignment: MainAxisAlignment.start, 1047 mainAxisAlignment: MainAxisAlignment.start,
382 children: [ 1048 children: [
383 - Row(  
384 - crossAxisAlignment: CrossAxisAlignment.start,  
385 - children: [  
386 - Column(  
387 - mainAxisAlignment: MainAxisAlignment.start,  
388 - crossAxisAlignment: CrossAxisAlignment.start, 1049 + Stack(alignment: Alignment.centerRight, children: [
  1050 + Container(
  1051 + width: double.infinity,
  1052 + padding: EdgeInsets.symmetric(
  1053 + horizontal: ScreenUtil().setWidth(40),
  1054 + vertical: ScreenUtil().setSp(16),
  1055 + ),
  1056 + decoration: BoxDecoration(
  1057 + color: MyColours.color_f3f3f3,
  1058 + borderRadius: BorderRadius.only(
  1059 + topLeft: Radius.circular(ScreenUtil().setWidth(24)),
  1060 + topRight: Radius.circular(ScreenUtil().setWidth(24)),
  1061 + )),
  1062 + child: Column(
389 children: [ 1063 children: [
390 Text( 1064 Text(
391 - tableManagerModel.selectDateStr, 1065 + tableManagerModel.selectDateStr +
  1066 + ' ' +
  1067 + tableManagerModel.doltStr,
392 style: TextStyle( 1068 style: TextStyle(
393 - color: MyColours.color_333333,  
394 - fontSize: ScreenUtil().setSp(45), 1069 + color: MyColours.color_515151,
  1070 + fontSize: ScreenUtil().setSp(28),
395 fontWeight: FontWeight.bold), 1071 fontWeight: FontWeight.bold),
396 ), 1072 ),
  1073 + VEmptyView(8),
397 Text( 1074 Text(
398 tableManagerModel.selectWeekAndLunarCalendar, 1075 tableManagerModel.selectWeekAndLunarCalendar,
399 style: TextStyle( 1076 style: TextStyle(
400 - color: MyColours.color_333333,  
401 - fontSize: ScreenUtil().setSp(30)),  
402 - ), 1077 + color: MyColours.color_999999,
  1078 + fontSize: ScreenUtil().setSp(20)),
  1079 + )
403 ], 1080 ],
404 ), 1081 ),
405 - Spacer(),  
406 - Padding(  
407 - padding: EdgeInsets.only(  
408 - top: ScreenUtil().setWidth(6),  
409 - ),  
410 - child: Text(  
411 - tableManagerModel.doltStr,  
412 - style: TextStyle(  
413 - color: MyColours.color_333333,  
414 - fontSize: ScreenUtil().setSp(48),  
415 - fontWeight: FontWeight.bold),  
416 - ),  
417 - ),  
418 - ], 1082 + ),
  1083 + Positioned(
  1084 + right: ScreenUtil().setWidth(40),
  1085 + child: InkWell(
  1086 + onTap: () {},
  1087 + child: Text(
  1088 + '清空',
  1089 + style: TextStyle(
  1090 + decoration: TextDecoration.underline,
  1091 + color: MyColours.color_438E93,
  1092 + fontSize: ScreenUtil().setSp(20)),
  1093 + )))
  1094 + ]),
  1095 + Container(
  1096 + margin: EdgeInsets.only(top: ScreenUtil().setWidth(44)),
  1097 + height: ScreenUtil().setWidth(60),
  1098 + child: ListView.builder(
  1099 + padding: EdgeInsets.only(left: ScreenUtil().setWidth(48)),
  1100 + itemCount: tableManagerModel.selectTables.length,
  1101 + shrinkWrap: true,
  1102 + scrollDirection: Axis.horizontal,
  1103 + itemBuilder: (BuildContext contxt, int index) {
  1104 + t.Table table = tableManagerModel.selectTables[index];
  1105 + return Container(
  1106 + margin: EdgeInsets.only(right: ScreenUtil().setWidth(20)),
  1107 + padding: EdgeInsets.only(
  1108 + left: ScreenUtil().setWidth(16),
  1109 + right: ScreenUtil().setWidth(4),
  1110 + top: ScreenUtil().setWidth(14),
  1111 + bottom: ScreenUtil().setWidth(14)),
  1112 + decoration: BoxDecoration(
  1113 + border: Border.all(
  1114 + width: ScreenUtil().setWidth(2),
  1115 + color: MyColours.color_438E93),
  1116 + borderRadius:
  1117 + BorderRadius.circular(ScreenUtil().setWidth(8))),
  1118 + child: Row(
  1119 + children: [
  1120 + Text(
  1121 + table.name,
  1122 + style: TextStyle(
  1123 + color: MyColours.color_438E93,
  1124 + fontSize: ScreenUtil().setSp(28)),
  1125 + ),
  1126 + HEmptyView(14),
  1127 + Image.asset(Utils.getImgPath('table_m_close'),
  1128 + width: ScreenUtil().setWidth(32)),
  1129 + ],
  1130 + ),
  1131 + );
  1132 + }),
419 ), 1133 ),
  1134 + _customerInfoWidget(),
420 VEmptyView(40), 1135 VEmptyView(40),
421 Row( 1136 Row(
422 crossAxisAlignment: CrossAxisAlignment.start, 1137 crossAxisAlignment: CrossAxisAlignment.start,
@@ -830,11 +1545,13 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -830,11 +1545,13 @@ class TableManagerPageState extends State<TableManagerPage> {
830 } 1545 }
831 1546
832 ///早餐、午餐、晚餐点击方法 1547 ///早餐、午餐、晚餐点击方法
833 - _clickMorAndNoonAndNig() async { 1548 + _clickMorAndNoonAndNig(BuildContext context) async {
  1549 + ddateIndex = null;
  1550 + ddateHm = '选填';
834 tableManagerModel.selectDateStr = 1551 tableManagerModel.selectDateStr =
835 tableManagerModel.returnDayDateStr(tableManagerModel.dateTimeSelect); 1552 tableManagerModel.returnDayDateStr(tableManagerModel.dateTimeSelect);
836 tableManagerModel.selectWeekAndLunarCalendar = tableManagerModel 1553 tableManagerModel.selectWeekAndLunarCalendar = tableManagerModel
837 - .returnWeekAndLunarCalendar(tableManagerModel.dateTimeSelect); 1554 + .returnWeekAndLunarCalendar(tableManagerModel.dateTimeSelect, context);
838 await tableManagerModel.getReserveList(context, 1555 await tableManagerModel.getReserveList(context,
839 needLoading: true, showMsg: true); 1556 needLoading: true, showMsg: true);
840 } 1557 }
@@ -842,6 +1559,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -842,6 +1559,7 @@ class TableManagerPageState extends State<TableManagerPage> {
842 @override 1559 @override
843 Widget build(BuildContext context) { 1560 Widget build(BuildContext context) {
844 tableManagerModel = Provider.of<TableManagerModel>(context, listen: true); 1561 tableManagerModel = Provider.of<TableManagerModel>(context, listen: true);
  1562 + _baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true);
845 return Scaffold( 1563 return Scaffold(
846 appBar: widget.guest == null 1564 appBar: widget.guest == null
847 ? null 1565 ? null
@@ -968,7 +1686,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -968,7 +1686,7 @@ class TableManagerPageState extends State<TableManagerPage> {
968 tableManagerModel.currTimeIndex = 1; 1686 tableManagerModel.currTimeIndex = 1;
969 }); 1687 });
970 1688
971 - _clickMorAndNoonAndNig(); 1689 + _clickMorAndNoonAndNig(context);
972 }, 1690 },
973 )), 1691 )),
974 btnNum == 3 && tableManagerModel.currTimeIndex == 3 1692 btnNum == 3 && tableManagerModel.currTimeIndex == 3
@@ -1004,7 +1722,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -1004,7 +1722,7 @@ class TableManagerPageState extends State<TableManagerPage> {
1004 setState(() { 1722 setState(() {
1005 tableManagerModel.currTimeIndex = 2; 1723 tableManagerModel.currTimeIndex = 2;
1006 }); 1724 });
1007 - _clickMorAndNoonAndNig(); 1725 + _clickMorAndNoonAndNig(context);
1008 }, 1726 },
1009 )), 1727 )),
1010 btnNum == 3 && tableManagerModel.currTimeIndex == 1 1728 btnNum == 3 && tableManagerModel.currTimeIndex == 1
@@ -1038,7 +1756,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -1038,7 +1756,7 @@ class TableManagerPageState extends State<TableManagerPage> {
1038 tableManagerModel.currTimeIndex = 3; 1756 tableManagerModel.currTimeIndex = 3;
1039 }); 1757 });
1040 1758
1041 - _clickMorAndNoonAndNig(); 1759 + _clickMorAndNoonAndNig(context);
1042 }, 1760 },
1043 )), 1761 )),
1044 ), 1762 ),
@@ -63,6 +63,7 @@ class TableManagerModel with ChangeNotifier { @@ -63,6 +63,7 @@ class TableManagerModel with ChangeNotifier {
63 String doltStr = ''; 63 String doltStr = '';
64 DateTime dateTimeSelect; 64 DateTime dateTimeSelect;
65 int selectNumber; 65 int selectNumber;
  66 + List dailyList = []; // 早市对应半点钟,午市对应半点钟、晚市对应半点钟
66 67
67 //初始化时间 68 //初始化时间
68 initTime(BuildContext context) async { 69 initTime(BuildContext context) async {
@@ -134,7 +135,7 @@ class TableManagerModel with ChangeNotifier { @@ -134,7 +135,7 @@ class TableManagerModel with ChangeNotifier {
134 currTimeIndex = 3; 135 currTimeIndex = 3;
135 } 136 }
136 selectDateStr = returnDayDateStr(dateTime); 137 selectDateStr = returnDayDateStr(dateTime);
137 - selectWeekAndLunarCalendar = returnWeekAndLunarCalendar(dateTime); 138 + selectWeekAndLunarCalendar = returnWeekAndLunarCalendar(dateTime, context);
138 List temp = await getTableList(context); 139 List temp = await getTableList(context);
139 if (temp.length > 0) { 140 if (temp.length > 0) {
140 getReserveList(context); 141 getReserveList(context);
@@ -145,6 +146,33 @@ class TableManagerModel with ChangeNotifier { @@ -145,6 +146,33 @@ class TableManagerModel with ChangeNotifier {
145 } 146 }
146 } 147 }
147 148
  149 + ///初始化时间 半个小时
  150 + _initTimeDdate(int dateSolt, BuildContext context) {
  151 + UserModel userModel = Provider.of<UserModel>(context, listen: false);
  152 + String str = '';
  153 + if (dateSolt == 1) {
  154 + //早餐
  155 + str = userModel.user.morning.isEmpty
  156 + ? "00:00-00:00"
  157 + : userModel.user.morning;
  158 + userModel.user.morning.isEmpty
  159 + ? dailyList = []
  160 + : dailyList = _getHourAndMinute(str, 1);
  161 + } else if (dateSolt == 2) {
  162 + //午餐
  163 + str = userModel.user.noon.isEmpty ? "00:00-00:00" : userModel.user.noon;
  164 + userModel.user.noon.isEmpty
  165 + ? dailyList = []
  166 + : dailyList = _getHourAndMinute(str, 2);
  167 + } else if (dateSolt == 3) {
  168 + //晚餐
  169 + str = userModel.user.night.isEmpty ? "00:00-00:00" : userModel.user.night;
  170 + userModel.user.night.isEmpty
  171 + ? dailyList = []
  172 + : dailyList = _getHourAndMinute(str, 3);
  173 + }
  174 + }
  175 +
148 getCurrDdateStr() { 176 getCurrDdateStr() {
149 String currSelectTime = ""; 177 String currSelectTime = "";
150 int timeMillsNow = DateTime.now().millisecondsSinceEpoch; 178 int timeMillsNow = DateTime.now().millisecondsSinceEpoch;
@@ -713,7 +741,7 @@ class TableManagerModel with ChangeNotifier { @@ -713,7 +741,7 @@ class TableManagerModel with ChangeNotifier {
713 dateTimeSelect = day; 741 dateTimeSelect = day;
714 dateText = _returnDate(day); 742 dateText = _returnDate(day);
715 selectDateStr = returnDayDateStr(day); 743 selectDateStr = returnDayDateStr(day);
716 - selectWeekAndLunarCalendar = returnWeekAndLunarCalendar(day); 744 + selectWeekAndLunarCalendar = returnWeekAndLunarCalendar(day, context);
717 dateTime = day; 745 dateTime = day;
718 getReserveList(context, needLoading: true); 746 getReserveList(context, needLoading: true);
719 } 747 }
@@ -725,7 +753,7 @@ class TableManagerModel with ChangeNotifier { @@ -725,7 +753,7 @@ class TableManagerModel with ChangeNotifier {
725 return date; 753 return date;
726 } 754 }
727 755
728 - _getDoltStr() { 756 + _getDoltStr(BuildContext context) {
729 if (currTimeIndex == 1) { 757 if (currTimeIndex == 1) {
730 doltStr = '早餐'; 758 doltStr = '早餐';
731 } else if (currTimeIndex == 2) { 759 } else if (currTimeIndex == 2) {
@@ -733,6 +761,7 @@ class TableManagerModel with ChangeNotifier { @@ -733,6 +761,7 @@ class TableManagerModel with ChangeNotifier {
733 } else if (currTimeIndex == 3) { 761 } else if (currTimeIndex == 3) {
734 doltStr = '晚餐'; 762 doltStr = '晚餐';
735 } 763 }
  764 + _initTimeDdate(currTimeIndex, context);
736 } 765 }
737 766
738 // String returnDayDateWeekStr(DateTime day, int index) { 767 // String returnDayDateWeekStr(DateTime day, int index) {
@@ -751,10 +780,11 @@ class TableManagerModel with ChangeNotifier { @@ -751,10 +780,11 @@ class TableManagerModel with ChangeNotifier {
751 String returnDayDateStr(DateTime day) { 780 String returnDayDateStr(DateTime day) {
752 String date = ''; 781 String date = '';
753 DateTime dateNow = DateTime.now(); 782 DateTime dateNow = DateTime.now();
754 - String ymd = "${day.year}-" + 783 + String ymd = "${day.year}年" +
755 Utils.addZeroNumber(day.month) + 784 Utils.addZeroNumber(day.month) +
756 - "-" +  
757 - Utils.addZeroNumber(day.day); 785 + "月" +
  786 + Utils.addZeroNumber(day.day) +
  787 + "日";
758 788
759 if (Utils.isOneDay(day, dateNow)) { 789 if (Utils.isOneDay(day, dateNow)) {
760 date += "今天 "; 790 date += "今天 ";
@@ -788,10 +818,10 @@ class TableManagerModel with ChangeNotifier { @@ -788,10 +818,10 @@ class TableManagerModel with ChangeNotifier {
788 return date; 818 return date;
789 } 819 }
790 820
791 - String returnWeekAndLunarCalendar(DateTime day) {  
792 - String date = "星期${Utils.formatWeekDayNum(day.weekday)} 农历 "; 821 + String returnWeekAndLunarCalendar(DateTime day, BuildContext context) {
  822 + String date = "星期${Utils.formatWeekDayNum(day.weekday)} ";
793 date += Utils.lunarCalendarHolidays(day); 823 date += Utils.lunarCalendarHolidays(day);
794 - _getDoltStr(); 824 + _getDoltStr(context);
795 return date; 825 return date;
796 } 826 }
797 827
@@ -1245,9 +1245,11 @@ var tableManagerPageHandle = new Handler( @@ -1245,9 +1245,11 @@ var tableManagerPageHandle = new Handler(
1245 // UserHistoryEntity userHistoryEntity = UserHistoryEntity.fromJson(json.decode( 1245 // UserHistoryEntity userHistoryEntity = UserHistoryEntity.fromJson(json.decode(
1246 // FluroConvertUtils.fluroCnParamsDecode( 1246 // FluroConvertUtils.fluroCnParamsDecode(
1247 // params["userHistoryEntity"].first))); 1247 // params["userHistoryEntity"].first)));
1248 - return ChangeNotifierProvider<TableManagerModel>(  
1249 - create: (_) => TableManagerModel(),  
1250 - child: TableManagerPage(guest: guest), 1248 + return ChangeNotifierProvider<BaseIndoProvider>(
  1249 + create: (_) => BaseIndoProvider(),
  1250 + child: ChangeNotifierProvider<TableManagerModel>(
  1251 + create: (_) => TableManagerModel(),
  1252 + child: TableManagerPage(guest: guest)),
1251 ); 1253 );
1252 }); 1254 });
1253 1255
@@ -151,6 +151,7 @@ dependencies: @@ -151,6 +151,7 @@ dependencies:
151 # flutter_downloader: ^1.7.1 151 # flutter_downloader: ^1.7.1
152 # open_file: ^3.2.1 152 # open_file: ^3.2.1
153 153
  154 +
154 webview_flutter: 155 webview_flutter:
155 path: library/webview_flutter-2.0.13-copy_inappwebview_select_file_20210930 156 path: library/webview_flutter-2.0.13-copy_inappwebview_select_file_20210930
156 sendsms: 157 sendsms:
@@ -161,6 +162,7 @@ dependencies: @@ -161,6 +162,7 @@ dependencies:
161 162
162 flutter_ex_widget: ^0.0.7 163 flutter_ex_widget: ^0.0.7
163 164
  165 +
164 166
165 167
166 168