Commit 9555c583d48f477ea64dafa6c24b9b352daffe68

Authored by wdn127929
1 parent 0d098603

历史手机号高度变大,增加滚动条

@@ -15,6 +15,7 @@ import 'package:one_key/widgets/v_empty_view.dart'; @@ -15,6 +15,7 @@ import 'package:one_key/widgets/v_empty_view.dart';
15 import 'package:permission_handler/permission_handler.dart'; 15 import 'package:permission_handler/permission_handler.dart';
16 import 'package:provider/provider.dart'; 16 import 'package:provider/provider.dart';
17 17
  18 +import '../../utils/screen_util.dart';
18 import '../../widgets/special_text/my_extended_text_selection_controls.dart'; 19 import '../../widgets/special_text/my_extended_text_selection_controls.dart';
19 20
20 /** 21 /**
@@ -43,6 +44,8 @@ class _EditReserverPageState extends State<EditReserverPage> { @@ -43,6 +44,8 @@ class _EditReserverPageState extends State<EditReserverPage> {
43 MyTextSelectionControls _myExtendedMaterialTextSelectionControls = 44 MyTextSelectionControls _myExtendedMaterialTextSelectionControls =
44 MyTextSelectionControls(); 45 MyTextSelectionControls();
45 46
  47 + ScrollController _scrollCrl = ScrollController();
  48 +
46 @override 49 @override
47 void initState() { 50 void initState() {
48 super.initState(); 51 super.initState();
@@ -195,9 +198,16 @@ class _EditReserverPageState extends State<EditReserverPage> { @@ -195,9 +198,16 @@ class _EditReserverPageState extends State<EditReserverPage> {
195 ), 198 ),
196 body: Container( 199 body: Container(
197 color: MyColours.color_ffffff, 200 color: MyColours.color_ffffff,
  201 + // color: Colors.red,
198 child: InkWell( 202 child: InkWell(
199 onTap: () { 203 onTap: () {
200 FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 204 FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  205 + if (showPhoneHistory) {
  206 + setState(() {
  207 + showPhoneHistory = false;
  208 + detailModel.userHistorys.clear();
  209 + });
  210 + }
201 }, 211 },
202 child: Padding( 212 child: Padding(
203 padding: EdgeInsets.symmetric( 213 padding: EdgeInsets.symmetric(
@@ -344,6 +354,9 @@ class _EditReserverPageState extends State<EditReserverPage> { @@ -344,6 +354,9 @@ class _EditReserverPageState extends State<EditReserverPage> {
344 }); 354 });
345 return; 355 return;
346 } 356 }
  357 + setState(() {
  358 + showPhoneHistory = true;
  359 + });
347 Map<String, String> params = { 360 Map<String, String> params = {
348 "keywords": value, 361 "keywords": value,
349 "sid": Provider.of<UserModel>(context, 362 "sid": Provider.of<UserModel>(context,
@@ -575,10 +588,13 @@ class _EditReserverPageState extends State<EditReserverPage> { @@ -575,10 +588,13 @@ class _EditReserverPageState extends State<EditReserverPage> {
575 color: MyColours.color_e5e5e5, 588 color: MyColours.color_e5e5e5,
576 blurRadius: ScreenUtil().setWidth(20)) 589 blurRadius: ScreenUtil().setWidth(20))
577 ]), 590 ]),
578 - width: ScreenUtil().setWidth(440),  
579 - height: detailModel.userHistorys.length > 1  
580 - ? ScreenUtil().setWidth(260)  
581 - : ScreenUtil().setWidth(104), 591 + width: ScreenUtil().screenWidth - w(60),
  592 + // width: ScreenUtil().setWidth(350),
  593 + constraints: BoxConstraints(maxHeight: w(270)),
  594 + // width: ScreenUtil().setWidth(440),
  595 + // height: detailModel.userHistorys.length > 1
  596 + // ? ScreenUtil().setWidth(260)
  597 + // : ScreenUtil().setWidth(104),
582 padding: EdgeInsets.symmetric( 598 padding: EdgeInsets.symmetric(
583 horizontal: ScreenUtil().setWidth(30)), 599 horizontal: ScreenUtil().setWidth(30)),
584 child: Align( 600 child: Align(
@@ -586,108 +602,122 @@ class _EditReserverPageState extends State<EditReserverPage> { @@ -586,108 +602,122 @@ class _EditReserverPageState extends State<EditReserverPage> {
586 child: MediaQuery.removePadding( 602 child: MediaQuery.removePadding(
587 context: context, 603 context: context,
588 removeTop: true, 604 removeTop: true,
589 - child: ListView.builder(  
590 - shrinkWrap: true,  
591 - itemBuilder: (context, index) {  
592 - return GestureDetector(  
593 - onTap: () {  
594 - setState(() {  
595 - showPhoneHistory = false;  
596 - detailModel.phoneController  
597 - .text = detailModel 605 + child: Scrollbar(
  606 + isAlwaysShown: true, //设置滚动条常亮
  607 + controller:
  608 + _scrollCrl, //必须设置一个controller
  609 +
  610 + ///添加进度条
  611 + child: ListView.builder(
  612 + shrinkWrap: true,
  613 + controller: _scrollCrl,
  614 + itemBuilder: (context, index) {
  615 + return GestureDetector(
  616 + onTap: () {
  617 + setState(() {
  618 + showPhoneHistory = false;
  619 + detailModel.phoneController
  620 + .text = detailModel
  621 + .userHistorys[
  622 + index]
  623 + .phone !=
  624 + null
  625 + ? detailModel
598 .userHistorys[index] 626 .userHistorys[index]
599 - .phone !=  
600 - null  
601 - ? detailModel  
602 - .userHistorys[index]  
603 - .phone  
604 - : '';  
605 - // _homeEnterModel.nameController.text =  
606 - // _homeEnterModel  
607 - // .userHistorys[index].rname +  
608 - // _nameSuffix();  
609 - _addNameSuffix(  
610 - detailModel 627 + .phone
  628 + : '';
  629 + // _homeEnterModel.nameController.text =
  630 + // _homeEnterModel
  631 + // .userHistorys[index].rname +
  632 + // _nameSuffix();
  633 + _addNameSuffix(
  634 + detailModel
  635 + .userHistorys[index]
  636 + .rname,
  637 + _nameSuffix());
  638 + nameStr = detailModel
611 .userHistorys[index] 639 .userHistorys[index]
612 - .rname,  
613 - _nameSuffix());  
614 - nameStr = detailModel  
615 - .userHistorys[index].rname;  
616 - _phoneNode.unfocus();  
617 - detailModel.userHistorys  
618 - .clear();  
619 - });  
620 - },  
621 - child: Container(  
622 - width: double.infinity,  
623 - height:  
624 - ScreenUtil().setWidth(102),  
625 - decoration: BoxDecoration(  
626 - border: Border(  
627 - bottom: (index !=  
628 - (detailModel 640 + .rname;
  641 + _phoneNode.unfocus();
  642 + detailModel.userHistorys
  643 + .clear();
  644 + });
  645 + },
  646 + child: Container(
  647 + width: double.infinity,
  648 + height: ScreenUtil()
  649 + .setWidth(102),
  650 + decoration: BoxDecoration(
  651 + border: Border(
  652 + bottom: (index !=
  653 + (detailModel
  654 + .userHistorys
  655 + .length -
  656 + 1) &&
  657 + detailModel
629 .userHistorys 658 .userHistorys
630 - .length -  
631 - 1) &&  
632 - detailModel  
633 - .userHistorys  
634 - .length >  
635 - 1)  
636 - ? BorderSide(  
637 - color: MyColours  
638 - .color_e5e5e5,  
639 - width:  
640 - ScreenUtil() 659 + .length >
  660 + 1)
  661 + ? BorderSide(
  662 + color: MyColours
  663 + .color_e5e5e5,
  664 + width: ScreenUtil()
641 .setWidth( 665 .setWidth(
642 2)) 666 2))
643 - : BorderSide.none)),  
644 - child: Row(  
645 - mainAxisAlignment:  
646 - MainAxisAlignment  
647 - .spaceBetween,  
648 - children: [  
649 - Text(  
650 - detailModel 667 + : BorderSide
  668 + .none)),
  669 + child: Row(
  670 + mainAxisAlignment:
  671 + MainAxisAlignment
  672 + .spaceBetween,
  673 + children: [
  674 + Text(
  675 + detailModel
  676 + .userHistorys[
  677 + index]
  678 + .phone ==
  679 + null
  680 + ? ''
  681 + : detailModel
651 .userHistorys[ 682 .userHistorys[
652 index] 683 index]
653 - .phone ==  
654 - null  
655 - ? ''  
656 - : detailModel  
657 - .userHistorys[index]  
658 - .phone,  
659 - style: TextStyle(  
660 - color: MyColours  
661 - .color_333333,  
662 - fontSize: ScreenUtil()  
663 - .setSp(32)),  
664 - ),  
665 - Expanded(  
666 - child: Text(  
667 - detailModel 684 + .phone,
  685 + style: TextStyle(
  686 + color: MyColours
  687 + .color_333333,
  688 + fontSize:
  689 + ScreenUtil()
  690 + .setSp(32)),
  691 + ),
  692 + Expanded(
  693 + child: Text(
  694 + detailModel
  695 + .userHistorys[
  696 + index]
  697 + .rname ==
  698 + null
  699 + ? ''
  700 + : detailModel
668 .userHistorys[ 701 .userHistorys[
669 index] 702 index]
670 - .rname ==  
671 - null  
672 - ? ''  
673 - : detailModel  
674 - .userHistorys[index]  
675 - .rname,  
676 - style: TextStyle(  
677 - color: MyColours  
678 - .color_333333,  
679 - fontSize: ScreenUtil()  
680 - .setSp(32)),  
681 - ))  
682 - ],  
683 - ),  
684 - ),  
685 - );  
686 - },  
687 - itemExtent: ScreenUtil().setWidth(104),  
688 - itemCount:  
689 - detailModel.userHistorys.length,  
690 - ))), 703 + .rname,
  704 + style: TextStyle(
  705 + color: MyColours
  706 + .color_333333,
  707 + fontSize:
  708 + ScreenUtil()
  709 + .setSp(32)),
  710 + ))
  711 + ],
  712 + ),
  713 + ),
  714 + );
  715 + },
  716 + itemExtent:
  717 + ScreenUtil().setWidth(104),
  718 + itemCount:
  719 + detailModel.userHistorys.length,
  720 + )))),
691 ), 721 ),
692 ), 722 ),
693 ], 723 ],
@@ -35,6 +35,7 @@ import 'package:provider/provider.dart'; @@ -35,6 +35,7 @@ import 'package:provider/provider.dart';
35 import 'package:one_key/models/table_list.dart' as t; 35 import 'package:one_key/models/table_list.dart' as t;
36 import 'dart:convert' as convert; 36 import 'dart:convert' as convert;
37 import 'package:easy_contact_picker/easy_contact_picker.dart'; 37 import 'package:easy_contact_picker/easy_contact_picker.dart';
  38 +import '../../utils/screen_util.dart';
38 import '../../widgets/special_text/my_extended_text_selection_controls.dart'; 39 import '../../widgets/special_text/my_extended_text_selection_controls.dart';
39 40
40 typedef clickCallback = void Function(String value); 41 typedef clickCallback = void Function(String value);
@@ -72,6 +73,7 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -72,6 +73,7 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
72 FocusNode _cusdemNode = FocusNode(); 73 FocusNode _cusdemNode = FocusNode();
73 MyTextSelectionControls _myExtendedMaterialTextSelectionControls = 74 MyTextSelectionControls _myExtendedMaterialTextSelectionControls =
74 MyTextSelectionControls(); 75 MyTextSelectionControls();
  76 + ScrollController _scrollCrl = ScrollController();
75 77
76 @override 78 @override
77 void initState() { 79 void initState() {
@@ -528,7 +530,7 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -528,7 +530,7 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
528 } 530 }
529 _notebookDetailChangeModel.nameController.text = name + suffix; 531 _notebookDetailChangeModel.nameController.text = name + suffix;
530 } 532 }
531 - 533 +/**
532 _bottomWidget() { 534 _bottomWidget() {
533 return Container( 535 return Container(
534 padding: EdgeInsets.symmetric( 536 padding: EdgeInsets.symmetric(
@@ -777,101 +779,114 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -777,101 +779,114 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
777 ], 779 ],
778 ), 780 ),
779 Offstage( 781 Offstage(
780 - offstage: !(showPhoneHistory &&  
781 - _notebookDetailChangeModel.userHistorys.length > 0),  
782 - child: Container(  
783 - decoration: BoxDecoration(  
784 - borderRadius: BorderRadius.circular(8),  
785 - border: Border.all(color: Colors.white),  
786 - color: MyColours.color_ffffff,  
787 - boxShadow: [  
788 - BoxShadow(  
789 - color: MyColours.color_e5e5e5,  
790 - blurRadius: ScreenUtil().setWidth(20))  
791 - ]),  
792 - // width: ScreenUtil().setWidth(440),  
793 - height: _notebookDetailChangeModel.userHistorys.length > 1  
794 - ? ScreenUtil().setWidth(208)  
795 - : ScreenUtil().setWidth(104),  
796 - padding: EdgeInsets.symmetric(  
797 - horizontal: ScreenUtil().setWidth(30)),  
798 - child: Align( 782 + offstage: !(showPhoneHistory &&
  783 + _notebookDetailChangeModel.userHistorys.length > 0),
  784 + child: Container(
  785 + decoration: BoxDecoration(
  786 + borderRadius: BorderRadius.circular(8),
  787 + border: Border.all(color: Colors.white),
  788 + color: MyColours.color_ffffff,
  789 + boxShadow: [
  790 + BoxShadow(
  791 + color: MyColours.color_e5e5e5,
  792 + blurRadius: ScreenUtil().setWidth(20))
  793 + ]),
  794 + // width: ScreenUtil().setWidth(440),
  795 + // height: _notebookDetailChangeModel.userHistorys.length > 1
  796 + // ? ScreenUtil().setWidth(208)
  797 + // : ScreenUtil().setWidth(104),
  798 + width: ScreenUtil().screenWidth - w(60),
  799 + // width: ScreenUtil().setWidth(350),
  800 + constraints: BoxConstraints(maxHeight: w(270)),
  801 + padding: EdgeInsets.symmetric(
  802 + horizontal: ScreenUtil().setWidth(30)),
  803 + child: Align(
799 alignment: Alignment.topCenter, 804 alignment: Alignment.topCenter,
800 child: MediaQuery.removePadding( 805 child: MediaQuery.removePadding(
801 context: context, 806 context: context,
802 removeTop: true, 807 removeTop: true,
803 - child: ListView.builder(  
804 - itemBuilder: (context, index) {  
805 - return GestureDetector(  
806 - onTap: () {  
807 - setState(() {  
808 - showPhoneHistory = false;  
809 - _notebookDetailChangeModel  
810 - .phoneController.text = 808 + child: Scrollbar(
  809 + isAlwaysShown: true, //设置滚动条常亮
  810 + controller: _scrollCrl, //必须设置一个controller
  811 +
  812 + ///添加进度条
  813 + child: ListView.builder(
  814 + controller: _scrollCrl,
  815 + itemBuilder: (context, index) {
  816 + return GestureDetector(
  817 + onTap: () {
  818 + setState(() {
  819 + showPhoneHistory = false;
811 _notebookDetailChangeModel 820 _notebookDetailChangeModel
812 - .userHistorys[index].phone;  
813 - // _notebookDetailChangeModel  
814 - // .nameController.text =  
815 - // _notebookDetailChangeModel  
816 - // .userHistorys[index].rname;  
817 - _addNameSuffix(  
818 - _notebookDetailChangeModel  
819 - .userHistorys[index].rname,  
820 - _nameSuffix());  
821 - nameStr = _notebookDetailChangeModel  
822 - .userHistorys[index].rname;  
823 - _phoneNode.unfocus();  
824 - _notebookDetailChangeModel.userHistorys  
825 - .clear();  
826 - });  
827 - },  
828 - child: Container(  
829 - width: double.infinity,  
830 - height: ScreenUtil().setWidth(102),  
831 - decoration: BoxDecoration(  
832 - border: Border(  
833 - bottom: (index !=  
834 - (_notebookDetailChangeModel 821 + .phoneController.text =
  822 + _notebookDetailChangeModel
  823 + .userHistorys[index].phone;
  824 + // _notebookDetailChangeModel
  825 + // .nameController.text =
  826 + // _notebookDetailChangeModel
  827 + // .userHistorys[index].rname;
  828 + _addNameSuffix(
  829 + _notebookDetailChangeModel
  830 + .userHistorys[index].rname,
  831 + _nameSuffix());
  832 + nameStr = _notebookDetailChangeModel
  833 + .userHistorys[index].rname;
  834 + _phoneNode.unfocus();
  835 + _notebookDetailChangeModel.userHistorys
  836 + .clear();
  837 + });
  838 + },
  839 + child: Container(
  840 + width: double.infinity,
  841 + height: ScreenUtil().setWidth(102),
  842 + decoration: BoxDecoration(
  843 + border: Border(
  844 + bottom: (index !=
  845 + (_notebookDetailChangeModel
  846 + .userHistorys
  847 + .length -
  848 + 1) &&
  849 + _notebookDetailChangeModel
835 .userHistorys 850 .userHistorys
836 - .length -  
837 - 1) &&  
838 - _notebookDetailChangeModel  
839 - .userHistorys.length >  
840 - 1)  
841 - ? BorderSide(  
842 - color: MyColours.color_e5e5e5,  
843 - width:  
844 - ScreenUtil().setWidth(2))  
845 - : BorderSide.none)),  
846 - child: Row(  
847 - mainAxisAlignment:  
848 - MainAxisAlignment.spaceBetween,  
849 - children: [  
850 - Text(  
851 - _notebookDetailChangeModel  
852 - .userHistorys[index].phone,  
853 - style: TextStyle(  
854 - color: MyColours.color_333333,  
855 - fontSize: ScreenUtil().setSp(32)), 851 + .length >
  852 + 1)
  853 + ? BorderSide(
  854 + color: MyColours
  855 + .color_e5e5e5,
  856 + width: ScreenUtil()
  857 + .setWidth(2))
  858 + : BorderSide.none)),
  859 + child: Row(
  860 + mainAxisAlignment:
  861 + MainAxisAlignment.spaceBetween,
  862 + children: [
  863 + Text(
  864 + _notebookDetailChangeModel
  865 + .userHistorys[index].phone,
  866 + style: TextStyle(
  867 + color: MyColours.color_333333,
  868 + fontSize:
  869 + ScreenUtil().setSp(32)),
  870 + ),
  871 + Text(
  872 + _notebookDetailChangeModel
  873 + .userHistorys[index].rname,
  874 + style: TextStyle(
  875 + color: MyColours.color_333333,
  876 + fontSize:
  877 + ScreenUtil().setSp(32)),
  878 + )
  879 + ],
856 ), 880 ),
857 - Text(  
858 - _notebookDetailChangeModel  
859 - .userHistorys[index].rname,  
860 - style: TextStyle(  
861 - color: MyColours.color_333333,  
862 - fontSize: ScreenUtil().setSp(32)),  
863 - )  
864 - ],  
865 - ),  
866 - ),  
867 - );  
868 - },  
869 - itemExtent: ScreenUtil().setWidth(104),  
870 - itemCount:  
871 - _notebookDetailChangeModel.userHistorys.length,  
872 - ))),  
873 - ),  
874 - ) 881 + ),
  882 + );
  883 + },
  884 + itemExtent: ScreenUtil().setWidth(104),
  885 + itemCount: _notebookDetailChangeModel
  886 + .userHistorys.length,
  887 + ))),
  888 + ),
  889 + ))
875 ], 890 ],
876 ) 891 )
877 // VEmptyView(62), 892 // VEmptyView(62),
@@ -880,6 +895,8 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -880,6 +895,8 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
880 ); 895 );
881 } 896 }
882 897
  898 + */
  899 +
883 _remarkListWidget() { 900 _remarkListWidget() {
884 List<Remark> remark = []; 901 List<Remark> remark = [];
885 if (remarkManagerModel.ofenRemarks.length > 4) { 902 if (remarkManagerModel.ofenRemarks.length > 4) {
@@ -1156,6 +1173,12 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -1156,6 +1173,12 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
1156 behavior: HitTestBehavior.translucent, 1173 behavior: HitTestBehavior.translucent,
1157 onTap: () { 1174 onTap: () {
1158 FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 1175 FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  1176 + if (showPhoneHistory) {
  1177 + setState(() {
  1178 + showPhoneHistory = false;
  1179 + // _notebookDetailChangeModel.userHistorys.clear();
  1180 + });
  1181 + }
1159 }, 1182 },
1160 child: Scaffold( 1183 child: Scaffold(
1161 backgroundColor: Colors.white, 1184 backgroundColor: Colors.white,
@@ -1838,11 +1861,14 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -1838,11 +1861,14 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
1838 color: MyColours.color_e5e5e5, 1861 color: MyColours.color_e5e5e5,
1839 blurRadius: ScreenUtil().setWidth(20)) 1862 blurRadius: ScreenUtil().setWidth(20))
1840 ]), 1863 ]),
1841 - width: ScreenUtil().setWidth(440),  
1842 - height:  
1843 - _notebookDetailChangeModel.userHistorys.length > 1  
1844 - ? ScreenUtil().setWidth(208)  
1845 - : ScreenUtil().setWidth(104), 1864 + // width: ScreenUtil().setWidth(440),
  1865 + // height:
  1866 + // _notebookDetailChangeModel.userHistorys.length > 1
  1867 + // ? ScreenUtil().setWidth(208)
  1868 + // : ScreenUtil().setWidth(104),
  1869 + width: ScreenUtil().screenWidth - w(60),
  1870 + // width: ScreenUtil().setWidth(350),
  1871 + constraints: BoxConstraints(maxHeight: w(260)),
