Commit 42e5510b6254db5572021880a2182326ed2ada41

Authored by wdn127929
1 parent 8c0d8f44

电话

@@ -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: [
@@ -1709,6 +1723,7 @@ class InvicationPageState extends State<InvicationPage> @@ -1709,6 +1723,7 @@ class InvicationPageState extends State<InvicationPage>
1709 borderRadius: BorderRadius.circular(8), 1723 borderRadius: BorderRadius.circular(8),
1710 border: Border.all(color: Colors.white), 1724 border: Border.all(color: Colors.white),
1711 color: MyColours.color_ffffff, 1725 color: MyColours.color_ffffff,
  1726 + // color: Colors.red,
1712 boxShadow: [ 1727 boxShadow: [
1713 BoxShadow( 1728 BoxShadow(
1714 color: MyColours.color_e5e5e5, 1729 color: MyColours.color_e5e5e5,
@@ -1716,7 +1731,7 @@ class InvicationPageState extends State<InvicationPage> @@ -1716,7 +1731,7 @@ class InvicationPageState extends State<InvicationPage>
1716 ]), 1731 ]),
1717 width: ScreenUtil().setWidth(440), 1732 width: ScreenUtil().setWidth(440),
1718 height: _baseIndoProvider.userHistorys.length > 1 1733 height: _baseIndoProvider.userHistorys.length > 1
1719 - ? ScreenUtil().setWidth(260) 1734 + ? ScreenUtil().setWidth(140)
1720 : ScreenUtil().setWidth(104), 1735 : ScreenUtil().setWidth(104),
1721 padding: EdgeInsets.symmetric( 1736 padding: EdgeInsets.symmetric(
1722 horizontal: ScreenUtil().setWidth(30)), 1737 horizontal: ScreenUtil().setWidth(30)),
@@ -2400,17 +2415,27 @@ class InvicationPageState extends State<InvicationPage> @@ -2400,17 +2415,27 @@ class InvicationPageState extends State<InvicationPage>
2400 children: [ 2415 children: [
2401 Expanded( 2416 Expanded(
2402 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,
2403 child: Column( 2424 child: Column(
2404 - children: [  
2405 - VEmptyView(40),  
2406 - _managerWidget(),  
2407 - VEmptyView(50),  
2408 - _orderInfoWidget(),  
2409 - VEmptyView(30),  
2410 - _couponWidget(),  
2411 - VEmptyView(20),  
2412 - ],  
2413 - ))), 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 + ))),
2414 _btnWidget(), 2439 _btnWidget(),
2415 ], 2440 ],
2416 ), 2441 ),