Commit 36c7b48311cf63f9bdc8ee9faed550b9c17fd68e

Authored by wdn127929
1 parent fb01c7e9

预订安排

@@ -75,7 +75,7 @@ class InvicationPageState extends State<InvicationPage> @@ -75,7 +75,7 @@ class InvicationPageState extends State<InvicationPage>
75 List<String> couponsCan = []; //优惠券弹框数据 75 List<String> couponsCan = []; //优惠券弹框数据
76 76
77 final GlobalKey globalKey = GlobalKey(); 77 final GlobalKey globalKey = GlobalKey();
78 - String reserverPhone; 78 + String reserverPhone; //联系人保存成功后的值
79 79
80 String nameStr; 80 String nameStr;
81 FocusNode _nameNode = FocusNode(); 81 FocusNode _nameNode = FocusNode();
@@ -89,7 +89,6 @@ class InvicationPageState extends State<InvicationPage> @@ -89,7 +89,6 @@ class InvicationPageState extends State<InvicationPage>
89 List<Map<String, String>> tableInfo = []; //桌位信息 89 List<Map<String, String>> tableInfo = []; //桌位信息
90 String ddate; 90 String ddate;
91 String ddateStr; 91 String ddateStr;
92 - String phoneWidget;  
93 String dateSolt; 92 String dateSolt;
94 String tid; 93 String tid;
95 String nameWidget; 94 String nameWidget;
@@ -101,12 +100,15 @@ class InvicationPageState extends State<InvicationPage> @@ -101,12 +100,15 @@ class InvicationPageState extends State<InvicationPage>
101 List dailyList = []; // 早市对应半点钟,午市对应半点钟、晚市对应半点钟 100 List dailyList = []; // 早市对应半点钟,午市对应半点钟、晚市对应半点钟
102 String ddateHm = ''; 101 String ddateHm = '';
103 String oldName; 102 String oldName;
104 - String oldPhone; 103 + String oldPhone; //联系人保存之前的值
105 String oldSex; 104 String oldSex;
106 bool needBack = false; 105 bool needBack = false;
107 bool needBlack = false; 106 bool needBlack = false;
108 bool needHistory = false; 107 bool needHistory = false;
109 String youhui = '选择优惠'; 108 String youhui = '选择优惠';
  109 + ScrollController scrollController = ScrollController();
  110 + final GlobalKey botGlobalKey = GlobalKey();
  111 +