1846 padding: EdgeInsets.symmetric( 1872 padding: EdgeInsets.symmetric(
1847 horizontal: ScreenUtil().setWidth(30)), 1873 horizontal: ScreenUtil().setWidth(30)),
1848 child: Align( 1874 child: Align(
@@ -1850,84 +1876,99 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -1850,84 +1876,99 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
1850 child: MediaQuery.removePadding( 1876 child: MediaQuery.removePadding(
1851 context: context, 1877 context: context,
1852 removeTop: true, 1878 removeTop: true,
1853 - child: ListView.builder(  
1854 - itemBuilder: (context, index) {  
1855 - return GestureDetector(  
1856 - onTap: () {  
1857 - setState(() {  
1858 - showPhoneHistory = false;  
1859 - _notebookDetailChangeModel  
1860 - .phoneController.text = 1879 + child: Scrollbar(
  1880 + isAlwaysShown: true, //设置滚动条常亮
  1881 + controller: _scrollCrl, //必须设置一个controller
  1882 +
  1883 + ///添加进度条
  1884 + child: ListView.builder(
  1885 + itemBuilder: (context, index) {
  1886 + return GestureDetector(
  1887 + onTap: () {
  1888 + setState(() {
  1889 + showPhoneHistory = false;
1861 _notebookDetailChangeModel 1890 _notebookDetailChangeModel
1862 - .userHistorys[index].phone;  
1863 - // _homeEnterModel.nameController.text =  
1864 - // _homeEnterModel  
1865 - // .userHistorys[index].rname +  
1866 - // _nameSuffix();  
1867 - _addNameSuffix( 1891 + .phoneController.text =
  1892 + _notebookDetailChangeModel
  1893 + .userHistorys[index]
  1894 + .phone;
  1895 + // _homeEnterModel.nameController.text =
  1896 + // _homeEnterModel
  1897 + // .userHistorys[index].rname +
  1898 + // _nameSuffix();
  1899 + _addNameSuffix(
  1900 + _notebookDetailChangeModel
  1901 + .userHistorys[index]
  1902 + .rname,
  1903 + _nameSuffix());
  1904 + nameStr =
  1905 + _notebookDetailChangeModel
  1906 + .userHistorys[index]
  1907 + .rname;
  1908 + _phoneNode.unfocus();
1868 _notebookDetailChangeModel 1909 _notebookDetailChangeModel
1869 - .userHistorys[index].rname,  
1870 - _nameSuffix());  
1871 - nameStr = _notebookDetailChangeModel  
1872 - .userHistorys[index].rname;  
1873 - _phoneNode.unfocus();  
1874 - _notebookDetailChangeModel  
1875 - .userHistorys  
1876 - .clear();  
1877 - });  
1878 - },  
1879 - child: Container(  
1880 - width: double.infinity,  
1881 - height: ScreenUtil().setWidth(102),  
1882 - decoration: BoxDecoration(  
1883 - border: Border(  
1884 - bottom: (index !=  
1885 - (_notebookDetailChangeModel 1910 + .userHistorys
  1911 + .clear();
  1912 + });
  1913 + },
  1914 + child: Container(
  1915 + width: double.infinity,
  1916 + height:
  1917 + ScreenUtil().setWidth(102),
  1918 + decoration: BoxDecoration(
  1919 + border: Border(
  1920 + bottom: (index !=
  1921 + (_notebookDetailChangeModel
  1922 + .userHistorys
  1923 + .length -
  1924 + 1) &&
  1925 + _notebookDetailChangeModel
1886 .userHistorys 1926 .userHistorys
1887 - .length -  
1888 - 1) &&  
1889 - _notebookDetailChangeModel  
1890 - .userHistorys  
1891 - .length >  
1892 - 1)  
1893 - ? BorderSide(  
1894 - color: MyColours  
1895 - .color_e5e5e5,  
1896 - width: ScreenUtil()  
1897 - .setWidth(2))  
1898 - : BorderSide.none)),  
1899 - child: Row(  
1900 - mainAxisAlignment:  
1901 - MainAxisAlignment.spaceBetween,  
1902 - children: [  
1903 - Text(  
1904 - _notebookDetailChangeModel  
1905 - .userHistorys[index].phone,  
1906 - style: TextStyle(  
1907 - color:  
1908 - MyColours.color_333333,  
1909 - fontSize:  
1910 - ScreenUtil().setSp(32)), 1927 + .length >
  1928 + 1)
  1929 + ? BorderSide(
  1930 + color: MyColours
  1931 + .color_e5e5e5,
  1932 + width:
  1933 + ScreenUtil()
  1934 + .setWidth(
  1935 + 2))
  1936 + : BorderSide.none)),
  1937 + child: Row(
  1938 + mainAxisAlignment:
  1939 + MainAxisAlignment
  1940 + .spaceBetween,
  1941 + children: [
  1942 + Text(
  1943 + _notebookDetailChangeModel
  1944 + .userHistorys[index]
  1945 + .phone,
  1946 + style: TextStyle(
  1947 + color: MyColours
  1948 + .color_333333,
  1949 + fontSize: ScreenUtil()
  1950 + .setSp(32)),
  1951 + ),
  1952 + Expanded(
  1953 + child: Text(
  1954 + _notebookDetailChangeModel
  1955 + .userHistorys[index]
  1956 + .rname,
  1957 + style: TextStyle(
  1958 + color: MyColours
  1959 + .color_333333,
  1960 + fontSize: ScreenUtil()
  1961 + .setSp(32)),
  1962 + ))
  1963 + ],
1911 ), 1964 ),
1912 - Expanded(  
1913 - child: Text(  
1914 - _notebookDetailChangeModel  
1915 - .userHistorys[index].rname,  
1916 - style: TextStyle(  
1917 - color:  
1918 - MyColours.color_333333,  
1919 - fontSize:  
1920 - ScreenUtil().setSp(32)),  
1921 - ))  
1922 - ],  
1923 - ),  
1924 - ),  
1925 - );  
1926 - },  
1927 - itemExtent: ScreenUtil().setWidth(104),  
1928 - itemCount: _notebookDetailChangeModel  
1929 - .userHistorys.length,  
1930 - ))), 1965 + ),
  1966 + );
  1967 + },
  1968 + itemExtent: ScreenUtil().setWidth(104),
  1969 + itemCount: _notebookDetailChangeModel
  1970 + .userHistorys.length,
  1971 + )))),
1931 ), 1972 ),
1932 ) 1973 )
1933 ], 1974 ],
@@ -46,6 +46,7 @@ import '../../app.dart'; @@ -46,6 +46,7 @@ import '../../app.dart';
46 import '../../models/sms_info.dart'; 46 import '../../models/sms_info.dart';
47 import '../../provider/customer_provider.dart'; 47 import '../../provider/customer_provider.dart';
48 import '../../provider/my_model.dart'; 48 import '../../provider/my_model.dart';
  49 +import '../../utils/screen_util.dart';
49 import '../../widgets/special_text/my_extended_text_selection_controls.dart'; 50 import '../../widgets/special_text/my_extended_text_selection_controls.dart';
50 51
51 class InvicationPage extends StatefulWidget { 52 class InvicationPage extends StatefulWidget {
@@ -163,6 +164,8 @@ class InvicationPageState extends State<InvicationPage> @@ -163,6 +164,8 @@ class InvicationPageState extends State<InvicationPage>
163 MyModel myModel; 164 MyModel myModel;
164 SmsInfoData smsInfoData; 165 SmsInfoData smsInfoData;
165 166
  167 + ScrollController _scrollCrl = ScrollController();
  168 +
166 @override 169 @override
167 void initState() { 170 void initState() {
168 super.initState(); 171 super.initState();
@@ -2354,105 +2357,121 @@ class InvicationPageState extends State<InvicationPage> @@ -2354,105 +2357,121 @@ class InvicationPageState extends State<InvicationPage>
2354 top: 0, 2357 top: 0,
2355 left: 0, 2358 left: 0,
2356 child: Offstage( 2359 child: Offstage(
2357 - offstage: !(showPhoneHistory &&  
2358 - _baseIndoProvider.userHistorys.length > 0),  
2359 - child: Container(  
2360 - decoration: BoxDecoration(  
2361 - borderRadius: BorderRadius.circular(8),  
2362 - border: Border.all(color: Colors.white),  
2363 - color: MyColours.color_ffffff,  
2364 - // color: Colors.red,  
2365 - boxShadow: [  
2366 - BoxShadow(  
2367 - color: MyColours.color_e5e5e5,  
2368 - blurRadius: ScreenUtil().setWidth(20))  
2369 - ]),  
2370 - width: ScreenUtil().setWidth(440),  
2371 - height: _baseIndoProvider.userHistorys.length > 1  
2372 - ? ScreenUtil().setWidth(140)  
2373 - : ScreenUtil().setWidth(104),  
2374 - padding: EdgeInsets.symmetric(  
2375 - horizontal: ScreenUtil().setWidth(30)),  
2376 - child: Align( 2360 + offstage: !(showPhoneHistory &&
  2361 + _baseIndoProvider.userHistorys.length > 0),
  2362 + child: Container(
  2363 + decoration: BoxDecoration(
  2364 + borderRadius: BorderRadius.circular(8),
  2365 + border: Border.all(color: Colors.white),
  2366 + color: MyColours.color_ffffff,
  2367 + // color: Colors.red,
  2368 + boxShadow: [
  2369 + BoxShadow(
  2370 + color: MyColours.color_e5e5e5,
  2371 + blurRadius: ScreenUtil().setWidth(20))
  2372 + ]),
  2373 + // width: ScreenUtil().setWidth(440),
  2374 + // height: _baseIndoProvider.userHistorys.length > 1
  2375 + // ? ScreenUtil().setWidth(140)
  2376 + // : ScreenUtil().setWidth(104),
  2377 + width: ScreenUtil().screenWidth - w(60),
  2378 + // width: ScreenUtil().setWidth(350),
  2379 + constraints: BoxConstraints(maxHeight: w(270)),
  2380 + padding: EdgeInsets.symmetric(
  2381 + horizontal: ScreenUtil().setWidth(30)),
  2382 + child: Align(
2377 alignment: Alignment.topCenter, 2383 alignment: Alignment.topCenter,
2378 child: MediaQuery.removePadding( 2384 child: MediaQuery.removePadding(
2379 context: context, 2385 context: context,
2380 removeTop: true, 2386 removeTop: true,
2381 - child: ListView.builder(  
2382 - shrinkWrap: true,  
2383 - itemBuilder: (context, index) {  
2384 - return GestureDetector(  
2385 - onTap: () {  
2386 - _getIsMemberByPhone(_baseIndoProvider  
2387 - .userHistorys[index].phone);  
2388 - needHistory = true;  
2389 - _showConfirmWidget(  
2390 - needHistory: true, index: index);  
2391 - },  
2392 - child: Container(  
2393 - width: double.infinity,  
2394 - height: ScreenUtil().setWidth(102),  
2395 - decoration: BoxDecoration(  
2396 - border: Border(  
2397 - bottom: (index !=  
2398 - (_baseIndoProvider 2387 + child: Scrollbar(
  2388 + isAlwaysShown: true, //设置滚动条常亮
  2389 + controller: _scrollCrl, //必须设置一个controller
  2390 +
  2391 + ///添加进度条
  2392 + child: ListView.builder(
  2393 + shrinkWrap: true,
  2394 + controller: _scrollCrl,
  2395 + itemBuilder: (context, index) {
  2396 + return GestureDetector(
  2397 + onTap: () {
  2398 + _getIsMemberByPhone(
  2399 + _baseIndoProvider
  2400 + .userHistorys[index].phone);
  2401 + needHistory = true;
  2402 + _showConfirmWidget(
  2403 + needHistory: true,
  2404 + index: index);
  2405 + },
  2406 + child: Container(
  2407 + width: double.infinity,
  2408 + height: ScreenUtil().setWidth(102),
  2409 + decoration: BoxDecoration(
  2410 + border: Border(
  2411 + bottom: (index !=
  2412 + (_baseIndoProvider
  2413 + .userHistorys
  2414 + .length -
  2415 + 1) &&
  2416 + _baseIndoProvider
2399 .userHistorys 2417 .userHistorys
2400 - .length -  
2401 - 1) &&  
2402 - _baseIndoProvider  
2403 - .userHistorys  
2404 - .length >  
2405 - 1)  
2406 - ? BorderSide(  
2407 - color: MyColours  
2408 - .color_e5e5e5,  
2409 - width: ScreenUtil()  
2410 - .setWidth(2))  
2411 - : BorderSide.none)),  
2412 - child: Row(  
2413 - mainAxisAlignment:  
2414 - MainAxisAlignment.spaceBetween,  
2415 - children: [  
2416 - Text(  
2417 - _baseIndoProvider 2418 + .length >
  2419 + 1)
  2420 + ? BorderSide(
  2421 + color: MyColours
  2422 + .color_e5e5e5,
  2423 + width: ScreenUtil()
  2424 + .setWidth(2))
  2425 + : BorderSide.none)),
  2426 + child: Row(
  2427 + mainAxisAlignment:
  2428 + MainAxisAlignment
  2429 + .spaceBetween,
  2430 + children: [
  2431 + Text(
  2432 + _baseIndoProvider
  2433 + .userHistorys[
  2434 + index]
  2435 + .phone ==
  2436 + null
  2437 + ? ''
  2438 + : _baseIndoProvider
2418 .userHistorys[index] 2439 .userHistorys[index]
2419 - .phone ==  
2420 - null  
2421 - ? ''  
2422 - : _baseIndoProvider  
2423 - .userHistorys[index]  
2424 - .phone,  
2425 - style: TextStyle(  
2426 - color: MyColours.color_333333,  
2427 - fontSize:  
2428 - ScreenUtil().setSp(32)),  
2429 - ),  
2430 - Expanded(  
2431 - child: Text(  
2432 - _baseIndoProvider 2440 + .phone,
  2441 + style: TextStyle(
  2442 + color: MyColours
  2443 + .color_333333,
  2444 + fontSize: ScreenUtil()
  2445 + .setSp(32)),
  2446 + ),
  2447 + Expanded(
  2448 + child: Text(
  2449 + _baseIndoProvider
  2450 + .userHistorys[
  2451 + index]
  2452 + .rname ==
  2453 + null
  2454 + ? ''
  2455 + : _baseIndoProvider
2433 .userHistorys[index] 2456 .userHistorys[index]
2434 - .rname ==  
2435 - null  
2436 - ? ''  
2437 - : _baseIndoProvider  
2438 - .userHistorys[index]  
2439 - .rname,  
2440 - style: TextStyle(  
2441 - color: MyColours.color_333333,  
2442 - fontSize:  
2443 - ScreenUtil().setSp(32)),  
2444 - ))  
2445 - ],  
2446 - ),  
2447 - ),  
2448 - );  
2449 - },  
2450 - itemExtent: ScreenUtil().setWidth(104),  
2451 - itemCount:  
2452 - _baseIndoProvider.userHistorys.length,  
2453 - ))),  
2454 - ),  
2455 - )) 2457 + .rname,
  2458 + style: TextStyle(
  2459 + color: MyColours
  2460 + .color_333333,
  2461 + fontSize: ScreenUtil()
  2462 + .setSp(32)),
  2463 + ))
  2464 + ],
  2465 + ),
  2466 + ),
  2467 + );
  2468 + },
  2469 + itemExtent: ScreenUtil().setWidth(104),
  2470 + itemCount:
  2471 + _baseIndoProvider.userHistorys.length,
  2472 + ))),
  2473 + ),
  2474 + )))
2456 : SizedBox() 2475 : SizedBox()
2457 ], 2476 ],
2458 ), 2477 ),
@@ -115,7 +115,7 @@ class _MonthItemState extends State<MonthItem> { @@ -115,7 +115,7 @@ class _MonthItemState extends State<MonthItem> {
115 ), 115 ),
116 HEmptyView(10), 116 HEmptyView(10),
117 Text( 117 Text(
118 - '${widget.countsListSunModel.totalPnum}人', 118 + '${widget.countsListSunModel.totalPnum??0}人',
119 style: TextStyle( 119 style: TextStyle(
120 color: MyColours.color_515151, 120 color: MyColours.color_515151,
121 fontSize: font(12)), 121 fontSize: font(12)),
@@ -45,7 +45,7 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { @@ -45,7 +45,7 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
45 "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid, 45 "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
46 'is_additional': swichState ? "1" : "0" 46 'is_additional': swichState ? "1" : "0"
47 }; 47 };
48 - bool success = await customerProvider.setSellerGuest(context, params); 48 + bool success = await customerProvider.setSellerGuest(context, params,showLoading: true);
49 if (success) {} 49 if (success) {}
50 } 50 }
51 51
@@ -71,8 +71,6 @@ class _DayOrderLeftPageState extends State<DayOrderLeftPage> { @@ -71,8 +71,6 @@ class _DayOrderLeftPageState extends State<DayOrderLeftPage> {
71 isShowLoading: isShowLoading); 71 isShowLoading: isShowLoading);
72 } 72 }
73 73
74 -  
75 -  
76 @override 74 @override
77 Widget build(BuildContext context) { 75 Widget build(BuildContext context) {
78 customerProvider = Provider.of<CustomerProvider>(context, listen: true); 76 customerProvider = Provider.of<CustomerProvider>(context, listen: true);
@@ -84,6 +84,8 @@ class _DayOrderPageState extends State<DayOrderPage> @@ -84,6 +84,8 @@ class _DayOrderPageState extends State<DayOrderPage>
84 } 84 }
85 85
86 Widget _headWidget() { 86 Widget _headWidget() {
  87 + // String day =
  88 + // widget.day.startsWith('0') ? widget.day.substring(1) : widget.day;
87 return Column( 89 return Column(
88 children: [ 90 children: [
89 Container( 91 Container(
@@ -96,7 +98,11 @@ class _DayOrderPageState extends State<DayOrderPage> @@ -96,7 +98,11 @@ class _DayOrderPageState extends State<DayOrderPage>
96 mainAxisAlignment: MainAxisAlignment.spaceBetween, 98 mainAxisAlignment: MainAxisAlignment.spaceBetween,
97 children: [ 99 children: [
98 Text( 100 Text(
99 - widget.year + '-' + widget.month + '-' + widget.day, 101 + widget.year +
  102 + '-' +
  103 + Utils.addZeroNumber(int.parse(widget.month)) +
  104 + '-' +
  105 + widget.day,
100 style: TextStyle( 106 style: TextStyle(
101 color: MyColours.color_515151, 107 color: MyColours.color_515151,
102 fontSize: font(16), 108 fontSize: font(16),
@@ -540,7 +540,7 @@ class _MonthOrderPageState extends State<MonthOrderPage> { @@ -540,7 +540,7 @@ class _MonthOrderPageState extends State<MonthOrderPage> {
540 NavigatorUtil.goDayOrderPage( 540 NavigatorUtil.goDayOrderPage(
541 context, 541 context,
542 widget.year.toString(), 542 widget.year.toString(),
543 - widget.month.toString(), 543 + month.toString(),
544 daylist.days.toString(), 544 daylist.days.toString(),
545 daylist, 545 daylist,
546 uid: widget.uid.toString(), 546 uid: widget.uid.toString(),
@@ -840,47 +840,47 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { @@ -840,47 +840,47 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> {
840 child: Column( 840 child: Column(
841 children: [ 841 children: [
842 VEmptyView(10), 842 VEmptyView(10),
843 - Stack(  
844 - children: [  
845 - InkWell(  
846 - onTap: () {  
847 - NavigatorUtil.goCustomerListPage(  
848 - context, FromPage.FromPageHome, '');  
849 - },  
850 - child: Container(  
851 - height: w(80),  
852 - color: MyColours.color_ffffff,  
853 - child: Row(  
854 - mainAxisAlignment: MainAxisAlignment.center,  
855 - children: [  
856 - Text(  
857 - '${widget.customerProvider.storeSunmodel.myCustomer}',  
858 - style: TextStyle(  
859 - color: MyColours.color_438E93,  
860 - fontSize: ScreenUtil().setSp(64),  
861 - fontWeight: FontWeight.bold),  
862 - ),  
863 - Text(  
864 - '位',  
865 - style: TextStyle(  
866 - color: MyColours.color_515151,  
867 - // fontWeight: FontWeight.bold,  
868 - fontSize: ScreenUtil().setSp(32)),  
869 - )  
870 - ], 843 + // Stack(
  844 + // children: [
  845 + InkWell(
  846 + onTap: () {
  847 + NavigatorUtil.goCustomerListPage(
  848 + context, FromPage.FromPageHome, '');
  849 + },
  850 + child: Container(
  851 + height: w(80),
  852 + color: MyColours.color_ffffff,
  853 + child: Row(
  854 + mainAxisAlignment: MainAxisAlignment.center,
  855 + children: [
  856 + Text(
  857 + '${widget.customerProvider.storeSunmodel.myCustomer}',
  858 + style: TextStyle(
  859 + color: MyColours.color_438E93,
  860 + fontSize: ScreenUtil().setSp(64),
  861 + fontWeight: FontWeight.bold),
871 ), 862 ),
872 - )),  
873 - Positioned(  
874 - top: ScreenUtil().setWidth(30),  
875 - right: ScreenUtil().setWidth(40),  
876 - child: InkWell(  
877 - onTap: () {  
878 - NavigatorUtil.goCustomerSetPage(context);  
879 - },  
880 - child: Image.asset(Utils.getImgPath('c_set'),  
881 - width: ScreenUtil().setWidth(40))))  
882 - ],  
883 - ), 863 + Text(
  864 + '位',
  865 + style: TextStyle(
  866 + color: MyColours.color_515151,
  867 + // fontWeight: FontWeight.bold,
  868 + fontSize: ScreenUtil().setSp(32)),
  869 + )
  870 + ],
  871 + ),
  872 + )),
  873 + // Positioned(
  874 + // top: ScreenUtil().setWidth(30),
  875 + // right: ScreenUtil().setWidth(40),
  876 + // child: InkWell(
  877 + // onTap: () {
  878 + // NavigatorUtil.goCustomerSetPage(context);
  879 + // },
  880 + // child: Image.asset(Utils.getImgPath('c_set'),
  881 + // width: ScreenUtil().setWidth(40))))
  882 + // ],
  883 + // ),
884 VEmptyView(10), 884 VEmptyView(10),
885 Row( 885 Row(
886 children: [ 886 children: [
@@ -9,6 +9,7 @@ import 'package:provider/provider.dart'; @@ -9,6 +9,7 @@ import 'package:provider/provider.dart';
9 import '../../../../models/store_customer_home_model.dart'; 9 import '../../../../models/store_customer_home_model.dart';
10 import '../../../../provider/customer_provider.dart'; 10 import '../../../../provider/customer_provider.dart';
11 import '../../../../res/colors.dart'; 11 import '../../../../res/colors.dart';
  12 +import '../../../../route/navigator_util.dart';
12 import '../../../../utils/event_bus.dart'; 13 import '../../../../utils/event_bus.dart';
13 import '../../../../utils/screen_util.dart'; 14 import '../../../../utils/screen_util.dart';
14 import '../../../../widgets/v_empty_view.dart'; 15 import '../../../../widgets/v_empty_view.dart';
@@ -61,10 +62,17 @@ class _StoreCustomerHomePageState extends State<StoreCustomerHomePage> @@ -61,10 +62,17 @@ class _StoreCustomerHomePageState extends State<StoreCustomerHomePage>
61 Widget build(BuildContext context) { 62 Widget build(BuildContext context) {
62 customerProvider = Provider.of<CustomerProvider>(context, listen: false); 63 customerProvider = Provider.of<CustomerProvider>(context, listen: false);
63 return Scaffold( 64 return Scaffold(
64 - appBar: SystemAppBar('全店客情', onTap: () {  
65 - EventBus().emit('changeStatusColor');  
66 - Navigator.pop(context);  
67 - }), 65 + appBar: SystemAppBar(
  66 + '全店客情',
  67 + onTap: () {
  68 + EventBus().emit('changeStatusColor');
  69 + Navigator.pop(context);
  70 + },
  71 + rightImgName: 'c_set.png',
  72 + onTapRight: () {
  73 + NavigatorUtil.goCustomerSetPage(context);
  74 + },
  75 + ),
68 body: WillPopScope( 76 body: WillPopScope(
69 onWillPop: () async { 77 onWillPop: () async {
70 EventBus().emit('changeStatusColor'); 78 EventBus().emit('changeStatusColor');
@@ -21,6 +21,7 @@ import 'package:provider/provider.dart'; @@ -21,6 +21,7 @@ import 'package:provider/provider.dart';
21 21
22 import '../../../../models/message_menu_model.dart'; 22 import '../../../../models/message_menu_model.dart';
23 import '../../../../models/seller_counts_list.dart'; 23 import '../../../../models/seller_counts_list.dart';
  24 +import '../../../../models/store_customer_home_model.dart';
24 import '../../../../utils/screen_util.dart'; 25 import '../../../../utils/screen_util.dart';
25 import '../../../../widgets/MyDivider.dart'; 26 import '../../../../widgets/MyDivider.dart';
26 import '../month_item.dart'; 27 import '../month_item.dart';
@@ -52,16 +53,7 @@ class _StoreCustomerHomeRightPageState @@ -52,16 +53,7 @@ class _StoreCustomerHomeRightPageState
52 void initState() { 53 void initState() {
53 super.initState(); 54 super.initState();
54 year = DateTime.now().year; 55 year = DateTime.now().year;
55 - widget.customerProvider.storeSunmodel.sellerUser.forEach((element) {  
56 - MessageMenuModel messageMenuModel = MessageMenuModel();  
57 - messageMenuModel.uid = element.uid;  
58 - messageMenuModel.title = element.nickName ?? element.account;  
59 - messageMenuModel.select = false;  
60 - menuTitle.add(messageMenuModel);  
61 - });  
62 - if (menuTitle.length > 0) {  
63 - menuTitle[0].select = true;  
64 - } 56 +
65 // for (int i = 0; i < 15; i++) { 57 // for (int i = 0; i < 15; i++) {
66 // MessageMenuModel messageMenuModel = MessageMenuModel(); 58 // MessageMenuModel messageMenuModel = MessageMenuModel();
67 // messageMenuModel.title = '${i}经理'; 59 // messageMenuModel.title = '${i}经理';
@@ -69,10 +61,24 @@ class _StoreCustomerHomeRightPageState @@ -69,10 +61,24 @@ class _StoreCustomerHomeRightPageState
69 // menuTitle.add(messageMenuModel); 61 // menuTitle.add(messageMenuModel);
70 // } 62 // }
71 WidgetsBinding.instance.addPostFrameCallback((_) { 63 WidgetsBinding.instance.addPostFrameCallback((_) {
72 - _couponNetworkData(); 64 + if (widget.customerProvider.storeSunmodel == null) {
  65 + _getSellerGuestManage();
  66 + } else {
  67 + widget.customerProvider.storeSunmodel.sellerUser.forEach((element) {
  68 + MessageMenuModel messageMenuModel = MessageMenuModel();
  69 + messageMenuModel.uid = element.uid;
  70 + messageMenuModel.title = element.nickName ?? element.account;
  71 + messageMenuModel.select = false;
  72 + menuTitle.add(messageMenuModel);
  73 + });
  74 + if (menuTitle.length > 0) {
  75 + menuTitle[0].select = true;
  76 + }
  77 + _couponNetworkData();
73 78
74 - _getMarketingByUid();  
75 - _getSellerCountsList(); 79 + _getMarketingByUid();
  80 + _getSellerCountsList();
  81 + }
76 }); 82 });
77 bus.on("refresh_my_customer_home", (arg) { 83 bus.on("refresh_my_customer_home", (arg) {
78 // _getGuestManageData(isShowLoading: false); 84 // _getGuestManageData(isShowLoading: false);
@@ -88,6 +94,27 @@ class _StoreCustomerHomeRightPageState @@ -88,6 +94,27 @@ class _StoreCustomerHomeRightPageState
88 super.dispose(); 94 super.dispose();
89 } 95 }
90 96
  97 + ///全店客情首页
  98 + _getSellerGuestManage() async {
  99 + StoreCustomerHomeSunModel model =
  100 + await widget.customerProvider.getSellerGuestManage(context);
  101 + // setState(() {});
  102 + widget.customerProvider.storeSunmodel.sellerUser.forEach((element) {
  103 + MessageMenuModel messageMenuModel = MessageMenuModel();
  104 + messageMenuModel.uid = element.uid;
  105 + messageMenuModel.title = element.nickName ?? element.account;
  106 + messageMenuModel.select = false;
  107 + menuTitle.add(messageMenuModel);
  108 + });
  109 + if (menuTitle.length > 0) {
  110 + menuTitle[0].select = true;
  111 + }
  112 + _couponNetworkData();
  113 +
  114 + _getMarketingByUid();
  115 + _getSellerCountsList();
  116 + }
  117 +
91 _getSellerCountsList({isShowLoading = false, VoidCallback callback}) async { 118 _getSellerCountsList({isShowLoading = false, VoidCallback callback}) async {
92 String uid = ''; 119 String uid = '';
93 menuTitle.forEach((element) { 120 menuTitle.forEach((element) {
@@ -336,579 +363,509 @@ class _StoreCustomerHomeRightPageState @@ -336,579 +363,509 @@ class _StoreCustomerHomeRightPageState
336 // EventBus().emit('changeStatusColor'); 363 // EventBus().emit('changeStatusColor');
337 // Navigator.pop(context); 364 // Navigator.pop(context);
338 // }), 365 // }),
339 - body: WillPopScope(  
340 - onWillPop: () async {  
341 - EventBus().emit('changeStatusColor');  
342 - return true;  
343 - },  
344 - child: Column( 366 + body: WillPopScope(onWillPop: () async {
  367 + EventBus().emit('changeStatusColor');
  368 + return true;
  369 + }, child: Consumer<CustomerProvider>(builder: (context, model, _) {
  370 + if (model.pageStateMyHome != PageState.Success) {
  371 + return ExceptionPage(
  372 + pageState: model.pageStateMyHome,
  373 + callback: () {
  374 + _getSellerCountsList();
  375 + },
  376 + emptyMsg: "暂时没有我的客情哦",
  377 + emptyImg: "empty_search",
  378 + showMsg: "加载中,请稍后...",
  379 + );
  380 + } else {
  381 + return Column(children: [
  382 + Container(
  383 + color: MyColours.color_ffffff,
  384 + height: ScreenUtil().setWidth(70),
  385 + padding: EdgeInsets.only(bottom: w(12)),
  386 + margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)),
  387 + child: Row(
345 children: [ 388 children: [
346 - Container(  
347 - color: MyColours.color_ffffff,  
348 - height: ScreenUtil().setWidth(70),  
349 - padding: EdgeInsets.only(bottom: w(12)),  
350 - margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)),  
351 - child: Row(  
352 - children: [  
353 - HEmptyView(48),  
354 - Expanded(  
355 - child: SizedBox(  
356 - // height: ScreenUtil().setWidth(30),  
357 - child: ListView.builder(  
358 - itemCount: menuTitle.length,  
359 - shrinkWrap: true,  
360 - controller: _controller,  
361 - scrollDirection: Axis.horizontal,  
362 - itemBuilder:  
363 - (BuildContext contxt, int index) {  
364 - return InkWell(  
365 - onTap: () {  
366 - for (MessageMenuModel item  
367 - in menuTitle) {  
368 - item.select = false;  
369 - }  
370 - menuTitle[index].select = true;  
371 - setState(() {});  
372 - _getSellerCountsList(  
373 - isShowLoading: true,  
374 - callback: () {});  
375 - // offset = 0;  
376 - // 1提前点餐/2内部预订/10在线预订/15店内消息传/12在线买单  
377 -  
378 - // if (index == 0) {  
379 - // typeid = '';  
380 - // } else if (index == 1) {  
381 - // //店内消息  
382 - // typeid = '15';  
383 - // } else if (index == 2) {  
384 - // //在线预订  
385 - // typeid = '10';  
386 - // } else if (index == 3) {  
387 - // //提前点餐  
388 - // typeid = '1';  
389 - // } else if (index == 4) {  
390 - // //在线买单  
391 - // typeid = '12';  
392 - // } else if (index == 5) {  
393 - // //会员充值  
394 - // typeid = '17';  
395 - // } else if (index == 6) {  
396 - // //存酒超期  
397 - // typeid = '18';  
398 - // }  
399 - // getMessage(typeid, showLoading: true);  
400 - },  
401 - child: Container(  
402 - // width: ScreenUtil().setWidth(104 * 2),  
403 -  
404 - margin: EdgeInsets.only(  
405 - right: ScreenUtil().setWidth(30),  
406 - ),  
407 - padding: EdgeInsets.symmetric(  
408 - horizontal:  
409 - ScreenUtil().setWidth(10),  
410 - vertical: ScreenUtil().setWidth(4)),  
411 - alignment: Alignment.center,  
412 - decoration: BoxDecoration(  
413 - borderRadius: BorderRadius.circular(  
414 - ScreenUtil().setWidth(10)),  
415 - // color: menuTitle[index].select  
416 - // ? MyColours.color_438E93  
417 - // : MyColours.color_999999,  
418 - border: Border.all(  
419 - color: menuTitle[index].select  
420 - ? MyColours.color_438E93  
421 - : MyColours.color_999999,  
422 - width:  
423 - ScreenUtil().setWidth(2))),  
424 - child: Text(  
425 - menuTitle[index].title,  
426 - overflow: TextOverflow.ellipsis,  
427 - style: TextStyle(  
428 - color: menuTitle[index].select  
429 - ? MyColours.color_438E93  
430 - : MyColours.color_999999,  
431 - fontSize: ScreenUtil().setSp(24),  
432 - decoration: TextDecoration.none,  
433 - fontWeight: FontWeight.normal),  
434 - ),  
435 - ),  
436 - );  
437 - })))  
438 - ],  
439 - ),  
440 - ),  
441 - Expanded(child:  
442 - Consumer<CustomerProvider>(builder: (context, model, _) {  
443 - if (model.pageStateMyHome != PageState.Success) {  
444 - return ExceptionPage(  
445 - pageState: model.pageStateMyHome,  
446 - callback: () {  
447 - _getGuestManageData();  
448 - },  
449 - emptyMsg: "暂时没有我的客情哦",  
450 - emptyImg: "empty_search",  
451 - showMsg: "加载中,请稍后...",  
452 - );  
453 - } else {  
454 - return Column(children: [  
455 - Expanded(  
456 - child: SingleChildScrollView(  
457 - controller: _controller,  
458 - child: Column(  
459 - children: [  
460 - // VEmptyView(10),  
461 - InkWell( 389 + HEmptyView(48),
  390 + Expanded(
  391 + child: SizedBox(
  392 + // height: ScreenUtil().setWidth(30),
  393 + child: ListView.builder(
  394 + itemCount: menuTitle.length,
  395 + shrinkWrap: true,
  396 + controller: _controller,
  397 + scrollDirection: Axis.horizontal,
  398 + itemBuilder: (BuildContext contxt, int index) {
  399 + return InkWell(
462 onTap: () { 400 onTap: () {
463 - NavigatorUtil.goMyCustomerListPage(  
464 - context, FromPage.FromPageMyCustomer); 401 + for (MessageMenuModel item in menuTitle) {
  402 + item.select = false;
  403 + }
  404 + menuTitle[index].select = true;
  405 + setState(() {});
  406 + _getSellerCountsList(
  407 + isShowLoading: true, callback: () {});
  408 + // offset = 0;
  409 + // 1提前点餐/2内部预订/10在线预订/15店内消息传/12在线买单
  410 +
  411 + // if (index == 0) {
  412 + // typeid = '';
  413 + // } else if (index == 1) {
  414 + // //店内消息
  415 + // typeid = '15';
  416 + // } else if (index == 2) {
  417 + // //在线预订
  418 + // typeid = '10';
  419 + // } else if (index == 3) {
  420 + // //提前点餐
  421 + // typeid = '1';
  422 + // } else if (index == 4) {
  423 + // //在线买单
  424 + // typeid = '12';
  425 + // } else if (index == 5) {
  426 + // //会员充值
  427 + // typeid = '17';
  428 + // } else if (index == 6) {
  429 + // //存酒超期
  430 + // typeid = '18';
  431 + // }
  432 + // getMessage(typeid, showLoading: true);
465 }, 433 },
466 child: Container( 434 child: Container(
467 - height: w(80),  
468 - color: MyColours.color_ffffff,  
469 - child: Row(  
470 - mainAxisAlignment: MainAxisAlignment.center,  
471 - children: [  
472 - // Text(  
473 - // '累计',  
474 - // style: TextStyle(  
475 - // color: MyColours.color_515151,  
476 - // fontWeight: FontWeight.bold,  
477 - // fontSize: ScreenUtil().setSp(32)),  
478 - // ),  
479 - Text(  
480 - '${widget.customerProvider.guestSunmodel.myCustomer}',  
481 - style: TextStyle(  
482 - color: MyColours.color_199095,  
483 - fontSize: ScreenUtil().setSp(64),  
484 - fontWeight: FontWeight.bold),  
485 - ),  
486 - Text(  
487 - '位',  
488 - style: TextStyle(  
489 - color: MyColours.color_515151,  
490 - fontWeight: FontWeight.bold,  
491 - fontSize: ScreenUtil().setSp(32)),  
492 - )  
493 - ], 435 + // width: ScreenUtil().setWidth(104 * 2),
  436 +
  437 + margin: EdgeInsets.only(
  438 + right: ScreenUtil().setWidth(30),
494 ), 439 ),
495 - )),  
496 - VEmptyView(10),  
497 - // GridView.builder(  
498 - // controller: _controller,  
499 - // shrinkWrap: true,  
500 - // cacheExtent: ScreenUtil().setWidth(0),  
501 - // itemCount: 3,  
502 - // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(  
503 - // crossAxisCount: 3,  
504 - // childAspectRatio: 1,  
505 - // mainAxisSpacing: ScreenUtil().setWidth(10),  
506 - // crossAxisSpacing: ScreenUtil().setWidth(10)),  
507 - // itemBuilder: (BuildContext context, int index) {  
508 - // // locationState = state;  
509 - // return _percentWidget(  
510 - // '${widget.customerProvider.guestSunmodel.active.count}',  
511 - // '活跃客户',  
512 - // '${widget.customerProvider.guestSunmodel.active.scale}');  
513 - // }),  
514 - Row( 440 + padding: EdgeInsets.symmetric(
  441 + horizontal: ScreenUtil().setWidth(10),
  442 + vertical: ScreenUtil().setWidth(4)),
  443 + alignment: Alignment.center,
  444 + decoration: BoxDecoration(
  445 + borderRadius: BorderRadius.circular(
  446 + ScreenUtil().setWidth(10)),
  447 + // color: menuTitle[index].select
  448 + // ? MyColours.color_438E93
  449 + // : MyColours.color_999999,
  450 + border: Border.all(
  451 + color: menuTitle[index].select
  452 + ? MyColours.color_438E93
  453 + : MyColours.color_999999,
  454 + width: ScreenUtil().setWidth(2))),
  455 + child: Text(
  456 + menuTitle[index].title,
  457 + overflow: TextOverflow.ellipsis,
  458 + style: TextStyle(
  459 + color: menuTitle[index].select
  460 + ? MyColours.color_438E93
  461 + : MyColours.color_999999,
  462 + fontSize: ScreenUtil().setSp(24),
  463 + decoration: TextDecoration.none,
  464 + fontWeight: FontWeight.normal),
  465 + ),
  466 + ),
  467 + );
  468 + })))
  469 + ],
  470 + ),
  471 + ),
  472 + Expanded(
  473 + child: SingleChildScrollView(
  474 + controller: _controller,
  475 + child: Column(
  476 + children: [
  477 + // VEmptyView(10),
  478 + InkWell(
  479 + onTap: () {
  480 + NavigatorUtil.goMyCustomerListPage(
  481 + context, FromPage.FromPageMyCustomer);
  482 + },
  483 + child: Container(
  484 + height: w(80),
  485 + color: MyColours.color_ffffff,
  486 + child: Row(
  487 + mainAxisAlignment: MainAxisAlignment.center,
  488 + children: [
  489 + // Text(
  490 + // '累计',
  491 + // style: TextStyle(
  492 + // color: MyColours.color_515151,
  493 + // fontWeight: FontWeight.bold,
  494 + // fontSize: ScreenUtil().setSp(32)),
  495 + // ),
  496 + Text(
  497 + '${widget.customerProvider.guestSunmodel.myCustomer}',
  498 + style: TextStyle(
  499 + color: MyColours.color_199095,
  500 + fontSize: ScreenUtil().setSp(64),
  501 + fontWeight: FontWeight.bold),
  502 + ),
  503 + Text(
  504 + '位',
  505 + style: TextStyle(
  506 + color: MyColours.color_515151,
  507 + fontWeight: FontWeight.bold,
  508 + fontSize: ScreenUtil().setSp(32)),
  509 + )
  510 + ],
  511 + ),
  512 + )),
  513 + VEmptyView(10),
  514 + // GridView.builder(
  515 + // controller: _controller,
  516 + // shrinkWrap: true,
  517 + // cacheExtent: ScreenUtil().setWidth(0),
  518 + // itemCount: 3,
  519 + // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
  520 + // crossAxisCount: 3,
  521 + // childAspectRatio: 1,
  522 + // mainAxisSpacing: ScreenUtil().setWidth(10),
  523 + // crossAxisSpacing: ScreenUtil().setWidth(10)),
  524 + // itemBuilder: (BuildContext context, int index) {
  525 + // // locationState = state;
  526 + // return _percentWidget(
  527 + // '${widget.customerProvider.guestSunmodel.active.count}',
  528 + // '活跃客户',
  529 + // '${widget.customerProvider.guestSunmodel.active.scale}');
  530 + // }),
  531 + Row(
  532 + children: [
  533 + _percentWidget(
  534 + '${widget.customerProvider.guestSunmodel.active.count}',
  535 + '活跃',
  536 + '${widget.customerProvider.guestSunmodel.active.scale}'),
  537 + HEmptyView(10),
  538 + _percentWidget(
  539 + '${widget.customerProvider.guestSunmodel.sleep.count}',
  540 + '60天未到店',
  541 + '${widget.customerProvider.guestSunmodel.sleep.scale}'),
  542 + HEmptyView(10),
  543 + _percentWidget(
  544 + '${widget.customerProvider.guestSunmodel.drain.count}',
  545 + '120天未到店',
  546 + '${widget.customerProvider.guestSunmodel.drain.scale}'),
  547 + ],
  548 + ),
  549 + ListView.builder(
  550 + controller: _controller,
  551 + shrinkWrap: true,
  552 + cacheExtent: ScreenUtil().setWidth(0),
  553 + itemCount:
  554 + widget.customerProvider.guestSunmodel.tips.task ==
  555 + null ||
  556 + widget.customerProvider.guestSunmodel.tips.task
  557 + .length ==
  558 + 0
  559 + ? 0
  560 + : widget.customerProvider.guestSunmodel.tips.task
  561 + .length,
  562 + itemBuilder: (BuildContext context, int index) {
  563 + // locationState = state;
  564 + Task data = widget
  565 + .customerProvider.guestSunmodel.tips.task[index];
  566 + return Column(
  567 + children: [
  568 + VEmptyView(10),
  569 + Container(
  570 + color: MyColours.color_ffffff,
  571 + padding: EdgeInsets.symmetric(
  572 + horizontal: ScreenUtil().setWidth(20),
  573 + vertical: ScreenUtil().setWidth(30)),
  574 + child: Row(
515 children: [ 575 children: [
516 - _percentWidget(  
517 - '${widget.customerProvider.guestSunmodel.active.count}',  
518 - '活跃',  
519 - '${widget.customerProvider.guestSunmodel.active.scale}'),  
520 - HEmptyView(10),  
521 - _percentWidget(  
522 - '${widget.customerProvider.guestSunmodel.sleep.count}',  
523 - '60天未到店',  
524 - '${widget.customerProvider.guestSunmodel.sleep.scale}'),  
525 - HEmptyView(10),  
526 - _percentWidget(  
527 - '${widget.customerProvider.guestSunmodel.drain.count}',  
528 - '120天未到店',  
529 - '${widget.customerProvider.guestSunmodel.drain.scale}'),  
530 - ],  
531 - ),  
532 - ListView.builder(  
533 - controller: _controller,  
534 - shrinkWrap: true,  
535 - cacheExtent: ScreenUtil().setWidth(0),  
536 - itemCount: widget.customerProvider.guestSunmodel  
537 - .tips.task ==  
538 - null ||  
539 - widget.customerProvider.guestSunmodel  
540 - .tips.task.length ==  
541 - 0  
542 - ? 0  
543 - : widget.customerProvider.guestSunmodel.tips  
544 - .task.length,  
545 - itemBuilder: (BuildContext context, int index) {  
546 - // locationState = state;  
547 - Task data = widget.customerProvider  
548 - .guestSunmodel.tips.task[index];  
549 - return Column(  
550 - children: [  
551 - VEmptyView(10),  
552 - Container(  
553 - color: MyColours.color_ffffff,  
554 - padding: EdgeInsets.symmetric(  
555 - horizontal:  
556 - ScreenUtil().setWidth(20),  
557 - vertical:  
558 - ScreenUtil().setWidth(30)),  
559 - child: Row(  
560 - children: [  
561 - Image.asset(  
562 - Utils.getImgPath('warning'),  
563 - width: ScreenUtil().setWidth(42),  
564 - ),  
565 - HEmptyView(15),  
566 - Expanded(  
567 - child: Column(  
568 - crossAxisAlignment:  
569 - CrossAxisAlignment.start,  
570 - children: [  
571 - Text(  
572 - '店内任务:${data.content}',  
573 - maxLines: 1,  
574 - overflow:  
575 - TextOverflow.ellipsis,  
576 - style: TextStyle(  
577 - color: MyColours  
578 - .color_333333,  
579 - fontSize: ScreenUtil()  
580 - .setSp(32)),  
581 - ),  
582 - data.aid != null &&  
583 - data.aidStr != null  
584 - ? Padding(  
585 - padding: EdgeInsets.only(  
586 - top: ScreenUtil()  
587 - .setWidth(8)),  
588 - child: Text(  
589 - '优惠内容:${data.aidStr}',  
590 - maxLines: 1,  
591 - overflow: TextOverflow  
592 - .ellipsis,  
593 - style: TextStyle(  
594 - color: MyColours  
595 - .color_333333,  
596 - fontSize:  
597 - ScreenUtil()  
598 - .setSp(  
599 - 24)),  
600 - ),  
601 - )  
602 - : SizedBox(),  
603 - VEmptyView(8),  
604 - Text(  
605 - '创建人:${data.createUser}',  
606 - maxLines: 1,  
607 - overflow:  
608 - TextOverflow.ellipsis,  
609 - style: TextStyle(  
610 - color: MyColours  
611 - .color_333333,  
612 - fontSize: ScreenUtil()  
613 - .setSp(26)),  
614 - )  
615 - ],  
616 - )),  
617 - HEmptyView(20),  
618 - Column(children: [  
619 - RoundButton(  
620 - text: '立即完成',  
621 -  
622 - padding: EdgeInsets.symmetric(  
623 - horizontal: ScreenUtil()  
624 - .setWidth(26)),  
625 - gradientStart:  
626 - MyColours.color_199095,  
627 - gradientEnd:  
628 - MyColours.color_199095,  
629 - // borderColor: MyColours.color_999999,  
630 - radius:  
631 - ScreenUtil().setWidth(40),  
632 - height:  
633 - ScreenUtil().setWidth(64),  
634 - width:  
635 - ScreenUtil().setWidth(180),  
636 - fontSize: 26,  
637 - isBold: false,  
638 - onPressed: () {  
639 - SellerList sellerList =  
640 - SellerList.fromJson(  
641 - json.decode(json  
642 - .encode(data)));  
643 - NavigatorUtil  
644 - .goMyMakeMarkingPageOnlyShow(  
645 - context, sellerList);  
646 - },  
647 - ),  
648 - data.remainingTime != null  
649 - ? Padding(  
650 - padding: EdgeInsets.only(  
651 - top: ScreenUtil()  
652 - .setWidth(6)),  
653 - child: Text(  
654 - '${data.remainingTime}天内',  
655 - maxLines: 1,  
656 - overflow: TextOverflow  
657 - .ellipsis,  
658 - style: TextStyle(  
659 - color:  
660 - Color.fromRGBO(  
661 - 215,  
662 - 30,  
663 - 40,  
664 - 1),  
665 - fontSize:  
666 - ScreenUtil()  
667 - .setSp(26)),  
668 - ))  
669 - : SizedBox()  
670 - ])  
671 - ],  
672 - ),  
673 - ),  
674 - ],  
675 - );  
676 - }),  
677 - ListView.builder(  
678 - controller: _controller,  
679 - shrinkWrap: true,  
680 - cacheExtent: ScreenUtil().setWidth(0),  
681 - itemCount: widget.customerProvider.guestSunmodel  
682 - .tips.recover ==  
683 - null ||  
684 - widget.customerProvider.guestSunmodel  
685 - .tips.recover.length ==  
686 - 0  
687 - ? 0  
688 - : 1,  
689 - itemBuilder: (BuildContext context, int index) {  
690 - // locationState = state;  
691 -  
692 - return Column(  
693 - children: [  
694 - VEmptyView(10),  
695 - Container(  
696 - color: MyColours.color_ffffff,  
697 - padding: EdgeInsets.symmetric(  
698 - horizontal:  
699 - ScreenUtil().setWidth(20),  
700 - vertical:  
701 - ScreenUtil().setWidth(30)),  
702 - child: Row(  
703 - children: [  
704 - Image.asset(  
705 - Utils.getImgPath('warning'),  
706 - width: ScreenUtil().setWidth(42),  
707 - ),  
708 - HEmptyView(15),  
709 - Expanded(  
710 - child: Text(  
711 - '${widget.customerProvider.guestSunmodel.tips.recover[0]}',  
712 - maxLines: 10, 576 + Image.asset(
  577 + Utils.getImgPath('warning'),
  578 + width: ScreenUtil().setWidth(42),
  579 + ),
  580 + HEmptyView(15),
  581 + Expanded(
  582 + child: Column(
  583 + crossAxisAlignment: CrossAxisAlignment.start,
  584 + children: [
  585 + Text(
  586 + '店内任务:${data.content}',
  587 + maxLines: 1,
  588 + overflow: TextOverflow.ellipsis,
  589 + style: TextStyle(
  590 + color: MyColours.color_333333,
  591 + fontSize: ScreenUtil().setSp(32)),
  592 + ),
  593 + data.aid != null && data.aidStr != null
  594 + ? Padding(
  595 + padding: EdgeInsets.only(
  596 + top: ScreenUtil().setWidth(8)),
  597 + child: Text(
  598 + '优惠内容:${data.aidStr}',
  599 + maxLines: 1,
713 overflow: TextOverflow.ellipsis, 600 overflow: TextOverflow.ellipsis,
714 style: TextStyle( 601 style: TextStyle(
715 color: MyColours.color_333333, 602 color: MyColours.color_333333,
716 fontSize: 603 fontSize:
717 - ScreenUtil().setSp(32)),  
718 - )),  
719 - HEmptyView(20),  
720 - RoundButton(  
721 - text: '一键追回',  
722 - padding: EdgeInsets.symmetric(  
723 - horizontal: ScreenUtil()  
724 - .setWidth(26)),  
725 - gradientStart:  
726 - MyColours.color_199095,  
727 - gradientEnd:  
728 - MyColours.color_199095,  
729 - // borderColor: MyColours.color_999999,  
730 - radius: ScreenUtil().setWidth(40),  
731 - height: ScreenUtil().setWidth(64),  
732 - width: ScreenUtil().setWidth(180),  
733 - fontSize: 26,  
734 - isBold: false,  
735 - onPressed: () {  
736 - NavigatorUtil.goMyMakeMarkingPage(  
737 - context,  
738 - fromPage: FromPage  
739 - .FromPageMyCustomer,  
740 - homeGid: Utils  
741 - .listToStringEnglish1(  
742 - widget  
743 - .customerProvider  
744 - .guestSunmodel  
745 - .tips  
746 - .recover[1]));  
747 - }, 604 + ScreenUtil().setSp(24)),
748 ), 605 ),
749 - ],  
750 - ),  
751 - ),  
752 - ],  
753 - );  
754 - }),  
755 - ListView.builder(  
756 - controller: _controller,  
757 - shrinkWrap: true,  
758 - cacheExtent: ScreenUtil().setWidth(0),  
759 - itemCount: widget.customerProvider.guestSunmodel  
760 - .tips.awaken ==  
761 - null ||  
762 - widget.customerProvider.guestSunmodel  
763 - .tips.awaken.length ==  
764 - 0  
765 - ? 0  
766 - : 1,  
767 - itemBuilder: (BuildContext context, int index) {  
768 - // locationState = state; 606 + )
  607 + : SizedBox(),
  608 + VEmptyView(8),
  609 + Text(
  610 + '创建人:${data.createUser}',
  611 + maxLines: 1,
  612 + overflow: TextOverflow.ellipsis,
  613 + style: TextStyle(
  614 + color: MyColours.color_333333,
  615 + fontSize: ScreenUtil().setSp(26)),
  616 + )
  617 + ],
  618 + )),
  619 + HEmptyView(20),
  620 + Column(children: [
  621 + RoundButton(
  622 + text: '立即完成',
769 623
770 - return Column(  
771 - children: [  
772 - VEmptyView(10),  
773 - Container(  
774 - color: MyColours.color_ffffff,  
775 - padding: EdgeInsets.symmetric(  
776 - horizontal:  
777 - ScreenUtil().setWidth(20),  
778 - vertical:  
779 - ScreenUtil().setWidth(30)),  
780 - child: Row(  
781 - children: [  
782 - Image.asset(  
783 - Utils.getImgPath('warning'),  
784 - width: ScreenUtil().setWidth(42),  
785 - ),  
786 - HEmptyView(15),  
787 - Expanded(  
788 - child: Text(  
789 - '${widget.customerProvider.guestSunmodel.tips.awaken[0]}',  
790 - maxLines: 10,  
791 - overflow: TextOverflow.ellipsis,  
792 - style: TextStyle(  
793 - color: MyColours.color_333333,  
794 - fontSize:  
795 - ScreenUtil().setSp(32)),  
796 - )),  
797 - HEmptyView(20),  
798 - RoundButton(  
799 - text: '一键唤醒',  
800 - padding: EdgeInsets.symmetric(  
801 - horizontal: ScreenUtil()  
802 - .setWidth(26)),  
803 - gradientStart:  
804 - MyColours.color_199095,  
805 - gradientEnd:  
806 - MyColours.color_199095,  
807 - // borderColor: MyColours.color_999999,  
808 - radius: ScreenUtil().setWidth(40),  
809 - height: ScreenUtil().setWidth(64),  
810 - width: ScreenUtil().setWidth(180),  
811 - fontSize: 26,  
812 - isBold: false,  
813 - onPressed: () {  
814 - NavigatorUtil.goMyMakeMarkingPage(  
815 - context,  
816 - fromPage: FromPage  
817 - .FromPageMyCustomer,  
818 - homeGid: Utils  
819 - .listToStringEnglish1(  
820 - widget  
821 - .customerProvider  
822 - .guestSunmodel  
823 - .tips  
824 - .awaken[1]));  
825 - },  
826 - ),  
827 - ],  
828 - ),  
829 - ),  
830 - ],  
831 - );  
832 - }),  
833 - _chart(),  
834 - ListView.builder(  
835 - itemCount: widget.customerProvider  
836 - .managerStatisticsList.length,  
837 - shrinkWrap: true,  
838 - controller: _controller,  
839 - padding:  
840 - EdgeInsets.symmetric(horizontal: w(10)),  
841 - itemBuilder: (context, index) {  
842 - SellerCountsListSunModel countsListSunModel =  
843 - widget.customerProvider  
844 - .managerStatisticsList[index];  
845 - return InkWell(  
846 - onTap: () {  
847 - String uid = '';  
848 - menuTitle.forEach((element) {  
849 - if (element.select) {  
850 - uid = element.uid;  
851 - }  
852 - });  
853 - NavigatorUtil.goMonthOrderPage(  
854 - context,  
855 - year.toString(),  
856 - countsListSunModel.monthss  
857 - .toString(),  
858 - uid: uid);  
859 - },  
860 - child: MonthItem(  
861 - countsListSunModel:  
862 - countsListSunModel));  
863 - })  
864 - ],  
865 - ),  
866 - )),  
867 - Container(  
868 - color: MyColours.color_FAFAFA,  
869 - padding: EdgeInsets.only(  
870 - top: w(13),  
871 - bottom: w(26),  
872 - left: w(45),  
873 - right: (45)),  
874 - child: Stack(  
875 - children: [  
876 - RoundButton(  
877 - onPressed: () {  
878 - NavigatorUtil.goMyMarketingRecordsPage(  
879 - context, FromPage.FromPageMyCustomer);  
880 - },  
881 - text: '历史营销记录',  
882 - fontSize: 32,  
883 - isBold: true,  
884 - // margin: EdgeInsets.only(  
885 - // top: w(13),  
886 - // bottom: w(26),  
887 - // left: w(45),  
888 - // right: (45)),  
889 - textColor: MyColours.color_F8F9FD,  
890 - gradientStart: MyColours.color_199095,  
891 - gradientEnd: MyColours.color_199095,  
892 - borderColor: MyColours.color_199095,  
893 - height: ScreenUtil().setWidth(86),  
894 - // width: ScreenUtil().setWidth(260),  
895 - radius: ScreenUtil().setWidth(10),  
896 - ),  
897 - showWarning  
898 - ? Positioned(  
899 - right: ScreenUtil().setWidth(30),  
900 - top: ScreenUtil().setWidth(45 / 2),  
901 - child: Image.asset(  
902 - Utils.getImgPath('warning'),  
903 - width: ScreenUtil().setWidth(35),  
904 - ))  
905 - : SizedBox()  
906 - ],  
907 - ))  
908 - ]);  
909 - }  
910 - })) 624 + padding: EdgeInsets.symmetric(
  625 + horizontal: ScreenUtil().setWidth(26)),
  626 + gradientStart: MyColours.color_199095,
  627 + gradientEnd: MyColours.color_199095,
  628 + // borderColor: MyColours.color_999999,
  629 + radius: ScreenUtil().setWidth(40),
  630 + height: ScreenUtil().setWidth(64),
  631 + width: ScreenUtil().setWidth(180),
  632 + fontSize: 26,
  633 + isBold: false,
  634 + onPressed: () {
  635 + SellerList sellerList =
  636 + SellerList.fromJson(
  637 + json.decode(json.encode(data)));
  638 + NavigatorUtil.goMyMakeMarkingPageOnlyShow(
  639 + context, sellerList);
  640 + },
  641 + ),
  642 + data.remainingTime != null
  643 + ? Padding(
  644 + padding: EdgeInsets.only(
  645 + top: ScreenUtil().setWidth(6)),
  646 + child: Text(
  647 + '${data.remainingTime}天内',
  648 + maxLines: 1,
  649 + overflow: TextOverflow.ellipsis,
  650 + style: TextStyle(
  651 + color: Color.fromRGBO(
  652 + 215, 30, 40, 1),
  653 + fontSize:
  654 + ScreenUtil().setSp(26)),
  655 + ))
  656 + : SizedBox()
  657 + ])
  658 + ],
  659 + ),
  660 + ),
  661 + ],
  662 + );
  663 + }),
  664 + ListView.builder(
  665 + controller: _controller,
  666 + shrinkWrap: true,
  667 + cacheExtent: ScreenUtil().setWidth(0),
  668 + itemCount:
  669 + widget.customerProvider.guestSunmodel.tips.recover ==
  670 + null ||
  671 + widget.customerProvider.guestSunmodel.tips
  672 + .recover.length ==
  673 + 0
  674 + ? 0
  675 + : 1,
  676 + itemBuilder: (BuildContext context, int index) {
  677 + // locationState = state;
  678 +
  679 + return Column(
  680 + children: [
  681 + VEmptyView(10),
  682 + Container(
  683 + color: MyColours.color_ffffff,
  684 + padding: EdgeInsets.symmetric(
  685 + horizontal: ScreenUtil().setWidth(20),
  686 + vertical: ScreenUtil().setWidth(30)),
  687 + child: Row(
  688 + children: [
  689 + Image.asset(
  690 + Utils.getImgPath('warning'),
  691 + width: ScreenUtil().setWidth(42),
  692 + ),
  693 + HEmptyView(15),
  694 + Expanded(
  695 + child: Text(
  696 + '${widget.customerProvider.guestSunmodel.tips.recover[0]}',
  697 + maxLines: 10,
  698 + overflow: TextOverflow.ellipsis,
  699 + style: TextStyle(
  700 + color: MyColours.color_333333,
  701 + fontSize: ScreenUtil().setSp(32)),
  702 + )),
  703 + HEmptyView(20),
  704 + RoundButton(
  705 + text: '一键追回',
  706 + padding: EdgeInsets.symmetric(
  707 + horizontal: ScreenUtil().setWidth(26)),
  708 + gradientStart: MyColours.color_199095,
  709 + gradientEnd: MyColours.color_199095,
  710 + // borderColor: MyColours.color_999999,
  711 + radius: ScreenUtil().setWidth(40),
  712 + height: ScreenUtil().setWidth(64),
  713 + width: ScreenUtil().setWidth(180),
  714 + fontSize: 26,
  715 + isBold: false,
  716 + onPressed: () {
  717 + NavigatorUtil.goMyMakeMarkingPage(context,
  718 + fromPage: FromPage.FromPageMyCustomer,
  719 + homeGid: Utils.listToStringEnglish1(
  720 + widget
  721 + .customerProvider
  722 + .guestSunmodel
  723 + .tips
  724 + .recover[1]));
  725 + },
  726 + ),
  727 + ],
  728 + ),
  729 + ),
  730 + ],
  731 + );
  732 + }),
  733 + ListView.builder(
  734 + controller: _controller,
  735 + shrinkWrap: true,
  736 + cacheExtent: ScreenUtil().setWidth(0),
  737 + itemCount:
  738 + widget.customerProvider.guestSunmodel.tips.awaken ==
  739 + null ||
  740 + widget.customerProvider.guestSunmodel.tips
  741 + .awaken.length ==
  742 + 0
  743 + ? 0
  744 + : 1,
  745 + itemBuilder: (BuildContext context, int index) {
  746 + // locationState = state;
  747 +
  748 + return Column(
  749 + children: [
  750 + VEmptyView(10),
  751 + Container(
  752 + color: MyColours.color_ffffff,
  753 + padding: EdgeInsets.symmetric(
  754 + horizontal: ScreenUtil().setWidth(20),
  755 + vertical: ScreenUtil().setWidth(30)),
  756 + child: Row(
  757 + children: [
  758 + Image.asset(
  759 + Utils.getImgPath('warning'),
  760 + width: ScreenUtil().setWidth(42),
  761 + ),
  762 + HEmptyView(15),
  763 + Expanded(
  764 + child: Text(
  765 + '${widget.customerProvider.guestSunmodel.tips.awaken[0]}',
  766 + maxLines: 10,
  767 + overflow: TextOverflow.ellipsis,
  768 + style: TextStyle(
  769 + color: MyColours.color_333333,
  770 + fontSize: ScreenUtil().setSp(32)),
  771 + )),
  772 + HEmptyView(20),
  773 + RoundButton(
  774 + text: '一键唤醒',
  775 + padding: EdgeInsets.symmetric(
  776 + horizontal: ScreenUtil().setWidth(26)),
  777 + gradientStart: MyColours.color_199095,
  778 + gradientEnd: MyColours.color_199095,
  779 + // borderColor: MyColours.color_999999,
  780 + radius: ScreenUtil().setWidth(40),
  781 + height: ScreenUtil().setWidth(64),
  782 + width: ScreenUtil().setWidth(180),
  783 + fontSize: 26,
  784 + isBold: false,
  785 + onPressed: () {
  786 + NavigatorUtil.goMyMakeMarkingPage(context,
  787 + fromPage: FromPage.FromPageMyCustomer,
  788 + homeGid: Utils.listToStringEnglish1(
  789 + widget.customerProvider
  790 + .guestSunmodel.tips.awaken[1]));
  791 + },
  792 + ),
  793 + ],
  794 + ),
  795 + ),
  796 + ],
  797 + );
  798 + }),
  799 + _chart(),
  800 + ListView.builder(
  801 + itemCount:
  802 + widget.customerProvider.managerStatisticsList.length,
  803 + shrinkWrap: true,
  804 + controller: _controller,
  805 + padding: EdgeInsets.symmetric(horizontal: w(10)),
  806 + itemBuilder: (context, index) {
  807 + SellerCountsListSunModel countsListSunModel =
  808 + widget.customerProvider.managerStatisticsList[index];
  809 + return InkWell(
  810 + onTap: () {
  811 + String uid = '';
  812 + menuTitle.forEach((element) {
  813 + if (element.select) {
  814 + uid = element.uid;
  815 + }
  816 + });
  817 + NavigatorUtil.goMonthOrderPage(
  818 + context,
  819 + year.toString(),
  820 + countsListSunModel.monthss.toString(),
  821 + uid: uid);
  822 + },
  823 + child: MonthItem(
  824 + countsListSunModel: countsListSunModel));
  825 + })
911 ], 826 ],
912 - ))); 827 + ),
  828 + )),
  829 + // Container(
  830 + // color: MyColours.color_FAFAFA,
  831 + // padding: EdgeInsets.only(
  832 + // top: w(13), bottom: w(26), left: w(45), right: (45)),
  833 + // child: Stack(
  834 + // children: [
  835 + // RoundButton(
  836 + // onPressed: () {
  837 + // NavigatorUtil.goMyMarketingRecordsPage(
  838 + // context, FromPage.FromPageMyCustomer);
  839 + // },
  840 + // text: '历史营销记录',
  841 + // fontSize: 32,
  842 + // isBold: true,
  843 + // // margin: EdgeInsets.only(
  844 + // // top: w(13),
  845 + // // bottom: w(26),
  846 + // // left: w(45),
  847 + // // right: (45)),
  848 + // textColor: MyColours.color_F8F9FD,
  849 + // gradientStart: MyColours.color_199095,
  850 + // gradientEnd: MyColours.color_199095,
  851 + // borderColor: MyColours.color_199095,
  852 + // height: ScreenUtil().setWidth(86),
  853 + // // width: ScreenUtil().setWidth(260),
  854 + // radius: ScreenUtil().setWidth(10),
  855 + // ),
  856 + // showWarning
  857 + // ? Positioned(
  858 + // right: ScreenUtil().setWidth(30),
  859 + // top: ScreenUtil().setWidth(45 / 2),
  860 + // child: Image.asset(
  861 + // Utils.getImgPath('warning'),
  862 + // width: ScreenUtil().setWidth(35),
  863 + // ))
  864 + // : SizedBox()
  865 + // ],
  866 + // ))
  867 + ]);
  868 + }
  869 + })));
913 } 870 }
914 } 871 }
@@ -101,7 +101,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -101,7 +101,7 @@ class TableManagerPageState extends State<TableManagerPage> {
101 String smsErro = ''; 101 String smsErro = '';
102 String showErro = ''; 102 String showErro = '';
103 103
104 - // ScrollController _scrollCrl = ScrollController(); 104 + ScrollController _scrollCrl = ScrollController();
105 final ItemPositionsListener itemPositionsListener = 105 final ItemPositionsListener itemPositionsListener =
106 ItemPositionsListener.create(); 106 ItemPositionsListener.create();
107 107
@@ -813,6 +813,9 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -813,6 +813,9 @@ class TableManagerPageState extends State<TableManagerPage> {
813 }); 813 });
814 return; 814 return;
815 } 815 }
  816 + setState(() {
  817 + showPhoneHistory = true;
  818 + });
816 Map<String, String> params = { 819 Map<String, String> params = {
817 "keywords": value, 820 "keywords": value,
818 "sid": Provider.of<UserModel>(context, listen: false) 821 "sid": Provider.of<UserModel>(context, listen: false)
@@ -1190,7 +1193,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -1190,7 +1193,7 @@ class TableManagerPageState extends State<TableManagerPage> {
1190 blurRadius: ScreenUtil().setWidth(20)) 1193 blurRadius: ScreenUtil().setWidth(20))
1191 ]), 1194 ]),
1192 // width: double.infinity, 1195 // width: double.infinity,
1193 - width: ScreenUtil().screenWidth-w(60), 1196 + width: ScreenUtil().screenWidth - w(60),
1194 // width: ScreenUtil().setWidth(350), 1197 // width: ScreenUtil().setWidth(350),
1195 constraints: BoxConstraints(maxHeight: w(170)), 1198 constraints: BoxConstraints(maxHeight: w(170)),
1196 // height: _baseIndoProvider.userHistorys.length > 1 1199 // height: _baseIndoProvider.userHistorys.length > 1
@@ -1203,98 +1206,110 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -1203,98 +1206,110 @@ class TableManagerPageState extends State<TableManagerPage> {
1203 child: MediaQuery.removePadding( 1206 child: MediaQuery.removePadding(
1204 context: context, 1207 context: context,
1205 removeTop: true, 1208 removeTop: true,
1206 - child: ListView.builder(  
1207 - shrinkWrap: true,  
1208 - itemBuilder: (context, index) {  
1209 - return GestureDetector(  
1210 - onTap: () {  
1211 - setState(() {  
1212 - showPhoneHistory = false;  
1213 - _baseIndoProvider.phoneController  
1214 - .text = _baseIndoProvider  
1215 - .userHistorys[index]  
1216 - .phone !=  
1217 - null  
1218 - ? _baseIndoProvider  
1219 - .userHistorys[index].phone  
1220 - : '';  
1221 - // _homeEnterModel.nameController.text =  
1222 - // _homeEnterModel  
1223 - // .userHistorys[index].rname +  
1224 - // _nameSuffix();  
1225 - _addNameSuffix(  
1226 - _baseIndoProvider  
1227 - .userHistorys[index].rname,  
1228 - sexStr);  
1229 - nameStr = _baseIndoProvider  
1230 - .userHistorys[index].rname;  
1231 - _phoneNode.unfocus();  
1232 - _baseIndoProvider.userHistorys  
1233 - .clear();  
1234 - });  
1235 - },  
1236 - child: Container(  
1237 - width: double.infinity,  
1238 - height: ScreenUtil().setWidth(102),  
1239 - decoration: BoxDecoration(  
1240 - border: Border(  
1241 - bottom: (index !=  
1242 - (_baseIndoProvider  
1243 - .userHistorys  
1244 - .length -  
1245 - 1) &&  
1246 - _baseIndoProvider  
1247 - .userHistorys  
1248 - .length >  
1249 - 1)  
1250 - ? BorderSide(  
1251 - color: MyColours  
1252 - .color_e5e5e5,  
1253 - width: ScreenUtil()  
1254 - .setWidth(2))  
1255 - : BorderSide.none)),  
1256 - child: Row(  
1257 - mainAxisAlignment:  
1258 - MainAxisAlignment.spaceBetween,  
1259 - children: [  
1260 - Text(  
1261 - _baseIndoProvider  
1262 - .userHistorys[index]  
1263 - .phone ==  
1264 - null  
1265 - ? ''  
1266 - : _baseIndoProvider  
1267 - .userHistorys[index]  
1268 - .phone,  
1269 - style: TextStyle(  
1270 - color: MyColours.color_333333,  
1271 - fontSize:  
1272 - ScreenUtil().setSp(32)),  
1273 - ),  
1274 - Expanded(  
1275 - child: Text(  
1276 - _baseIndoProvider 1209 + child: Scrollbar(
  1210 + isAlwaysShown: true, //设置滚动条常亮
  1211 + controller: _scrollCrl, //必须设置一个controller
  1212 +
  1213 + ///添加进度条
  1214 + child: ListView.builder(
  1215 + shrinkWrap: true,
  1216 + controller: _scrollCrl,
  1217 + itemBuilder: (context, index) {
  1218 + return GestureDetector(
  1219 + onTap: () {
  1220 + setState(() {
  1221 + showPhoneHistory = false;
  1222 + _baseIndoProvider.phoneController
  1223 + .text = _baseIndoProvider
1277 .userHistorys[index] 1224 .userHistorys[index]
1278 - .rname == 1225 + .phone !=
1279 null 1226 null
1280 - ? ''  
1281 - : _baseIndoProvider 1227 + ? _baseIndoProvider
  1228 + .userHistorys[index].phone
  1229 + : '';
  1230 + // _homeEnterModel.nameController.text =
  1231 + // _homeEnterModel
  1232 + // .userHistorys[index].rname +
  1233 + // _nameSuffix();
  1234 + _addNameSuffix(
  1235 + _baseIndoProvider
1282 .userHistorys[index] 1236 .userHistorys[index]
1283 .rname, 1237 .rname,
1284 - style: TextStyle(  
1285 - color: MyColours.color_333333,  
1286 - fontSize:  
1287 - ScreenUtil().setSp(32)),  
1288 - ))  
1289 - ],  
1290 - ),  
1291 - ),  
1292 - );  
1293 - },  
1294 - itemExtent: ScreenUtil().setWidth(104),  
1295 - itemCount:  
1296 - _baseIndoProvider.userHistorys.length,  
1297 - ))), 1238 + sexStr);
  1239 + nameStr = _baseIndoProvider
  1240 + .userHistorys[index].rname;
  1241 + _phoneNode.unfocus();
  1242 + _baseIndoProvider.userHistorys
  1243 + .clear();
  1244 + });
  1245 + },
  1246 + child: Container(
  1247 + width: double.infinity,
  1248 + height: ScreenUtil().setWidth(102),
  1249 + decoration: BoxDecoration(
  1250 + border: Border(
  1251 + bottom: (index !=
  1252 + (_baseIndoProvider
  1253 + .userHistorys
  1254 + .length -
  1255 + 1) &&
  1256 + _baseIndoProvider
  1257 + .userHistorys
  1258 + .length >
  1259 + 1)
  1260 + ? BorderSide(
  1261 + color: MyColours
  1262 + .color_e5e5e5,
  1263 + width: ScreenUtil()
  1264 + .setWidth(2))
  1265 + : BorderSide.none)),
  1266 + child: Row(
  1267 + mainAxisAlignment:
  1268 + MainAxisAlignment
  1269 + .spaceBetween,
  1270 + children: [
  1271 + Text(
  1272 + _baseIndoProvider
  1273 + .userHistorys[
  1274 + index]
  1275 + .phone ==
  1276 + null
  1277 + ? ''
  1278 + : _baseIndoProvider
  1279 + .userHistorys[index]
  1280 + .phone,
  1281 + style: TextStyle(
  1282 + color: MyColours
  1283 + .color_333333,
  1284 + fontSize: ScreenUtil()
  1285 + .setSp(32)),
  1286 + ),
  1287 + Expanded(
  1288 + child: Text(
  1289 + _baseIndoProvider
  1290 + .userHistorys[
  1291 + index]
  1292 + .rname ==
  1293 + null
  1294 + ? ''
  1295 + : _baseIndoProvider
  1296 + .userHistorys[index]
  1297 + .rname,
  1298 + style: TextStyle(
  1299 + color: MyColours
  1300 + .color_333333,
  1301 + fontSize: ScreenUtil()
  1302 + .setSp(32)),
  1303 + ))
  1304 + ],
  1305 + ),
  1306 + ),
  1307 + );
  1308 + },
  1309 + itemExtent: ScreenUtil().setWidth(104),
  1310 + itemCount:
  1311 + _baseIndoProvider.userHistorys.length,
  1312 + )))),
1298 ), 1313 ),
1299 )), 1314 )),
1300 ], 1315 ],
@@ -2010,6 +2025,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -2010,6 +2025,7 @@ class TableManagerPageState extends State<TableManagerPage> {
2010 tableManagerModel.selectTables = []; 2025 tableManagerModel.selectTables = [];
2011 wechatNotification = true; 2026 wechatNotification = true;
2012 showPhoneHistory = false; //显示客户历史记录 2027 showPhoneHistory = false; //显示客户历史记录
  2028 + _baseIndoProvider.userHistorys.clear();
2013 2029
2014 currentRemark = ''; 2030 currentRemark = '';
2015 2031
@@ -2037,199 +2053,211 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -2037,199 +2053,211 @@ class TableManagerPageState extends State<TableManagerPage> {
2037 2053
2038 ///选中的桌子widget 2054 ///选中的桌子widget
2039 Widget _selectTableWidgetSms() { 2055 Widget _selectTableWidgetSms() {
2040 - return Container(  
2041 - // constraints: BoxConstraints(maxHeight: ScreenUtil().setWidth(760)),  
2042 - // height: ScreenUtil().setWidth(400),  
2043 - width: double.infinity,  
2044 - decoration: BoxDecoration(  
2045 - color: MyColours.color_ffffff,  
2046 - boxShadow: [  
2047 - BoxShadow(  
2048 - color: MyColours.color_333333,  
2049 - blurRadius: ScreenUtil().setWidth(14))  
2050 - ],  
2051 - borderRadius: BorderRadius.only(  
2052 - topLeft: Radius.circular(ScreenUtil().setWidth(24)),  
2053 - topRight: Radius.circular(ScreenUtil().setWidth(24)),  
2054 - )),  
2055 - child: SingleChildScrollView(  
2056 - child: Column(  
2057 - // mainAxisSize: MainAxisSize.min,  
2058 - mainAxisAlignment: MainAxisAlignment.start,  
2059 - crossAxisAlignment: CrossAxisAlignment.start,  
2060 - children: [  
2061 - Stack(alignment: Alignment.centerRight, children: [  
2062 - Container(  
2063 - width: double.infinity,  
2064 - padding: EdgeInsets.symmetric(  
2065 - horizontal: ScreenUtil().setWidth(40),  
2066 - vertical: ScreenUtil().setSp(16),  
2067 - ),  
2068 - decoration: BoxDecoration(  
2069 - color: MyColours.color_f3f3f3,  
2070 - borderRadius: BorderRadius.only(  
2071 - topLeft: Radius.circular(ScreenUtil().setWidth(24)),  
2072 - topRight: Radius.circular(ScreenUtil().setWidth(24)),  
2073 - )),  
2074 - child: Column(  
2075 - children: [  
2076 - Text(  
2077 - tableManagerModel.selectDateStr +  
2078 - ' ' +  
2079 - tableManagerModel.doltStr,  
2080 - style: TextStyle(  
2081 - color: MyColours.color_515151,  
2082 - fontSize: ScreenUtil().setSp(28),  
2083 - fontWeight: FontWeight.bold), 2056 + return InkWell(
  2057 + onTap: () {
  2058 + if (showPhoneHistory) {
  2059 + setState(() {
  2060 + showPhoneHistory = false;
  2061 + });
  2062 + }
  2063 + },
  2064 + child: Container(
  2065 + // constraints: BoxConstraints(maxHeight: ScreenUtil().setWidth(760)),
  2066 + // height: ScreenUtil().setWidth(400),
  2067 + width: double.infinity,
  2068 + decoration: BoxDecoration(
  2069 + color: MyColours.color_ffffff,
  2070 + boxShadow: [
  2071 + BoxShadow(
  2072 + color: MyColours.color_333333,
  2073 + blurRadius: ScreenUtil().setWidth(14))
  2074 + ],
  2075 + borderRadius: BorderRadius.only(
  2076 + topLeft: Radius.circular(ScreenUtil().setWidth(24)),
  2077 + topRight: Radius.circular(ScreenUtil().setWidth(24)),
  2078 + )),
  2079 + child: SingleChildScrollView(
  2080 + child: Column(
  2081 + // mainAxisSize: MainAxisSize.min,
  2082 + mainAxisAlignment: MainAxisAlignment.start,
  2083 + crossAxisAlignment: CrossAxisAlignment.start,
  2084 + children: [
  2085 + Stack(alignment: Alignment.centerRight, children: [
  2086 + Container(
  2087 + width: double.infinity,
  2088 + padding: EdgeInsets.symmetric(
  2089 + horizontal: ScreenUtil().setWidth(40),
  2090 + vertical: ScreenUtil().setSp(16),
2084 ), 2091 ),
2085 - VEmptyView(8),  
2086 - Text(  
2087 - tableManagerModel.selectWeekAndLunarCalendar,  
2088 - style: TextStyle(  
2089 - color: MyColours.color_999999,  
2090 - fontSize: ScreenUtil().setSp(20)),  
2091 - )  
2092 - ],  
2093 - ),  
2094 - ),  
2095 - Positioned(  
2096 - right: ScreenUtil().setWidth(40),  
2097 - child: InkWell(  
2098 - onTap: () {  
2099 - _clearData();  
2100 - },  
2101 - child: Text(  
2102 - '清空',  
2103 - style: TextStyle(  
2104 - decoration: TextDecoration.underline,  
2105 - color: MyColours.color_438E93,  
2106 - fontSize: ScreenUtil().setSp(20)),  
2107 - )))  
2108 - ]),  
2109 - Container(  
2110 - margin: EdgeInsets.only(top: ScreenUtil().setWidth(44)),  
2111 - height: ScreenUtil().setWidth(60),  
2112 - child: ListView.builder(  
2113 - padding: EdgeInsets.only(left: ScreenUtil().setWidth(48)),  
2114 - itemCount: tableManagerModel.selectTables.length,  
2115 - shrinkWrap: true,  
2116 - scrollDirection: Axis.horizontal,  
2117 - itemBuilder: (BuildContext contxt, int index) {  
2118 - t.Table table = tableManagerModel.selectTables[index];  
2119 - return Container(  
2120 - margin:  
2121 - EdgeInsets.only(right: ScreenUtil().setWidth(20)),  
2122 - padding: EdgeInsets.only(  
2123 - left: ScreenUtil().setWidth(16),  
2124 - // right: ScreenUtil().setWidth(4),  
2125 - // top: ScreenUtil().setWidth(14),  
2126 - // bottom: ScreenUtil().setWidth(14)  
2127 - ),  
2128 - decoration: BoxDecoration(  
2129 - border: Border.all(  
2130 - width: ScreenUtil().setWidth(2),  
2131 - color: MyColours.color_438E93),  
2132 - borderRadius: BorderRadius.circular(  
2133 - ScreenUtil().setWidth(8))),  
2134 - child: Row(  
2135 - children: [  
2136 - Text(  
2137 - table.name, 2092 + decoration: BoxDecoration(
  2093 + color: MyColours.color_f3f3f3,
  2094 + borderRadius: BorderRadius.only(
  2095 + topLeft: Radius.circular(ScreenUtil().setWidth(24)),
  2096 + topRight:
  2097 + Radius.circular(ScreenUtil().setWidth(24)),
  2098 + )),
  2099 + child: Column(
  2100 + children: [
  2101 + Text(
  2102 + tableManagerModel.selectDateStr +
  2103 + ' ' +
  2104 + tableManagerModel.doltStr,
  2105 + style: TextStyle(
  2106 + color: MyColours.color_515151,
  2107 + fontSize: ScreenUtil().setSp(28),
  2108 + fontWeight: FontWeight.bold),
  2109 + ),
  2110 + VEmptyView(8),
  2111 + Text(
  2112 + tableManagerModel.selectWeekAndLunarCalendar,
  2113 + style: TextStyle(
  2114 + color: MyColours.color_999999,
  2115 + fontSize: ScreenUtil().setSp(20)),
  2116 + )
  2117 + ],
  2118 + ),
  2119 + ),
  2120 + Positioned(
  2121 + right: ScreenUtil().setWidth(40),
  2122 + child: InkWell(
  2123 + onTap: () {
  2124 + _clearData();
  2125 + },
  2126 + child: Text(
  2127 + '清空',
2138 style: TextStyle( 2128 style: TextStyle(
  2129 + decoration: TextDecoration.underline,
2139 color: MyColours.color_438E93, 2130 color: MyColours.color_438E93,
2140 - fontSize: ScreenUtil().setSp(28)), 2131 + fontSize: ScreenUtil().setSp(20)),
  2132 + )))
  2133 + ]),
  2134 + Container(
  2135 + margin: EdgeInsets.only(top: ScreenUtil().setWidth(44)),
  2136 + height: ScreenUtil().setWidth(60),
  2137 + child: ListView.builder(
  2138 + padding:
  2139 + EdgeInsets.only(left: ScreenUtil().setWidth(48)),
  2140 + itemCount: tableManagerModel.selectTables.length,
  2141 + shrinkWrap: true,
  2142 + scrollDirection: Axis.horizontal,
  2143 + itemBuilder: (BuildContext contxt, int index) {
  2144 + t.Table table = tableManagerModel.selectTables[index];
  2145 + return Container(
  2146 + margin: EdgeInsets.only(
  2147 + right: ScreenUtil().setWidth(20)),
  2148 + padding: EdgeInsets.only(
  2149 + left: ScreenUtil().setWidth(16),
  2150 + // right: ScreenUtil().setWidth(4),
  2151 + // top: ScreenUtil().setWidth(14),
  2152 + // bottom: ScreenUtil().setWidth(14)
2141 ), 2153 ),
2142 - HEmptyView(14),  
2143 - InkWell(  
2144 - onTap: () {  
2145 - //删除已经选择的桌位  
2146 - tableManagerModel.selectTables  
2147 - .removeWhere((t) => t.id == table.id);  
2148 - if (tableManagerModel.selectTables.length ==  
2149 - 0) {  
2150 - // wechatNotification = true;  
2151 - _clearData();  
2152 - } 2154 + decoration: BoxDecoration(
  2155 + border: Border.all(
  2156 + width: ScreenUtil().setWidth(2),
  2157 + color: MyColours.color_438E93),
  2158 + borderRadius: BorderRadius.circular(
  2159 + ScreenUtil().setWidth(8))),
  2160 + child: Row(
  2161 + children: [
  2162 + Text(
  2163 + table.name,
  2164 + style: TextStyle(
  2165 + color: MyColours.color_438E93,
  2166 + fontSize: ScreenUtil().setSp(28)),
  2167 + ),
  2168 + HEmptyView(14),
  2169 + InkWell(
  2170 + onTap: () {
  2171 + //删除已经选择的桌位
  2172 + tableManagerModel.selectTables
  2173 + .removeWhere((t) => t.id == table.id);
  2174 + if (tableManagerModel
  2175 + .selectTables.length ==
  2176 + 0) {
  2177 + // wechatNotification = true;
  2178 + _clearData();
  2179 + }
2153 2180
2154 - for (t.Table item  
2155 - in tableManagerModel.tablesShow) {  
2156 - if (item.id == table.id) {  
2157 - item.selected = false;  
2158 - setState(() {});  
2159 - }  
2160 - }  
2161 - for (t.Table item in tableManagerModel  
2162 - .areaTableMapShow[  
2163 - tableManagerModel  
2164 - .areas[tableManagerModel.selectNumber]  
2165 - .name]) {  
2166 - if (item.id == table.id) {  
2167 - item.selected = false;  
2168 - setState(() {});  
2169 - }  
2170 - }  
2171 - },  
2172 - child: Container(  
2173 - // color: Colors.red,  
2174 - padding: EdgeInsets.only(  
2175 - top: ScreenUtil().setWidth(14),  
2176 - bottom: ScreenUtil().setWidth(14),  
2177 - left: ScreenUtil().setWidth(14),  
2178 - right: ScreenUtil().setWidth(4)),  
2179 - child: Image.asset(  
2180 - Utils.getImgPath('table_m_close'),  
2181 - width: ScreenUtil().setWidth(32)))),  
2182 - ],  
2183 - ),  
2184 - );  
2185 - }),  
2186 - ),  
2187 - // Column(children: [  
2188 - _customerInfoWidget(), 2181 + for (t.Table item
  2182 + in tableManagerModel.tablesShow) {
  2183 + if (item.id == table.id) {
  2184 + item.selected = false;
  2185 + setState(() {});
  2186 + }
  2187 + }
  2188 + for (t.Table item
  2189 + in tableManagerModel.areaTableMapShow[
  2190 + tableManagerModel
  2191 + .areas[tableManagerModel
  2192 + .selectNumber]
  2193 + .name]) {
  2194 + if (item.id == table.id) {
  2195 + item.selected = false;
  2196 + setState(() {});
  2197 + }
  2198 + }
  2199 + },
  2200 + child: Container(
  2201 + // color: Colors.red,
  2202 + padding: EdgeInsets.only(
  2203 + top: ScreenUtil().setWidth(14),
  2204 + bottom: ScreenUtil().setWidth(14),
  2205 + left: ScreenUtil().setWidth(14),
  2206 + right: ScreenUtil().setWidth(4)),
  2207 + child: Image.asset(
  2208 + Utils.getImgPath('table_m_close'),
  2209 + width: ScreenUtil().setWidth(32)))),
  2210 + ],
  2211 + ),
  2212 + );
  2213 + }),
  2214 + ),
  2215 + // Column(children: [
  2216 + _customerInfoWidget(),
2189 2217
2190 - // _couponWidget(),  
2191 - // ]), 2218 + // _couponWidget(),
  2219 + // ]),
2192 2220
2193 - VEmptyView(20),  
2194 - Padding(  
2195 - padding: EdgeInsets.symmetric(  
2196 - horizontal: ScreenUtil().setWidth(36)),  
2197 - child: Row(  
2198 - children: [  
2199 - Expanded(  
2200 - child: RoundButton(  
2201 - text: '短信通知',  
2202 - height: ScreenUtil().setWidth(96),  
2203 - fontSize: 32,  
2204 - gradientStart: MyColours.color_438E93,  
2205 - gradientEnd: MyColours.color_438E93,  
2206 - radius: ScreenUtil().setWidth(8),  
2207 - isBold: false,  
2208 - onPressed: () async {  
2209 - if (myModel.smsInfo == '0') {  
2210 - setState(() {  
2211 - showErro = smsErro;  
2212 - });  
2213 - return;  
2214 - }  
2215 - if ((_baseIndoProvider.phoneController.text  
2216 - .replaceAll(' ', '')  
2217 - .isEmpty ||  
2218 - !Utils.phoneRegExp(_baseIndoProvider  
2219 - .phoneController.text  
2220 - .replaceAll(' ', '')))) {  
2221 - setState(() {  
2222 - showErro = '请输入正确的11位手机号码';  
2223 - });  
2224 - return;  
2225 - } else {  
2226 - setState(() {  
2227 - showErro = '';  
2228 - });  
2229 - } 2221 + VEmptyView(20),
  2222 + Padding(
  2223 + padding: EdgeInsets.symmetric(
  2224 + horizontal: ScreenUtil().setWidth(36)),
  2225 + child: Row(
  2226 + children: [
  2227 + Expanded(
  2228 + child: RoundButton(
  2229 + text: '短信通知',
  2230 + height: ScreenUtil().setWidth(96),
  2231 + fontSize: 32,
  2232 + gradientStart: MyColours.color_438E93,
  2233 + gradientEnd: MyColours.color_438E93,
  2234 + radius: ScreenUtil().setWidth(8),
  2235 + isBold: false,
  2236 + onPressed: () async {
  2237 + if (myModel.smsInfo == '0') {
  2238 + setState(() {
  2239 + showErro = smsErro;
  2240 + });
  2241 + return;
  2242 + }
  2243 + if ((_baseIndoProvider.phoneController.text
  2244 + .replaceAll(' ', '')
  2245 + .isEmpty ||
  2246 + !Utils.phoneRegExp(_baseIndoProvider
  2247 + .phoneController.text
  2248 + .replaceAll(' ', '')))) {
  2249 + setState(() {
  2250 + showErro = '请输入正确的11位手机号码';
  2251 + });
  2252 + return;
  2253 + } else {
  2254 + setState(() {
  2255 + showErro = '';
  2256 + });
  2257 + }
2230 2258
2231 - // if (!couponProvider.sendSMS) {  
2232 - /* 2259 + // if (!couponProvider.sendSMS) {
  2260 + /*
2233 String dateSoltStr = ''; 2261 String dateSoltStr = '';
2234 if (widget.dateSolt == '1') { 2262 if (widget.dateSolt == '1') {
2235 dateSoltStr = '早餐'; 2263 dateSoltStr = '早餐';
@@ -2271,572 +2299,576 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -2271,572 +2299,576 @@ class TableManagerPageState extends State<TableManagerPage> {
2271 params['Strtext'] = user.sellername; 2299 params['Strtext'] = user.sellername;
2272 } 2300 }
2273 */ 2301 */
2274 - Guest guest = Guest(  
2275 - null,  
2276 - null,  
2277 - null,  
2278 - null,  
2279 - null,  
2280 - null,  
2281 - null,  
2282 - null,  
2283 - null,  
2284 - null,  
2285 - null,  
2286 - null,  
2287 - null,  
2288 - null,  
2289 - null,  
2290 - null,  
2291 - null,  
2292 - null);  
2293 - if (widget.guest == null) {  
2294 - guest.phone = _baseIndoProvider.phoneController.text  
2295 - .replaceAll(' ', ''); //预订人电话  
2296 -  
2297 - if (nameStr != null && nameStr.trim().length > 0) {  
2298 - String sex = '1';  
2299 - if (sexStr == '女士') {  
2300 - sex = '2';  
2301 - } else if (sexStr == '公司') {  
2302 - sex = '3';  
2303 - }  
2304 - guest.rname = nameStr; //预订人姓名  
2305 - guest.sex = sex; //预订人性别:1:男 2:女  
2306 -  
2307 - }  
2308 - }  
2309 - String pnum;  
2310 - if (pnumController.text != '') {  
2311 - pnum = pnumController.text;  
2312 - }  
2313 - String cusdem;  
2314 - if (customController.text.trim().length > 0) {  
2315 - cusdem = customController.text;  
2316 - }  
2317 - SunReserveInfoModel _model =  
2318 - await tableManagerModel.setReserveInfo(context,  
2319 - needKeep: true,  
2320 - pnum: pnum,  
2321 - cusdem: cusdem,  
2322 - tempTime: ddateHm == '选填' ? null : ddateHm,  
2323 - guest: widget.guest == null  
2324 - ? guest  
2325 - : widget.guest);  
2326 - if (_model != null &&  
2327 - ObjectUtil.isNotEmpty(_model.row) &&  
2328 - ObjectUtil.isNotEmpty(_model.row.id)) {  
2329 - print('成功');  
2330 - // tableManagerModel.selectTables = [];  
2331 - // wechatNotification = true;  
2332 - _clearData(); 2302 + Guest guest = Guest(
  2303 + null,
  2304 + null,
  2305 + null,
  2306 + null,
  2307 + null,
  2308 + null,
  2309 + null,
  2310 + null,
  2311 + null,
  2312 + null,
  2313 + null,
  2314 + null,
  2315 + null,
  2316 + null,
  2317 + null,
  2318 + null,
  2319 + null,
  2320 + null);
  2321 + if (widget.guest == null) {
  2322 + guest.phone = _baseIndoProvider
  2323 + .phoneController.text
  2324 + .replaceAll(' ', ''); //预订人电话
  2325 +
  2326 + if (nameStr != null &&
  2327 + nameStr.trim().length > 0) {
  2328 + String sex = '1';
  2329 + if (sexStr == '女士') {
  2330 + sex = '2';
  2331 + } else if (sexStr == '公司') {
  2332 + sex = '3';
  2333 + }
  2334 + guest.rname = nameStr; //预订人姓名
  2335 + guest.sex = sex; //预订人性别:1:男 2:女
2333 2336
2334 - // _homeEnterModel.clearData();  
2335 - bus.emit("refresh_tablemanager"); //刷新当前页面  
2336 - bus.emit("refresh_book_list"); //刷新已预订列表  
2337 - if (youhui != '选择优惠') {  
2338 - Map<String, String> params = {  
2339 - "rid": _model.row.id,  
2340 - "aid":  
2341 - '${couponProvider.couponListSelect[couponSelectIndex].id}'  
2342 - };  
2343 - bool isSuc = await couponProvider  
2344 - .setActivityAsReserve(context, params);  
2345 - if (isSuc) {  
2346 - couponProvider.hasModify = true;  
2347 - UserModel userModel = Provider.of<UserModel>(  
2348 - context,  
2349 - listen: false);  
2350 - Map<String, String> params = {  
2351 - "rid": _model.row.id,  
2352 - "sid": userModel.user.sellerid  
2353 - };  
2354 - bool success = await couponProvider  
2355 - .sendSMSWxSendSms(context, params);  
2356 - print(success); 2337 + }
2357 } 2338 }
2358 - } else {  
2359 - UserModel userModel = Provider.of<UserModel>(  
2360 - context,  
2361 - listen: false);  
2362 - Map<String, String> params = {  
2363 - "rid": _model.row.id,  
2364 - "sid": userModel.user.sellerid  
2365 - };  
2366 - bool success = await couponProvider  
2367 - .sendSMSWxSendSms(context, params);  
2368 - print(success);  
2369 - }  
2370 -  
2371 - // if (success) {  
2372 - // Utils.showToast('短信已经发送成功!');  
2373 - // } else {  
2374 - // Utils.showToast('发送次数太频繁!');  
2375 - // }  
2376 - // } else {  
2377 - // Utils.showToast('短信已经发送成功!');  
2378 - // }  
2379 - // //进入订座详情页面  
2380 - // NavigatorUtil.goNotebookDetailPage(  
2381 - // context,  
2382 - // _model.row.id,  
2383 - // Provider.of<UserModel>(context, listen: false)  
2384 - // .user  
2385 - // .openid,  
2386 - // );  
2387 - // String ddate_solt = '';  
2388 - // if (_model.row.isSetDdate == '1') {  
2389 - // String createtime = _model.row.ddate.toString() + '000';  
2390 - // DateTime createTime =  
2391 - // DateTime.fromMillisecondsSinceEpoch(  
2392 - // int.parse(createtime));  
2393 - // ddate_solt = DateUtil.formatDate(createTime,  
2394 - // format: DateFormats.h_m);  
2395 - // } else {  
2396 - // if (_model.row.ddateSolt == '1') {  
2397 - // ddate_solt = '早餐';  
2398 - // } else if (_model.row.ddateSolt == '2') {  
2399 - // ddate_solt = '午餐';  
2400 - // } else if (_model.row.ddateSolt == '3') {  
2401 - // ddate_solt = '晚餐';  
2402 - // }  
2403 - // }  
2404 - // List<dynamic> tableinfo =  
2405 - // convert.jsonDecode(_model.row.tableinfo);  
2406 - // print(tableinfo);  
2407 -  
2408 - // // String _nameStr =  
2409 - // // table.TableList.fromJson(tableinfo[0]).name;  
2410 - // // if (tableinfo.length > 1) {  
2411 - // // _nameStr = table.TableList.fromJson(tableinfo[0]).name +  
2412 - // // '等${tableinfo.length}桌';  
2413 - // // }  
2414 - // // LogUtil.v(_nameStr);  
2415 - // // String _tid = '';  
2416 - // // for (int i = 0; i < tableinfo.length; i++) {  
2417 - // // _tid += '${table.TableList.fromJson(tableinfo[i]).id},';  
2418 - // // }  
2419 - // // if (_tid.endsWith(',')) {  
2420 - // // _tid = _tid.substring(0, _tid.length - 1);  
2421 - // // }  
2422 - // String _nameStr = '';  
2423 - // String _tid = '';  
2424 - // for (int i = 0; i < tableinfo.length; i++) {  
2425 - // _nameStr +=  
2426 - // '${table.TableList.fromJson(tableinfo[i]).name},';  
2427 -  
2428 - // _tid += '${table.TableList.fromJson(tableinfo[i]).id},';  
2429 - // }  
2430 - // if (_tid.endsWith(',')) {  
2431 - // _tid = _tid.substring(0, _tid.length - 1);  
2432 - // }  
2433 - // if (_nameStr.endsWith(',')) {  
2434 - // _nameStr = _nameStr.substring(0, _nameStr.length - 1);  
2435 - // }  
2436 - // NavigatorUtil.goInvicationPage(  
2437 - // context,  
2438 - // _model.row.id,  
2439 - // _nameStr,  
2440 - // _model.row.ddate,  
2441 - // ddate_solt,  
2442 - // _model.row.phone,  
2443 - // _model.row.ddateSolt,  
2444 - // _model.row.rname == null ? '' : _model.row.rname,  
2445 - // _model.row.sex == null ? '' : _model.row.sex,  
2446 - // tid: _tid,  
2447 - // replace: false);  
2448 - // // //今天 明天 其他天  
2449 - // // String tempTime = _homeEnterModel.ddateStr;  
2450 - // // if (_homeEnterModel.ddateStr == '') {  
2451 - // // if (currTimeIndex == 1) {  
2452 - // // tempTime = '08:00';  
2453 - // // } else if (currTimeIndex == 2) {  
2454 - // // tempTime = '12:00';  
2455 - // // } else if (currTimeIndex == 3) {  
2456 - // // tempTime = '18:00';  
2457 - // // }  
2458 - // // }  
2459 - // // print(_model.row.tableinfo);  
2460 - // // _clearData();  
2461 - // // String timeStr = dateText + ' ' + tempTime + ':00';  
2462 -  
2463 - // // LogUtil.v(timeStr);  
2464 - // // int ddate = DateUtil.getDateMsByTimeStr(timeStr);  
2465 -  
2466 - // // _homeEnterModel.getNewTableList(context, '${ddate}',  
2467 - // // currTimeIndex.toString(), pnum);  
2468 -  
2469 - // // EventBus().emit("refresh_tablemanager"); //刷新桌位  
2470 - } else {  
2471 - Utils.showToast("预订失败!");  
2472 - }  
2473 - },  
2474 - )),  
2475 - HEmptyView(36),  
2476 - RoundButton(  
2477 - text: '返回微信通知',  
2478 - width: ScreenUtil().setWidth(182),  
2479 - height: ScreenUtil().setWidth(96),  
2480 - fontSize: 24,  
2481 - textColor: MyColours.color_515151,  
2482 - gradientStart: MyColours.color_f3f3f3,  
2483 - gradientEnd: MyColours.color_f3f3f3,  
2484 - radius: ScreenUtil().setWidth(8),  
2485 - isBold: false,  
2486 - onPressed: () {  
2487 - setState(() {  
2488 - wechatNotification = true;  
2489 - });  
2490 - },  
2491 - )  
2492 - ],  
2493 - )), 2339 + String pnum;
  2340 + if (pnumController.text != '') {
  2341 + pnum = pnumController.text;
  2342 + }
  2343 + String cusdem;
  2344 + if (customController.text.trim().length > 0) {
  2345 + cusdem = customController.text;
  2346 + }
  2347 + SunReserveInfoModel _model =
  2348 + await tableManagerModel.setReserveInfo(
  2349 + context,
  2350 + needKeep: true,
  2351 + pnum: pnum,
  2352 + cusdem: cusdem,
  2353 + tempTime:
  2354 + ddateHm == '选填' ? null : ddateHm,
  2355 + guest: widget.guest == null
  2356 + ? guest
  2357 + : widget.guest);
  2358 + if (_model != null &&
  2359 + ObjectUtil.isNotEmpty(_model.row) &&
  2360 + ObjectUtil.isNotEmpty(_model.row.id)) {
  2361 + print('成功');
  2362 + // tableManagerModel.selectTables = [];
  2363 + // wechatNotification = true;
  2364 + _clearData();
  2365 +
  2366 + // _homeEnterModel.clearData();
  2367 + bus.emit("refresh_tablemanager"); //刷新当前页面
  2368 + bus.emit("refresh_book_list"); //刷新已预订列表
  2369 + if (youhui != '选择优惠') {
  2370 + Map<String, String> params = {
  2371 + "rid": _model.row.id,
  2372 + "aid":
  2373 + '${couponProvider.couponListSelect[couponSelectIndex].id}'
  2374 + };
  2375 + bool isSuc = await couponProvider
  2376 + .setActivityAsReserve(context, params);
  2377 + if (isSuc) {
  2378 + couponProvider.hasModify = true;
  2379 + UserModel userModel =
  2380 + Provider.of<UserModel>(context,
  2381 + listen: false);
  2382 + Map<String, String> params = {
  2383 + "rid": _model.row.id,
  2384 + "sid": userModel.user.sellerid
  2385 + };
  2386 + bool success = await couponProvider
  2387 + .sendSMSWxSendSms(context, params);
  2388 + print(success);
  2389 + }
  2390 + } else {
  2391 + UserModel userModel = Provider.of<UserModel>(
  2392 + context,
  2393 + listen: false);
  2394 + Map<String, String> params = {
  2395 + "rid": _model.row.id,
  2396 + "sid": userModel.user.sellerid
  2397 + };
  2398 + bool success = await couponProvider
  2399 + .sendSMSWxSendSms(context, params);
  2400 + print(success);
  2401 + }
2494 2402
2495 - // Row(  
2496 - // crossAxisAlignment: CrossAxisAlignment.start,  
2497 - // children: [  
2498 - // // HEmptyView(15),  
2499 - // Padding(  
2500 - // // width: ScreenUtil().setWidth(120),  
2501 - // padding: EdgeInsets.only(top: ScreenUtil().setWidth(10)),  
2502 - // child: Text(  
2503 - // '已选桌位:',  
2504 - // style: TextStyle(  
2505 - // color: MyColours.color_333333,  
2506 - // fontSize: ScreenUtil().setSp(26)),  
2507 - // )),  
2508 - // HEmptyView(15),  
2509 - // // Expanded(  
2510 - // // child:  
2511 - // // width: ScreenUtil().screenWidth -  
2512 - // // ScreenUtil().setWidth(160),  
2513 - // // constraints:  
2514 - // // BoxConstraints(maxHeight: ScreenUtil().setWidth(140)),  
2515 - // // color: Colors.blueAccent,  
2516 -  
2517 - // // ListView.builder(  
2518 - // // shrinkWrap: true,  
2519 - // // itemBuilder: (BuildContext context, int index) {  
2520 - // // return  
2521 - // // Scrollbar(  
2522 - // // isAlwaysShown: true, //设置滚动条常亮  
2523 - // // controller: _scrollCrl, //必须设置一个controller  
2524 -  
2525 - // // ///添加进度条  
2526 - // // child:  
2527 - // // SingleChildScrollView(  
2528 - // // controller: _scrollCrl,  
2529 - // // child:  
2530 - // Container(  
2531 - // // color: Colors.red,  
2532 - // width: ScreenUtil().screenWidth -  
2533 - // ScreenUtil().setWidth(100 + 130),  
2534 - // child: Wrap(  
2535 - // spacing: ScreenUtil().setWidth(20),  
2536 - // runSpacing: ScreenUtil().setWidth(20),  
2537 - // children: _buildAlwayItems())),  
2538 - // // )  
2539 - // // )  
2540 - // // },  
2541 - // // itemCount: 1,  
2542 - // // ),  
2543 - // // )  
2544 - // ],  
2545 - // ),  
2546 - // VEmptyView(40),  
2547 - // Container(  
2548 - // // width: ScreenUtil().setWidth(100),  
2549 - // // color: Colors.red,  
2550 - // // constraints: BoxConstraints(  
2551 - // // minHeight: ScreenUtil().setWidth(500),  
2552 - // // ),  
2553 - // child: Row(  
2554 - // mainAxisAlignment: MainAxisAlignment.spaceEvenly,  
2555 - // children: [  
2556 - // InkWell(  
2557 - // onTap: () {  
2558 - // tableManagerModel.selectTables = [];  
2559 - // for (t.Table item in tableManagerModel.tablesShow) {  
2560 - // item.selected = false;  
2561 - // }  
2562 - // tableManagerModel.areaTableMapShow.forEach((key, value) {  
2563 - // value.forEach((element) {  
2564 - // element.selected = false;  
2565 - // });  
2566 - // });  
2567 -  
2568 - // tableManagerModel.notifyListeners();  
2569 - // },  
2570 - // child: Container(  
2571 - // padding: EdgeInsets.all(  
2572 - // ScreenUtil().setWidth(30),  
2573 - // ),  
2574 - // child: Text(  
2575 - // '取消重置',  
2576 - // style: TextStyle(  
2577 - // color: MyColours.color_199095,  
2578 - // fontSize: ScreenUtil().setSp(26)),  
2579 - // ),  
2580 - // ),  
2581 - // ),  
2582 - // RoundButton(  
2583 - // onPressed: () async {  
2584 - // SunReserveInfoModel _model =  
2585 - // await tableManagerModel.setReserveInfo(context,  
2586 - // needKeep: true, guest: widget.guest);  
2587 - // if (_model != null &&  
2588 - // ObjectUtil.isNotEmpty(_model.row) &&  
2589 - // ObjectUtil.isNotEmpty(_model.row.id)) {  
2590 - // print('成功');  
2591 - // tableManagerModel.selectTables = [];  
2592 - // // _homeEnterModel.clearData();  
2593 - // bus.emit("refresh_tablemanager"); //刷新当前页面  
2594 - // bus.emit("refresh_book_list"); //刷新已预订列表  
2595 - // //进入订座详情页面  
2596 - // // NavigatorUtil.goNotebookDetailPage(  
2597 - // // context,  
2598 - // // _model.row.id,  
2599 - // // Provider.of<UserModel>(context, listen: false)  
2600 - // // .user  
2601 - // // .openid,  
2602 - // // );  
2603 - // // String ddate_solt = '';  
2604 - // // if (_model.row.isSetDdate == '1') {  
2605 - // // String createtime =  
2606 - // // _model.row.ddate.toString() + '000';  
2607 - // // DateTime createTime =  
2608 - // // DateTime.fromMillisecondsSinceEpoch(  
2609 - // // int.parse(createtime));  
2610 - // // ddate_solt = DateUtil.formatDate(createTime,  
2611 - // // format: DateFormats.h_m);  
2612 - // // } else {  
2613 - // // if (_model.row.ddateSolt == '1') {  
2614 - // // ddate_solt = '早餐';  
2615 - // // } else if (_model.row.ddateSolt == '2') {  
2616 - // // ddate_solt = '午餐';  
2617 - // // } else if (_model.row.ddateSolt == '3') {  
2618 - // // ddate_solt = '晚餐';  
2619 - // // }  
2620 - // // }  
2621 - // // List<dynamic> tableinfo =  
2622 - // // convert.jsonDecode(_model.row.tableinfo);  
2623 - // // print(tableinfo);  
2624 -  
2625 - // // String _nameStr =  
2626 - // // t.TableList.fromJson(tableinfo[0]).name;  
2627 - // // if (tableinfo.length > 1) {  
2628 - // // _nameStr = t.TableList.fromJson(tableinfo[0]).name +  
2629 - // // '等${tableinfo.length}桌';  
2630 - // // }  
2631 - // // LogUtil.v(_nameStr);  
2632 - // // String _tid = '';  
2633 - // // for (int i = 0; i < tableinfo.length; i++) {  
2634 - // // _tid += '${t.TableList.fromJson(tableinfo[i]).id},';  
2635 - // // }  
2636 - // // if (_tid.endsWith(',')) {  
2637 - // // _tid = _tid.substring(0, _tid.length - 1);  
2638 - // // }  
2639 - // // NavigatorUtil.goInvicationPage(  
2640 - // // context,  
2641 - // // _model.row.id,  
2642 - // // _nameStr,  
2643 - // // _model.row.ddate,  
2644 - // // ddate_solt,  
2645 - // // _model.row.phone,  
2646 - // // _model.row.ddateSolt,  
2647 - // // tid: _tid,  
2648 - // // replace: false);  
2649 - // // //今天 明天 其他天  
2650 - // // String tempTime = _homeEnterModel.ddateStr;  
2651 - // // if (_homeEnterModel.ddateStr == '') {  
2652 - // // if (currTimeIndex == 1) {  
2653 - // // tempTime = '08:00';  
2654 - // // } else if (currTimeIndex == 2) {  
2655 - // // tempTime = '12:00';  
2656 - // // } else if (currTimeIndex == 3) {  
2657 - // // tempTime = '18:00';  
2658 - // // }  
2659 - // // }  
2660 - // // print(_model.row.tableinfo);  
2661 - // // _clearData();  
2662 - // // String timeStr = dateText + ' ' + tempTime + ':00';  
2663 -  
2664 - // // LogUtil.v(timeStr);  
2665 - // // int ddate = DateUtil.getDateMsByTimeStr(timeStr);  
2666 -  
2667 - // // _homeEnterModel.getNewTableList(context, '${ddate}',  
2668 - // // currTimeIndex.toString(), pnum);  
2669 -  
2670 - // // EventBus().emit("refresh_tablemanager"); //刷新桌位  
2671 - // } else {  
2672 - // Utils.showToast("预订失败!");  
2673 - // }  
2674 - // },  
2675 - // text: '仅预订',  
2676 - // fontSize: 32,  
2677 - // isBold: false,  
2678 - // width: ScreenUtil().setWidth(180),  
2679 - // height: ScreenUtil().setWidth(90),  
2680 - // padding: EdgeInsets.symmetric(  
2681 - // horizontal: ScreenUtil().setWidth(20),  
2682 - // vertical: ScreenUtil().setWidth(4)),  
2683 - // textColor: MyColours.color_199095,  
2684 - // gradientStart: MyColours.color_ffffff,  
2685 - // gradientEnd: MyColours.color_ffffff,  
2686 - // radius: ScreenUtil().setWidth(10),  
2687 - // borderColor: MyColours.color_199095,  
2688 - // ),  
2689 - // RoundButton(  
2690 - // onPressed: () async {  
2691 - // SunReserveInfoModel _model =  
2692 - // await tableManagerModel.setReserveInfo(context,  
2693 - // needKeep: true, guest: widget.guest);  
2694 - // if (_model != null &&  
2695 - // ObjectUtil.isNotEmpty(_model.row) &&  
2696 - // ObjectUtil.isNotEmpty(_model.row.id)) {  
2697 - // print('成功');  
2698 - // tableManagerModel.selectTables = [];  
2699 - // // _homeEnterModel.clearData();  
2700 - // bus.emit("refresh_tablemanager"); //刷新当前页面  
2701 - // bus.emit("refresh_book_list"); //刷新已预订列表  
2702 - // // //进入订座详情页面  
2703 - // // NavigatorUtil.goNotebookDetailPage(  
2704 - // // context,  
2705 - // // _model.row.id,  
2706 - // // Provider.of<UserModel>(context, listen: false)  
2707 - // // .user  
2708 - // // .openid,  
2709 - // // );  
2710 - // String ddate_solt = '';  
2711 - // if (_model.row.isSetDdate == '1') {  
2712 - // String createtime = _model.row.ddate.toString() + '000';  
2713 - // DateTime createTime =  
2714 - // DateTime.fromMillisecondsSinceEpoch(  
2715 - // int.parse(createtime));  
2716 - // ddate_solt = DateUtil.formatDate(createTime,  
2717 - // format: DateFormats.h_m);  
2718 - // } else {  
2719 - // if (_model.row.ddateSolt == '1') {  
2720 - // ddate_solt = '早餐';  
2721 - // } else if (_model.row.ddateSolt == '2') {  
2722 - // ddate_solt = '午餐';  
2723 - // } else if (_model.row.ddateSolt == '3') {  
2724 - // ddate_solt = '晚餐';  
2725 - // }  
2726 - // }  
2727 - // List<dynamic> tableinfo =  
2728 - // convert.jsonDecode(_model.row.tableinfo);  
2729 - // print(tableinfo);  
2730 -  
2731 - // // String _nameStr =  
2732 - // // table.TableList.fromJson(tableinfo[0]).name;  
2733 - // // if (tableinfo.length > 1) {  
2734 - // // _nameStr = table.TableList.fromJson(tableinfo[0]).name +  
2735 - // // '等${tableinfo.length}桌';  
2736 - // // }  
2737 - // // LogUtil.v(_nameStr);  
2738 - // // String _tid = '';  
2739 - // // for (int i = 0; i < tableinfo.length; i++) {  
2740 - // // _tid += '${table.TableList.fromJson(tableinfo[i]).id},';  
2741 - // // }  
2742 - // // if (_tid.endsWith(',')) {  
2743 - // // _tid = _tid.substring(0, _tid.length - 1);  
2744 - // // }  
2745 - // String _nameStr = '';  
2746 - // String _tid = '';  
2747 - // for (int i = 0; i < tableinfo.length; i++) {  
2748 - // _nameStr +=  
2749 - // '${table.TableList.fromJson(tableinfo[i]).name},';  
2750 -  
2751 - // _tid += '${table.TableList.fromJson(tableinfo[i]).id},';  
2752 - // }  
2753 - // if (_tid.endsWith(',')) {  
2754 - // _tid = _tid.substring(0, _tid.length - 1);  
2755 - // }  
2756 - // if (_nameStr.endsWith(',')) {  
2757 - // _nameStr = _nameStr.substring(0, _nameStr.length - 1);  
2758 - // }  
2759 - // NavigatorUtil.goInvicationPage(  
2760 - // context,  
2761 - // _model.row.id,  
2762 - // _nameStr,  
2763 - // _model.row.ddate,  
2764 - // ddate_solt,  
2765 - // _model.row.phone,  
2766 - // _model.row.ddateSolt,  
2767 - // _model.row.rname == null ? '' : _model.row.rname,  
2768 - // _model.row.sex == null ? '' : _model.row.sex,  
2769 - // tid: _tid,  
2770 - // replace: false);  
2771 - // // //今天 明天 其他天  
2772 - // // String tempTime = _homeEnterModel.ddateStr;  
2773 - // // if (_homeEnterModel.ddateStr == '') {  
2774 - // // if (currTimeIndex == 1) {  
2775 - // // tempTime = '08:00';  
2776 - // // } else if (currTimeIndex == 2) {  
2777 - // // tempTime = '12:00';  
2778 - // // } else if (currTimeIndex == 3) {  
2779 - // // tempTime = '18:00';  
2780 - // // }  
2781 - // // }  
2782 - // // print(_model.row.tableinfo);  
2783 - // // _clearData();  
2784 - // // String timeStr = dateText + ' ' + tempTime + ':00';  
2785 -  
2786 - // // LogUtil.v(timeStr);  
2787 - // // int ddate = DateUtil.getDateMsByTimeStr(timeStr);  
2788 -  
2789 - // // _homeEnterModel.getNewTableList(context, '${ddate}',  
2790 - // // currTimeIndex.toString(), pnum);  
2791 -  
2792 - // // EventBus().emit("refresh_tablemanager"); //刷新桌位  
2793 - // } else {  
2794 - // Utils.showToast("预订失败!");  
2795 - // }  
2796 - // },  
2797 - // text: '预订并通知',  
2798 - // fontSize: 32,  
2799 - // isBold: false,  
2800 - // width: ScreenUtil().setWidth(220),  
2801 - // height: ScreenUtil().setWidth(90),  
2802 - // padding: EdgeInsets.symmetric(  
2803 - // horizontal: ScreenUtil().setWidth(20),  
2804 - // vertical: ScreenUtil().setWidth(4)),  
2805 - // textColor: MyColours.color_ffffff,  
2806 - // gradientStart: MyColours.color_199095,  
2807 - // gradientEnd: MyColours.color_199095,  
2808 - // radius: ScreenUtil().setWidth(10),  
2809 - // borderColor: MyColours.color_199095,  
2810 - // ),  
2811 - // ],  
2812 - // ),  
2813 - // ),  
2814 - showErro == ''  
2815 - ? VEmptyView(62)  
2816 - : Container(  
2817 - padding: EdgeInsets.only(  
2818 - left: ScreenUtil().setWidth(36),  
2819 - top: ScreenUtil().setWidth(12),  
2820 - right: ScreenUtil().setWidth(36),  
2821 - bottom: ScreenUtil().setWidth(18),  
2822 - ),  
2823 - child: Row(  
2824 - children: [  
2825 - Image.asset(Utils.getImgPath('error_circle_red'),  
2826 - width: ScreenUtil().setWidth(44)),  
2827 - HEmptyView(16),  
2828 - Text(  
2829 - showErro,  
2830 - style: TextStyle(  
2831 - color: MyColours.color_E34D59,  
2832 - fontSize: ScreenUtil().setSp(28)), 2403 + // if (success) {
  2404 + // Utils.showToast('短信已经发送成功!');
  2405 + // } else {
  2406 + // Utils.showToast('发送次数太频繁!');
  2407 + // }
  2408 + // } else {
  2409 + // Utils.showToast('短信已经发送成功!');
  2410 + // }
  2411 + // //进入订座详情页面
  2412 + // NavigatorUtil.goNotebookDetailPage(
  2413 + // context,
  2414 + // _model.row.id,
  2415 + // Provider.of<UserModel>(context, listen: false)
  2416 + // .user
  2417 + // .openid,
  2418 + // );
  2419 + // String ddate_solt = '';
  2420 + // if (_model.row.isSetDdate == '1') {
  2421 + // String createtime = _model.row.ddate.toString() + '000';
  2422 + // DateTime createTime =
  2423 + // DateTime.fromMillisecondsSinceEpoch(
  2424 + // int.parse(createtime));
  2425 + // ddate_solt = DateUtil.formatDate(createTime,
  2426 + // format: DateFormats.h_m);
  2427 + // } else {
  2428 + // if (_model.row.ddateSolt == '1') {
  2429 + // ddate_solt = '早餐';
  2430 + // } else if (_model.row.ddateSolt == '2') {
  2431 + // ddate_solt = '午餐';
  2432 + // } else if (_model.row.ddateSolt == '3') {
  2433 + // ddate_solt = '晚餐';
  2434 + // }
  2435 + // }
  2436 + // List<dynamic> tableinfo =
  2437 + // convert.jsonDecode(_model.row.tableinfo);
  2438 + // print(tableinfo);
  2439 +
  2440 + // // String _nameStr =
  2441 + // // table.TableList.fromJson(tableinfo[0]).name;
  2442 + // // if (tableinfo.length > 1) {
  2443 + // // _nameStr = table.TableList.fromJson(tableinfo[0]).name +
  2444 + // // '等${tableinfo.length}桌';
  2445 + // // }
  2446 + // // LogUtil.v(_nameStr);
  2447 + // // String _tid = '';
  2448 + // // for (int i = 0; i < tableinfo.length; i++) {
  2449 + // // _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
  2450 + // // }
  2451 + // // if (_tid.endsWith(',')) {
  2452 + // // _tid = _tid.substring(0, _tid.length - 1);
  2453 + // // }
  2454 + // String _nameStr = '';
  2455 + // String _tid = '';
  2456 + // for (int i = 0; i < tableinfo.length; i++) {
  2457 + // _nameStr +=
  2458 + // '${table.TableList.fromJson(tableinfo[i]).name},';
  2459 +
  2460 + // _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
  2461 + // }
  2462 + // if (_tid.endsWith(',')) {
  2463 + // _tid = _tid.substring(0, _tid.length - 1);
  2464 + // }
  2465 + // if (_nameStr.endsWith(',')) {
  2466 + // _nameStr = _nameStr.substring(0, _nameStr.length - 1);
  2467 + // }
  2468 + // NavigatorUtil.goInvicationPage(
  2469 + // context,
  2470 + // _model.row.id,
  2471 + // _nameStr,
  2472 + // _model.row.ddate,
  2473 + // ddate_solt,
  2474 + // _model.row.phone,
  2475 + // _model.row.ddateSolt,
  2476 + // _model.row.rname == null ? '' : _model.row.rname,
  2477 + // _model.row.sex == null ? '' : _model.row.sex,
  2478 + // tid: _tid,
  2479 + // replace: false);
  2480 + // // //今天 明天 其他天
  2481 + // // String tempTime = _homeEnterModel.ddateStr;
  2482 + // // if (_homeEnterModel.ddateStr == '') {
  2483 + // // if (currTimeIndex == 1) {
  2484 + // // tempTime = '08:00';
  2485 + // // } else if (currTimeIndex == 2) {
  2486 + // // tempTime = '12:00';
  2487 + // // } else if (currTimeIndex == 3) {
  2488 + // // tempTime = '18:00';
  2489 + // // }
  2490 + // // }
  2491 + // // print(_model.row.tableinfo);
  2492 + // // _clearData();
  2493 + // // String timeStr = dateText + ' ' + tempTime + ':00';
  2494 +
  2495 + // // LogUtil.v(timeStr);
  2496 + // // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
  2497 +
  2498 + // // _homeEnterModel.getNewTableList(context, '${ddate}',
  2499 + // // currTimeIndex.toString(), pnum);
  2500 +
  2501 + // // EventBus().emit("refresh_tablemanager"); //刷新桌位
  2502 + } else {
  2503 + Utils.showToast("预订失败!");
  2504 + }
  2505 + },
  2506 + )),
  2507 + HEmptyView(36),
  2508 + RoundButton(
  2509 + text: '返回微信通知',
  2510 + width: ScreenUtil().setWidth(182),
  2511 + height: ScreenUtil().setWidth(96),
  2512 + fontSize: 24,
  2513 + textColor: MyColours.color_515151,
  2514 + gradientStart: MyColours.color_f3f3f3,
  2515 + gradientEnd: MyColours.color_f3f3f3,
  2516 + radius: ScreenUtil().setWidth(8),
  2517 + isBold: false,
  2518 + onPressed: () {
  2519 + setState(() {
  2520 + wechatNotification = true;
  2521 + });
  2522 + },
2833 ) 2523 )
2834 ], 2524 ],
2835 - ),  
2836 - )  
2837 - ],  
2838 - ),  
2839 - )); 2525 + )),
  2526 +
  2527 + // Row(
  2528 + // crossAxisAlignment: CrossAxisAlignment.start,
  2529 + // children: [
  2530 + // // HEmptyView(15),
  2531 + // Padding(
  2532 + // // width: ScreenUtil().setWidth(120),
  2533 + // padding: EdgeInsets.only(top: ScreenUtil().setWidth(10)),
  2534 + // child: Text(
  2535 + // '已选桌位:',
  2536 + // style: TextStyle(
  2537 + // color: MyColours.color_333333,
  2538 + // fontSize: ScreenUtil().setSp(26)),
  2539 + // )),
  2540 + // HEmptyView(15),
  2541 + // // Expanded(
  2542 + // // child:
  2543 + // // width: ScreenUtil().screenWidth -
  2544 + // // ScreenUtil().setWidth(160),
  2545 + // // constraints:
  2546 + // // BoxConstraints(maxHeight: ScreenUtil().setWidth(140)),
  2547 + // // color: Colors.blueAccent,
  2548 +
  2549 + // // ListView.builder(
  2550 + // // shrinkWrap: true,
  2551 + // // itemBuilder: (BuildContext context, int index) {
  2552 + // // return
  2553 + // // Scrollbar(
  2554 + // // isAlwaysShown: true, //设置滚动条常亮
  2555 + // // controller: _scrollCrl, //必须设置一个controller
  2556 +
  2557 + // // ///添加进度条
  2558 + // // child:
  2559 + // // SingleChildScrollView(
  2560 + // // controller: _scrollCrl,
  2561 + // // child:
  2562 + // Container(
  2563 + // // color: Colors.red,
  2564 + // width: ScreenUtil().screenWidth -
  2565 + // ScreenUtil().setWidth(100 + 130),
  2566 + // child: Wrap(
  2567 + // spacing: ScreenUtil().setWidth(20),
  2568 + // runSpacing: ScreenUtil().setWidth(20),
  2569 + // children: _buildAlwayItems())),
  2570 + // // )
  2571 + // // )
  2572 + // // },
  2573 + // // itemCount: 1,
  2574 + // // ),
  2575 + // // )
  2576 + // ],
  2577 + // ),
  2578 + // VEmptyView(40),
  2579 + // Container(
  2580 + // // width: ScreenUtil().setWidth(100),
  2581 + // // color: Colors.red,
  2582 + // // constraints: BoxConstraints(
  2583 + // // minHeight: ScreenUtil().setWidth(500),
  2584 + // // ),
  2585 + // child: Row(
  2586 + // mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  2587 + // children: [
  2588 + // InkWell(
  2589 + // onTap: () {
  2590 + // tableManagerModel.selectTables = [];
  2591 + // for (t.Table item in tableManagerModel.tablesShow) {
  2592 + // item.selected = false;
  2593 + // }
  2594 + // tableManagerModel.areaTableMapShow.forEach((key, value) {
  2595 + // value.forEach((element) {
  2596 + // element.selected = false;
  2597 + // });
  2598 + // });
  2599 +
  2600 + // tableManagerModel.notifyListeners();
  2601 + // },
  2602 + // child: Container(
  2603 + // padding: EdgeInsets.all(
  2604 + // ScreenUtil().setWidth(30),
  2605 + // ),
  2606 + // child: Text(
  2607 + // '取消重置',
  2608 + // style: TextStyle(
  2609 + // color: MyColours.color_199095,
  2610 + // fontSize: ScreenUtil().setSp(26)),
  2611 + // ),
  2612 + // ),
  2613 + // ),
  2614 + // RoundButton(
  2615 + // onPressed: () async {
  2616 + // SunReserveInfoModel _model =
  2617 + // await tableManagerModel.setReserveInfo(context,
  2618 + // needKeep: true, guest: widget.guest);
  2619 + // if (_model != null &&
  2620 + // ObjectUtil.isNotEmpty(_model.row) &&
  2621 + // ObjectUtil.isNotEmpty(_model.row.id)) {
  2622 + // print('成功');
  2623 + // tableManagerModel.selectTables = [];
  2624 + // // _homeEnterModel.clearData();
  2625 + // bus.emit("refresh_tablemanager"); //刷新当前页面
  2626 + // bus.emit("refresh_book_list"); //刷新已预订列表
  2627 + // //进入订座详情页面
  2628 + // // NavigatorUtil.goNotebookDetailPage(
  2629 + // // context,
  2630 + // // _model.row.id,
  2631 + // // Provider.of<UserModel>(context, listen: false)
  2632 + // // .user
  2633 + // // .openid,
  2634 + // // );
  2635 + // // String ddate_solt = '';
  2636 + // // if (_model.row.isSetDdate == '1') {
  2637 + // // String createtime =
  2638 + // // _model.row.ddate.toString() + '000';
  2639 + // // DateTime createTime =
  2640 + // // DateTime.fromMillisecondsSinceEpoch(
  2641 + // // int.parse(createtime));
  2642 + // // ddate_solt = DateUtil.formatDate(createTime,
  2643 + // // format: DateFormats.h_m);
  2644 + // // } else {
  2645 + // // if (_model.row.ddateSolt == '1') {
  2646 + // // ddate_solt = '早餐';
  2647 + // // } else if (_model.row.ddateSolt == '2') {
  2648 + // // ddate_solt = '午餐';
  2649 + // // } else if (_model.row.ddateSolt == '3') {
  2650 + // // ddate_solt = '晚餐';
  2651 + // // }
  2652 + // // }
  2653 + // // List<dynamic> tableinfo =
  2654 + // // convert.jsonDecode(_model.row.tableinfo);
  2655 + // // print(tableinfo);
  2656 +
  2657 + // // String _nameStr =
  2658 + // // t.TableList.fromJson(tableinfo[0]).name;
  2659 + // // if (tableinfo.length > 1) {
  2660 + // // _nameStr = t.TableList.fromJson(tableinfo[0]).name +
  2661 + // // '等${tableinfo.length}桌';
  2662 + // // }
  2663 + // // LogUtil.v(_nameStr);
  2664 + // // String _tid = '';
  2665 + // // for (int i = 0; i < tableinfo.length; i++) {
  2666 + // // _tid += '${t.TableList.fromJson(tableinfo[i]).id},';
  2667 + // // }
  2668 + // // if (_tid.endsWith(',')) {
  2669 + // // _tid = _tid.substring(0, _tid.length - 1);
  2670 + // // }
  2671 + // // NavigatorUtil.goInvicationPage(
  2672 + // // context,
  2673 + // // _model.row.id,
  2674 + // // _nameStr,
  2675 + // // _model.row.ddate,
  2676 + // // ddate_solt,
  2677 + // // _model.row.phone,
  2678 + // // _model.row.ddateSolt,
  2679 + // // tid: _tid,
  2680 + // // replace: false);
  2681 + // // //今天 明天 其他天
  2682 + // // String tempTime = _homeEnterModel.ddateStr;
  2683 + // // if (_homeEnterModel.ddateStr == '') {
  2684 + // // if (currTimeIndex == 1) {
  2685 + // // tempTime = '08:00';
  2686 + // // } else if (currTimeIndex == 2) {
  2687 + // // tempTime = '12:00';
  2688 + // // } else if (currTimeIndex == 3) {
  2689 + // // tempTime = '18:00';
  2690 + // // }
  2691 + // // }
  2692 + // // print(_model.row.tableinfo);
  2693 + // // _clearData();
  2694 + // // String timeStr = dateText + ' ' + tempTime + ':00';
  2695 +
  2696 + // // LogUtil.v(timeStr);
  2697 + // // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
  2698 +
  2699 + // // _homeEnterModel.getNewTableList(context, '${ddate}',
  2700 + // // currTimeIndex.toString(), pnum);
  2701 +
  2702 + // // EventBus().emit("refresh_tablemanager"); //刷新桌位
  2703 + // } else {
  2704 + // Utils.showToast("预订失败!");
  2705 + // }
  2706 + // },
  2707 + // text: '仅预订',
  2708 + // fontSize: 32,
  2709 + // isBold: false,
  2710 + // width: ScreenUtil().setWidth(180),
  2711 + // height: ScreenUtil().setWidth(90),
  2712 + // padding: EdgeInsets.symmetric(
  2713 + // horizontal: ScreenUtil().setWidth(20),
  2714 + // vertical: ScreenUtil().setWidth(4)),
  2715 + // textColor: MyColours.color_199095,
  2716 + // gradientStart: MyColours.color_ffffff,
  2717 + // gradientEnd: MyColours.color_ffffff,
  2718 + // radius: ScreenUtil().setWidth(10),
  2719 + // borderColor: MyColours.color_199095,
  2720 + // ),
  2721 + // RoundButton(
  2722 + // onPressed: () async {
  2723 + // SunReserveInfoModel _model =
  2724 + // await tableManagerModel.setReserveInfo(context,
  2725 + // needKeep: true, guest: widget.guest);
  2726 + // if (_model != null &&
  2727 + // ObjectUtil.isNotEmpty(_model.row) &&
  2728 + // ObjectUtil.isNotEmpty(_model.row.id)) {
  2729 + // print('成功');
  2730 + // tableManagerModel.selectTables = [];
  2731 + // // _homeEnterModel.clearData();
  2732 + // bus.emit("refresh_tablemanager"); //刷新当前页面
  2733 + // bus.emit("refresh_book_list"); //刷新已预订列表
  2734 + // // //进入订座详情页面
  2735 + // // NavigatorUtil.goNotebookDetailPage(
  2736 + // // context,
  2737 + // // _model.row.id,
  2738 + // // Provider.of<UserModel>(context, listen: false)
  2739 + // // .user
  2740 + // // .openid,
  2741 + // // );
  2742 + // String ddate_solt = '';
  2743 + // if (_model.row.isSetDdate == '1') {
  2744 + // String createtime = _model.row.ddate.toString() + '000';
  2745 + // DateTime createTime =
  2746 + // DateTime.fromMillisecondsSinceEpoch(
  2747 + // int.parse(createtime));
  2748 + // ddate_solt = DateUtil.formatDate(createTime,
  2749 + // format: DateFormats.h_m);
  2750 + // } else {
  2751 + // if (_model.row.ddateSolt == '1') {
  2752 + // ddate_solt = '早餐';
  2753 + // } else if (_model.row.ddateSolt == '2') {
  2754 + // ddate_solt = '午餐';
  2755 + // } else if (_model.row.ddateSolt == '3') {
  2756 + // ddate_solt = '晚餐';
  2757 + // }
  2758 + // }
  2759 + // List<dynamic> tableinfo =
  2760 + // convert.jsonDecode(_model.row.tableinfo);
  2761 + // print(tableinfo);
  2762 +
  2763 + // // String _nameStr =
  2764 + // // table.TableList.fromJson(tableinfo[0]).name;
  2765 + // // if (tableinfo.length > 1) {
  2766 + // // _nameStr = table.TableList.fromJson(tableinfo[0]).name +
  2767 + // // '等${tableinfo.length}桌';
  2768 + // // }
  2769 + // // LogUtil.v(_nameStr);
  2770 + // // String _tid = '';
  2771 + // // for (int i = 0; i < tableinfo.length; i++) {
  2772 + // // _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
  2773 + // // }
  2774 + // // if (_tid.endsWith(',')) {
  2775 + // // _tid = _tid.substring(0, _tid.length - 1);
  2776 + // // }
  2777 + // String _nameStr = '';
  2778 + // String _tid = '';
  2779 + // for (int i = 0; i < tableinfo.length; i++) {
  2780 + // _nameStr +=
  2781 + // '${table.TableList.fromJson(tableinfo[i]).name},';
  2782 +
  2783 + // _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
  2784 + // }
  2785 + // if (_tid.endsWith(',')) {
  2786 + // _tid = _tid.substring(0, _tid.length - 1);
  2787 + // }
  2788 + // if (_nameStr.endsWith(',')) {
  2789 + // _nameStr = _nameStr.substring(0, _nameStr.length - 1);
  2790 + // }
  2791 + // NavigatorUtil.goInvicationPage(
  2792 + // context,
  2793 + // _model.row.id,
  2794 + // _nameStr,
  2795 + // _model.row.ddate,
  2796 + // ddate_solt,
  2797 + // _model.row.phone,
  2798 + // _model.row.ddateSolt,
  2799 + // _model.row.rname == null ? '' : _model.row.rname,
  2800 + // _model.row.sex == null ? '' : _model.row.sex,
  2801 + // tid: _tid,
  2802 + // replace: false);
  2803 + // // //今天 明天 其他天
  2804 + // // String tempTime = _homeEnterModel.ddateStr;
  2805 + // // if (_homeEnterModel.ddateStr == '') {
  2806 + // // if (currTimeIndex == 1) {
  2807 + // // tempTime = '08:00';
  2808 + // // } else if (currTimeIndex == 2) {
  2809 + // // tempTime = '12:00';
  2810 + // // } else if (currTimeIndex == 3) {
  2811 + // // tempTime = '18:00';
  2812 + // // }
  2813 + // // }
  2814 + // // print(_model.row.tableinfo);
  2815 + // // _clearData();
  2816 + // // String timeStr = dateText + ' ' + tempTime + ':00';
  2817 +
  2818 + // // LogUtil.v(timeStr);
  2819 + // // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
  2820 +
  2821 + // // _homeEnterModel.getNewTableList(context, '${ddate}',
  2822 + // // currTimeIndex.toString(), pnum);
  2823 +
  2824 + // // EventBus().emit("refresh_tablemanager"); //刷新桌位
  2825 + // } else {
  2826 + // Utils.showToast("预订失败!");
  2827 + // }
  2828 + // },
  2829 + // text: '预订并通知',
  2830 + // fontSize: 32,
  2831 + // isBold: false,
  2832 + // width: ScreenUtil().setWidth(220),
  2833 + // height: ScreenUtil().setWidth(90),
  2834 + // padding: EdgeInsets.symmetric(
  2835 + // horizontal: ScreenUtil().setWidth(20),
  2836 + // vertical: ScreenUtil().setWidth(4)),
  2837 + // textColor: MyColours.color_ffffff,
  2838 + // gradientStart: MyColours.color_199095,
  2839 + // gradientEnd: MyColours.color_199095,
  2840 + // radius: ScreenUtil().setWidth(10),
  2841 + // borderColor: MyColours.color_199095,
  2842 + // ),
  2843 + // ],
  2844 + // ),
  2845 + // ),
  2846 + showErro == ''
  2847 + ? VEmptyView(62)
  2848 + : Container(
  2849 + padding: EdgeInsets.only(
  2850 + left: ScreenUtil().setWidth(36),
  2851 + top: ScreenUtil().setWidth(12),
  2852 + right: ScreenUtil().setWidth(36),
  2853 + bottom: ScreenUtil().setWidth(18),
  2854 + ),
  2855 + child: Row(
  2856 + children: [
  2857 + Image.asset(Utils.getImgPath('error_circle_red'),
  2858 + width: ScreenUtil().setWidth(44)),
  2859 + HEmptyView(16),
  2860 + Text(
  2861 + showErro,
  2862 + style: TextStyle(
  2863 + color: MyColours.color_E34D59,
  2864 + fontSize: ScreenUtil().setSp(28)),
  2865 + )
  2866 + ],
  2867 + ),
  2868 + )
  2869 + ],
  2870 + ),
  2871 + )));
2840 } 2872 }
2841 2873
2842 //构建常用备注 2874 //构建常用备注
@@ -1389,6 +1389,7 @@ class CustomerProvider extends ChangeNotifier { @@ -1389,6 +1389,7 @@ class CustomerProvider extends ChangeNotifier {
1389 {isShowLoading = true}) async { 1389 {isShowLoading = true}) async {
1390 if (isShowLoading) { 1390 if (isShowLoading) {
1391 pageStateStoreHome = PageState.Loading; 1391 pageStateStoreHome = PageState.Loading;
  1392 + pageStateMyHome = PageState.Loading;
1392 notifyListeners(); 1393 notifyListeners();
1393 } 1394 }
1394 Map<String, String> params = { 1395 Map<String, String> params = {
@@ -1404,12 +1405,15 @@ class CustomerProvider extends ChangeNotifier { @@ -1404,12 +1405,15 @@ class CustomerProvider extends ChangeNotifier {
1404 switch (error.type) { 1405 switch (error.type) {
1405 case 1: 1406 case 1:
1406 pageStateStoreHome = PageState.ConnectivityError; 1407 pageStateStoreHome = PageState.ConnectivityError;
  1408 + pageStateMyHome = PageState.ConnectivityError;
1407 break; 1409 break;
1408 case 2: 1410 case 2:
1409 pageStateStoreHome = PageState.ConnectivityTimeOut; 1411 pageStateStoreHome = PageState.ConnectivityTimeOut;
  1412 + pageStateMyHome = PageState.ConnectivityTimeOut;
1410 break; 1413 break;
1411 default: 1414 default:
1412 pageStateStoreHome = PageState.ConnectivityError; 1415 pageStateStoreHome = PageState.ConnectivityError;
  1416 + pageStateMyHome = PageState.ConnectivityError;
1413 break; 1417 break;
1414 } 1418 }
1415 } 1419 }
@@ -1420,6 +1424,7 @@ class CustomerProvider extends ChangeNotifier { @@ -1420,6 +1424,7 @@ class CustomerProvider extends ChangeNotifier {
1420 if (baseResp.data.isEmpty) { 1424 if (baseResp.data.isEmpty) {
1421 if (isShowLoading) { 1425 if (isShowLoading) {
1422 pageStateStoreHome = PageState.Empty; 1426 pageStateStoreHome = PageState.Empty;
  1427 + pageStateMyHome = PageState.Empty;
1423 } 1428 }
1424 } else { 1429 } else {
1425 if (isShowLoading) { 1430 if (isShowLoading) {
@@ -1432,6 +1437,7 @@ class CustomerProvider extends ChangeNotifier { @@ -1432,6 +1437,7 @@ class CustomerProvider extends ChangeNotifier {
1432 } else { 1437 } else {
1433 if (isShowLoading) { 1438 if (isShowLoading) {
1434 pageStateStoreHome = PageState.ConnectivityError; 1439 pageStateStoreHome = PageState.ConnectivityError;
  1440 + pageStateMyHome = PageState.ConnectivityError;
1435 } 1441 }
1436 if (baseResp != null) { 1442 if (baseResp != null) {
1437 Utils.showToast(baseResp.msg ?? ""); 1443 Utils.showToast(baseResp.msg ?? "");
@@ -1811,8 +1817,9 @@ class CustomerProvider extends ChangeNotifier { @@ -1811,8 +1817,9 @@ class CustomerProvider extends ChangeNotifier {
1811 if (baseResp != null && baseResp.code == Constant.status_success) { 1817 if (baseResp != null && baseResp.code == Constant.status_success) {
1812 // guestReserveSunModel = 1818 // guestReserveSunModel =
1813 // GuestReserveModel.fromJson(baseResp.responseData).data; 1819 // GuestReserveModel.fromJson(baseResp.responseData).data;
1814 - if (baseResp.responseData['data'] == 1 ||  
1815 - baseResp.responseData['data'] == 0) { 1820 + if (baseResp.responseData['data'] is Map ||
  1821 + baseResp.responseData['data'] == 1) {
  1822 + Utils.showToast("设置成功!");
1816 return true; 1823 return true;
1817 } 1824 }
1818 return false; 1825 return false;