110 @override 112 @override
111 void initState() { 113 void initState() {
112 super.initState(); 114 super.initState();
@@ -128,6 +130,7 @@ class InvicationPageState extends State<InvicationPage> @@ -128,6 +130,7 @@ class InvicationPageState extends State<InvicationPage>
128 _phoneNode.addListener(() { 130 _phoneNode.addListener(() {
129 if (_phoneNode.hasFocus) { 131 if (_phoneNode.hasFocus) {
130 showOverlay(context); 132 showOverlay(context);
  133 + Scrollable.ensureVisible(botGlobalKey.currentContext);
131 } else { 134 } else {
132 if (!needBack && !needBlack && !needHistory && !_nameNode.hasFocus) { 135 if (!needBack && !needBlack && !needHistory && !_nameNode.hasFocus) {
133 _showConfirmWidget(); 136 _showConfirmWidget();
@@ -535,9 +538,20 @@ class InvicationPageState extends State<InvicationPage> @@ -535,9 +538,20 @@ class InvicationPageState extends State<InvicationPage>
535 bool sucess = await detailModel.upReserveInfo(context, widget.rid, 538 bool sucess = await detailModel.upReserveInfo(context, widget.rid,
536 name: name, sex: sex, phone: phone); 539 name: name, sex: sex, phone: phone);
537 if (sucess) { 540 if (sucess) {
  541 + reserverPhone = phone;
  542 + oldPhone = phone;
  543 + oldName = name;
  544 + oldSex = sex;
  545 +
538 EventBus().emit("refresh_tablemanager"); //刷新桌位 546 EventBus().emit("refresh_tablemanager"); //刷新桌位
539 bus.emit("refresh_book_list"); //刷新已预订列表 547 bus.emit("refresh_book_list"); //刷新已预订列表
540 bus.emit("refresh_detail"); 548 bus.emit("refresh_detail");
  549 + } else {
  550 + reserverPhone = oldPhone;
  551 + _baseIndoProvider.phoneController.text = oldPhone;
  552 + // oldName = nameStr;
  553 + // reserverPhone = oldPhone;
  554 + // sex = oldSex;
541 } 555 }
542 } 556 }
543 557
@@ -579,14 +593,13 @@ class InvicationPageState extends State<InvicationPage> @@ -579,14 +593,13 @@ class InvicationPageState extends State<InvicationPage>
579 593
580 ddate = detailEntity.ddate; 594 ddate = detailEntity.ddate;
581 ddateStr = detailEntity.ddateStr; 595 ddateStr = detailEntity.ddateStr;
582 - phoneWidget = detailEntity.phone;  
583 - reserverPhone = phoneWidget; 596 + reserverPhone = detailEntity.phone;
584 _baseIndoProvider.phoneController.text = reserverPhone; 597 _baseIndoProvider.phoneController.text = reserverPhone;
585 dateSolt = detailEntity.ddate_solt; 598 dateSolt = detailEntity.ddate_solt;
586 nameWidget = detailEntity.rname == null ? '' : detailEntity.rname; 599 nameWidget = detailEntity.rname == null ? '' : detailEntity.rname;
587 sex = detailEntity.sex == null ? '' : detailEntity.sex; 600 sex = detailEntity.sex == null ? '' : detailEntity.sex;
588 oldName = nameWidget; 601 oldName = nameWidget;
589 - oldPhone = phoneWidget; 602 + oldPhone = reserverPhone;
590 oldSex = sex; 603 oldSex = sex;
591 if (nameWidget != '' && nameWidget != null && sex != '' && sex != null) { 604 if (nameWidget != '' && nameWidget != null && sex != '' && sex != null) {
592 nameStr = nameWidget; 605 nameStr = nameWidget;
@@ -1608,6 +1621,7 @@ class InvicationPageState extends State<InvicationPage> @@ -1608,6 +1621,7 @@ class InvicationPageState extends State<InvicationPage>
1608 ], 1621 ],
1609 ), 1622 ),
1610 Stack( 1623 Stack(
  1624 + clipBehavior: Clip.none,
1611 children: [ 1625 children: [
1612 Column( 1626 Column(
1613 children: [ 1627 children: [
@@ -1651,14 +1665,7 @@ class InvicationPageState extends State<InvicationPage> @@ -1651,14 +1665,7 @@ class InvicationPageState extends State<InvicationPage>
1651 onChanged: (value) { 1665 onChanged: (value) {
1652 print('ggg'); 1666 print('ggg');
1653 1667
1654 - if (value.endsWith('先生') ||  
1655 - value.endsWith('女士') ||  
1656 - value.endsWith('公司')) {  
1657 - nameStr = value.substring(  
1658 - 0, value.length - 2);  
1659 - } else {  
1660 - nameStr = value;  
1661 - } 1668 + nameStr = value;
1662 }, 1669 },
1663 onEditingComplete: () { 1670 onEditingComplete: () {
1664 print('fff'); 1671 print('fff');
@@ -1716,6 +1723,7 @@ class InvicationPageState extends State<InvicationPage> @@ -1716,6 +1723,7 @@ class InvicationPageState extends State<InvicationPage>
1716 borderRadius: BorderRadius.circular(8), 1723 borderRadius: BorderRadius.circular(8),
1717 border: Border.all(color: Colors.white), 1724 border: Border.all(color: Colors.white),
1718 color: MyColours.color_ffffff, 1725 color: MyColours.color_ffffff,
  1726 + // color: Colors.red,
1719 boxShadow: [ 1727 boxShadow: [
1720 BoxShadow( 1728 BoxShadow(
1721 color: MyColours.color_e5e5e5, 1729 color: MyColours.color_e5e5e5,
@@ -1723,7 +1731,7 @@ class InvicationPageState extends State<InvicationPage> @@ -1723,7 +1731,7 @@ class InvicationPageState extends State<InvicationPage>
1723 ]), 1731 ]),
1724 width: ScreenUtil().setWidth(440), 1732 width: ScreenUtil().setWidth(440),
1725 height: _baseIndoProvider.userHistorys.length > 1 1733 height: _baseIndoProvider.userHistorys.length > 1
1726 - ? ScreenUtil().setWidth(260) 1734 + ? ScreenUtil().setWidth(140)
1727 : ScreenUtil().setWidth(104), 1735 : ScreenUtil().setWidth(104),
1728 padding: EdgeInsets.symmetric( 1736 padding: EdgeInsets.symmetric(
1729 horizontal: ScreenUtil().setWidth(30)), 1737 horizontal: ScreenUtil().setWidth(30)),
@@ -2407,17 +2415,27 @@ class InvicationPageState extends State<InvicationPage> @@ -2407,17 +2415,27 @@ class InvicationPageState extends State<InvicationPage>
2407 children: [ 2415 children: [
2408 Expanded( 2416 Expanded(
2409 child: SingleChildScrollView( 2417 child: SingleChildScrollView(
  2418 + controller: scrollController,
  2419 + scrollDirection: Axis.vertical,
  2420 + //true 滑动到底部
  2421 + padding: EdgeInsets.all(0.0),
  2422 + reverse:
  2423 + _phoneNode.hasFocus ? true : false,
2410 child: Column( 2424 child: Column(
2411 - children: [  
2412 - VEmptyView(40),  
2413 - _managerWidget(),  
2414 - VEmptyView(50),  
2415 - _orderInfoWidget(),  
2416 - VEmptyView(30),  
2417 - _couponWidget(),  
2418 - VEmptyView(20),  
2419 - ],  
2420 - ))), 2425 + children: [
  2426 + VEmptyView(40),
  2427 + _managerWidget(),
  2428 + VEmptyView(50),
  2429 + _orderInfoWidget(),
  2430 + VEmptyView(30),
  2431 + _couponWidget(),
  2432 + VEmptyView(20),
  2433 + Container(
  2434 + key: botGlobalKey,
  2435 + height:
  2436 + ScreenUtil().setWidth(20))
  2437 + ],
  2438 + ))),
2421 _btnWidget(), 2439 _btnWidget(),
2422 ], 2440 ],
2423 ), 2441 ),