Showing
6 changed files
with
2623 additions
and
1440 deletions
lib/pages/my/customer_type/month_item.dart
0 → 100644
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | + | ||
| 4 | +import '../../../res/colors.dart'; | ||
| 5 | +import '../../../utils/screen_util.dart'; | ||
| 6 | +import '../../../utils/utils.dart'; | ||
| 7 | +import '../../../widgets/MyDivider.dart'; | ||
| 8 | +import '../../../widgets/h_empty_view.dart'; | ||
| 9 | +import '../../../widgets/v_empty_view.dart'; | ||
| 10 | + | ||
| 11 | +class MonthItem extends StatefulWidget { | ||
| 12 | + MonthItem({Key key}) : super(key: key); | ||
| 13 | + | ||
| 14 | + @override | ||
| 15 | + _MonthItemState createState() => _MonthItemState(); | ||
| 16 | +} | ||
| 17 | + | ||
| 18 | +class _MonthItemState extends State<MonthItem> { | ||
| 19 | + Widget _space({Color color = MyColours.color_515151, num height = 19}) { | ||
| 20 | + return Row( | ||
| 21 | + children: [ | ||
| 22 | + HEmptyView(10), | ||
| 23 | + MyDivider( | ||
| 24 | + w(1), | ||
| 25 | + w(height), | ||
| 26 | + color: color, | ||
| 27 | + ), | ||
| 28 | + HEmptyView(10), | ||
| 29 | + ], | ||
| 30 | + ); | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + @override | ||
| 34 | + Widget build(BuildContext context) { | ||
| 35 | + return Container( | ||
| 36 | + margin: EdgeInsets.only(bottom: w(10)), | ||
| 37 | + decoration: BoxDecoration( | ||
| 38 | + color: MyColours.color_ffffff, | ||
| 39 | + borderRadius: BorderRadius.circular(r(8))), | ||
| 40 | + child: Column( | ||
| 41 | + children: [ | ||
| 42 | + Container( | ||
| 43 | + height: w(35), | ||
| 44 | + padding: EdgeInsets.only(left: w(15), right: w(30)), | ||
| 45 | + decoration: BoxDecoration( | ||
| 46 | + color: MyColours.color_33438E93, | ||
| 47 | + borderRadius: BorderRadius.only( | ||
| 48 | + topLeft: Radius.circular(r(8)), | ||
| 49 | + topRight: Radius.circular(r(8)), | ||
| 50 | + )), | ||
| 51 | + child: Row( | ||
| 52 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 53 | + children: [ | ||
| 54 | + Text( | ||
| 55 | + '4月', | ||
| 56 | + style: TextStyle( | ||
| 57 | + color: MyColours.color_515151, fontSize: font(18)), | ||
| 58 | + ), | ||
| 59 | + Row( | ||
| 60 | + mainAxisAlignment: MainAxisAlignment.end, | ||
| 61 | + children: [ | ||
| 62 | + Text( | ||
| 63 | + '预订1089单', | ||
| 64 | + style: TextStyle( | ||
| 65 | + color: MyColours.color_515151, fontSize: font(14)), | ||
| 66 | + ), | ||
| 67 | + _space(), | ||
| 68 | + Text( | ||
| 69 | + '1190桌', | ||
| 70 | + style: TextStyle( | ||
| 71 | + color: MyColours.color_515151, fontSize: font(14)), | ||
| 72 | + ), | ||
| 73 | + ], | ||
| 74 | + ), | ||
| 75 | + ], | ||
| 76 | + ), | ||
| 77 | + ), | ||
| 78 | + Container( | ||
| 79 | + padding: EdgeInsets.only(left: w(15), top: w(8), bottom: w(8)), | ||
| 80 | + child: Row( | ||
| 81 | + children: [ | ||
| 82 | + Expanded( | ||
| 83 | + child: Column( | ||
| 84 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 85 | + children: [ | ||
| 86 | + Wrap( | ||
| 87 | + runSpacing: w(6), | ||
| 88 | + children: [ | ||
| 89 | + Text( | ||
| 90 | + '到店 1059单', | ||
| 91 | + style: TextStyle( | ||
| 92 | + color: MyColours.color_515151, | ||
| 93 | + fontSize: font(12)), | ||
| 94 | + ), | ||
| 95 | + HEmptyView(10), | ||
| 96 | + MyDivider( | ||
| 97 | + w(1), | ||
| 98 | + w(17), | ||
| 99 | + color: MyColours.color_DBDBDB, | ||
| 100 | + ), | ||
| 101 | + HEmptyView(10), | ||
| 102 | + Text( | ||
| 103 | + '1160桌', | ||
| 104 | + style: TextStyle( | ||
| 105 | + color: MyColours.color_515151, | ||
| 106 | + fontSize: font(12)), | ||
| 107 | + ), | ||
| 108 | + HEmptyView(10), | ||
| 109 | + MyDivider( | ||
| 110 | + w(1), | ||
| 111 | + w(17), | ||
| 112 | + color: MyColours.color_DBDBDB, | ||
| 113 | + ), | ||
| 114 | + HEmptyView(10), | ||
| 115 | + Text( | ||
| 116 | + '8000人', | ||
| 117 | + style: TextStyle( | ||
| 118 | + color: MyColours.color_515151, | ||
| 119 | + fontSize: font(12)), | ||
| 120 | + ), | ||
| 121 | + HEmptyView(10), | ||
| 122 | + MyDivider( | ||
| 123 | + w(1), | ||
| 124 | + w(17), | ||
| 125 | + color: MyColours.color_DBDBDB, | ||
| 126 | + ), | ||
| 127 | + HEmptyView(10), | ||
| 128 | + Text( | ||
| 129 | + '30取消', | ||
| 130 | + style: TextStyle( | ||
| 131 | + color: MyColours.color_515151, | ||
| 132 | + fontSize: font(12)), | ||
| 133 | + ), | ||
| 134 | + HEmptyView(10), | ||
| 135 | + MyDivider( | ||
| 136 | + w(1), | ||
| 137 | + w(17), | ||
| 138 | + color: MyColours.color_DBDBDB, | ||
| 139 | + ), | ||
| 140 | + HEmptyView(10), | ||
| 141 | + Text( | ||
| 142 | + '到客97.2%', | ||
| 143 | + style: TextStyle( | ||
| 144 | + color: MyColours.color_515151, | ||
| 145 | + fontSize: font(12)), | ||
| 146 | + ), | ||
| 147 | + ], | ||
| 148 | + ), | ||
| 149 | + VEmptyView(12), | ||
| 150 | + Wrap( | ||
| 151 | + // crossAxisAlignment: WrapCrossAlignment.start, | ||
| 152 | + // runAlignment: WrapAlignment.center, | ||
| 153 | + // alignment: WrapAlignment.center, | ||
| 154 | + runSpacing: w(6), | ||
| 155 | + children: [ | ||
| 156 | + Text( | ||
| 157 | + '有金额订单数 6000', | ||
| 158 | + style: TextStyle( | ||
| 159 | + color: MyColours.color_999999, | ||
| 160 | + fontSize: font( | ||
| 161 | + (10), | ||
| 162 | + )), | ||
| 163 | + ), | ||
| 164 | + HEmptyView(10), | ||
| 165 | + MyDivider( | ||
| 166 | + w(1), | ||
| 167 | + w(12), | ||
| 168 | + color: MyColours.color_DBDBDB, | ||
| 169 | + ), | ||
| 170 | + HEmptyView(10), | ||
| 171 | + Text( | ||
| 172 | + '总消费 9585800.00元', | ||
| 173 | + style: TextStyle( | ||
| 174 | + color: MyColours.color_999999, | ||
| 175 | + fontSize: font( | ||
| 176 | + (10), | ||
| 177 | + )), | ||
| 178 | + ), | ||
| 179 | + ], | ||
| 180 | + ), | ||
| 181 | + VEmptyView(12), | ||
| 182 | + Wrap( | ||
| 183 | + // crossAxisAlignment: WrapCrossAlignment.start, | ||
| 184 | + // runAlignment: WrapAlignment.center, | ||
| 185 | + // alignment: WrapAlignment.center, | ||
| 186 | + runSpacing: w(6), | ||
| 187 | + children: [ | ||
| 188 | + Text( | ||
| 189 | + '人均 8885.58元', | ||
| 190 | + style: TextStyle( | ||
| 191 | + color: MyColours.color_999999, | ||
| 192 | + fontSize: font( | ||
| 193 | + (10), | ||
| 194 | + )), | ||
| 195 | + ), | ||
| 196 | + HEmptyView(10), | ||
| 197 | + MyDivider( | ||
| 198 | + w(1), | ||
| 199 | + w(12), | ||
| 200 | + color: MyColours.color_DBDBDB, | ||
| 201 | + ), | ||
| 202 | + HEmptyView(10), | ||
| 203 | + Text( | ||
| 204 | + '桌均 95888.58元', | ||
| 205 | + style: TextStyle( | ||
| 206 | + color: MyColours.color_999999, | ||
| 207 | + fontSize: font( | ||
| 208 | + (10), | ||
| 209 | + )), | ||
| 210 | + ), | ||
| 211 | + ], | ||
| 212 | + ), | ||
| 213 | + VEmptyView(12), | ||
| 214 | + Wrap( | ||
| 215 | + // crossAxisAlignment: WrapCrossAlignment.start, | ||
| 216 | + // runAlignment: WrapAlignment.center, | ||
| 217 | + // alignment: WrapAlignment.center, | ||
| 218 | + runSpacing: w(6), | ||
| 219 | + children: [ | ||
| 220 | + Text( | ||
| 221 | + '存酒 8位', | ||
| 222 | + style: TextStyle( | ||
| 223 | + color: MyColours.color_999999, | ||
| 224 | + fontSize: font( | ||
| 225 | + (10), | ||
| 226 | + )), | ||
| 227 | + ), | ||
| 228 | + HEmptyView(10), | ||
| 229 | + MyDivider( | ||
| 230 | + w(1), | ||
| 231 | + w(12), | ||
| 232 | + color: MyColours.color_DBDBDB, | ||
| 233 | + ), | ||
| 234 | + HEmptyView(10), | ||
| 235 | + Text( | ||
| 236 | + '提前点餐 9位', | ||
| 237 | + style: TextStyle( | ||
| 238 | + color: MyColours.color_999999, | ||
| 239 | + fontSize: font( | ||
| 240 | + (10), | ||
| 241 | + )), | ||
| 242 | + ), | ||
| 243 | + HEmptyView(10), | ||
| 244 | + MyDivider( | ||
| 245 | + w(1), | ||
| 246 | + w(12), | ||
| 247 | + color: MyColours.color_DBDBDB, | ||
| 248 | + ), | ||
| 249 | + HEmptyView(10), | ||
| 250 | + Text( | ||
| 251 | + '安排菜 9位', | ||
| 252 | + style: TextStyle( | ||
| 253 | + color: MyColours.color_999999, | ||
| 254 | + fontSize: font( | ||
| 255 | + (10), | ||
| 256 | + )), | ||
| 257 | + ), | ||
| 258 | + ], | ||
| 259 | + ), | ||
| 260 | + ], | ||
| 261 | + )), | ||
| 262 | + HEmptyView(12), | ||
| 263 | + Container( | ||
| 264 | + width: w(50), | ||
| 265 | + child: Image.asset( | ||
| 266 | + Utils.getImgPath('c_arrow_right'), | ||
| 267 | + width: ScreenUtil().setWidth(24), | ||
| 268 | + height: ScreenUtil().setWidth(24), | ||
| 269 | + )) | ||
| 270 | + ], | ||
| 271 | + )) | ||
| 272 | + ], | ||
| 273 | + ), | ||
| 274 | + ); | ||
| 275 | + } | ||
| 276 | +} |
| @@ -21,6 +21,7 @@ import 'package:provider/provider.dart'; | @@ -21,6 +21,7 @@ import 'package:provider/provider.dart'; | ||
| 21 | 21 | ||
| 22 | import '../../../../utils/screen_util.dart'; | 22 | import '../../../../utils/screen_util.dart'; |
| 23 | import '../../../../widgets/MyDivider.dart'; | 23 | import '../../../../widgets/MyDivider.dart'; |
| 24 | +import '../month_item.dart'; | ||
| 24 | import '../store_customer/bar_chart_page.dart'; | 25 | import '../store_customer/bar_chart_page.dart'; |
| 25 | 26 | ||
| 26 | /** | 27 | /** |
| @@ -193,20 +194,6 @@ class _MyCustomerHomePageState extends State<MyCustomerHomePage> { | @@ -193,20 +194,6 @@ class _MyCustomerHomePageState extends State<MyCustomerHomePage> { | ||
| 193 | ); | 194 | ); |
| 194 | } | 195 | } |
| 195 | 196 | ||
| 196 | - Widget _space({Color color = MyColours.color_515151, num height = 19}) { | ||
| 197 | - return Row( | ||
| 198 | - children: [ | ||
| 199 | - HEmptyView(10), | ||
| 200 | - MyDivider( | ||
| 201 | - w(1), | ||
| 202 | - w(height), | ||
| 203 | - color: color, | ||
| 204 | - ), | ||
| 205 | - HEmptyView(10), | ||
| 206 | - ], | ||
| 207 | - ); | ||
| 208 | - } | ||
| 209 | - | ||
| 210 | ///活跃客户、沉睡客户、流失客户 | 197 | ///活跃客户、沉睡客户、流失客户 |
| 211 | Widget _percentWidget(String pnum, String btnTitle, String percent) { | 198 | Widget _percentWidget(String pnum, String btnTitle, String percent) { |
| 212 | return InkWell( | 199 | return InkWell( |
| @@ -658,266 +645,7 @@ class _MyCustomerHomePageState extends State<MyCustomerHomePage> { | @@ -658,266 +645,7 @@ class _MyCustomerHomePageState extends State<MyCustomerHomePage> { | ||
| 658 | controller: _controller, | 645 | controller: _controller, |
| 659 | padding: EdgeInsets.symmetric(horizontal: w(10)), | 646 | padding: EdgeInsets.symmetric(horizontal: w(10)), |
| 660 | itemBuilder: (context, index) { | 647 | itemBuilder: (context, index) { |
| 661 | - return Container( | ||
| 662 | - margin: EdgeInsets.only(bottom: w(10)), | ||
| 663 | - decoration: BoxDecoration( | ||
| 664 | - color: MyColours.color_ffffff, | ||
| 665 | - borderRadius: BorderRadius.circular(r(8))), | ||
| 666 | - child: Column( | ||
| 667 | - children: [ | ||
| 668 | - Container( | ||
| 669 | - height: w(35), | ||
| 670 | - padding: EdgeInsets.only( | ||
| 671 | - left: w(15), right: w(30)), | ||
| 672 | - decoration: BoxDecoration( | ||
| 673 | - color: MyColours.color_33438E93, | ||
| 674 | - borderRadius: BorderRadius.only( | ||
| 675 | - topLeft: Radius.circular(r(8)), | ||
| 676 | - topRight: Radius.circular(r(8)), | ||
| 677 | - )), | ||
| 678 | - child: Row( | ||
| 679 | - mainAxisAlignment: | ||
| 680 | - MainAxisAlignment.spaceBetween, | ||
| 681 | - children: [ | ||
| 682 | - Text( | ||
| 683 | - '4月', | ||
| 684 | - style: TextStyle( | ||
| 685 | - color: MyColours.color_515151, | ||
| 686 | - fontSize: font(18)), | ||
| 687 | - ), | ||
| 688 | - Row( | ||
| 689 | - mainAxisAlignment: | ||
| 690 | - MainAxisAlignment.end, | ||
| 691 | - children: [ | ||
| 692 | - Text( | ||
| 693 | - '预订1089单', | ||
| 694 | - style: TextStyle( | ||
| 695 | - color: MyColours.color_515151, | ||
| 696 | - fontSize: font(14)), | ||
| 697 | - ), | ||
| 698 | - _space(), | ||
| 699 | - Text( | ||
| 700 | - '1190桌', | ||
| 701 | - style: TextStyle( | ||
| 702 | - color: MyColours.color_515151, | ||
| 703 | - fontSize: font(14)), | ||
| 704 | - ), | ||
| 705 | - ], | ||
| 706 | - ), | ||
| 707 | - ], | ||
| 708 | - ), | ||
| 709 | - ), | ||
| 710 | - Container( | ||
| 711 | - padding: EdgeInsets.only( | ||
| 712 | - left: w(15), top: w(8), bottom: w(8)), | ||
| 713 | - child: Row( | ||
| 714 | - children: [ | ||
| 715 | - Expanded( | ||
| 716 | - child: Column( | ||
| 717 | - crossAxisAlignment: | ||
| 718 | - CrossAxisAlignment.start, | ||
| 719 | - children: [ | ||
| 720 | - Wrap( | ||
| 721 | - runSpacing: w(6), | ||
| 722 | - children: [ | ||
| 723 | - Text( | ||
| 724 | - '到店 1059单', | ||
| 725 | - style: TextStyle( | ||
| 726 | - color: MyColours | ||
| 727 | - .color_515151, | ||
| 728 | - fontSize: font(12)), | ||
| 729 | - ), | ||
| 730 | - HEmptyView(10), | ||
| 731 | - MyDivider( | ||
| 732 | - w(1), | ||
| 733 | - w(17), | ||
| 734 | - color: MyColours.color_DBDBDB, | ||
| 735 | - ), | ||
| 736 | - HEmptyView(10), | ||
| 737 | - Text( | ||
| 738 | - '1160桌', | ||
| 739 | - style: TextStyle( | ||
| 740 | - color: MyColours | ||
| 741 | - .color_515151, | ||
| 742 | - fontSize: font(12)), | ||
| 743 | - ), | ||
| 744 | - HEmptyView(10), | ||
| 745 | - MyDivider( | ||
| 746 | - w(1), | ||
| 747 | - w(17), | ||
| 748 | - color: MyColours.color_DBDBDB, | ||
| 749 | - ), | ||
| 750 | - HEmptyView(10), | ||
| 751 | - Text( | ||
| 752 | - '8000人', | ||
| 753 | - style: TextStyle( | ||
| 754 | - color: MyColours | ||
| 755 | - .color_515151, | ||
| 756 | - fontSize: font(12)), | ||
| 757 | - ), | ||
| 758 | - HEmptyView(10), | ||
| 759 | - MyDivider( | ||
| 760 | - w(1), | ||
| 761 | - w(17), | ||
| 762 | - color: MyColours.color_DBDBDB, | ||
| 763 | - ), | ||
| 764 | - HEmptyView(10), | ||
| 765 | - Text( | ||
| 766 | - '30取消', | ||
| 767 | - style: TextStyle( | ||
| 768 | - color: MyColours | ||
| 769 | - .color_515151, | ||
| 770 | - fontSize: font(12)), | ||
| 771 | - ), | ||
| 772 | - HEmptyView(10), | ||
| 773 | - MyDivider( | ||
| 774 | - w(1), | ||
| 775 | - w(17), | ||
| 776 | - color: MyColours.color_DBDBDB, | ||
| 777 | - ), | ||
| 778 | - HEmptyView(10), | ||
| 779 | - Text( | ||
| 780 | - '到客97.2%', | ||
| 781 | - style: TextStyle( | ||
| 782 | - color: MyColours | ||
| 783 | - .color_515151, | ||
| 784 | - fontSize: font(12)), | ||
| 785 | - ), | ||
| 786 | - ], | ||
| 787 | - ), | ||
| 788 | - VEmptyView(12), | ||
| 789 | - Wrap( | ||
| 790 | - // crossAxisAlignment: WrapCrossAlignment.start, | ||
| 791 | - // runAlignment: WrapAlignment.center, | ||
| 792 | - // alignment: WrapAlignment.center, | ||
| 793 | - runSpacing: w(6), | ||
| 794 | - children: [ | ||
| 795 | - Text( | ||
| 796 | - '有金额订单数 6000', | ||
| 797 | - style: TextStyle( | ||
| 798 | - color: MyColours | ||
| 799 | - .color_999999, | ||
| 800 | - fontSize: font( | ||
| 801 | - (10), | ||
| 802 | - )), | ||
| 803 | - ), | ||
| 804 | - HEmptyView(10), | ||
| 805 | - MyDivider( | ||
| 806 | - w(1), | ||
| 807 | - w(12), | ||
| 808 | - color: MyColours.color_DBDBDB, | ||
| 809 | - ), | ||
| 810 | - HEmptyView(10), | ||
| 811 | - Text( | ||
| 812 | - '总消费 9585800.00元', | ||
| 813 | - style: TextStyle( | ||
| 814 | - color: MyColours | ||
| 815 | - .color_999999, | ||
| 816 | - fontSize: font( | ||
| 817 | - (10), | ||
| 818 | - )), | ||
| 819 | - ), | ||
| 820 | - ], | ||
| 821 | - ), | ||
| 822 | - VEmptyView(12), | ||
| 823 | - Wrap( | ||
| 824 | - // crossAxisAlignment: WrapCrossAlignment.start, | ||
| 825 | - // runAlignment: WrapAlignment.center, | ||
| 826 | - // alignment: WrapAlignment.center, | ||
| 827 | - runSpacing: w(6), | ||
| 828 | - children: [ | ||
| 829 | - Text( | ||
| 830 | - '人均 8885.58元', | ||
| 831 | - style: TextStyle( | ||
| 832 | - color: MyColours | ||
| 833 | - .color_999999, | ||
| 834 | - fontSize: font( | ||
| 835 | - (10), | ||
| 836 | - )), | ||
| 837 | - ), | ||
| 838 | - HEmptyView(10), | ||
| 839 | - MyDivider( | ||
| 840 | - w(1), | ||
| 841 | - w(12), | ||
| 842 | - color: MyColours.color_DBDBDB, | ||
| 843 | - ), | ||
| 844 | - HEmptyView(10), | ||
| 845 | - Text( | ||
| 846 | - '桌均 95888.58元', | ||
| 847 | - style: TextStyle( | ||
| 848 | - color: MyColours | ||
| 849 | - .color_999999, | ||
| 850 | - fontSize: font( | ||
| 851 | - (10), | ||
| 852 | - )), | ||
| 853 | - ), | ||
| 854 | - ], | ||
| 855 | - ), | ||
| 856 | - VEmptyView(12), | ||
| 857 | - Wrap( | ||
| 858 | - // crossAxisAlignment: WrapCrossAlignment.start, | ||
| 859 | - // runAlignment: WrapAlignment.center, | ||
| 860 | - // alignment: WrapAlignment.center, | ||
| 861 | - runSpacing: w(6), | ||
| 862 | - children: [ | ||
| 863 | - Text( | ||
| 864 | - '存酒 8位', | ||
| 865 | - style: TextStyle( | ||
| 866 | - color: MyColours | ||
| 867 | - .color_999999, | ||
| 868 | - fontSize: font( | ||
| 869 | - (10), | ||
| 870 | - )), | ||
| 871 | - ), | ||
| 872 | - HEmptyView(10), | ||
| 873 | - MyDivider( | ||
| 874 | - w(1), | ||
| 875 | - w(12), | ||
| 876 | - color: MyColours.color_DBDBDB, | ||
| 877 | - ), | ||
| 878 | - HEmptyView(10), | ||
| 879 | - Text( | ||
| 880 | - '提前点餐 9位', | ||
| 881 | - style: TextStyle( | ||
| 882 | - color: MyColours | ||
| 883 | - .color_999999, | ||
| 884 | - fontSize: font( | ||
| 885 | - (10), | ||
| 886 | - )), | ||
| 887 | - ), | ||
| 888 | - HEmptyView(10), | ||
| 889 | - MyDivider( | ||
| 890 | - w(1), | ||
| 891 | - w(12), | ||
| 892 | - color: MyColours.color_DBDBDB, | ||
| 893 | - ), | ||
| 894 | - HEmptyView(10), | ||
| 895 | - Text( | ||
| 896 | - '安排菜 9位', | ||
| 897 | - style: TextStyle( | ||
| 898 | - color: MyColours | ||
| 899 | - .color_999999, | ||
| 900 | - fontSize: font( | ||
| 901 | - (10), | ||
| 902 | - )), | ||
| 903 | - ), | ||
| 904 | - ], | ||
| 905 | - ), | ||
| 906 | - ], | ||
| 907 | - )), | ||
| 908 | - HEmptyView(12), | ||
| 909 | - Container( | ||
| 910 | - width: w(50), | ||
| 911 | - child: Image.asset( | ||
| 912 | - Utils.getImgPath('c_arrow_right'), | ||
| 913 | - width: ScreenUtil().setWidth(24), | ||
| 914 | - height: ScreenUtil().setWidth(24), | ||
| 915 | - )) | ||
| 916 | - ], | ||
| 917 | - )) | ||
| 918 | - ], | ||
| 919 | - ), | ||
| 920 | - ); | 648 | + return MonthItem(); |
| 921 | }) | 649 | }) |
| 922 | ], | 650 | ], |
| 923 | ), | 651 | ), |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | +import 'package:one_key/constant/state.dart'; | ||
| 4 | +import 'package:one_key/models/marketing_by_seller_model.dart'; | ||
| 5 | +import 'package:one_key/models/seller_info.dart'; | ||
| 6 | +import 'package:one_key/models/store_customer_home_model.dart'; | ||
| 7 | +import 'package:one_key/pages/my/customer_type/store_customer/bar_chart_page.dart'; | ||
| 8 | +import 'package:one_key/provider/customer_provider.dart'; | ||
| 9 | +import 'package:one_key/provider/user_model.dart'; | ||
| 10 | +import 'package:one_key/res/colors.dart'; | ||
| 11 | +import 'package:one_key/route/navigator_util.dart'; | ||
| 12 | +import 'package:one_key/utils/event_bus.dart'; | ||
| 13 | +import 'package:one_key/utils/utils.dart'; | ||
| 14 | +import 'package:one_key/widgets/MyDivider.dart'; | ||
| 15 | +import 'package:one_key/widgets/h_empty_view.dart'; | ||
| 16 | +import 'package:one_key/widgets/page_exception.dart'; | ||
| 17 | +import 'package:one_key/widgets/round_button.dart'; | ||
| 18 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 19 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 20 | +import 'package:provider/provider.dart'; | ||
| 21 | + | ||
| 22 | +import '../../../../utils/screen_util.dart'; | ||
| 23 | +import '../month_item.dart'; | ||
| 24 | + | ||
| 25 | +class StoreCustomerHomeLeftPage extends StatefulWidget { | ||
| 26 | + StoreCustomerHomeLeftPage({Key key}) : super(key: key); | ||
| 27 | + | ||
| 28 | + @override | ||
| 29 | + _StoreCustomerHomeLeftPageState createState() => | ||
| 30 | + _StoreCustomerHomeLeftPageState(); | ||
| 31 | +} | ||
| 32 | + | ||
| 33 | +class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | ||
| 34 | + ScrollController _controller = ScrollController(); | ||
| 35 | + CustomerProvider customerProvider; | ||
| 36 | + bool showWarning = false; | ||
| 37 | + int year; | ||
| 38 | + int month; | ||
| 39 | + List<BarData> dataList = [ | ||
| 40 | + BarData(MyColours.color_8EBBBE, 200), | ||
| 41 | + BarData(MyColours.color_8EBBBE, 8), | ||
| 42 | + BarData(MyColours.color_8EBBBE, 15), | ||
| 43 | + BarData(MyColours.color_8EBBBE, 5), | ||
| 44 | + BarData(MyColours.color_8EBBBE, 2), | ||
| 45 | + BarData(MyColours.color_8EBBBE, 2), | ||
| 46 | + BarData(MyColours.color_8EBBBE, 18), | ||
| 47 | + BarData(MyColours.color_8EBBBE, 168), | ||
| 48 | + BarData(MyColours.color_8EBBBE, 15), | ||
| 49 | + BarData(MyColours.color_8EBBBE, 5), | ||
| 50 | + BarData(MyColours.color_8EBBBE, null ?? 0), | ||
| 51 | + BarData(MyColours.color_8EBBBE, 0), | ||
| 52 | + ]; | ||
| 53 | + | ||
| 54 | + @override | ||
| 55 | + void initState() { | ||
| 56 | + super.initState(); | ||
| 57 | + | ||
| 58 | + year = DateTime.now().year; | ||
| 59 | + month = DateTime.now().month; | ||
| 60 | + WidgetsBinding.instance.addPostFrameCallback((_) { | ||
| 61 | + _getSellerGuestManage(); | ||
| 62 | + _getMarketingBySeller(); | ||
| 63 | + }); | ||
| 64 | + bus.on("refresh_store_customer_home", (arg) { | ||
| 65 | + _getMarketingBySeller(); | ||
| 66 | + _getSellerGuestManage(); | ||
| 67 | + }); | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + @override | ||
| 71 | + void dispose() { | ||
| 72 | + bus.off('refresh_store_customer_home'); | ||
| 73 | + // bus.off("refresh_coupon_list"); | ||
| 74 | + super.dispose(); | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + ///全店客情首页 | ||
| 78 | + _getSellerGuestManage() async { | ||
| 79 | + StoreCustomerHomeSunModel model = | ||
| 80 | + await customerProvider.getSellerGuestManage(context); | ||
| 81 | + // setState(() {}); | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + _getMarketingBySeller() async { | ||
| 85 | + Map<String, String> params = { | ||
| 86 | + "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid | ||
| 87 | + }; | ||
| 88 | + List<MarketingBySellerSunModel> list = | ||
| 89 | + await customerProvider.getMarketingBySeller(context, params); | ||
| 90 | + if (list != null && list.length > 0) { | ||
| 91 | + bool temp = list.any((value) { | ||
| 92 | + return value.finishedStatus == '0'; | ||
| 93 | + }); | ||
| 94 | + setState(() { | ||
| 95 | + showWarning = temp; | ||
| 96 | + }); | ||
| 97 | + } | ||
| 98 | + // await customerProvider.searchData(customerProvider.controller.text); | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + ///活跃客户、沉睡客户、流失客户 | ||
| 102 | + Widget _percentWidget(String pnum, String btnTitle, String percent, | ||
| 103 | + {String uid = ''}) { | ||
| 104 | + return InkWell( | ||
| 105 | + onTap: () async { | ||
| 106 | + String index = '0'; | ||
| 107 | + if (btnTitle == '活跃') { | ||
| 108 | + index = '1'; | ||
| 109 | + } else if (btnTitle == '60天未到店') { | ||
| 110 | + index = '2'; | ||
| 111 | + } else if (btnTitle == '120天未到店') { | ||
| 112 | + index = '3'; | ||
| 113 | + } | ||
| 114 | + NavigatorUtil.goCustomerListPage(context, FromPage.FromPageHome, uid, | ||
| 115 | + index: index); | ||
| 116 | + }, | ||
| 117 | + child: Container( | ||
| 118 | + color: MyColours.color_ffffff, | ||
| 119 | + height: w(90), | ||
| 120 | + width: (ScreenUtil().screenWidth - ScreenUtil().setWidth(20)) / 3, | ||
| 121 | + // height: (ScreenUtil().screenWidth - ScreenUtil().setWidth(20)) / 3, | ||
| 122 | + child: Column( | ||
| 123 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 124 | + children: [ | ||
| 125 | + VEmptyView(30), | ||
| 126 | + Container( | ||
| 127 | + height: w(24), | ||
| 128 | + child: Row( | ||
| 129 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 130 | + children: [ | ||
| 131 | + Text(pnum, | ||
| 132 | + style: TextStyle( | ||
| 133 | + color: btnTitle == '活跃' | ||
| 134 | + ? MyColours.color_199095 | ||
| 135 | + : btnTitle == '60天未到店' | ||
| 136 | + ? MyColours.color_E89243 | ||
| 137 | + : MyColours.color_E34D59, | ||
| 138 | + fontSize: ScreenUtil().setSp(48), | ||
| 139 | + fontWeight: FontWeight.bold)), | ||
| 140 | + Text('位', | ||
| 141 | + style: TextStyle( | ||
| 142 | + color: MyColours.color_515151, | ||
| 143 | + fontSize: ScreenUtil().setSp(28), | ||
| 144 | + )) | ||
| 145 | + ], | ||
| 146 | + )), | ||
| 147 | + VEmptyView(20), | ||
| 148 | + RoundButton( | ||
| 149 | + onPressed: () async { | ||
| 150 | + String index = '0'; | ||
| 151 | + if (btnTitle == '活跃') { | ||
| 152 | + index = '1'; | ||
| 153 | + } else if (btnTitle == '60天未到店') { | ||
| 154 | + index = '2'; | ||
| 155 | + } else if (btnTitle == '120天未到店') { | ||
| 156 | + index = '3'; | ||
| 157 | + } | ||
| 158 | + NavigatorUtil.goCustomerListPage( | ||
| 159 | + context, FromPage.FromPageHome, uid, | ||
| 160 | + index: index); | ||
| 161 | + }, | ||
| 162 | + text: btnTitle, | ||
| 163 | + fontSize: 24, | ||
| 164 | + isBold: false, | ||
| 165 | + textColor: MyColours.color_999999, | ||
| 166 | + gradientStart: MyColours.color_ffffff, | ||
| 167 | + gradientEnd: MyColours.color_ffffff, | ||
| 168 | + borderColor: MyColours.color_ffffff, | ||
| 169 | + height: ScreenUtil().setWidth(48), | ||
| 170 | + // width: ScreenUtil().setWidth(160), | ||
| 171 | + radius: ScreenUtil().setWidth(30), | ||
| 172 | + ), | ||
| 173 | + // VEmptyView(16), | ||
| 174 | + // percent == null | ||
| 175 | + // ? SizedBox() | ||
| 176 | + // : Text('${percent}%', | ||
| 177 | + // style: TextStyle( | ||
| 178 | + // color: MyColours.color_199095, | ||
| 179 | + // fontSize: ScreenUtil().setSp(24), | ||
| 180 | + // )), | ||
| 181 | + ], | ||
| 182 | + ), | ||
| 183 | + )); | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + ///活跃客户、沉睡客户、流失客户 | ||
| 187 | + // Widget _percentWidget(String pnum, String btnTitle, String percent, | ||
| 188 | + // {String uid = ''}) { | ||
| 189 | + // return InkWell( | ||
| 190 | + // onTap: () async { | ||
| 191 | + // String index = '0'; | ||
| 192 | + | ||
| 193 | + // if (btnTitle == '活跃') { | ||
| 194 | + // index = '1'; | ||
| 195 | + // } else if (btnTitle == '60天未到店') { | ||
| 196 | + // index = '2'; | ||
| 197 | + // } else if (btnTitle == '120天未到店') { | ||
| 198 | + // index = '3'; | ||
| 199 | + // } | ||
| 200 | + // if (btnTitle == '未分配') { | ||
| 201 | + // NavigatorUtil.goCustomerListPage( | ||
| 202 | + // context, FromPage.FromPageHome, uid, | ||
| 203 | + // index: index, distribution: true); | ||
| 204 | + // } else { | ||
| 205 | + // NavigatorUtil.goCustomerListPage( | ||
| 206 | + // context, FromPage.FromPageHome, uid, | ||
| 207 | + // index: index); | ||
| 208 | + // } | ||
| 209 | + // }, | ||
| 210 | + // child: Container( | ||
| 211 | + // color: MyColours.color_ffffff, | ||
| 212 | + // // height: ScreenUtil().setWidth(230), | ||
| 213 | + // width: (ScreenUtil().screenWidth - ScreenUtil().setWidth(20)) / 3, | ||
| 214 | + // height: (ScreenUtil().screenWidth - ScreenUtil().setWidth(20)) / 3, | ||
| 215 | + // child: Column( | ||
| 216 | + // mainAxisAlignment: MainAxisAlignment.center, | ||
| 217 | + // children: [ | ||
| 218 | + // Row( | ||
| 219 | + // mainAxisAlignment: MainAxisAlignment.center, | ||
| 220 | + // children: [ | ||
| 221 | + // Text(pnum, | ||
| 222 | + // style: TextStyle( | ||
| 223 | + // color: MyColours.color_199095, | ||
| 224 | + // fontSize: ScreenUtil().setSp(40), | ||
| 225 | + // fontWeight: FontWeight.bold)), | ||
| 226 | + // Text('位', | ||
| 227 | + // style: TextStyle( | ||
| 228 | + // color: MyColours.color_199095, | ||
| 229 | + // fontSize: ScreenUtil().setSp(24), | ||
| 230 | + // )) | ||
| 231 | + // ], | ||
| 232 | + // ), | ||
| 233 | + // btnTitle == '' ? SizedBox() : VEmptyView(20), | ||
| 234 | + // btnTitle == '' | ||
| 235 | + // ? SizedBox() | ||
| 236 | + // : InkWell( | ||
| 237 | + // onTap: () async { | ||
| 238 | + // String index = '0'; | ||
| 239 | + | ||
| 240 | + // if (btnTitle == '活跃客户') { | ||
| 241 | + // index = '1'; | ||
| 242 | + // } else if (btnTitle == '沉睡客户') { | ||
| 243 | + // index = '2'; | ||
| 244 | + // } else if (btnTitle == '流失客户') { | ||
| 245 | + // index = '3'; | ||
| 246 | + // } | ||
| 247 | + // if (btnTitle == '未分配') { | ||
| 248 | + // NavigatorUtil.goCustomerListPage( | ||
| 249 | + // context, FromPage.FromPageHome, uid, | ||
| 250 | + // index: index, distribution: true); | ||
| 251 | + // } else { | ||
| 252 | + // NavigatorUtil.goCustomerListPage( | ||
| 253 | + // context, FromPage.FromPageHome, uid, | ||
| 254 | + // index: index); | ||
| 255 | + // } | ||
| 256 | + // }, | ||
| 257 | + // child: Container( | ||
| 258 | + // height: ScreenUtil().setWidth(45), | ||
| 259 | + // width: ScreenUtil().setWidth(160), | ||
| 260 | + // alignment: Alignment.center, | ||
| 261 | + // padding: EdgeInsets.symmetric(horizontal: w(10)), | ||
| 262 | + // decoration: BoxDecoration( | ||
| 263 | + // color: MyColours.color_ffffff, | ||
| 264 | + // border: Border.all( | ||
| 265 | + // width: w(1), | ||
| 266 | + // color: Color.fromRGBO(118, 118, 118, 1), | ||
| 267 | + // ), | ||
| 268 | + // borderRadius: | ||
| 269 | + // BorderRadius.circular(ScreenUtil().setWidth(30)), | ||
| 270 | + // ), | ||
| 271 | + // child: Text( | ||
| 272 | + // btnTitle, | ||
| 273 | + // maxLines: 1, | ||
| 274 | + // overflow: TextOverflow.ellipsis, | ||
| 275 | + // style: TextStyle( | ||
| 276 | + // color: MyColours.color_333333, | ||
| 277 | + // fontSize: font(12)), | ||
| 278 | + // ), | ||
| 279 | + // )) | ||
| 280 | + // // RoundButton( | ||
| 281 | + // // onPressed: () async { | ||
| 282 | + // // String index = '0'; | ||
| 283 | + | ||
| 284 | + // // if (btnTitle == '活跃客户') { | ||
| 285 | + // // index = '1'; | ||
| 286 | + // // } else if (btnTitle == '沉睡客户') { | ||
| 287 | + // // index = '2'; | ||
| 288 | + // // } else if (btnTitle == '流失客户') { | ||
| 289 | + // // index = '3'; | ||
| 290 | + // // } | ||
| 291 | + // // NavigatorUtil.goCustomerListPage( | ||
| 292 | + // // context, FromPage.FromPageHome, uid, | ||
| 293 | + // // index: index); | ||
| 294 | + // // }, | ||
| 295 | + // // text: btnTitle, | ||
| 296 | + // // fontSize: 24, | ||
| 297 | + // // isBold: false, | ||
| 298 | + // // textColor: MyColours.color_333333, | ||
| 299 | + // // gradientStart: MyColours.color_ffffff, | ||
| 300 | + // // gradientEnd: MyColours.color_ffffff, | ||
| 301 | + // // borderColor: Color.fromRGBO(118, 118, 118, 1), | ||
| 302 | + // // height: ScreenUtil().setWidth(45), | ||
| 303 | + // // width: ScreenUtil().setWidth(160), | ||
| 304 | + // // radius: ScreenUtil().setWidth(30), | ||
| 305 | + // // ), | ||
| 306 | + // , | ||
| 307 | + // VEmptyView(16), | ||
| 308 | + // percent == null | ||
| 309 | + // ? SizedBox() | ||
| 310 | + // : Text('${percent}%', | ||
| 311 | + // style: TextStyle( | ||
| 312 | + // color: MyColours.color_199095, | ||
| 313 | + // fontSize: ScreenUtil().setSp(24), | ||
| 314 | + // )), | ||
| 315 | + // ], | ||
| 316 | + // ), | ||
| 317 | + // )); | ||
| 318 | + // } | ||
| 319 | + | ||
| 320 | + Widget _chart() { | ||
| 321 | + return Container( | ||
| 322 | + // height: w(216), | ||
| 323 | + padding: EdgeInsets.only(top: w(16), left: w(16), right: w(16)), | ||
| 324 | + margin: EdgeInsets.all(w(10)), | ||
| 325 | + decoration: BoxDecoration( | ||
| 326 | + color: MyColours.color_ffffff, | ||
| 327 | + borderRadius: BorderRadius.circular(r(8))), | ||
| 328 | + child: Column( | ||
| 329 | + children: [ | ||
| 330 | + Row( | ||
| 331 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 332 | + children: [ | ||
| 333 | + InkWell( | ||
| 334 | + onTap: () { | ||
| 335 | + setState(() { | ||
| 336 | + year--; | ||
| 337 | + }); | ||
| 338 | + // _getGuestReserve(showLoading: true); | ||
| 339 | + }, | ||
| 340 | + child: Padding( | ||
| 341 | + padding: | ||
| 342 | + EdgeInsets.only(right: ScreenUtil().setWidth(20)), | ||
| 343 | + child: Image.asset( | ||
| 344 | + Utils.getImgPath('c_arrow_left'), | ||
| 345 | + width: ScreenUtil().setWidth(24), | ||
| 346 | + ))), | ||
| 347 | + Text( | ||
| 348 | + '${year}年', | ||
| 349 | + style: TextStyle( | ||
| 350 | + fontSize: ScreenUtil().setSp(32), | ||
| 351 | + color: MyColours.color_000000), | ||
| 352 | + ), | ||
| 353 | + InkWell( | ||
| 354 | + onTap: () { | ||
| 355 | + if (year >= DateTime.now().year) { | ||
| 356 | + return; | ||
| 357 | + } | ||
| 358 | + setState(() { | ||
| 359 | + year++; | ||
| 360 | + }); | ||
| 361 | + // _getGuestReserve(showLoading: true); | ||
| 362 | + }, | ||
| 363 | + child: Padding( | ||
| 364 | + padding: EdgeInsets.only( | ||
| 365 | + left: ScreenUtil().setWidth(20), | ||
| 366 | + ), | ||
| 367 | + child: Image.asset( | ||
| 368 | + Utils.getImgPath(year != DateTime.now().year | ||
| 369 | + ? 'c_arrow_right' | ||
| 370 | + : 'c_arrow_right_gray'), | ||
| 371 | + width: ScreenUtil().setWidth(24), | ||
| 372 | + ))) | ||
| 373 | + ], | ||
| 374 | + ), | ||
| 375 | + VEmptyView(80), | ||
| 376 | + Container( | ||
| 377 | + width: double.infinity, | ||
| 378 | + height: w(177), | ||
| 379 | + child: LayoutBuilder(builder: (context, constraints) { | ||
| 380 | + return BarChartWidget( | ||
| 381 | + dataList: dataList, | ||
| 382 | + ); | ||
| 383 | + })) | ||
| 384 | + ], | ||
| 385 | + ), | ||
| 386 | + ); | ||
| 387 | + } | ||
| 388 | + | ||
| 389 | + Widget _monthWidget() { | ||
| 390 | + return Container( | ||
| 391 | + margin: EdgeInsets.symmetric(horizontal: w(10)), | ||
| 392 | + padding: EdgeInsets.symmetric(horizontal: w(15), vertical: w(10)), | ||
| 393 | + decoration: BoxDecoration(color: MyColours.color_ffffff), | ||
| 394 | + child: Column( | ||
| 395 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 396 | + children: [ | ||
| 397 | + Row( | ||
| 398 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 399 | + children: [ | ||
| 400 | + InkWell( | ||
| 401 | + onTap: () { | ||
| 402 | + if (month == 1) { | ||
| 403 | + month = 12; | ||
| 404 | + setState(() {}); | ||
| 405 | + } else { | ||
| 406 | + setState(() { | ||
| 407 | + month--; | ||
| 408 | + }); | ||
| 409 | + } | ||
| 410 | + | ||
| 411 | + // _getGuestReserve(showLoading: true); | ||
| 412 | + }, | ||
| 413 | + child: Padding( | ||
| 414 | + padding: | ||
| 415 | + EdgeInsets.only(right: ScreenUtil().setWidth(20)), | ||
| 416 | + child: Image.asset( | ||
| 417 | + Utils.getImgPath('c_arrow_left'), | ||
| 418 | + width: ScreenUtil().setWidth(24), | ||
| 419 | + ))), | ||
| 420 | + Text( | ||
| 421 | + '${month}月', | ||
| 422 | + style: TextStyle( | ||
| 423 | + fontSize: ScreenUtil().setSp(40), | ||
| 424 | + color: MyColours.color_515151), | ||
| 425 | + ), | ||
| 426 | + InkWell( | ||
| 427 | + onTap: () { | ||
| 428 | + if (month == 12) { | ||
| 429 | + month = 1; | ||
| 430 | + setState(() {}); | ||
| 431 | + } else { | ||
| 432 | + setState(() { | ||
| 433 | + month++; | ||
| 434 | + }); | ||
| 435 | + } | ||
| 436 | + | ||
| 437 | + // _getGuestReserve(showLoading: true); | ||
| 438 | + }, | ||
| 439 | + child: Padding( | ||
| 440 | + padding: EdgeInsets.only( | ||
| 441 | + left: ScreenUtil().setWidth(20), | ||
| 442 | + ), | ||
| 443 | + child: Image.asset( | ||
| 444 | + Utils.getImgPath('c_arrow_right'), | ||
| 445 | + width: ScreenUtil().setWidth(24), | ||
| 446 | + ))) | ||
| 447 | + ], | ||
| 448 | + ), | ||
| 449 | + VEmptyView(20), | ||
| 450 | + Row( | ||
| 451 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 452 | + children: [ | ||
| 453 | + Text( | ||
| 454 | + '预订', | ||
| 455 | + style: TextStyle( | ||
| 456 | + fontWeight: FontWeight.bold, | ||
| 457 | + color: MyColours.color_515151, | ||
| 458 | + fontSize: font( | ||
| 459 | + (18), | ||
| 460 | + )), | ||
| 461 | + ), | ||
| 462 | + HEmptyView(10), | ||
| 463 | + Text( | ||
| 464 | + '1089单', | ||
| 465 | + style: TextStyle( | ||
| 466 | + color: MyColours.color_515151, | ||
| 467 | + fontSize: font( | ||
| 468 | + (14), | ||
| 469 | + )), | ||
| 470 | + ), | ||
| 471 | + HEmptyView(10), | ||
| 472 | + MyDivider( | ||
| 473 | + w(1), | ||
| 474 | + w(15), | ||
| 475 | + color: MyColours.color_DBDBDB, | ||
| 476 | + ), | ||
| 477 | + HEmptyView(10), | ||
| 478 | + Text( | ||
| 479 | + '1190桌', | ||
| 480 | + style: TextStyle( | ||
| 481 | + color: MyColours.color_515151, | ||
| 482 | + fontSize: font( | ||
| 483 | + (14), | ||
| 484 | + )), | ||
| 485 | + ), | ||
| 486 | + ], | ||
| 487 | + ), | ||
| 488 | + VEmptyView(15), | ||
| 489 | + Wrap( | ||
| 490 | + // crossAxisAlignment: WrapCrossAlignment.center, | ||
| 491 | + // runAlignment: WrapAlignment.center, | ||
| 492 | + // alignment: WrapAlignment.center, | ||
| 493 | + runSpacing: w(5), | ||
| 494 | + children: [ | ||
| 495 | + Text( | ||
| 496 | + '到店', | ||
| 497 | + style: TextStyle( | ||
| 498 | + fontWeight: FontWeight.bold, | ||
| 499 | + color: MyColours.color_515151, | ||
| 500 | + fontSize: font( | ||
| 501 | + (18), | ||
| 502 | + )), | ||
| 503 | + ), | ||
| 504 | + HEmptyView(10), | ||
| 505 | + Text( | ||
| 506 | + '1089单', | ||
| 507 | + style: TextStyle( | ||
| 508 | + color: MyColours.color_515151, | ||
| 509 | + fontSize: font( | ||
| 510 | + (14), | ||
| 511 | + )), | ||
| 512 | + ), | ||
| 513 | + HEmptyView(10), | ||
| 514 | + MyDivider( | ||
| 515 | + w(1), | ||
| 516 | + w(15), | ||
| 517 | + color: MyColours.color_DBDBDB, | ||
| 518 | + ), | ||
| 519 | + HEmptyView(10), | ||
| 520 | + Text( | ||
| 521 | + '1190桌', | ||
| 522 | + style: TextStyle( | ||
| 523 | + color: MyColours.color_515151, | ||
| 524 | + fontSize: font( | ||
| 525 | + (14), | ||
| 526 | + )), | ||
| 527 | + ), | ||
| 528 | + HEmptyView(10), | ||
| 529 | + MyDivider( | ||
| 530 | + w(1), | ||
| 531 | + w(15), | ||
| 532 | + color: MyColours.color_DBDBDB, | ||
| 533 | + ), | ||
| 534 | + HEmptyView(10), | ||
| 535 | + Text( | ||
| 536 | + '1190人', | ||
| 537 | + style: TextStyle( | ||
| 538 | + color: MyColours.color_515151, | ||
| 539 | + fontSize: font( | ||
| 540 | + (14), | ||
| 541 | + )), | ||
| 542 | + ), | ||
| 543 | + HEmptyView(10), | ||
| 544 | + MyDivider( | ||
| 545 | + w(1), | ||
| 546 | + w(15), | ||
| 547 | + color: MyColours.color_DBDBDB, | ||
| 548 | + ), | ||
| 549 | + HEmptyView(10), | ||
| 550 | + Text( | ||
| 551 | + '1190取消', | ||
| 552 | + style: TextStyle( | ||
| 553 | + color: MyColours.color_515151, | ||
| 554 | + fontSize: font( | ||
| 555 | + (14), | ||
| 556 | + )), | ||
| 557 | + ), | ||
| 558 | + HEmptyView(10), | ||
| 559 | + MyDivider( | ||
| 560 | + w(1), | ||
| 561 | + w(15), | ||
| 562 | + color: MyColours.color_DBDBDB, | ||
| 563 | + ), | ||
| 564 | + HEmptyView(10), | ||
| 565 | + Text( | ||
| 566 | + '到客97.2%', | ||
| 567 | + style: TextStyle( | ||
| 568 | + color: MyColours.color_515151, | ||
| 569 | + fontSize: font( | ||
| 570 | + (14), | ||
| 571 | + )), | ||
| 572 | + ), | ||
| 573 | + ], | ||
| 574 | + ), | ||
| 575 | + VEmptyView(15), | ||
| 576 | + MyDivider( | ||
| 577 | + double.infinity, | ||
| 578 | + w(1), | ||
| 579 | + color: MyColours.color_DBDBDB, | ||
| 580 | + ), | ||
| 581 | + VEmptyView(15), | ||
| 582 | + Wrap( | ||
| 583 | + // crossAxisAlignment: WrapCrossAlignment.start, | ||
| 584 | + // runAlignment: WrapAlignment.center, | ||
| 585 | + // alignment: WrapAlignment.center, | ||
| 586 | + runSpacing: w(5), | ||
| 587 | + children: [ | ||
| 588 | + Text( | ||
| 589 | + '有金额订单 6000', | ||
| 590 | + style: TextStyle( | ||
| 591 | + color: MyColours.color_999999, | ||
| 592 | + decoration: TextDecoration.underline, | ||
| 593 | + fontSize: font( | ||
| 594 | + (10), | ||
| 595 | + )), | ||
| 596 | + ), | ||
| 597 | + HEmptyView(10), | ||
| 598 | + MyDivider( | ||
| 599 | + w(1), | ||
| 600 | + w(12), | ||
| 601 | + color: MyColours.color_DBDBDB, | ||
| 602 | + ), | ||
| 603 | + HEmptyView(10), | ||
| 604 | + Text( | ||
| 605 | + '消费 9585800.00元', | ||
| 606 | + style: TextStyle( | ||
| 607 | + color: MyColours.color_999999, | ||
| 608 | + decoration: TextDecoration.underline, | ||
| 609 | + fontSize: font( | ||
| 610 | + (10), | ||
| 611 | + )), | ||
| 612 | + ), | ||
| 613 | + HEmptyView(10), | ||
| 614 | + MyDivider( | ||
| 615 | + w(1), | ||
| 616 | + w(12), | ||
| 617 | + color: MyColours.color_DBDBDB, | ||
| 618 | + ), | ||
| 619 | + HEmptyView(10), | ||
| 620 | + Text( | ||
| 621 | + '人均 8885.58元', | ||
| 622 | + style: TextStyle( | ||
| 623 | + color: MyColours.color_999999, | ||
| 624 | + decoration: TextDecoration.underline, | ||
| 625 | + fontSize: font( | ||
| 626 | + (10), | ||
| 627 | + )), | ||
| 628 | + ), | ||
| 629 | + HEmptyView(10), | ||
| 630 | + MyDivider( | ||
| 631 | + w(1), | ||
| 632 | + w(12), | ||
| 633 | + color: MyColours.color_DBDBDB, | ||
| 634 | + ), | ||
| 635 | + HEmptyView(10), | ||
| 636 | + Text( | ||
| 637 | + '桌均 95888.58元', | ||
| 638 | + style: TextStyle( | ||
| 639 | + color: MyColours.color_999999, | ||
| 640 | + decoration: TextDecoration.underline, | ||
| 641 | + fontSize: font( | ||
| 642 | + (10), | ||
| 643 | + )), | ||
| 644 | + ), | ||
| 645 | + HEmptyView(10), | ||
| 646 | + MyDivider( | ||
| 647 | + w(1), | ||
| 648 | + w(12), | ||
| 649 | + color: MyColours.color_DBDBDB, | ||
| 650 | + ), | ||
| 651 | + HEmptyView(10), | ||
| 652 | + Text( | ||
| 653 | + '存酒 8位', | ||
| 654 | + style: TextStyle( | ||
| 655 | + color: MyColours.color_999999, | ||
| 656 | + decoration: TextDecoration.underline, | ||
| 657 | + fontSize: font( | ||
| 658 | + (10), | ||
| 659 | + )), | ||
| 660 | + ), | ||
| 661 | + HEmptyView(10), | ||
| 662 | + MyDivider( | ||
| 663 | + w(1), | ||
| 664 | + w(12), | ||
| 665 | + color: MyColours.color_DBDBDB, | ||
| 666 | + ), | ||
| 667 | + HEmptyView(10), | ||
| 668 | + Text( | ||
| 669 | + '提前点餐 9位', | ||
| 670 | + style: TextStyle( | ||
| 671 | + color: MyColours.color_999999, | ||
| 672 | + decoration: TextDecoration.underline, | ||
| 673 | + fontSize: font( | ||
| 674 | + (10), | ||
| 675 | + )), | ||
| 676 | + ), | ||
| 677 | + HEmptyView(10), | ||
| 678 | + MyDivider( | ||
| 679 | + w(1), | ||
| 680 | + w(12), | ||
| 681 | + color: MyColours.color_DBDBDB, | ||
| 682 | + ), | ||
| 683 | + HEmptyView(10), | ||
| 684 | + Text( | ||
| 685 | + '安排菜 9位', | ||
| 686 | + style: TextStyle( | ||
| 687 | + color: MyColours.color_999999, | ||
| 688 | + decoration: TextDecoration.underline, | ||
| 689 | + fontSize: font( | ||
| 690 | + (10), | ||
| 691 | + )), | ||
| 692 | + ), | ||
| 693 | + ], | ||
| 694 | + ), | ||
| 695 | + ], | ||
| 696 | + ), | ||
| 697 | + ); | ||
| 698 | + } | ||
| 699 | + | ||
| 700 | + Widget _managerWidget(String pnum, String btnTitle, String percent, | ||
| 701 | + {String uid = ''}) { | ||
| 702 | + return Container( | ||
| 703 | + // width: w(122), | ||
| 704 | + height: w(116), | ||
| 705 | + padding: EdgeInsets.symmetric(vertical: w(12), horizontal: w(10)), | ||
| 706 | + decoration: BoxDecoration( | ||
| 707 | + color: MyColours.color_ffffff, | ||
| 708 | + ), | ||
| 709 | + child: Column( | ||
| 710 | + children: [ | ||
| 711 | + Align( | ||
| 712 | + alignment: Alignment.centerLeft, | ||
| 713 | + child: Container( | ||
| 714 | + padding: EdgeInsets.symmetric(vertical: w(4), horizontal: w(5)), | ||
| 715 | + decoration: BoxDecoration( | ||
| 716 | + borderRadius: BorderRadius.circular(r(3)), | ||
| 717 | + border: | ||
| 718 | + Border.all(color: MyColours.color_999999, width: w(1))), | ||
| 719 | + child: Text( | ||
| 720 | + btnTitle, | ||
| 721 | + style: TextStyle( | ||
| 722 | + fontSize: font(12), | ||
| 723 | + fontWeight: FontWeight.bold, | ||
| 724 | + color: MyColours.color_999999), | ||
| 725 | + ), | ||
| 726 | + ), | ||
| 727 | + ), | ||
| 728 | + VEmptyView(20), | ||
| 729 | + Row( | ||
| 730 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 731 | + children: [ | ||
| 732 | + Text( | ||
| 733 | + pnum, | ||
| 734 | + style: TextStyle( | ||
| 735 | + fontSize: font(24), | ||
| 736 | + fontWeight: FontWeight.bold, | ||
| 737 | + color: MyColours.color_438E93), | ||
| 738 | + ), | ||
| 739 | + Text( | ||
| 740 | + '位', | ||
| 741 | + style: TextStyle( | ||
| 742 | + fontSize: font(14), color: MyColours.color_000000), | ||
| 743 | + ), | ||
| 744 | + ], | ||
| 745 | + ), | ||
| 746 | + VEmptyView(10), | ||
| 747 | + Row( | ||
| 748 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 749 | + children: [ | ||
| 750 | + Text( | ||
| 751 | + '23', | ||
| 752 | + style: TextStyle( | ||
| 753 | + fontSize: font(14), | ||
| 754 | + fontWeight: FontWeight.bold, | ||
| 755 | + color: MyColours.color_438E93), | ||
| 756 | + ), | ||
| 757 | + MyDivider( | ||
| 758 | + w(4), | ||
| 759 | + w(1), | ||
| 760 | + color: MyColours.color_999999, | ||
| 761 | + ), | ||
| 762 | + Text( | ||
| 763 | + '9', | ||
| 764 | + style: TextStyle( | ||
| 765 | + fontSize: font(14), | ||
| 766 | + fontWeight: FontWeight.bold, | ||
| 767 | + color: MyColours.color_E89243), | ||
| 768 | + ), | ||
| 769 | + MyDivider( | ||
| 770 | + w(4), | ||
| 771 | + w(1), | ||
| 772 | + color: MyColours.color_999999, | ||
| 773 | + ), | ||
| 774 | + Text( | ||
| 775 | + '2', | ||
| 776 | + style: TextStyle( | ||
| 777 | + fontSize: font(14), | ||
| 778 | + fontWeight: FontWeight.bold, | ||
| 779 | + color: MyColours.color_E34D59), | ||
| 780 | + ), | ||
| 781 | + ], | ||
| 782 | + ), | ||
| 783 | + ], | ||
| 784 | + ), | ||
| 785 | + ); | ||
| 786 | + } | ||
| 787 | + | ||
| 788 | + @override | ||
| 789 | + Widget build(BuildContext context) { | ||
| 790 | + customerProvider = Provider.of<CustomerProvider>(context, listen: false); | ||
| 791 | + return Scaffold( | ||
| 792 | + // backgroundColor: Color.fromRGBO(246, 248, 250, 1), | ||
| 793 | + // appBar: SystemAppBar('全店客情', onTap: () { | ||
| 794 | + // EventBus().emit('changeStatusColor'); | ||
| 795 | + // Navigator.pop(context); | ||
| 796 | + // }), | ||
| 797 | + body: WillPopScope(onWillPop: () async { | ||
| 798 | + EventBus().emit('changeStatusColor'); | ||
| 799 | + return true; | ||
| 800 | + }, child: Consumer<CustomerProvider>(builder: (context, model, _) { | ||
| 801 | + if (model.pageStateStoreHome != PageState.Success) { | ||
| 802 | + return ExceptionPage( | ||
| 803 | + pageState: model.pageStateStoreHome, | ||
| 804 | + callback: () { | ||
| 805 | + // getTableList(); | ||
| 806 | + _getSellerGuestManage(); | ||
| 807 | + }, | ||
| 808 | + emptyMsg: "暂时没有全店客情哦", | ||
| 809 | + emptyImg: "empty_search", | ||
| 810 | + showMsg: "加载中,请稍后...", | ||
| 811 | + ); | ||
| 812 | + } else { | ||
| 813 | + return Column(children: [ | ||
| 814 | + Expanded( | ||
| 815 | + child: SingleChildScrollView( | ||
| 816 | + controller: _controller, | ||
| 817 | + child: Column( | ||
| 818 | + children: [ | ||
| 819 | + VEmptyView(10), | ||
| 820 | + Stack( | ||
| 821 | + children: [ | ||
| 822 | + InkWell( | ||
| 823 | + onTap: () { | ||
| 824 | + NavigatorUtil.goCustomerListPage( | ||
| 825 | + context, FromPage.FromPageHome, ''); | ||
| 826 | + }, | ||
| 827 | + child: Container( | ||
| 828 | + height: w(80), | ||
| 829 | + color: MyColours.color_ffffff, | ||
| 830 | + child: Row( | ||
| 831 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 832 | + children: [ | ||
| 833 | + Text( | ||
| 834 | + '${customerProvider.storeSunmodel.myCustomer}', | ||
| 835 | + style: TextStyle( | ||
| 836 | + color: MyColours.color_438E93, | ||
| 837 | + fontSize: ScreenUtil().setSp(64), | ||
| 838 | + fontWeight: FontWeight.bold), | ||
| 839 | + ), | ||
| 840 | + Text( | ||
| 841 | + '位', | ||
| 842 | + style: TextStyle( | ||
| 843 | + color: MyColours.color_515151, | ||
| 844 | + // fontWeight: FontWeight.bold, | ||
| 845 | + fontSize: ScreenUtil().setSp(32)), | ||
| 846 | + ) | ||
| 847 | + ], | ||
| 848 | + ), | ||
| 849 | + )), | ||
| 850 | + Positioned( | ||
| 851 | + top: ScreenUtil().setWidth(30), | ||
| 852 | + right: ScreenUtil().setWidth(40), | ||
| 853 | + child: InkWell( | ||
| 854 | + onTap: () { | ||
| 855 | + NavigatorUtil.goCustomerSetPage(context); | ||
| 856 | + }, | ||
| 857 | + child: Image.asset(Utils.getImgPath('c_set'), | ||
| 858 | + width: ScreenUtil().setWidth(40)))) | ||
| 859 | + ], | ||
| 860 | + ), | ||
| 861 | + VEmptyView(10), | ||
| 862 | + Row( | ||
| 863 | + children: [ | ||
| 864 | + _percentWidget( | ||
| 865 | + '${customerProvider.storeSunmodel.active.count}', | ||
| 866 | + '活跃', | ||
| 867 | + '${customerProvider.storeSunmodel.active.scale}'), | ||
| 868 | + HEmptyView(10), | ||
| 869 | + _percentWidget( | ||
| 870 | + '${customerProvider.storeSunmodel.sleep.count}', | ||
| 871 | + '60天未到店', | ||
| 872 | + '${customerProvider.storeSunmodel.sleep.scale}'), | ||
| 873 | + HEmptyView(10), | ||
| 874 | + _percentWidget( | ||
| 875 | + '${customerProvider.storeSunmodel.drain.count}', | ||
| 876 | + '120天未到店', | ||
| 877 | + '${customerProvider.storeSunmodel.drain.scale}'), | ||
| 878 | + ], | ||
| 879 | + ), | ||
| 880 | + // GridView.builder( | ||
| 881 | + // controller: _controller, | ||
| 882 | + // shrinkWrap: true, | ||
| 883 | + // cacheExtent: ScreenUtil().setWidth(0), | ||
| 884 | + // itemCount: 3, | ||
| 885 | + // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | ||
| 886 | + // crossAxisCount: 3, | ||
| 887 | + // childAspectRatio: 1, | ||
| 888 | + // mainAxisSpacing: ScreenUtil().setWidth(10), | ||
| 889 | + // crossAxisSpacing: ScreenUtil().setWidth(10)), | ||
| 890 | + // itemBuilder: (BuildContext context, int index) { | ||
| 891 | + // // locationState = state; | ||
| 892 | + // return _percentWidget('1999', '活跃客户', '39.20'); | ||
| 893 | + // }), | ||
| 894 | + // Row( | ||
| 895 | + // children: [ | ||
| 896 | + // _percentWidget('19992', '活跃客户', '90.90'), | ||
| 897 | + // HEmptyView(10), | ||
| 898 | + // _percentWidget('19992', '沉睡客户', '90.90'), | ||
| 899 | + // HEmptyView(10), | ||
| 900 | + // _percentWidget('19992', '流失客户', '5.90'), | ||
| 901 | + // ], | ||
| 902 | + // ), | ||
| 903 | + // Padding( | ||
| 904 | + // padding: EdgeInsets.symmetric( | ||
| 905 | + // vertical: ScreenUtil().setWidth(30)), | ||
| 906 | + // child: Text( | ||
| 907 | + // '客户经理', | ||
| 908 | + // style: TextStyle( | ||
| 909 | + // fontSize: ScreenUtil().setSp(28), | ||
| 910 | + // color: MyColours.color_333333), | ||
| 911 | + // ), | ||
| 912 | + // ), | ||
| 913 | + VEmptyView(10), | ||
| 914 | + GridView.builder( | ||
| 915 | + controller: _controller, | ||
| 916 | + shrinkWrap: true, | ||
| 917 | + cacheExtent: ScreenUtil().setWidth(0), | ||
| 918 | + itemCount: | ||
| 919 | + customerProvider.storeSunmodel.sellerUser.length + 1, | ||
| 920 | + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | ||
| 921 | + crossAxisCount: 3, | ||
| 922 | + childAspectRatio: 1.05, | ||
| 923 | + mainAxisSpacing: ScreenUtil().setWidth(10), | ||
| 924 | + crossAxisSpacing: ScreenUtil().setWidth(10)), | ||
| 925 | + itemBuilder: (BuildContext context, int index) { | ||
| 926 | + // locationState = state; | ||
| 927 | + if (index == 0) { | ||
| 928 | + return _managerWidget( | ||
| 929 | + '${customerProvider.storeSunmodel.distribution}', | ||
| 930 | + '未分配经理', | ||
| 931 | + null); | ||
| 932 | + } | ||
| 933 | + | ||
| 934 | + return _managerWidget( | ||
| 935 | + '${customerProvider.storeSunmodel.sellerUser[index - 1].count}', | ||
| 936 | + customerProvider.storeSunmodel.sellerUser[index - 1] | ||
| 937 | + .account == | ||
| 938 | + null | ||
| 939 | + ? '' | ||
| 940 | + : '${customerProvider.storeSunmodel.sellerUser[index - 1].nickName ?? customerProvider.storeSunmodel.sellerUser[index - 1].account}', | ||
| 941 | + null, | ||
| 942 | + uid: customerProvider | ||
| 943 | + .storeSunmodel.sellerUser[index - 1].uid); | ||
| 944 | + }), | ||
| 945 | + VEmptyView(10), | ||
| 946 | + ListView.builder( | ||
| 947 | + shrinkWrap: true, | ||
| 948 | + controller: _controller, | ||
| 949 | + itemCount: 2, | ||
| 950 | + itemBuilder: (context, index) { | ||
| 951 | + return Container( | ||
| 952 | + padding: EdgeInsets.symmetric( | ||
| 953 | + vertical: w(12), horizontal: w(16)), | ||
| 954 | + decoration: BoxDecoration( | ||
| 955 | + color: MyColours.color_ffffff, | ||
| 956 | + border: Border( | ||
| 957 | + bottom: BorderSide( | ||
| 958 | + color: index == 2 - 1 | ||
| 959 | + ? MyColours.color_ffffff | ||
| 960 | + : MyColours.color_E7E7E7, | ||
| 961 | + width: w(1)))), | ||
| 962 | + child: Row( | ||
| 963 | + children: [ | ||
| 964 | + Expanded( | ||
| 965 | + child: Text( | ||
| 966 | + '7天内存酒超期:5位/7天内纪念日提醒:3位', | ||
| 967 | + style: TextStyle( | ||
| 968 | + fontSize: font(16), | ||
| 969 | + color: MyColours.color_515151), | ||
| 970 | + )), | ||
| 971 | + Text( | ||
| 972 | + '创建营销计划', | ||
| 973 | + style: TextStyle( | ||
| 974 | + fontSize: font(16), | ||
| 975 | + color: MyColours.color_999999), | ||
| 976 | + ), | ||
| 977 | + HEmptyView(20), | ||
| 978 | + Image.asset( | ||
| 979 | + Utils.getImgPath('arrow_right_new'), | ||
| 980 | + width: w(12), | ||
| 981 | + ) | ||
| 982 | + ], | ||
| 983 | + ), | ||
| 984 | + ); | ||
| 985 | + }), | ||
| 986 | + _chart(), | ||
| 987 | + // _monthWidget(), | ||
| 988 | + | ||
| 989 | + ListView.builder( | ||
| 990 | + itemCount: 10, | ||
| 991 | + shrinkWrap: true, | ||
| 992 | + controller: _controller, | ||
| 993 | + padding: EdgeInsets.symmetric(horizontal: w(10)), | ||
| 994 | + itemBuilder: (context, index) { | ||
| 995 | + return MonthItem(); | ||
| 996 | + }), | ||
| 997 | +/** | ||
| 998 | + ListView.builder( | ||
| 999 | + itemCount: 10, | ||
| 1000 | + controller: _controller, | ||
| 1001 | + shrinkWrap: true, | ||
| 1002 | + padding: EdgeInsets.symmetric(horizontal: w(10)), | ||
| 1003 | + itemBuilder: (context, index) { | ||
| 1004 | + return Container( | ||
| 1005 | + margin: EdgeInsets.only(bottom: w(10)), | ||
| 1006 | + padding: EdgeInsets.symmetric(horizontal: w(10)), | ||
| 1007 | + decoration: BoxDecoration( | ||
| 1008 | + color: MyColours.color_ffffff, | ||
| 1009 | + borderRadius: BorderRadius.only( | ||
| 1010 | + topRight: Radius.circular(r(8)), | ||
| 1011 | + bottomRight: Radius.circular(r(8))), | ||
| 1012 | + ), | ||
| 1013 | + child: Row( | ||
| 1014 | + children: [ | ||
| 1015 | + Container( | ||
| 1016 | + width: w(122), | ||
| 1017 | + padding: EdgeInsets.symmetric(vertical: w(5)), | ||
| 1018 | + decoration: BoxDecoration( | ||
| 1019 | + border: Border( | ||
| 1020 | + right: BorderSide( | ||
| 1021 | + color: MyColours.color_f3f3f3, | ||
| 1022 | + width: w(1)))), | ||
| 1023 | + child: Column( | ||
| 1024 | + children: [ | ||
| 1025 | + VEmptyView(24), | ||
| 1026 | + Align( | ||
| 1027 | + alignment: Alignment.centerLeft, | ||
| 1028 | + child: Container( | ||
| 1029 | + padding: EdgeInsets.symmetric( | ||
| 1030 | + vertical: w(4), horizontal: w(5)), | ||
| 1031 | + decoration: BoxDecoration( | ||
| 1032 | + borderRadius: | ||
| 1033 | + BorderRadius.circular(r(3)), | ||
| 1034 | + border: Border.all( | ||
| 1035 | + color: MyColours.color_999999, | ||
| 1036 | + width: w(1))), | ||
| 1037 | + child: Text( | ||
| 1038 | + '张珊珊', | ||
| 1039 | + style: TextStyle( | ||
| 1040 | + fontSize: font(12), | ||
| 1041 | + fontWeight: FontWeight.bold, | ||
| 1042 | + color: MyColours.color_999999), | ||
| 1043 | + ), | ||
| 1044 | + ), | ||
| 1045 | + ), | ||
| 1046 | + VEmptyView(10), | ||
| 1047 | + Row( | ||
| 1048 | + mainAxisAlignment: | ||
| 1049 | + MainAxisAlignment.center, | ||
| 1050 | + children: [ | ||
| 1051 | + Text( | ||
| 1052 | + '34', | ||
| 1053 | + style: TextStyle( | ||
| 1054 | + fontSize: font(24), | ||
| 1055 | + fontWeight: FontWeight.bold, | ||
| 1056 | + color: MyColours.color_438E93), | ||
| 1057 | + ), | ||
| 1058 | + Text( | ||
| 1059 | + '位', | ||
| 1060 | + style: TextStyle( | ||
| 1061 | + fontSize: font(14), | ||
| 1062 | + color: MyColours.color_000000), | ||
| 1063 | + ), | ||
| 1064 | + ], | ||
| 1065 | + ), | ||
| 1066 | + VEmptyView(10), | ||
| 1067 | + Row( | ||
| 1068 | + mainAxisAlignment: | ||
| 1069 | + MainAxisAlignment.center, | ||
| 1070 | + children: [ | ||
| 1071 | + Text( | ||
| 1072 | + '23', | ||
| 1073 | + style: TextStyle( | ||
| 1074 | + fontSize: font(14), | ||
| 1075 | + fontWeight: FontWeight.bold, | ||
| 1076 | + color: MyColours.color_438E93), | ||
| 1077 | + ), | ||
| 1078 | + MyDivider( | ||
| 1079 | + w(4), | ||
| 1080 | + w(1), | ||
| 1081 | + color: MyColours.color_999999, | ||
| 1082 | + ), | ||
| 1083 | + Text( | ||
| 1084 | + '9', | ||
| 1085 | + style: TextStyle( | ||
| 1086 | + fontSize: font(14), | ||
| 1087 | + fontWeight: FontWeight.bold, | ||
| 1088 | + color: MyColours.color_E89243), | ||
| 1089 | + ), | ||
| 1090 | + MyDivider( | ||
| 1091 | + w(4), | ||
| 1092 | + w(1), | ||
| 1093 | + color: MyColours.color_999999, | ||
| 1094 | + ), | ||
| 1095 | + Text( | ||
| 1096 | + '2', | ||
| 1097 | + style: TextStyle( | ||
| 1098 | + fontSize: font(14), | ||
| 1099 | + fontWeight: FontWeight.bold, | ||
| 1100 | + color: MyColours.color_E34D59), | ||
| 1101 | + ), | ||
| 1102 | + ], | ||
| 1103 | + ), | ||
| 1104 | + VEmptyView(24), | ||
| 1105 | + ], | ||
| 1106 | + ), | ||
| 1107 | + ), | ||
| 1108 | + Expanded( | ||
| 1109 | + child: Container( | ||
| 1110 | + padding: EdgeInsets.only( | ||
| 1111 | + top: w(5), bottom: w(5), left: w(10)), | ||
| 1112 | + child: Row( | ||
| 1113 | + mainAxisAlignment: | ||
| 1114 | + MainAxisAlignment.spaceBetween, | ||
| 1115 | + // crossAxisAlignment: CrossAxisAlignment.start, | ||
| 1116 | + children: [ | ||
| 1117 | + Column( | ||
| 1118 | + mainAxisAlignment: | ||
| 1119 | + MainAxisAlignment.start, | ||
| 1120 | + crossAxisAlignment: | ||
| 1121 | + CrossAxisAlignment.start, | ||
| 1122 | + children: [ | ||
| 1123 | + Row( | ||
| 1124 | + crossAxisAlignment: | ||
| 1125 | + CrossAxisAlignment.start, | ||
| 1126 | + children: [ | ||
| 1127 | + Text( | ||
| 1128 | + '预订', | ||
| 1129 | + style: TextStyle( | ||
| 1130 | + fontWeight: FontWeight.bold, | ||
| 1131 | + color: MyColours.color_515151, | ||
| 1132 | + fontSize: font( | ||
| 1133 | + (12), | ||
| 1134 | + )), | ||
| 1135 | + ), | ||
| 1136 | + HEmptyView(10), | ||
| 1137 | + Text( | ||
| 1138 | + '1089单', | ||
| 1139 | + style: TextStyle( | ||
| 1140 | + color: MyColours.color_515151, | ||
| 1141 | + fontSize: font( | ||
| 1142 | + (10), | ||
| 1143 | + )), | ||
| 1144 | + ), | ||
| 1145 | + HEmptyView(10), | ||
| 1146 | + MyDivider( | ||
| 1147 | + w(1), | ||
| 1148 | + w(15), | ||
| 1149 | + color: MyColours.color_DBDBDB, | ||
| 1150 | + ), | ||
| 1151 | + HEmptyView(10), | ||
| 1152 | + Text( | ||
| 1153 | + '1190桌', | ||
| 1154 | + style: TextStyle( | ||
| 1155 | + color: MyColours.color_515151, | ||
| 1156 | + fontSize: font( | ||
| 1157 | + (10), | ||
| 1158 | + )), | ||
| 1159 | + ), | ||
| 1160 | + ], | ||
| 1161 | + ), | ||
| 1162 | + VEmptyView(10), | ||
| 1163 | + Row( | ||
| 1164 | + crossAxisAlignment: | ||
| 1165 | + CrossAxisAlignment.start, | ||
| 1166 | + children: [ | ||
| 1167 | + Text( | ||
| 1168 | + '到店', | ||
| 1169 | + style: TextStyle( | ||
| 1170 | + fontWeight: FontWeight.bold, | ||
| 1171 | + color: MyColours.color_515151, | ||
| 1172 | + fontSize: font( | ||
| 1173 | + (12), | ||
| 1174 | + )), | ||
| 1175 | + ), | ||
| 1176 | + HEmptyView(10), | ||
| 1177 | + Text( | ||
| 1178 | + '1089单', | ||
| 1179 | + style: TextStyle( | ||
| 1180 | + color: MyColours.color_515151, | ||
| 1181 | + fontSize: font( | ||
| 1182 | + (10), | ||
| 1183 | + )), | ||
| 1184 | + ), | ||
| 1185 | + HEmptyView(10), | ||
| 1186 | + MyDivider( | ||
| 1187 | + w(1), | ||
| 1188 | + w(15), | ||
| 1189 | + color: MyColours.color_DBDBDB, | ||
| 1190 | + ), | ||
| 1191 | + HEmptyView(10), | ||
| 1192 | + Text( | ||
| 1193 | + '1190桌', | ||
| 1194 | + style: TextStyle( | ||
| 1195 | + color: MyColours.color_515151, | ||
| 1196 | + fontSize: font( | ||
| 1197 | + (10), | ||
| 1198 | + )), | ||
| 1199 | + ), | ||
| 1200 | + ], | ||
| 1201 | + ), | ||
| 1202 | + VEmptyView(10), | ||
| 1203 | + Row( | ||
| 1204 | + crossAxisAlignment: | ||
| 1205 | + CrossAxisAlignment.start, | ||
| 1206 | + children: [ | ||
| 1207 | + Text( | ||
| 1208 | + '1089人', | ||
| 1209 | + style: TextStyle( | ||
| 1210 | + color: MyColours.color_515151, | ||
| 1211 | + fontSize: font( | ||
| 1212 | + (10), | ||
| 1213 | + )), | ||
| 1214 | + ), | ||
| 1215 | + HEmptyView(10), | ||
| 1216 | + MyDivider( | ||
| 1217 | + w(1), | ||
| 1218 | + w(15), | ||
| 1219 | + color: MyColours.color_DBDBDB, | ||
| 1220 | + ), | ||
| 1221 | + HEmptyView(10), | ||
| 1222 | + Text( | ||
| 1223 | + '1190取消', | ||
| 1224 | + style: TextStyle( | ||
| 1225 | + color: MyColours.color_515151, | ||
| 1226 | + fontSize: font( | ||
| 1227 | + (10), | ||
| 1228 | + )), | ||
| 1229 | + ), | ||
| 1230 | + HEmptyView(10), | ||
| 1231 | + MyDivider( | ||
| 1232 | + w(1), | ||
| 1233 | + w(15), | ||
| 1234 | + color: MyColours.color_DBDBDB, | ||
| 1235 | + ), | ||
| 1236 | + HEmptyView(10), | ||
| 1237 | + Text( | ||
| 1238 | + '到客90.1%', | ||
| 1239 | + style: TextStyle( | ||
| 1240 | + color: MyColours.color_515151, | ||
| 1241 | + fontSize: font( | ||
| 1242 | + (10), | ||
| 1243 | + )), | ||
| 1244 | + ), | ||
| 1245 | + ], | ||
| 1246 | + ), | ||
| 1247 | + VEmptyView(10), | ||
| 1248 | + Row( | ||
| 1249 | + crossAxisAlignment: | ||
| 1250 | + CrossAxisAlignment.start, | ||
| 1251 | + children: [ | ||
| 1252 | + Text( | ||
| 1253 | + '有金额订单数 25', | ||
| 1254 | + style: TextStyle( | ||
| 1255 | + color: MyColours.color_999999, | ||
| 1256 | + fontSize: font( | ||
| 1257 | + (10), | ||
| 1258 | + )), | ||
| 1259 | + ), | ||
| 1260 | + HEmptyView(10), | ||
| 1261 | + MyDivider( | ||
| 1262 | + w(1), | ||
| 1263 | + w(15), | ||
| 1264 | + color: MyColours.color_DBDBDB, | ||
| 1265 | + ), | ||
| 1266 | + HEmptyView(10), | ||
| 1267 | + Text( | ||
| 1268 | + '总消费 25800元', | ||
| 1269 | + style: TextStyle( | ||
| 1270 | + color: MyColours.color_999999, | ||
| 1271 | + fontSize: font( | ||
| 1272 | + (10), | ||
| 1273 | + )), | ||
| 1274 | + ), | ||
| 1275 | + ], | ||
| 1276 | + ), | ||
| 1277 | + VEmptyView(10), | ||
| 1278 | + Row( | ||
| 1279 | + crossAxisAlignment: | ||
| 1280 | + CrossAxisAlignment.start, | ||
| 1281 | + children: [ | ||
| 1282 | + Text( | ||
| 1283 | + '人均 103.2元', | ||
| 1284 | + style: TextStyle( | ||
| 1285 | + color: MyColours.color_999999, | ||
| 1286 | + fontSize: font( | ||
| 1287 | + (10), | ||
| 1288 | + )), | ||
| 1289 | + ), | ||
| 1290 | + HEmptyView(10), | ||
| 1291 | + MyDivider( | ||
| 1292 | + w(1), | ||
| 1293 | + w(15), | ||
| 1294 | + color: MyColours.color_DBDBDB, | ||
| 1295 | + ), | ||
| 1296 | + HEmptyView(10), | ||
| 1297 | + Text( | ||
| 1298 | + '桌均 860元', | ||
| 1299 | + style: TextStyle( | ||
| 1300 | + color: MyColours.color_999999, | ||
| 1301 | + fontSize: font( | ||
| 1302 | + (10), | ||
| 1303 | + )), | ||
| 1304 | + ), | ||
| 1305 | + ], | ||
| 1306 | + ), | ||
| 1307 | + VEmptyView(10), | ||
| 1308 | + Row( | ||
| 1309 | + crossAxisAlignment: | ||
| 1310 | + CrossAxisAlignment.start, | ||
| 1311 | + children: [ | ||
| 1312 | + Text( | ||
| 1313 | + '存酒 1位', | ||
| 1314 | + style: TextStyle( | ||
| 1315 | + color: MyColours.color_999999, | ||
| 1316 | + fontSize: font( | ||
| 1317 | + (10), | ||
| 1318 | + )), | ||
| 1319 | + ), | ||
| 1320 | + HEmptyView(10), | ||
| 1321 | + MyDivider( | ||
| 1322 | + w(1), | ||
| 1323 | + w(15), | ||
| 1324 | + color: MyColours.color_DBDBDB, | ||
| 1325 | + ), | ||
| 1326 | + HEmptyView(10), | ||
| 1327 | + Text( | ||
| 1328 | + '提前点餐 9位', | ||
| 1329 | + style: TextStyle( | ||
| 1330 | + color: MyColours.color_999999, | ||
| 1331 | + fontSize: font( | ||
| 1332 | + (10), | ||
| 1333 | + )), | ||
| 1334 | + ), | ||
| 1335 | + HEmptyView(10), | ||
| 1336 | + MyDivider( | ||
| 1337 | + w(1), | ||
| 1338 | + w(15), | ||
| 1339 | + color: MyColours.color_DBDBDB, | ||
| 1340 | + ), | ||
| 1341 | + HEmptyView(10), | ||
| 1342 | + Text( | ||
| 1343 | + '安排菜 9位', | ||
| 1344 | + style: TextStyle( | ||
| 1345 | + color: MyColours.color_999999, | ||
| 1346 | + fontSize: font( | ||
| 1347 | + (10), | ||
| 1348 | + )), | ||
| 1349 | + ), | ||
| 1350 | + ], | ||
| 1351 | + ), | ||
| 1352 | + ], | ||
| 1353 | + ), | ||
| 1354 | + Image.asset( | ||
| 1355 | + Utils.getImgPath('arrow_right_new'), | ||
| 1356 | + width: w(12), | ||
| 1357 | + ) | ||
| 1358 | + ], | ||
| 1359 | + ), | ||
| 1360 | + )) | ||
| 1361 | + ], | ||
| 1362 | + ), | ||
| 1363 | + ); | ||
| 1364 | + }) | ||
| 1365 | + */ | ||
| 1366 | + ], | ||
| 1367 | + ), | ||
| 1368 | + )), | ||
| 1369 | + Container( | ||
| 1370 | + color: MyColours.color_FAFAFA, | ||
| 1371 | + padding: EdgeInsets.only( | ||
| 1372 | + top: w(13), bottom: w(26), left: w(45), right: (45)), | ||
| 1373 | + child: Stack( | ||
| 1374 | + children: [ | ||
| 1375 | + RoundButton( | ||
| 1376 | + onPressed: () { | ||
| 1377 | + NavigatorUtil.goMarketingRecordsPage( | ||
| 1378 | + context, FromPage.FromPageStoreCustomer); | ||
| 1379 | + }, | ||
| 1380 | + text: '历史营销记录', | ||
| 1381 | + fontSize: 32, | ||
| 1382 | + isBold: true, | ||
| 1383 | + // margin: EdgeInsets.only( | ||
| 1384 | + // top: w(13), | ||
| 1385 | + // bottom: w(26), | ||
| 1386 | + // left: w(45), | ||
| 1387 | + // right: (45)), | ||
| 1388 | + textColor: MyColours.color_F8F9FD, | ||
| 1389 | + gradientStart: MyColours.color_199095, | ||
| 1390 | + gradientEnd: MyColours.color_199095, | ||
| 1391 | + borderColor: MyColours.color_199095, | ||
| 1392 | + height: ScreenUtil().setWidth(86), | ||
| 1393 | + // width: ScreenUtil().setWidth(260), | ||
| 1394 | + radius: ScreenUtil().setWidth(10), | ||
| 1395 | + ), | ||
| 1396 | + showWarning | ||
| 1397 | + ? Positioned( | ||
| 1398 | + right: ScreenUtil().setWidth(30), | ||
| 1399 | + top: ScreenUtil().setWidth(45 / 2), | ||
| 1400 | + child: Image.asset( | ||
| 1401 | + Utils.getImgPath('warning'), | ||
| 1402 | + width: ScreenUtil().setWidth(35), | ||
| 1403 | + )) | ||
| 1404 | + : SizedBox() | ||
| 1405 | + ], | ||
| 1406 | + )) | ||
| 1407 | + ]); | ||
| 1408 | + } | ||
| 1409 | + })), | ||
| 1410 | + ); | ||
| 1411 | + } | ||
| 1412 | +} |
| 1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
| 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 3 | -import 'package:one_key/constant/state.dart'; | ||
| 4 | -import 'package:one_key/models/marketing_by_seller_model.dart'; | ||
| 5 | -import 'package:one_key/models/seller_info.dart'; | ||
| 6 | -import 'package:one_key/models/store_customer_home_model.dart'; | ||
| 7 | -import 'package:one_key/pages/my/customer_type/store_customer/bar_chart_page.dart'; | ||
| 8 | -import 'package:one_key/provider/customer_provider.dart'; | ||
| 9 | -import 'package:one_key/provider/user_model.dart'; | ||
| 10 | -import 'package:one_key/res/colors.dart'; | ||
| 11 | -import 'package:one_key/route/navigator_util.dart'; | ||
| 12 | -import 'package:one_key/utils/event_bus.dart'; | ||
| 13 | -import 'package:one_key/utils/utils.dart'; | ||
| 14 | -import 'package:one_key/widgets/MyDivider.dart'; | 3 | +import 'package:one_key/pages/my/customer_type/store_customer/store_customer_home_left_page.dart'; |
| 4 | +import 'package:one_key/pages/my/customer_type/store_customer/store_customer_home_right_page.dart'; | ||
| 15 | import 'package:one_key/widgets/h_empty_view.dart'; | 5 | import 'package:one_key/widgets/h_empty_view.dart'; |
| 16 | -import 'package:one_key/widgets/page_exception.dart'; | ||
| 17 | -import 'package:one_key/widgets/round_button.dart'; | ||
| 18 | import 'package:one_key/widgets/system_app_bar.dart'; | 6 | import 'package:one_key/widgets/system_app_bar.dart'; |
| 19 | -import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 20 | -import 'package:provider/provider.dart'; | ||
| 21 | 7 | ||
| 8 | +import '../../../../res/colors.dart'; | ||
| 22 | import '../../../../utils/screen_util.dart'; | 9 | import '../../../../utils/screen_util.dart'; |
| 10 | +import '../../../../widgets/v_empty_view.dart'; | ||
| 11 | + | ||
| 23 | /*** | 12 | /*** |
| 24 | * 全店客情首页 | 13 | * 全店客情首页 |
| 25 | */ | 14 | */ |
| 15 | + | ||
| 26 | class StoreCustomerHomePage extends StatefulWidget { | 16 | class StoreCustomerHomePage extends StatefulWidget { |
| 27 | StoreCustomerHomePage({Key key}) : super(key: key); | 17 | StoreCustomerHomePage({Key key}) : super(key: key); |
| 28 | 18 | ||
| @@ -30,1168 +20,93 @@ class StoreCustomerHomePage extends StatefulWidget { | @@ -30,1168 +20,93 @@ class StoreCustomerHomePage extends StatefulWidget { | ||
| 30 | _StoreCustomerHomePageState createState() => _StoreCustomerHomePageState(); | 20 | _StoreCustomerHomePageState createState() => _StoreCustomerHomePageState(); |
| 31 | } | 21 | } |
| 32 | 22 | ||
| 33 | -class _StoreCustomerHomePageState extends State<StoreCustomerHomePage> { | ||
| 34 | - ScrollController _controller = ScrollController(); | ||
| 35 | - CustomerProvider customerProvider; | ||
| 36 | - bool showWarning = false; | ||
| 37 | - int year; | ||
| 38 | - int month; | ||
| 39 | - List<BarData> dataList = [ | ||
| 40 | - BarData(MyColours.color_8EBBBE, 200), | ||
| 41 | - BarData(MyColours.color_8EBBBE, 8), | ||
| 42 | - BarData(MyColours.color_8EBBBE, 15), | ||
| 43 | - BarData(MyColours.color_8EBBBE, 5), | ||
| 44 | - BarData(MyColours.color_8EBBBE, 2), | ||
| 45 | - BarData(MyColours.color_8EBBBE, 2), | ||
| 46 | - BarData(MyColours.color_8EBBBE, 18), | ||
| 47 | - BarData(MyColours.color_8EBBBE, 168), | ||
| 48 | - BarData(MyColours.color_8EBBBE, 15), | ||
| 49 | - BarData(MyColours.color_8EBBBE, 5), | ||
| 50 | - BarData(MyColours.color_8EBBBE, null ?? 0), | ||
| 51 | - BarData(MyColours.color_8EBBBE, 0), | ||
| 52 | - ]; | 23 | +class _StoreCustomerHomePageState extends State<StoreCustomerHomePage> |
| 24 | + with TickerProviderStateMixin { | ||
| 25 | + TabController tabController; | ||
| 26 | + Color selectedColor = MyColours.color_ffffff; | ||
| 27 | + Color unSelectedColor = MyColours.color_BFC4D4; | ||
| 53 | 28 | ||
| 54 | @override | 29 | @override |
| 55 | void initState() { | 30 | void initState() { |
| 31 | + // TODO: implement initState | ||
| 56 | super.initState(); | 32 | super.initState(); |
| 57 | - | ||
| 58 | - year = DateTime.now().year; | ||
| 59 | - month = DateTime.now().month; | ||
| 60 | - WidgetsBinding.instance.addPostFrameCallback((_) { | ||
| 61 | - _getSellerGuestManage(); | ||
| 62 | - _getMarketingBySeller(); | ||
| 63 | - }); | ||
| 64 | - bus.on("refresh_store_customer_home", (arg) { | ||
| 65 | - _getMarketingBySeller(); | ||
| 66 | - _getSellerGuestManage(); | 33 | + tabController = TabController(length: 2, vsync: this); |
| 34 | + | ||
| 35 | + tabController.addListener(() { | ||
| 36 | + //点击tab时或滑动tab回调一次 | ||
| 37 | + // if (tabController.index.toDouble() == tabController.animation.value) { | ||
| 38 | + // getMessage(index: tabController.index); | ||
| 39 | + // selectIndex = tabController.index; | ||
| 40 | + // setState(() {}); | ||
| 41 | + // } | ||
| 67 | }); | 42 | }); |
| 68 | } | 43 | } |
| 69 | 44 | ||
| 70 | @override | 45 | @override |
| 71 | - void dispose() { | ||
| 72 | - bus.off('refresh_store_customer_home'); | ||
| 73 | - // bus.off("refresh_coupon_list"); | ||
| 74 | - super.dispose(); | ||
| 75 | - } | ||
| 76 | - | ||
| 77 | - ///全店客情首页 | ||
| 78 | - _getSellerGuestManage() async { | ||
| 79 | - StoreCustomerHomeSunModel model = | ||
| 80 | - await customerProvider.getSellerGuestManage(context); | ||
| 81 | - // setState(() {}); | ||
| 82 | - } | ||
| 83 | - | ||
| 84 | - _getMarketingBySeller() async { | ||
| 85 | - Map<String, String> params = { | ||
| 86 | - "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid | ||
| 87 | - }; | ||
| 88 | - List<MarketingBySellerSunModel> list = | ||
| 89 | - await customerProvider.getMarketingBySeller(context, params); | ||
| 90 | - if (list != null && list.length > 0) { | ||
| 91 | - bool temp = list.any((value) { | ||
| 92 | - return value.finishedStatus == '0'; | ||
| 93 | - }); | ||
| 94 | - setState(() { | ||
| 95 | - showWarning = temp; | ||
| 96 | - }); | ||
| 97 | - } | ||
| 98 | - // await customerProvider.searchData(customerProvider.controller.text); | ||
| 99 | - } | ||
| 100 | - | ||
| 101 | - ///活跃客户、沉睡客户、流失客户 | ||
| 102 | - Widget _percentWidget(String pnum, String btnTitle, String percent, | ||
| 103 | - {String uid = ''}) { | ||
| 104 | - return InkWell( | ||
| 105 | - onTap: () async { | ||
| 106 | - String index = '0'; | ||
| 107 | - | ||
| 108 | - if (btnTitle == '活跃客户') { | ||
| 109 | - index = '1'; | ||
| 110 | - } else if (btnTitle == '沉睡客户') { | ||
| 111 | - index = '2'; | ||
| 112 | - } else if (btnTitle == '流失客户') { | ||
| 113 | - index = '3'; | ||
| 114 | - } | ||
| 115 | - if (btnTitle == '未分配') { | ||
| 116 | - NavigatorUtil.goCustomerListPage( | ||
| 117 | - context, FromPage.FromPageHome, uid, | ||
| 118 | - index: index, distribution: true); | ||
| 119 | - } else { | ||
| 120 | - NavigatorUtil.goCustomerListPage( | ||
| 121 | - context, FromPage.FromPageHome, uid, | ||
| 122 | - index: index); | ||
| 123 | - } | ||
| 124 | - }, | ||
| 125 | - child: Container( | ||
| 126 | - color: MyColours.color_ffffff, | ||
| 127 | - // height: ScreenUtil().setWidth(230), | ||
| 128 | - width: (ScreenUtil().screenWidth - ScreenUtil().setWidth(20)) / 3, | ||
| 129 | - height: (ScreenUtil().screenWidth - ScreenUtil().setWidth(20)) / 3, | ||
| 130 | - child: Column( | ||
| 131 | - mainAxisAlignment: MainAxisAlignment.center, | ||
| 132 | - children: [ | ||
| 133 | - Row( | ||
| 134 | - mainAxisAlignment: MainAxisAlignment.center, | ||
| 135 | - children: [ | ||
| 136 | - Text(pnum, | ||
| 137 | - style: TextStyle( | ||
| 138 | - color: MyColours.color_199095, | ||
| 139 | - fontSize: ScreenUtil().setSp(40), | ||
| 140 | - fontWeight: FontWeight.bold)), | ||
| 141 | - Text('位', | ||
| 142 | - style: TextStyle( | ||
| 143 | - color: MyColours.color_199095, | ||
| 144 | - fontSize: ScreenUtil().setSp(24), | ||
| 145 | - )) | ||
| 146 | - ], | ||
| 147 | - ), | ||
| 148 | - btnTitle == '' ? SizedBox() : VEmptyView(20), | ||
| 149 | - btnTitle == '' | ||
| 150 | - ? SizedBox() | ||
| 151 | - : InkWell( | ||
| 152 | - onTap: () async { | ||
| 153 | - String index = '0'; | ||
| 154 | - | ||
| 155 | - if (btnTitle == '活跃客户') { | ||
| 156 | - index = '1'; | ||
| 157 | - } else if (btnTitle == '沉睡客户') { | ||
| 158 | - index = '2'; | ||
| 159 | - } else if (btnTitle == '流失客户') { | ||
| 160 | - index = '3'; | ||
| 161 | - } | ||
| 162 | - if (btnTitle == '未分配') { | ||
| 163 | - NavigatorUtil.goCustomerListPage( | ||
| 164 | - context, FromPage.FromPageHome, uid, | ||
| 165 | - index: index, distribution: true); | ||
| 166 | - } else { | ||
| 167 | - NavigatorUtil.goCustomerListPage( | ||
| 168 | - context, FromPage.FromPageHome, uid, | ||
| 169 | - index: index); | ||
| 170 | - } | ||
| 171 | - }, | ||
| 172 | - child: Container( | ||
| 173 | - height: ScreenUtil().setWidth(45), | ||
| 174 | - width: ScreenUtil().setWidth(160), | ||
| 175 | - alignment: Alignment.center, | ||
| 176 | - padding: EdgeInsets.symmetric(horizontal: w(10)), | ||
| 177 | - decoration: BoxDecoration( | ||
| 178 | - color: MyColours.color_ffffff, | ||
| 179 | - border: Border.all( | ||
| 180 | - width: w(1), | ||
| 181 | - color: Color.fromRGBO(118, 118, 118, 1), | ||
| 182 | - ), | ||
| 183 | - borderRadius: | ||
| 184 | - BorderRadius.circular(ScreenUtil().setWidth(30)), | ||
| 185 | - ), | ||
| 186 | - child: Text( | ||
| 187 | - btnTitle, | ||
| 188 | - maxLines: 1, | ||
| 189 | - overflow: TextOverflow.ellipsis, | ||
| 190 | - style: TextStyle( | ||
| 191 | - color: MyColours.color_333333, | ||
| 192 | - fontSize: font(12)), | ||
| 193 | - ), | ||
| 194 | - )) | ||
| 195 | - // RoundButton( | ||
| 196 | - // onPressed: () async { | ||
| 197 | - // String index = '0'; | ||
| 198 | - | ||
| 199 | - // if (btnTitle == '活跃客户') { | ||
| 200 | - // index = '1'; | ||
| 201 | - // } else if (btnTitle == '沉睡客户') { | ||
| 202 | - // index = '2'; | ||
| 203 | - // } else if (btnTitle == '流失客户') { | ||
| 204 | - // index = '3'; | ||
| 205 | - // } | ||
| 206 | - // NavigatorUtil.goCustomerListPage( | ||
| 207 | - // context, FromPage.FromPageHome, uid, | ||
| 208 | - // index: index); | ||
| 209 | - // }, | ||
| 210 | - // text: btnTitle, | ||
| 211 | - // fontSize: 24, | ||
| 212 | - // isBold: false, | ||
| 213 | - // textColor: MyColours.color_333333, | ||
| 214 | - // gradientStart: MyColours.color_ffffff, | ||
| 215 | - // gradientEnd: MyColours.color_ffffff, | ||
| 216 | - // borderColor: Color.fromRGBO(118, 118, 118, 1), | ||
| 217 | - // height: ScreenUtil().setWidth(45), | ||
| 218 | - // width: ScreenUtil().setWidth(160), | ||
| 219 | - // radius: ScreenUtil().setWidth(30), | ||
| 220 | - // ), | ||
| 221 | - , | ||
| 222 | - VEmptyView(16), | ||
| 223 | - percent == null | ||
| 224 | - ? SizedBox() | ||
| 225 | - : Text('${percent}%', | ||
| 226 | - style: TextStyle( | ||
| 227 | - color: MyColours.color_199095, | ||
| 228 | - fontSize: ScreenUtil().setSp(24), | ||
| 229 | - )), | ||
| 230 | - ], | ||
| 231 | - ), | ||
| 232 | - )); | ||
| 233 | - } | ||
| 234 | - | ||
| 235 | - Widget _chart() { | ||
| 236 | - return Container( | ||
| 237 | - // height: w(216), | ||
| 238 | - padding: EdgeInsets.only(top: w(16), left: w(16), right: w(16)), | ||
| 239 | - margin: EdgeInsets.all(w(10)), | ||
| 240 | - decoration: BoxDecoration( | ||
| 241 | - color: MyColours.color_ffffff, | ||
| 242 | - borderRadius: BorderRadius.circular(r(8))), | ||
| 243 | - child: Column( | ||
| 244 | - children: [ | ||
| 245 | - Row( | ||
| 246 | - mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 247 | - children: [ | ||
| 248 | - InkWell( | ||
| 249 | - onTap: () { | ||
| 250 | - setState(() { | ||
| 251 | - year--; | ||
| 252 | - }); | ||
| 253 | - // _getGuestReserve(showLoading: true); | ||
| 254 | - }, | ||
| 255 | - child: Padding( | ||
| 256 | - padding: | ||
| 257 | - EdgeInsets.only(right: ScreenUtil().setWidth(20)), | ||
| 258 | - child: Image.asset( | ||
| 259 | - Utils.getImgPath('c_arrow_left'), | ||
| 260 | - width: ScreenUtil().setWidth(24), | ||
| 261 | - ))), | ||
| 262 | - Text( | ||
| 263 | - '${year}年', | ||
| 264 | - style: TextStyle( | ||
| 265 | - fontSize: ScreenUtil().setSp(32), | ||
| 266 | - color: MyColours.color_000000), | ||
| 267 | - ), | ||
| 268 | - InkWell( | ||
| 269 | - onTap: () { | ||
| 270 | - if (year >= DateTime.now().year) { | ||
| 271 | - return; | ||
| 272 | - } | ||
| 273 | - setState(() { | ||
| 274 | - year++; | ||
| 275 | - }); | ||
| 276 | - // _getGuestReserve(showLoading: true); | ||
| 277 | - }, | ||
| 278 | - child: Padding( | ||
| 279 | - padding: EdgeInsets.only( | ||
| 280 | - left: ScreenUtil().setWidth(20), | ||
| 281 | - ), | ||
| 282 | - child: Image.asset( | ||
| 283 | - Utils.getImgPath(year != DateTime.now().year | ||
| 284 | - ? 'c_arrow_right' | ||
| 285 | - : 'c_arrow_right_gray'), | ||
| 286 | - width: ScreenUtil().setWidth(24), | ||
| 287 | - ))) | ||
| 288 | - ], | ||
| 289 | - ), | ||
| 290 | - VEmptyView(80), | ||
| 291 | - Container( | ||
| 292 | - width: double.infinity, | ||
| 293 | - height: w(177), | ||
| 294 | - child: LayoutBuilder(builder: (context, constraints) { | ||
| 295 | - return BarChartWidget( | ||
| 296 | - dataList: dataList, | ||
| 297 | - ); | ||
| 298 | - })) | ||
| 299 | - ], | ||
| 300 | - ), | ||
| 301 | - ); | ||
| 302 | - } | ||
| 303 | - | ||
| 304 | - Widget _monthWidget() { | ||
| 305 | - return Container( | ||
| 306 | - margin: EdgeInsets.symmetric(horizontal: w(10)), | ||
| 307 | - padding: EdgeInsets.symmetric(horizontal: w(15), vertical: w(10)), | ||
| 308 | - decoration: BoxDecoration(color: MyColours.color_ffffff), | ||
| 309 | - child: Column( | ||
| 310 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 311 | - children: [ | ||
| 312 | - Row( | ||
| 313 | - mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 314 | - children: [ | ||
| 315 | - InkWell( | ||
| 316 | - onTap: () { | ||
| 317 | - if (month == 1) { | ||
| 318 | - month = 12; | ||
| 319 | - setState(() {}); | ||
| 320 | - } else { | ||
| 321 | - setState(() { | ||
| 322 | - month--; | ||
| 323 | - }); | ||
| 324 | - } | ||
| 325 | - | ||
| 326 | - // _getGuestReserve(showLoading: true); | ||
| 327 | - }, | ||
| 328 | - child: Padding( | ||
| 329 | - padding: | ||
| 330 | - EdgeInsets.only(right: ScreenUtil().setWidth(20)), | ||
| 331 | - child: Image.asset( | ||
| 332 | - Utils.getImgPath('c_arrow_left'), | ||
| 333 | - width: ScreenUtil().setWidth(24), | ||
| 334 | - ))), | ||
| 335 | - Text( | ||
| 336 | - '${month}月', | ||
| 337 | - style: TextStyle( | ||
| 338 | - fontSize: ScreenUtil().setSp(40), | ||
| 339 | - color: MyColours.color_515151), | ||
| 340 | - ), | ||
| 341 | - InkWell( | ||
| 342 | - onTap: () { | ||
| 343 | - if (month == 12) { | ||
| 344 | - month = 1; | ||
| 345 | - setState(() {}); | ||
| 346 | - } else { | ||
| 347 | - setState(() { | ||
| 348 | - month++; | ||
| 349 | - }); | ||
| 350 | - } | ||
| 351 | - | ||
| 352 | - // _getGuestReserve(showLoading: true); | ||
| 353 | - }, | ||
| 354 | - child: Padding( | ||
| 355 | - padding: EdgeInsets.only( | ||
| 356 | - left: ScreenUtil().setWidth(20), | ||
| 357 | - ), | ||
| 358 | - child: Image.asset( | ||
| 359 | - Utils.getImgPath('c_arrow_right'), | ||
| 360 | - width: ScreenUtil().setWidth(24), | ||
| 361 | - ))) | ||
| 362 | - ], | ||
| 363 | - ), | ||
| 364 | - VEmptyView(20), | ||
| 365 | - Row( | ||
| 366 | - crossAxisAlignment: CrossAxisAlignment.center, | ||
| 367 | - children: [ | ||
| 368 | - Text( | ||
| 369 | - '预订', | ||
| 370 | - style: TextStyle( | ||
| 371 | - fontWeight: FontWeight.bold, | ||
| 372 | - color: MyColours.color_515151, | ||
| 373 | - fontSize: font( | ||
| 374 | - (18), | ||
| 375 | - )), | ||
| 376 | - ), | ||
| 377 | - HEmptyView(10), | ||
| 378 | - Text( | ||
| 379 | - '1089单', | ||
| 380 | - style: TextStyle( | ||
| 381 | - color: MyColours.color_515151, | ||
| 382 | - fontSize: font( | ||
| 383 | - (14), | ||
| 384 | - )), | ||
| 385 | - ), | ||
| 386 | - HEmptyView(10), | ||
| 387 | - MyDivider( | ||
| 388 | - w(1), | ||
| 389 | - w(15), | ||
| 390 | - color: MyColours.color_DBDBDB, | ||
| 391 | - ), | ||
| 392 | - HEmptyView(10), | ||
| 393 | - Text( | ||
| 394 | - '1190桌', | ||
| 395 | - style: TextStyle( | ||
| 396 | - color: MyColours.color_515151, | ||
| 397 | - fontSize: font( | ||
| 398 | - (14), | ||
| 399 | - )), | ||
| 400 | - ), | ||
| 401 | - ], | ||
| 402 | - ), | ||
| 403 | - VEmptyView(15), | ||
| 404 | - Wrap( | ||
| 405 | - // crossAxisAlignment: WrapCrossAlignment.center, | ||
| 406 | - // runAlignment: WrapAlignment.center, | ||
| 407 | - // alignment: WrapAlignment.center, | ||
| 408 | - children: [ | ||
| 409 | - Text( | ||
| 410 | - '到店', | ||
| 411 | - style: TextStyle( | ||
| 412 | - fontWeight: FontWeight.bold, | ||
| 413 | - color: MyColours.color_515151, | ||
| 414 | - fontSize: font( | ||
| 415 | - (18), | ||
| 416 | - )), | ||
| 417 | - ), | ||
| 418 | - HEmptyView(10), | ||
| 419 | - Text( | ||
| 420 | - '1089单', | ||
| 421 | - style: TextStyle( | ||
| 422 | - color: MyColours.color_515151, | ||
| 423 | - fontSize: font( | ||
| 424 | - (14), | ||
| 425 | - )), | ||
| 426 | - ), | ||
| 427 | - HEmptyView(10), | ||
| 428 | - MyDivider( | ||
| 429 | - w(1), | ||
| 430 | - w(15), | ||
| 431 | - color: MyColours.color_DBDBDB, | ||
| 432 | - ), | ||
| 433 | - HEmptyView(10), | ||
| 434 | - Text( | ||
| 435 | - '1190桌', | ||
| 436 | - style: TextStyle( | ||
| 437 | - color: MyColours.color_515151, | ||
| 438 | - fontSize: font( | ||
| 439 | - (14), | ||
| 440 | - )), | ||
| 441 | - ), | ||
| 442 | - HEmptyView(10), | ||
| 443 | - MyDivider( | ||
| 444 | - w(1), | ||
| 445 | - w(15), | ||
| 446 | - color: MyColours.color_DBDBDB, | ||
| 447 | - ), | ||
| 448 | - HEmptyView(10), | ||
| 449 | - Text( | ||
| 450 | - '1190人', | ||
| 451 | - style: TextStyle( | ||
| 452 | - color: MyColours.color_515151, | ||
| 453 | - fontSize: font( | ||
| 454 | - (14), | ||
| 455 | - )), | ||
| 456 | - ), | ||
| 457 | - HEmptyView(10), | ||
| 458 | - MyDivider( | ||
| 459 | - w(1), | ||
| 460 | - w(15), | ||
| 461 | - color: MyColours.color_DBDBDB, | ||
| 462 | - ), | ||
| 463 | - HEmptyView(10), | ||
| 464 | - Text( | ||
| 465 | - '1190取消', | ||
| 466 | - style: TextStyle( | ||
| 467 | - color: MyColours.color_515151, | ||
| 468 | - fontSize: font( | ||
| 469 | - (14), | ||
| 470 | - )), | ||
| 471 | - ), | ||
| 472 | - HEmptyView(10), | ||
| 473 | - MyDivider( | ||
| 474 | - w(1), | ||
| 475 | - w(15), | ||
| 476 | - color: MyColours.color_DBDBDB, | ||
| 477 | - ), | ||
| 478 | - HEmptyView(10), | ||
| 479 | - Text( | ||
| 480 | - '到客97.2%', | ||
| 481 | - style: TextStyle( | ||
| 482 | - color: MyColours.color_515151, | ||
| 483 | - fontSize: font( | ||
| 484 | - (14), | ||
| 485 | - )), | ||
| 486 | - ), | ||
| 487 | - ], | ||
| 488 | - ), | ||
| 489 | - VEmptyView(15), | ||
| 490 | - MyDivider( | ||
| 491 | - double.infinity, | ||
| 492 | - w(1), | ||
| 493 | - color: MyColours.color_DBDBDB, | ||
| 494 | - ), | ||
| 495 | - VEmptyView(15), | ||
| 496 | - Wrap( | ||
| 497 | - // crossAxisAlignment: WrapCrossAlignment.start, | ||
| 498 | - // runAlignment: WrapAlignment.center, | ||
| 499 | - // alignment: WrapAlignment.center, | ||
| 500 | - runSpacing: w(5), | ||
| 501 | - children: [ | ||
| 502 | - Text( | ||
| 503 | - '有金额订单 6000', | ||
| 504 | - style: TextStyle( | ||
| 505 | - color: MyColours.color_999999, | ||
| 506 | - decoration: TextDecoration.underline, | ||
| 507 | - fontSize: font( | ||
| 508 | - (10), | ||
| 509 | - )), | ||
| 510 | - ), | ||
| 511 | - HEmptyView(10), | ||
| 512 | - MyDivider( | ||
| 513 | - w(1), | ||
| 514 | - w(12), | ||
| 515 | - color: MyColours.color_DBDBDB, | ||
| 516 | - ), | ||
| 517 | - HEmptyView(10), | ||
| 518 | - Text( | ||
| 519 | - '消费 9585800.00元', | ||
| 520 | - style: TextStyle( | ||
| 521 | - color: MyColours.color_999999, | ||
| 522 | - decoration: TextDecoration.underline, | ||
| 523 | - fontSize: font( | ||
| 524 | - (10), | ||
| 525 | - )), | ||
| 526 | - ), | ||
| 527 | - HEmptyView(10), | ||
| 528 | - MyDivider( | ||
| 529 | - w(1), | ||
| 530 | - w(12), | ||
| 531 | - color: MyColours.color_DBDBDB, | ||
| 532 | - ), | ||
| 533 | - HEmptyView(10), | ||
| 534 | - Text( | ||
| 535 | - '人均 8885.58元', | ||
| 536 | - style: TextStyle( | ||
| 537 | - color: MyColours.color_999999, | ||
| 538 | - decoration: TextDecoration.underline, | ||
| 539 | - fontSize: font( | ||
| 540 | - (10), | ||
| 541 | - )), | ||
| 542 | - ), | ||
| 543 | - HEmptyView(10), | ||
| 544 | - MyDivider( | ||
| 545 | - w(1), | ||
| 546 | - w(12), | ||
| 547 | - color: MyColours.color_DBDBDB, | ||
| 548 | - ), | ||
| 549 | - HEmptyView(10), | ||
| 550 | - Text( | ||
| 551 | - '桌均 95888.58元', | ||
| 552 | - style: TextStyle( | ||
| 553 | - color: MyColours.color_999999, | ||
| 554 | - decoration: TextDecoration.underline, | ||
| 555 | - fontSize: font( | ||
| 556 | - (10), | ||
| 557 | - )), | ||
| 558 | - ), | ||
| 559 | - HEmptyView(10), | ||
| 560 | - MyDivider( | ||
| 561 | - w(1), | ||
| 562 | - w(12), | ||
| 563 | - color: MyColours.color_DBDBDB, | ||
| 564 | - ), | ||
| 565 | - HEmptyView(10), | ||
| 566 | - Text( | ||
| 567 | - '存酒 8位', | ||
| 568 | - style: TextStyle( | ||
| 569 | - color: MyColours.color_999999, | ||
| 570 | - decoration: TextDecoration.underline, | ||
| 571 | - fontSize: font( | ||
| 572 | - (10), | ||
| 573 | - )), | ||
| 574 | - ), | ||
| 575 | - HEmptyView(10), | ||
| 576 | - MyDivider( | ||
| 577 | - w(1), | ||
| 578 | - w(12), | ||
| 579 | - color: MyColours.color_DBDBDB, | ||
| 580 | - ), | ||
| 581 | - HEmptyView(10), | ||
| 582 | - Text( | ||
| 583 | - '提前点餐 9位', | ||
| 584 | - style: TextStyle( | ||
| 585 | - color: MyColours.color_999999, | ||
| 586 | - decoration: TextDecoration.underline, | ||
| 587 | - fontSize: font( | ||
| 588 | - (10), | ||
| 589 | - )), | ||
| 590 | - ), | ||
| 591 | - HEmptyView(10), | ||
| 592 | - MyDivider( | ||
| 593 | - w(1), | ||
| 594 | - w(12), | ||
| 595 | - color: MyColours.color_DBDBDB, | ||
| 596 | - ), | ||
| 597 | - HEmptyView(10), | ||
| 598 | - Text( | ||
| 599 | - '安排菜 9位', | ||
| 600 | - style: TextStyle( | ||
| 601 | - color: MyColours.color_999999, | ||
| 602 | - decoration: TextDecoration.underline, | ||
| 603 | - fontSize: font( | ||
| 604 | - (10), | ||
| 605 | - )), | ||
| 606 | - ), | ||
| 607 | - ], | ||
| 608 | - ), | ||
| 609 | - ], | ||
| 610 | - ), | ||
| 611 | - ); | ||
| 612 | - } | ||
| 613 | - | ||
| 614 | - @override | ||
| 615 | Widget build(BuildContext context) { | 46 | Widget build(BuildContext context) { |
| 616 | - customerProvider = Provider.of<CustomerProvider>(context, listen: false); | ||
| 617 | return Scaffold( | 47 | return Scaffold( |
| 618 | - backgroundColor: Color.fromRGBO(246, 248, 250, 1), | ||
| 619 | - appBar: SystemAppBar('全店客情', onTap: () { | ||
| 620 | - EventBus().emit('changeStatusColor'); | ||
| 621 | - Navigator.pop(context); | ||
| 622 | - }), | ||
| 623 | - body: WillPopScope(onWillPop: () async { | ||
| 624 | - EventBus().emit('changeStatusColor'); | ||
| 625 | - return true; | ||
| 626 | - }, child: Consumer<CustomerProvider>(builder: (context, model, _) { | ||
| 627 | - if (model.pageStateStoreHome != PageState.Success) { | ||
| 628 | - return ExceptionPage( | ||
| 629 | - pageState: model.pageStateStoreHome, | ||
| 630 | - callback: () { | ||
| 631 | - // getTableList(); | ||
| 632 | - _getSellerGuestManage(); | ||
| 633 | - }, | ||
| 634 | - emptyMsg: "暂时没有全店客情哦", | ||
| 635 | - emptyImg: "empty_search", | ||
| 636 | - showMsg: "加载中,请稍后...", | ||
| 637 | - ); | ||
| 638 | - } else { | ||
| 639 | - return Column(children: [ | ||
| 640 | - Expanded( | ||
| 641 | - child: SingleChildScrollView( | ||
| 642 | - controller: _controller, | ||
| 643 | - child: Column( | ||
| 644 | - children: [ | ||
| 645 | - VEmptyView(10), | ||
| 646 | - Stack( | ||
| 647 | - children: [ | ||
| 648 | - Container( | ||
| 649 | - color: MyColours.color_ffffff, | ||
| 650 | - padding: EdgeInsets.symmetric( | ||
| 651 | - vertical: ScreenUtil().setWidth(30)), | ||
| 652 | - child: Column( | ||
| 653 | - children: [ | ||
| 654 | - Row( | ||
| 655 | - mainAxisAlignment: MainAxisAlignment.center, | ||
| 656 | - children: [ | ||
| 657 | - Text( | ||
| 658 | - '${customerProvider.storeSunmodel.myCustomer}', | ||
| 659 | - style: TextStyle( | ||
| 660 | - color: MyColours.color_199095, | ||
| 661 | - fontSize: ScreenUtil().setSp(60), | ||
| 662 | - fontWeight: FontWeight.bold), | ||
| 663 | - ), | ||
| 664 | - Text( | ||
| 665 | - '位', | ||
| 666 | - style: TextStyle( | ||
| 667 | - color: MyColours.color_199095, | ||
| 668 | - fontWeight: FontWeight.bold, | ||
| 669 | - fontSize: ScreenUtil().setSp(30)), | ||
| 670 | - ) | ||
| 671 | - ], | ||
| 672 | - ), | ||
| 673 | - VEmptyView(10), | ||
| 674 | - RoundButton( | ||
| 675 | - onPressed: () async { | ||
| 676 | - NavigatorUtil.goCustomerListPage( | ||
| 677 | - context, FromPage.FromPageHome, ''); | ||
| 678 | - }, | ||
| 679 | - text: '全店客户', | ||
| 680 | - fontSize: 24, | ||
| 681 | - isBold: false, | ||
| 682 | - textColor: MyColours.color_333333, | ||
| 683 | - gradientStart: MyColours.color_ffffff, | ||
| 684 | - gradientEnd: MyColours.color_ffffff, | ||
| 685 | - borderColor: Color.fromRGBO(118, 118, 118, 1), | ||
| 686 | - height: ScreenUtil().setWidth(45), | ||
| 687 | - width: ScreenUtil().setWidth(160), | ||
| 688 | - radius: ScreenUtil().setWidth(30), | ||
| 689 | - ) | ||
| 690 | - ], | ||
| 691 | - ), | ||
| 692 | - ), | ||
| 693 | - Positioned( | ||
| 694 | - top: ScreenUtil().setWidth(30), | ||
| 695 | - right: ScreenUtil().setWidth(40), | ||
| 696 | - child: InkWell( | ||
| 697 | - onTap: () { | ||
| 698 | - NavigatorUtil.goCustomerSetPage(context); | ||
| 699 | - }, | ||
| 700 | - child: Image.asset(Utils.getImgPath('c_set'), | ||
| 701 | - width: ScreenUtil().setWidth(40)))) | ||
| 702 | - ], | ||
| 703 | - ), | ||
| 704 | - VEmptyView(10), | ||
| 705 | - Row( | ||
| 706 | - children: [ | ||
| 707 | - _percentWidget( | ||
| 708 | - '${customerProvider.storeSunmodel.active.count}', | ||
| 709 | - '活跃客户', | ||
| 710 | - '${customerProvider.storeSunmodel.active.scale}'), | ||
| 711 | - HEmptyView(10), | ||
| 712 | - _percentWidget( | ||
| 713 | - '${customerProvider.storeSunmodel.sleep.count}', | ||
| 714 | - '沉睡客户', | ||
| 715 | - '${customerProvider.storeSunmodel.sleep.scale}'), | ||
| 716 | - HEmptyView(10), | ||
| 717 | - _percentWidget( | ||
| 718 | - '${customerProvider.storeSunmodel.drain.count}', | ||
| 719 | - '流失客户', | ||
| 720 | - '${customerProvider.storeSunmodel.drain.scale}'), | ||
| 721 | - ], | ||
| 722 | - ), | ||
| 723 | - // GridView.builder( | ||
| 724 | - // controller: _controller, | ||
| 725 | - // shrinkWrap: true, | ||
| 726 | - // cacheExtent: ScreenUtil().setWidth(0), | ||
| 727 | - // itemCount: 3, | ||
| 728 | - // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | ||
| 729 | - // crossAxisCount: 3, | ||
| 730 | - // childAspectRatio: 1, | ||
| 731 | - // mainAxisSpacing: ScreenUtil().setWidth(10), | ||
| 732 | - // crossAxisSpacing: ScreenUtil().setWidth(10)), | ||
| 733 | - // itemBuilder: (BuildContext context, int index) { | ||
| 734 | - // // locationState = state; | ||
| 735 | - // return _percentWidget('1999', '活跃客户', '39.20'); | ||
| 736 | - // }), | ||
| 737 | - // Row( | ||
| 738 | - // children: [ | ||
| 739 | - // _percentWidget('19992', '活跃客户', '90.90'), | ||
| 740 | - // HEmptyView(10), | ||
| 741 | - // _percentWidget('19992', '沉睡客户', '90.90'), | ||
| 742 | - // HEmptyView(10), | ||
| 743 | - // _percentWidget('19992', '流失客户', '5.90'), | ||
| 744 | - // ], | ||
| 745 | - // ), | ||
| 746 | - Padding( | ||
| 747 | - padding: EdgeInsets.symmetric( | ||
| 748 | - vertical: ScreenUtil().setWidth(30)), | ||
| 749 | - child: Text( | ||
| 750 | - '客户经理', | ||
| 751 | - style: TextStyle( | ||
| 752 | - fontSize: ScreenUtil().setSp(28), | ||
| 753 | - color: MyColours.color_333333), | ||
| 754 | - ), | ||
| 755 | - ), | ||
| 756 | - GridView.builder( | ||
| 757 | - controller: _controller, | ||
| 758 | - shrinkWrap: true, | ||
| 759 | - cacheExtent: ScreenUtil().setWidth(0), | ||
| 760 | - itemCount: | ||
| 761 | - customerProvider.storeSunmodel.sellerUser.length + 1, | ||
| 762 | - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | ||
| 763 | - crossAxisCount: 3, | ||
| 764 | - childAspectRatio: 1, | ||
| 765 | - mainAxisSpacing: ScreenUtil().setWidth(10), | ||
| 766 | - crossAxisSpacing: ScreenUtil().setWidth(10)), | ||
| 767 | - itemBuilder: (BuildContext context, int index) { | ||
| 768 | - // locationState = state; | ||
| 769 | - if (index == 0) { | ||
| 770 | - return _percentWidget( | ||
| 771 | - '${customerProvider.storeSunmodel.distribution}', | ||
| 772 | - '未分配', | ||
| 773 | - null); | ||
| 774 | - } | ||
| 775 | - | ||
| 776 | - return _percentWidget( | ||
| 777 | - '${customerProvider.storeSunmodel.sellerUser[index - 1].count}', | ||
| 778 | - customerProvider.storeSunmodel.sellerUser[index - 1] | ||
| 779 | - .account == | ||
| 780 | - null | ||
| 781 | - ? '' | ||
| 782 | - : '${customerProvider.storeSunmodel.sellerUser[index - 1].nickName ?? customerProvider.storeSunmodel.sellerUser[index - 1].account}经理', | ||
| 783 | - null, | ||
| 784 | - uid: customerProvider | ||
| 785 | - .storeSunmodel.sellerUser[index - 1].uid); | ||
| 786 | - }), | ||
| 787 | - _chart(), | ||
| 788 | - _monthWidget(), | ||
| 789 | - VEmptyView(24), | ||
| 790 | - | ||
| 791 | - ListView.builder( | ||
| 792 | - itemCount: 10, | ||
| 793 | - controller: _controller, | ||
| 794 | - shrinkWrap: true, | ||
| 795 | - padding: EdgeInsets.symmetric(horizontal: w(10)), | ||
| 796 | - itemBuilder: (context, index) { | ||
| 797 | - return Container( | ||
| 798 | - margin: EdgeInsets.only(bottom: w(10)), | ||
| 799 | - padding: EdgeInsets.symmetric(horizontal: w(10)), | ||
| 800 | - decoration: BoxDecoration( | ||
| 801 | - color: MyColours.color_ffffff, | ||
| 802 | - borderRadius: BorderRadius.only( | ||
| 803 | - topRight: Radius.circular(r(8)), | ||
| 804 | - bottomRight: Radius.circular(r(8))), | ||
| 805 | - ), | ||
| 806 | - child: Row( | ||
| 807 | - children: [ | ||
| 808 | - Container( | ||
| 809 | - width: w(122), | ||
| 810 | - padding: EdgeInsets.symmetric(vertical: w(5)), | ||
| 811 | - decoration: BoxDecoration( | ||
| 812 | - border: Border( | ||
| 813 | - right: BorderSide( | ||
| 814 | - color: MyColours.color_f3f3f3, | ||
| 815 | - width: w(1)))), | ||
| 816 | - child: Column( | ||
| 817 | - children: [ | ||
| 818 | - VEmptyView(24), | ||
| 819 | - Align( | ||
| 820 | - alignment: Alignment.centerLeft, | ||
| 821 | - child: Container( | ||
| 822 | - padding: EdgeInsets.symmetric( | ||
| 823 | - vertical: w(4), horizontal: w(5)), | ||
| 824 | - decoration: BoxDecoration( | ||
| 825 | - borderRadius: | ||
| 826 | - BorderRadius.circular(r(3)), | ||
| 827 | - border: Border.all( | ||
| 828 | - color: MyColours.color_999999, | ||
| 829 | - width: w(1))), | ||
| 830 | - child: Text( | ||
| 831 | - '张珊珊', | ||
| 832 | - style: TextStyle( | ||
| 833 | - fontSize: font(12), | ||
| 834 | - fontWeight: FontWeight.bold, | ||
| 835 | - color: MyColours.color_999999), | ||
| 836 | - ), | ||
| 837 | - ), | ||
| 838 | - ), | ||
| 839 | - VEmptyView(10), | ||
| 840 | - Row( | ||
| 841 | - mainAxisAlignment: | ||
| 842 | - MainAxisAlignment.center, | ||
| 843 | - children: [ | ||
| 844 | - Text( | ||
| 845 | - '34', | ||
| 846 | - style: TextStyle( | ||
| 847 | - fontSize: font(24), | ||
| 848 | - fontWeight: FontWeight.bold, | ||
| 849 | - color: MyColours.color_438E93), | ||
| 850 | - ), | ||
| 851 | - Text( | ||
| 852 | - '位', | ||
| 853 | - style: TextStyle( | ||
| 854 | - fontSize: font(14), | ||
| 855 | - color: MyColours.color_000000), | ||
| 856 | - ), | ||
| 857 | - ], | ||
| 858 | - ), | ||
| 859 | - VEmptyView(10), | ||
| 860 | - Row( | ||
| 861 | - mainAxisAlignment: | ||
| 862 | - MainAxisAlignment.center, | ||
| 863 | - children: [ | ||
| 864 | - Text( | ||
| 865 | - '23', | ||
| 866 | - style: TextStyle( | ||
| 867 | - fontSize: font(14), | ||
| 868 | - fontWeight: FontWeight.bold, | ||
| 869 | - color: MyColours.color_438E93), | ||
| 870 | - ), | ||
| 871 | - MyDivider( | ||
| 872 | - w(4), | ||
| 873 | - w(1), | ||
| 874 | - color: MyColours.color_999999, | ||
| 875 | - ), | ||
| 876 | - Text( | ||
| 877 | - '9', | ||
| 878 | - style: TextStyle( | ||
| 879 | - fontSize: font(14), | ||
| 880 | - fontWeight: FontWeight.bold, | ||
| 881 | - color: MyColours.color_E89243), | ||
| 882 | - ), | ||
| 883 | - MyDivider( | ||
| 884 | - w(4), | ||
| 885 | - w(1), | ||
| 886 | - color: MyColours.color_999999, | ||
| 887 | - ), | ||
| 888 | - Text( | ||
| 889 | - '2', | ||
| 890 | - style: TextStyle( | ||
| 891 | - fontSize: font(14), | ||
| 892 | - fontWeight: FontWeight.bold, | ||
| 893 | - color: MyColours.color_E34D59), | ||
| 894 | - ), | ||
| 895 | - ], | ||
| 896 | - ), | ||
| 897 | - VEmptyView(24), | ||
| 898 | - ], | ||
| 899 | - ), | ||
| 900 | - ), | ||
| 901 | - Expanded( | ||
| 902 | - child: Container( | ||
| 903 | - padding: EdgeInsets.only( | ||
| 904 | - top: w(5), bottom: w(5), left: w(10)), | ||
| 905 | - child: Row( | ||
| 906 | - mainAxisAlignment: | ||
| 907 | - MainAxisAlignment.spaceBetween, | ||
| 908 | - // crossAxisAlignment: CrossAxisAlignment.start, | ||
| 909 | - children: [ | ||
| 910 | - Column( | ||
| 911 | - mainAxisAlignment: | ||
| 912 | - MainAxisAlignment.start, | ||
| 913 | - crossAxisAlignment: | ||
| 914 | - CrossAxisAlignment.start, | ||
| 915 | - children: [ | ||
| 916 | - Row( | ||
| 917 | - crossAxisAlignment: | ||
| 918 | - CrossAxisAlignment.start, | ||
| 919 | - children: [ | ||
| 920 | - Text( | ||
| 921 | - '预订', | ||
| 922 | - style: TextStyle( | ||
| 923 | - fontWeight: FontWeight.bold, | ||
| 924 | - color: MyColours.color_515151, | ||
| 925 | - fontSize: font( | ||
| 926 | - (12), | ||
| 927 | - )), | ||
| 928 | - ), | ||
| 929 | - HEmptyView(10), | ||
| 930 | - Text( | ||
| 931 | - '1089单', | ||
| 932 | - style: TextStyle( | ||
| 933 | - color: MyColours.color_515151, | ||
| 934 | - fontSize: font( | ||
| 935 | - (10), | ||
| 936 | - )), | ||
| 937 | - ), | ||
| 938 | - HEmptyView(10), | ||
| 939 | - MyDivider( | ||
| 940 | - w(1), | ||
| 941 | - w(15), | ||
| 942 | - color: MyColours.color_DBDBDB, | ||
| 943 | - ), | ||
| 944 | - HEmptyView(10), | ||
| 945 | - Text( | ||
| 946 | - '1190桌', | ||
| 947 | - style: TextStyle( | ||
| 948 | - color: MyColours.color_515151, | ||
| 949 | - fontSize: font( | ||
| 950 | - (10), | ||
| 951 | - )), | ||
| 952 | - ), | ||
| 953 | - ], | ||
| 954 | - ), | ||
| 955 | - VEmptyView(10), | ||
| 956 | - Row( | ||
| 957 | - crossAxisAlignment: | ||
| 958 | - CrossAxisAlignment.start, | ||
| 959 | - children: [ | ||
| 960 | - Text( | ||
| 961 | - '到店', | ||
| 962 | - style: TextStyle( | ||
| 963 | - fontWeight: FontWeight.bold, | ||
| 964 | - color: MyColours.color_515151, | ||
| 965 | - fontSize: font( | ||
| 966 | - (12), | ||
| 967 | - )), | ||
| 968 | - ), | ||
| 969 | - HEmptyView(10), | ||
| 970 | - Text( | ||
| 971 | - '1089单', | ||
| 972 | - style: TextStyle( | ||
| 973 | - color: MyColours.color_515151, | ||
| 974 | - fontSize: font( | ||
| 975 | - (10), | ||
| 976 | - )), | ||
| 977 | - ), | ||
| 978 | - HEmptyView(10), | ||
| 979 | - MyDivider( | ||
| 980 | - w(1), | ||
| 981 | - w(15), | ||
| 982 | - color: MyColours.color_DBDBDB, | ||
| 983 | - ), | ||
| 984 | - HEmptyView(10), | ||
| 985 | - Text( | ||
| 986 | - '1190桌', | ||
| 987 | - style: TextStyle( | ||
| 988 | - color: MyColours.color_515151, | ||
| 989 | - fontSize: font( | ||
| 990 | - (10), | ||
| 991 | - )), | ||
| 992 | - ), | ||
| 993 | - ], | ||
| 994 | - ), | ||
| 995 | - VEmptyView(10), | ||
| 996 | - Row( | ||
| 997 | - crossAxisAlignment: | ||
| 998 | - CrossAxisAlignment.start, | ||
| 999 | - children: [ | ||
| 1000 | - Text( | ||
| 1001 | - '1089人', | ||
| 1002 | - style: TextStyle( | ||
| 1003 | - color: MyColours.color_515151, | ||
| 1004 | - fontSize: font( | ||
| 1005 | - (10), | ||
| 1006 | - )), | ||
| 1007 | - ), | ||
| 1008 | - HEmptyView(10), | ||
| 1009 | - MyDivider( | ||
| 1010 | - w(1), | ||
| 1011 | - w(15), | ||
| 1012 | - color: MyColours.color_DBDBDB, | ||
| 1013 | - ), | ||
| 1014 | - HEmptyView(10), | ||
| 1015 | - Text( | ||
| 1016 | - '1190取消', | ||
| 1017 | - style: TextStyle( | ||
| 1018 | - color: MyColours.color_515151, | ||
| 1019 | - fontSize: font( | ||
| 1020 | - (10), | ||
| 1021 | - )), | ||
| 1022 | - ), | ||
| 1023 | - HEmptyView(10), | ||
| 1024 | - MyDivider( | ||
| 1025 | - w(1), | ||
| 1026 | - w(15), | ||
| 1027 | - color: MyColours.color_DBDBDB, | ||
| 1028 | - ), | ||
| 1029 | - HEmptyView(10), | ||
| 1030 | - Text( | ||
| 1031 | - '到客90.1%', | ||
| 1032 | - style: TextStyle( | ||
| 1033 | - color: MyColours.color_515151, | ||
| 1034 | - fontSize: font( | ||
| 1035 | - (10), | ||
| 1036 | - )), | ||
| 1037 | - ), | ||
| 1038 | - ], | ||
| 1039 | - ), | ||
| 1040 | - VEmptyView(10), | ||
| 1041 | - Row( | ||
| 1042 | - crossAxisAlignment: | ||
| 1043 | - CrossAxisAlignment.start, | ||
| 1044 | - children: [ | ||
| 1045 | - Text( | ||
| 1046 | - '有金额订单数 25', | ||
| 1047 | - style: TextStyle( | ||
| 1048 | - color: MyColours.color_999999, | ||
| 1049 | - fontSize: font( | ||
| 1050 | - (10), | ||
| 1051 | - )), | ||
| 1052 | - ), | ||
| 1053 | - HEmptyView(10), | ||
| 1054 | - MyDivider( | ||
| 1055 | - w(1), | ||
| 1056 | - w(15), | ||
| 1057 | - color: MyColours.color_DBDBDB, | ||
| 1058 | - ), | ||
| 1059 | - HEmptyView(10), | ||
| 1060 | - Text( | ||
| 1061 | - '总消费 25800元', | ||
| 1062 | - style: TextStyle( | ||
| 1063 | - color: MyColours.color_999999, | ||
| 1064 | - fontSize: font( | ||
| 1065 | - (10), | ||
| 1066 | - )), | ||
| 1067 | - ), | ||
| 1068 | - ], | ||
| 1069 | - ), | ||
| 1070 | - VEmptyView(10), | ||
| 1071 | - Row( | ||
| 1072 | - crossAxisAlignment: | ||
| 1073 | - CrossAxisAlignment.start, | ||
| 1074 | - children: [ | ||
| 1075 | - Text( | ||
| 1076 | - '人均 103.2元', | ||
| 1077 | - style: TextStyle( | ||
| 1078 | - color: MyColours.color_999999, | ||
| 1079 | - fontSize: font( | ||
| 1080 | - (10), | ||
| 1081 | - )), | ||
| 1082 | - ), | ||
| 1083 | - HEmptyView(10), | ||
| 1084 | - MyDivider( | ||
| 1085 | - w(1), | ||
| 1086 | - w(15), | ||
| 1087 | - color: MyColours.color_DBDBDB, | ||
| 1088 | - ), | ||
| 1089 | - HEmptyView(10), | ||
| 1090 | - Text( | ||
| 1091 | - '桌均 860元', | ||
| 1092 | - style: TextStyle( | ||
| 1093 | - color: MyColours.color_999999, | ||
| 1094 | - fontSize: font( | ||
| 1095 | - (10), | ||
| 1096 | - )), | ||
| 1097 | - ), | ||
| 1098 | - ], | ||
| 1099 | - ), | ||
| 1100 | - VEmptyView(10), | ||
| 1101 | - Row( | ||
| 1102 | - crossAxisAlignment: | ||
| 1103 | - CrossAxisAlignment.start, | ||
| 1104 | - children: [ | ||
| 1105 | - Text( | ||
| 1106 | - '存酒 1位', | ||
| 1107 | - style: TextStyle( | ||
| 1108 | - color: MyColours.color_999999, | ||
| 1109 | - fontSize: font( | ||
| 1110 | - (10), | ||
| 1111 | - )), | ||
| 1112 | - ), | ||
| 1113 | - HEmptyView(10), | ||
| 1114 | - MyDivider( | ||
| 1115 | - w(1), | ||
| 1116 | - w(15), | ||
| 1117 | - color: MyColours.color_DBDBDB, | ||
| 1118 | - ), | ||
| 1119 | - HEmptyView(10), | ||
| 1120 | - Text( | ||
| 1121 | - '提前点餐 9位', | ||
| 1122 | - style: TextStyle( | ||
| 1123 | - color: MyColours.color_999999, | ||
| 1124 | - fontSize: font( | ||
| 1125 | - (10), | ||
| 1126 | - )), | ||
| 1127 | - ), | ||
| 1128 | - HEmptyView(10), | ||
| 1129 | - MyDivider( | ||
| 1130 | - w(1), | ||
| 1131 | - w(15), | ||
| 1132 | - color: MyColours.color_DBDBDB, | ||
| 1133 | - ), | ||
| 1134 | - HEmptyView(10), | ||
| 1135 | - Text( | ||
| 1136 | - '安排菜 9位', | ||
| 1137 | - style: TextStyle( | ||
| 1138 | - color: MyColours.color_999999, | ||
| 1139 | - fontSize: font( | ||
| 1140 | - (10), | ||
| 1141 | - )), | ||
| 1142 | - ), | ||
| 1143 | - ], | ||
| 1144 | - ), | ||
| 1145 | - ], | ||
| 1146 | - ), | ||
| 1147 | - Image.asset( | ||
| 1148 | - Utils.getImgPath('arrow_right_new'), | ||
| 1149 | - width: w(12), | ||
| 1150 | - ) | ||
| 1151 | - ], | ||
| 1152 | - ), | ||
| 1153 | - )) | ||
| 1154 | - ], | 48 | + appBar: SystemAppBar('全店客情'), |
| 49 | + body: Column( | ||
| 50 | + children: [ | ||
| 51 | + Container( | ||
| 52 | + alignment: Alignment.center, | ||
| 53 | + width: double.infinity, | ||
| 54 | + color: MyColours.color_ffffff, | ||
| 55 | + padding: EdgeInsets.only(bottom: w(9), top: w(9)), | ||
| 56 | + child: TabBar( | ||
| 57 | + onTap: (index) { | ||
| 58 | + print(index); | ||
| 59 | + }, | ||
| 60 | + controller: tabController, | ||
| 61 | + isScrollable: true, | ||
| 62 | + indicatorColor: MyColours.color_438E93, | ||
| 63 | + indicatorSize: TabBarIndicatorSize.tab, | ||
| 64 | + indicatorWeight: w(2), | ||
| 65 | + unselectedLabelColor: MyColours.color_999999, | ||
| 66 | + labelColor: MyColours.color_438E93, | ||
| 67 | + labelStyle: TextStyle( | ||
| 68 | + fontSize: w(14), | ||
| 69 | + color: MyColours.color_438E93, | ||
| 70 | + fontWeight: FontWeight.bold), | ||
| 71 | + unselectedLabelStyle: | ||
| 72 | + TextStyle(fontSize: w(12), color: MyColours.color_999999), | ||
| 73 | + indicatorPadding: EdgeInsets.only(left: w(24), right: w(24)), | ||
| 74 | + // labelPadding: | ||
| 75 | + // EdgeInsets.symmetric(horizontal: w(32)), //tabs控件之间的间距 | ||
| 76 | + tabs: [ | ||
| 77 | + Tab( | ||
| 78 | + height: w(30), | ||
| 79 | + child: Container( | ||
| 80 | + width: w(100), | ||
| 81 | + alignment: Alignment.center, | ||
| 82 | + child: Text( | ||
| 83 | + '全店', | ||
| 1155 | ), | 84 | ), |
| 1156 | - ); | ||
| 1157 | - }) | ||
| 1158 | - ], | ||
| 1159 | - ), | ||
| 1160 | - )), | ||
| 1161 | - Padding( | ||
| 1162 | - padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(30)), | ||
| 1163 | - child: Stack( | ||
| 1164 | - children: [ | ||
| 1165 | - RoundButton( | ||
| 1166 | - onPressed: () { | ||
| 1167 | - NavigatorUtil.goMarketingRecordsPage( | ||
| 1168 | - context, FromPage.FromPageStoreCustomer); | ||
| 1169 | - }, | ||
| 1170 | - text: '营销记录', | ||
| 1171 | - fontSize: 24, | ||
| 1172 | - isBold: false, | ||
| 1173 | - textColor: MyColours.color_199095, | ||
| 1174 | - gradientStart: MyColours.color_ffffff, | ||
| 1175 | - gradientEnd: MyColours.color_ffffff, | ||
| 1176 | - borderColor: MyColours.color_199095, | ||
| 1177 | - height: ScreenUtil().setWidth(75), | ||
| 1178 | - width: ScreenUtil().setWidth(260), | ||
| 1179 | - radius: ScreenUtil().setWidth(10), | 85 | + )), |
| 86 | + Tab( | ||
| 87 | + height: w(30), | ||
| 88 | + child: Container( | ||
| 89 | + width: w(100), | ||
| 90 | + alignment: Alignment.center, | ||
| 91 | + child: Text( | ||
| 92 | + '分经理', | ||
| 93 | + )), | ||
| 1180 | ), | 94 | ), |
| 1181 | - showWarning | ||
| 1182 | - ? Positioned( | ||
| 1183 | - right: ScreenUtil().setWidth(30), | ||
| 1184 | - top: ScreenUtil().setWidth(40 / 2), | ||
| 1185 | - child: Image.asset( | ||
| 1186 | - Utils.getImgPath('warning'), | ||
| 1187 | - width: ScreenUtil().setWidth(35), | ||
| 1188 | - )) | ||
| 1189 | - : SizedBox() | ||
| 1190 | ], | 95 | ], |
| 1191 | - )) | ||
| 1192 | - ]); | ||
| 1193 | - } | ||
| 1194 | - })), | ||
| 1195 | - ); | 96 | + |
| 97 | + // indicatorPadding: EdgeInsets.only( | ||
| 98 | + // left: ScreenUtil().setWidth(16), | ||
| 99 | + // right: ScreenUtil().setWidth(32)), | ||
| 100 | + // indicatorWeight: ScreenUtil().setWidth(6.0), | ||
| 101 | + )), | ||
| 102 | + | ||
| 103 | + Expanded( | ||
| 104 | + child: TabBarView(controller: tabController, children: [ | ||
| 105 | + StoreCustomerHomeLeftPage(), | ||
| 106 | + StoreCustomerHomeRightPage() | ||
| 107 | + ]), | ||
| 108 | + ), | ||
| 109 | + ], | ||
| 110 | + )); | ||
| 1196 | } | 111 | } |
| 1197 | } | 112 | } |
| 1 | +import 'dart:convert'; | ||
| 2 | +import 'dart:ui'; | ||
| 3 | + | ||
| 4 | +import 'package:flutter/material.dart'; | ||
| 5 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 6 | +import 'package:one_key/constant/state.dart'; | ||
| 7 | +import 'package:one_key/models/guest_manage_model.dart'; | ||
| 8 | +import 'package:one_key/models/marketing_by_uid_model.dart'; | ||
| 9 | +import 'package:one_key/provider/customer_provider.dart'; | ||
| 10 | +import 'package:one_key/provider/user_model.dart'; | ||
| 11 | +import 'package:one_key/res/colors.dart'; | ||
| 12 | +import 'package:one_key/route/navigator_util.dart'; | ||
| 13 | +import 'package:one_key/utils/event_bus.dart'; | ||
| 14 | +import 'package:one_key/utils/utils.dart'; | ||
| 15 | +import 'package:one_key/widgets/h_empty_view.dart'; | ||
| 16 | +import 'package:one_key/widgets/page_exception.dart'; | ||
| 17 | +import 'package:one_key/widgets/round_button.dart'; | ||
| 18 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 19 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 20 | +import 'package:provider/provider.dart'; | ||
| 21 | + | ||
| 22 | +import '../../../../models/message_menu_model.dart'; | ||
| 23 | +import '../../../../utils/screen_util.dart'; | ||
| 24 | +import '../../../../widgets/MyDivider.dart'; | ||
| 25 | +import '../month_item.dart'; | ||
| 26 | +import '../store_customer/bar_chart_page.dart'; | ||
| 27 | + | ||
| 28 | +/** | ||
| 29 | + * | ||
| 30 | + */ | ||
| 31 | +class StoreCustomerHomeRightPage extends StatefulWidget { | ||
| 32 | + StoreCustomerHomeRightPage({Key key}) : super(key: key); | ||
| 33 | + | ||
| 34 | + @override | ||
| 35 | + _StoreCustomerHomeRightPageState createState() => | ||
| 36 | + _StoreCustomerHomeRightPageState(); | ||
| 37 | +} | ||
| 38 | + | ||
| 39 | +class _StoreCustomerHomeRightPageState | ||
| 40 | + extends State<StoreCustomerHomeRightPage> { | ||
| 41 | + ScrollController _controller = ScrollController(); | ||
| 42 | + CustomerProvider customerProvider; | ||
| 43 | + bool showWarning = false; | ||
| 44 | + | ||
| 45 | + int year; | ||
| 46 | + | ||
| 47 | + List<BarData> dataList = [ | ||
| 48 | + BarData(MyColours.color_8EBBBE, 200), | ||
| 49 | + BarData(MyColours.color_8EBBBE, 8), | ||
| 50 | + BarData(MyColours.color_8EBBBE, 15), | ||
| 51 | + BarData(MyColours.color_8EBBBE, 5), | ||
| 52 | + BarData(MyColours.color_8EBBBE, 2), | ||
| 53 | + BarData(MyColours.color_8EBBBE, 2), | ||
| 54 | + BarData(MyColours.color_8EBBBE, 18), | ||
| 55 | + BarData(MyColours.color_8EBBBE, 168), | ||
| 56 | + BarData(MyColours.color_8EBBBE, 15), | ||
| 57 | + BarData(MyColours.color_8EBBBE, 5), | ||
| 58 | + BarData(MyColours.color_8EBBBE, null ?? 0), | ||
| 59 | + BarData(MyColours.color_8EBBBE, 0), | ||
| 60 | + ]; | ||
| 61 | + | ||
| 62 | + List<MessageMenuModel> menuTitle = []; | ||
| 63 | + @override | ||
| 64 | + void initState() { | ||
| 65 | + super.initState(); | ||
| 66 | + year = DateTime.now().year; | ||
| 67 | + for (int i = 0; i < 15; i++) { | ||
| 68 | + MessageMenuModel messageMenuModel = MessageMenuModel(); | ||
| 69 | + messageMenuModel.title = '${i}经理'; | ||
| 70 | + messageMenuModel.select = i == 0 ? true : false; | ||
| 71 | + menuTitle.add(messageMenuModel); | ||
| 72 | + } | ||
| 73 | + WidgetsBinding.instance.addPostFrameCallback((_) { | ||
| 74 | + _couponNetworkData(); | ||
| 75 | + | ||
| 76 | + _getMarketingByUid(); | ||
| 77 | + }); | ||
| 78 | + bus.on("refresh_my_customer_home", (arg) { | ||
| 79 | + _getGuestManageData(isShowLoading: false); | ||
| 80 | + _getMarketingByUid(); | ||
| 81 | + }); | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + @override | ||
| 85 | + void dispose() { | ||
| 86 | + bus.off('refresh_my_customer_home'); | ||
| 87 | + // bus.off("refresh_coupon_list"); | ||
| 88 | + super.dispose(); | ||
| 89 | + } | ||
| 90 | + | ||
| 91 | + ///我的客户首页 | ||
| 92 | + _getGuestManageData({bool isShowLoading = true}) async { | ||
| 93 | + GuestManageSunModel model = await customerProvider | ||
| 94 | + .getGuestManageData(context, isShowLoading: isShowLoading); | ||
| 95 | + // setState(() {}); | ||
| 96 | + } | ||
| 97 | + | ||
| 98 | + ///消费券 | ||
| 99 | + _couponNetworkData({bool isShowLoading = true}) async { | ||
| 100 | + // customerMakingProvider.couponSelectIndex = 0; | ||
| 101 | + Map<String, String> params = { | ||
| 102 | + "uid": Provider.of<UserModel>(context, listen: false).user.openid, | ||
| 103 | + }; | ||
| 104 | + await customerProvider.getCustomerSelectActivityNew(context, params, | ||
| 105 | + isShowLoading: isShowLoading); | ||
| 106 | + //此人已经新建好券 | ||
| 107 | + // if (customerProvider.couponListSelect.length > 0) { | ||
| 108 | + // for (int i = 0; i < customerProvider.couponListSelect.length; i++) { | ||
| 109 | + // if (widget.sellerList.aid == customerProvider.couponListSelect[i].id) { | ||
| 110 | + // aidStr = customerProvider.couponListSelect[i].aname; | ||
| 111 | + // } | ||
| 112 | + // } | ||
| 113 | + // customerProvider.notifyListeners(); | ||
| 114 | + // } else { | ||
| 115 | + // //没有新建的优惠券 | ||
| 116 | + // } | ||
| 117 | + _getGuestManageData(); | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + _getMarketingByUid() async { | ||
| 121 | + Map<String, String> params = { | ||
| 122 | + "uid": Provider.of<UserModel>(context, listen: false).user.openid | ||
| 123 | + }; | ||
| 124 | + // await customerProvider.getMarketingByUid(context, params); | ||
| 125 | + | ||
| 126 | + MarketingByUidsSunModel myRecordData = | ||
| 127 | + await customerProvider.getMarketingByUid(context, params); | ||
| 128 | + if (myRecordData != null && myRecordData.sellerList.length > 0) { | ||
| 129 | + bool temp = myRecordData.sellerList.any((value) { | ||
| 130 | + return value.finishedStatus == '0'; | ||
| 131 | + }); | ||
| 132 | + setState(() { | ||
| 133 | + showWarning = temp; | ||
| 134 | + }); | ||
| 135 | + } | ||
| 136 | + // await customerProvider.searchData(customerProvider.controller.text); | ||
| 137 | + } | ||
| 138 | + | ||
| 139 | + Widget _chart() { | ||
| 140 | + return Container( | ||
| 141 | + // height: w(216), | ||
| 142 | + padding: EdgeInsets.only(top: w(16), left: w(16), right: w(16)), | ||
| 143 | + margin: EdgeInsets.all(w(10)), | ||
| 144 | + decoration: BoxDecoration( | ||
| 145 | + color: MyColours.color_ffffff, | ||
| 146 | + borderRadius: BorderRadius.circular(r(8))), | ||
| 147 | + child: Column( | ||
| 148 | + children: [ | ||
| 149 | + Row( | ||
| 150 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 151 | + children: [ | ||
| 152 | + InkWell( | ||
| 153 | + onTap: () { | ||
| 154 | + setState(() { | ||
| 155 | + year--; | ||
| 156 | + }); | ||
| 157 | + // _getGuestReserve(showLoading: true); | ||
| 158 | + }, | ||
| 159 | + child: Padding( | ||
| 160 | + padding: | ||
| 161 | + EdgeInsets.only(right: ScreenUtil().setWidth(20)), | ||
| 162 | + child: Image.asset( | ||
| 163 | + Utils.getImgPath('c_arrow_left'), | ||
| 164 | + width: ScreenUtil().setWidth(24), | ||
| 165 | + ))), | ||
| 166 | + Text( | ||
| 167 | + '${year}年', | ||
| 168 | + style: TextStyle( | ||
| 169 | + fontSize: ScreenUtil().setSp(32), | ||
| 170 | + color: MyColours.color_000000), | ||
| 171 | + ), | ||
| 172 | + InkWell( | ||
| 173 | + onTap: () { | ||
| 174 | + if (year >= DateTime.now().year) { | ||
| 175 | + return; | ||
| 176 | + } | ||
| 177 | + setState(() { | ||
| 178 | + year++; | ||
| 179 | + }); | ||
| 180 | + // _getGuestReserve(showLoading: true); | ||
| 181 | + }, | ||
| 182 | + child: Padding( | ||
| 183 | + padding: EdgeInsets.only( | ||
| 184 | + left: ScreenUtil().setWidth(20), | ||
| 185 | + ), | ||
| 186 | + child: Image.asset( | ||
| 187 | + Utils.getImgPath(year != DateTime.now().year | ||
| 188 | + ? 'c_arrow_right' | ||
| 189 | + : 'c_arrow_right_gray'), | ||
| 190 | + width: ScreenUtil().setWidth(24), | ||
| 191 | + ))) | ||
| 192 | + ], | ||
| 193 | + ), | ||
| 194 | + VEmptyView(80), | ||
| 195 | + Container( | ||
| 196 | + width: double.infinity, | ||
| 197 | + height: w(177), | ||
| 198 | + child: LayoutBuilder(builder: (context, constraints) { | ||
| 199 | + return BarChartWidget( | ||
| 200 | + dataList: dataList, | ||
| 201 | + ); | ||
| 202 | + })) | ||
| 203 | + ], | ||
| 204 | + ), | ||
| 205 | + ); | ||
| 206 | + } | ||
| 207 | + | ||
| 208 | + ///活跃客户、沉睡客户、流失客户 | ||
| 209 | + Widget _percentWidget(String pnum, String btnTitle, String percent) { | ||
| 210 | + return InkWell( | ||
| 211 | + onTap: () async { | ||
| 212 | + String index = '0'; | ||
| 213 | + if (btnTitle == '活跃') { | ||
| 214 | + index = '1'; | ||
| 215 | + } else if (btnTitle == '60天未到店') { | ||
| 216 | + index = '2'; | ||
| 217 | + } else if (btnTitle == '120天未到店') { | ||
| 218 | + index = '3'; | ||
| 219 | + } | ||
| 220 | + NavigatorUtil.goMyCustomerListPage( | ||
| 221 | + context, FromPage.FromPageMyCustomer, | ||
| 222 | + index: index); | ||
| 223 | + }, | ||
| 224 | + child: Container( | ||
| 225 | + color: MyColours.color_ffffff, | ||
| 226 | + height: w(90), | ||
| 227 | + width: (ScreenUtil().screenWidth - ScreenUtil().setWidth(20)) / 3, | ||
| 228 | + // height: (ScreenUtil().screenWidth - ScreenUtil().setWidth(20)) / 3, | ||
| 229 | + child: Column( | ||
| 230 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 231 | + children: [ | ||
| 232 | + VEmptyView(30), | ||
| 233 | + Container( | ||
| 234 | + height: w(24), | ||
| 235 | + child: Row( | ||
| 236 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 237 | + children: [ | ||
| 238 | + Text(pnum, | ||
| 239 | + style: TextStyle( | ||
| 240 | + color: btnTitle == '活跃' | ||
| 241 | + ? MyColours.color_199095 | ||
| 242 | + : btnTitle == '60天未到店' | ||
| 243 | + ? MyColours.color_E89243 | ||
| 244 | + : MyColours.color_E34D59, | ||
| 245 | + fontSize: ScreenUtil().setSp(48), | ||
| 246 | + fontWeight: FontWeight.bold)), | ||
| 247 | + Text('位', | ||
| 248 | + style: TextStyle( | ||
| 249 | + color: MyColours.color_515151, | ||
| 250 | + fontSize: ScreenUtil().setSp(28), | ||
| 251 | + )) | ||
| 252 | + ], | ||
| 253 | + )), | ||
| 254 | + VEmptyView(20), | ||
| 255 | + RoundButton( | ||
| 256 | + onPressed: () async { | ||
| 257 | + String index = '0'; | ||
| 258 | + if (btnTitle == '活跃') { | ||
| 259 | + index = '1'; | ||
| 260 | + } else if (btnTitle == '60天未到店') { | ||
| 261 | + index = '2'; | ||
| 262 | + } else if (btnTitle == '120天未到店') { | ||
| 263 | + index = '3'; | ||
| 264 | + } | ||
| 265 | + NavigatorUtil.goMyCustomerListPage( | ||
| 266 | + context, FromPage.FromPageMyCustomer, | ||
| 267 | + index: index); | ||
| 268 | + }, | ||
| 269 | + text: btnTitle, | ||
| 270 | + fontSize: 24, | ||
| 271 | + isBold: false, | ||
| 272 | + textColor: MyColours.color_999999, | ||
| 273 | + gradientStart: MyColours.color_ffffff, | ||
| 274 | + gradientEnd: MyColours.color_ffffff, | ||
| 275 | + borderColor: MyColours.color_ffffff, | ||
| 276 | + height: ScreenUtil().setWidth(48), | ||
| 277 | + // width: ScreenUtil().setWidth(160), | ||
| 278 | + radius: ScreenUtil().setWidth(30), | ||
| 279 | + ), | ||
| 280 | + // VEmptyView(16), | ||
| 281 | + // percent == null | ||
| 282 | + // ? SizedBox() | ||
| 283 | + // : Text('${percent}%', | ||
| 284 | + // style: TextStyle( | ||
| 285 | + // color: MyColours.color_199095, | ||
| 286 | + // fontSize: ScreenUtil().setSp(24), | ||
| 287 | + // )), | ||
| 288 | + ], | ||
| 289 | + ), | ||
| 290 | + )); | ||
| 291 | + } | ||
| 292 | + | ||
| 293 | + @override | ||
| 294 | + Widget build(BuildContext context) { | ||
| 295 | + customerProvider = Provider.of<CustomerProvider>(context, listen: false); | ||
| 296 | + return Scaffold( | ||
| 297 | + // backgroundColor: MyColours.color_f3f3f3, | ||
| 298 | + // appBar: SystemAppBar('我的客情', onTap: () { | ||
| 299 | + // EventBus().emit('changeStatusColor'); | ||
| 300 | + // Navigator.pop(context); | ||
| 301 | + // }), | ||
| 302 | + body: WillPopScope( | ||
| 303 | + onWillPop: () async { | ||
| 304 | + EventBus().emit('changeStatusColor'); | ||
| 305 | + return true; | ||
| 306 | + }, | ||
| 307 | + child: Column( | ||
| 308 | + children: [ | ||
| 309 | + Container( | ||
| 310 | + color: MyColours.color_ffffff, | ||
| 311 | + height: ScreenUtil().setWidth(70), | ||
| 312 | + padding: EdgeInsets.only(bottom: w(12)), | ||
| 313 | + margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)), | ||
| 314 | + child: Row( | ||
| 315 | + children: [ | ||
| 316 | + HEmptyView(48), | ||
| 317 | + Expanded( | ||
| 318 | + child: SizedBox( | ||
| 319 | + // height: ScreenUtil().setWidth(30), | ||
| 320 | + child: ListView.builder( | ||
| 321 | + itemCount: menuTitle.length, | ||
| 322 | + shrinkWrap: true, | ||
| 323 | + controller: _controller, | ||
| 324 | + scrollDirection: Axis.horizontal, | ||
| 325 | + itemBuilder: | ||
| 326 | + (BuildContext contxt, int index) { | ||
| 327 | + return InkWell( | ||
| 328 | + onTap: () { | ||
| 329 | + for (MessageMenuModel item | ||
| 330 | + in menuTitle) { | ||
| 331 | + item.select = false; | ||
| 332 | + } | ||
| 333 | + menuTitle[index].select = true; | ||
| 334 | + setState(() {}); | ||
| 335 | + // offset = 0; | ||
| 336 | + // 1提前点餐/2内部预订/10在线预订/15店内消息传/12在线买单 | ||
| 337 | + | ||
| 338 | + // if (index == 0) { | ||
| 339 | + // typeid = ''; | ||
| 340 | + // } else if (index == 1) { | ||
| 341 | + // //店内消息 | ||
| 342 | + // typeid = '15'; | ||
| 343 | + // } else if (index == 2) { | ||
| 344 | + // //在线预订 | ||
| 345 | + // typeid = '10'; | ||
| 346 | + // } else if (index == 3) { | ||
| 347 | + // //提前点餐 | ||
| 348 | + // typeid = '1'; | ||
| 349 | + // } else if (index == 4) { | ||
| 350 | + // //在线买单 | ||
| 351 | + // typeid = '12'; | ||
| 352 | + // } else if (index == 5) { | ||
| 353 | + // //会员充值 | ||
| 354 | + // typeid = '17'; | ||
| 355 | + // } else if (index == 6) { | ||
| 356 | + // //存酒超期 | ||
| 357 | + // typeid = '18'; | ||
| 358 | + // } | ||
| 359 | + // getMessage(typeid, showLoading: true); | ||
| 360 | + }, | ||
| 361 | + child: Container( | ||
| 362 | + // width: ScreenUtil().setWidth(104 * 2), | ||
| 363 | + | ||
| 364 | + margin: EdgeInsets.only( | ||
| 365 | + right: ScreenUtil().setWidth(30), | ||
| 366 | + ), | ||
| 367 | + padding: EdgeInsets.symmetric( | ||
| 368 | + horizontal: | ||
| 369 | + ScreenUtil().setWidth(10), | ||
| 370 | + vertical: ScreenUtil().setWidth(4)), | ||
| 371 | + alignment: Alignment.center, | ||
| 372 | + decoration: BoxDecoration( | ||
| 373 | + borderRadius: BorderRadius.circular( | ||
| 374 | + ScreenUtil().setWidth(10)), | ||
| 375 | + // color: menuTitle[index].select | ||
| 376 | + // ? MyColours.color_438E93 | ||
| 377 | + // : MyColours.color_999999, | ||
| 378 | + border: Border.all( | ||
| 379 | + color: menuTitle[index].select | ||
| 380 | + ? MyColours.color_438E93 | ||
| 381 | + : MyColours.color_999999, | ||
| 382 | + width: | ||
| 383 | + ScreenUtil().setWidth(2))), | ||
| 384 | + child: Text( | ||
| 385 | + menuTitle[index].title, | ||
| 386 | + overflow: TextOverflow.ellipsis, | ||
| 387 | + style: TextStyle( | ||
| 388 | + color: menuTitle[index].select | ||
| 389 | + ? MyColours.color_438E93 | ||
| 390 | + : MyColours.color_999999, | ||
| 391 | + fontSize: ScreenUtil().setSp(24), | ||
| 392 | + decoration: TextDecoration.none, | ||
| 393 | + fontWeight: FontWeight.normal), | ||
| 394 | + ), | ||
| 395 | + ), | ||
| 396 | + ); | ||
| 397 | + }))) | ||
| 398 | + ], | ||
| 399 | + ), | ||
| 400 | + ), | ||
| 401 | + Expanded(child: | ||
| 402 | + Consumer<CustomerProvider>(builder: (context, model, _) { | ||
| 403 | + if (model.pageStateMyHome != PageState.Success) { | ||
| 404 | + return ExceptionPage( | ||
| 405 | + pageState: model.pageStateMyHome, | ||
| 406 | + callback: () { | ||
| 407 | + _getGuestManageData(); | ||
| 408 | + }, | ||
| 409 | + emptyMsg: "暂时没有我的客情哦", | ||
| 410 | + emptyImg: "empty_search", | ||
| 411 | + showMsg: "加载中,请稍后...", | ||
| 412 | + ); | ||
| 413 | + } else { | ||
| 414 | + return Column(children: [ | ||
| 415 | + Expanded( | ||
| 416 | + child: SingleChildScrollView( | ||
| 417 | + controller: _controller, | ||
| 418 | + child: Column( | ||
| 419 | + children: [ | ||
| 420 | + // VEmptyView(10), | ||
| 421 | + InkWell( | ||
| 422 | + onTap: () { | ||
| 423 | + NavigatorUtil.goMyCustomerListPage( | ||
| 424 | + context, FromPage.FromPageMyCustomer); | ||
| 425 | + }, | ||
| 426 | + child: Container( | ||
| 427 | + height: w(80), | ||
| 428 | + color: MyColours.color_ffffff, | ||
| 429 | + child: Row( | ||
| 430 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 431 | + children: [ | ||
| 432 | + // Text( | ||
| 433 | + // '累计', | ||
| 434 | + // style: TextStyle( | ||
| 435 | + // color: MyColours.color_515151, | ||
| 436 | + // fontWeight: FontWeight.bold, | ||
| 437 | + // fontSize: ScreenUtil().setSp(32)), | ||
| 438 | + // ), | ||
| 439 | + Text( | ||
| 440 | + '${customerProvider.guestSunmodel.myCustomer}', | ||
| 441 | + style: TextStyle( | ||
| 442 | + color: MyColours.color_199095, | ||
| 443 | + fontSize: ScreenUtil().setSp(64), | ||
| 444 | + fontWeight: FontWeight.bold), | ||
| 445 | + ), | ||
| 446 | + Text( | ||
| 447 | + '位', | ||
| 448 | + style: TextStyle( | ||
| 449 | + color: MyColours.color_515151, | ||
| 450 | + fontWeight: FontWeight.bold, | ||
| 451 | + fontSize: ScreenUtil().setSp(32)), | ||
| 452 | + ) | ||
| 453 | + ], | ||
| 454 | + ), | ||
| 455 | + )), | ||
| 456 | + VEmptyView(10), | ||
| 457 | + // GridView.builder( | ||
| 458 | + // controller: _controller, | ||
| 459 | + // shrinkWrap: true, | ||
| 460 | + // cacheExtent: ScreenUtil().setWidth(0), | ||
| 461 | + // itemCount: 3, | ||
| 462 | + // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | ||
| 463 | + // crossAxisCount: 3, | ||
| 464 | + // childAspectRatio: 1, | ||
| 465 | + // mainAxisSpacing: ScreenUtil().setWidth(10), | ||
| 466 | + // crossAxisSpacing: ScreenUtil().setWidth(10)), | ||
| 467 | + // itemBuilder: (BuildContext context, int index) { | ||
| 468 | + // // locationState = state; | ||
| 469 | + // return _percentWidget( | ||
| 470 | + // '${customerProvider.guestSunmodel.active.count}', | ||
| 471 | + // '活跃客户', | ||
| 472 | + // '${customerProvider.guestSunmodel.active.scale}'); | ||
| 473 | + // }), | ||
| 474 | + Row( | ||
| 475 | + children: [ | ||
| 476 | + _percentWidget( | ||
| 477 | + '${customerProvider.guestSunmodel.active.count}', | ||
| 478 | + '活跃', | ||
| 479 | + '${customerProvider.guestSunmodel.active.scale}'), | ||
| 480 | + HEmptyView(10), | ||
| 481 | + _percentWidget( | ||
| 482 | + '${customerProvider.guestSunmodel.sleep.count}', | ||
| 483 | + '60天未到店', | ||
| 484 | + '${customerProvider.guestSunmodel.sleep.scale}'), | ||
| 485 | + HEmptyView(10), | ||
| 486 | + _percentWidget( | ||
| 487 | + '${customerProvider.guestSunmodel.drain.count}', | ||
| 488 | + '120天未到店', | ||
| 489 | + '${customerProvider.guestSunmodel.drain.scale}'), | ||
| 490 | + ], | ||
| 491 | + ), | ||
| 492 | + ListView.builder( | ||
| 493 | + controller: _controller, | ||
| 494 | + shrinkWrap: true, | ||
| 495 | + cacheExtent: ScreenUtil().setWidth(0), | ||
| 496 | + itemCount: | ||
| 497 | + customerProvider.guestSunmodel.tips.task == | ||
| 498 | + null || | ||
| 499 | + customerProvider.guestSunmodel.tips | ||
| 500 | + .task.length == | ||
| 501 | + 0 | ||
| 502 | + ? 0 | ||
| 503 | + : customerProvider | ||
| 504 | + .guestSunmodel.tips.task.length, | ||
| 505 | + itemBuilder: (BuildContext context, int index) { | ||
| 506 | + // locationState = state; | ||
| 507 | + Task data = customerProvider | ||
| 508 | + .guestSunmodel.tips.task[index]; | ||
| 509 | + return Column( | ||
| 510 | + children: [ | ||
| 511 | + VEmptyView(10), | ||
| 512 | + Container( | ||
| 513 | + color: MyColours.color_ffffff, | ||
| 514 | + padding: EdgeInsets.symmetric( | ||
| 515 | + horizontal: | ||
| 516 | + ScreenUtil().setWidth(20), | ||
| 517 | + vertical: | ||
| 518 | + ScreenUtil().setWidth(30)), | ||
| 519 | + child: Row( | ||
| 520 | + children: [ | ||
| 521 | + Image.asset( | ||
| 522 | + Utils.getImgPath('warning'), | ||
| 523 | + width: ScreenUtil().setWidth(42), | ||
| 524 | + ), | ||
| 525 | + HEmptyView(15), | ||
| 526 | + Expanded( | ||
| 527 | + child: Column( | ||
| 528 | + crossAxisAlignment: | ||
| 529 | + CrossAxisAlignment.start, | ||
| 530 | + children: [ | ||
| 531 | + Text( | ||
| 532 | + '店内任务:${data.content}', | ||
| 533 | + maxLines: 1, | ||
| 534 | + overflow: | ||
| 535 | + TextOverflow.ellipsis, | ||
| 536 | + style: TextStyle( | ||
| 537 | + color: MyColours | ||
| 538 | + .color_333333, | ||
| 539 | + fontSize: ScreenUtil() | ||
| 540 | + .setSp(32)), | ||
| 541 | + ), | ||
| 542 | + data.aid != null && | ||
| 543 | + data.aidStr != null | ||
| 544 | + ? Padding( | ||
| 545 | + padding: EdgeInsets.only( | ||
| 546 | + top: ScreenUtil() | ||
| 547 | + .setWidth(8)), | ||
| 548 | + child: Text( | ||
| 549 | + '优惠内容:${data.aidStr}', | ||
| 550 | + maxLines: 1, | ||
| 551 | + overflow: TextOverflow | ||
| 552 | + .ellipsis, | ||
| 553 | + style: TextStyle( | ||
| 554 | + color: MyColours | ||
| 555 | + .color_333333, | ||
| 556 | + fontSize: | ||
| 557 | + ScreenUtil() | ||
| 558 | + .setSp( | ||
| 559 | + 24)), | ||
| 560 | + ), | ||
| 561 | + ) | ||
| 562 | + : SizedBox(), | ||
| 563 | + VEmptyView(8), | ||
| 564 | + Text( | ||
| 565 | + '创建人:${data.createUser}', | ||
| 566 | + maxLines: 1, | ||
| 567 | + overflow: | ||
| 568 | + TextOverflow.ellipsis, | ||
| 569 | + style: TextStyle( | ||
| 570 | + color: MyColours | ||
| 571 | + .color_333333, | ||
| 572 | + fontSize: ScreenUtil() | ||
| 573 | + .setSp(26)), | ||
| 574 | + ) | ||
| 575 | + ], | ||
| 576 | + )), | ||
| 577 | + HEmptyView(20), | ||
| 578 | + Column(children: [ | ||
| 579 | + RoundButton( | ||
| 580 | + text: '立即完成', | ||
| 581 | + | ||
| 582 | + padding: EdgeInsets.symmetric( | ||
| 583 | + horizontal: ScreenUtil() | ||
| 584 | + .setWidth(26)), | ||
| 585 | + gradientStart: | ||
| 586 | + MyColours.color_199095, | ||
| 587 | + gradientEnd: | ||
| 588 | + MyColours.color_199095, | ||
| 589 | + // borderColor: MyColours.color_999999, | ||
| 590 | + radius: | ||
| 591 | + ScreenUtil().setWidth(40), | ||
| 592 | + height: | ||
| 593 | + ScreenUtil().setWidth(64), | ||
| 594 | + width: | ||
| 595 | + ScreenUtil().setWidth(180), | ||
| 596 | + fontSize: 26, | ||
| 597 | + isBold: false, | ||
| 598 | + onPressed: () { | ||
| 599 | + SellerList sellerList = | ||
| 600 | + SellerList.fromJson( | ||
| 601 | + json.decode(json | ||
| 602 | + .encode(data))); | ||
| 603 | + NavigatorUtil | ||
| 604 | + .goMyMakeMarkingPageOnlyShow( | ||
| 605 | + context, sellerList); | ||
| 606 | + }, | ||
| 607 | + ), | ||
| 608 | + data.remainingTime != null | ||
| 609 | + ? Padding( | ||
| 610 | + padding: EdgeInsets.only( | ||
| 611 | + top: ScreenUtil() | ||
| 612 | + .setWidth(6)), | ||
| 613 | + child: Text( | ||
| 614 | + '${data.remainingTime}天内', | ||
| 615 | + maxLines: 1, | ||
| 616 | + overflow: TextOverflow | ||
| 617 | + .ellipsis, | ||
| 618 | + style: TextStyle( | ||
| 619 | + color: | ||
| 620 | + Color.fromRGBO( | ||
| 621 | + 215, | ||
| 622 | + 30, | ||
| 623 | + 40, | ||
| 624 | + 1), | ||
| 625 | + fontSize: | ||
| 626 | + ScreenUtil() | ||
| 627 | + .setSp(26)), | ||
| 628 | + )) | ||
| 629 | + : SizedBox() | ||
| 630 | + ]) | ||
| 631 | + ], | ||
| 632 | + ), | ||
| 633 | + ), | ||
| 634 | + ], | ||
| 635 | + ); | ||
| 636 | + }), | ||
| 637 | + ListView.builder( | ||
| 638 | + controller: _controller, | ||
| 639 | + shrinkWrap: true, | ||
| 640 | + cacheExtent: ScreenUtil().setWidth(0), | ||
| 641 | + itemCount: customerProvider | ||
| 642 | + .guestSunmodel.tips.recover == | ||
| 643 | + null || | ||
| 644 | + customerProvider.guestSunmodel.tips | ||
| 645 | + .recover.length == | ||
| 646 | + 0 | ||
| 647 | + ? 0 | ||
| 648 | + : 1, | ||
| 649 | + itemBuilder: (BuildContext context, int index) { | ||
| 650 | + // locationState = state; | ||
| 651 | + | ||
| 652 | + return Column( | ||
| 653 | + children: [ | ||
| 654 | + VEmptyView(10), | ||
| 655 | + Container( | ||
| 656 | + color: MyColours.color_ffffff, | ||
| 657 | + padding: EdgeInsets.symmetric( | ||
| 658 | + horizontal: | ||
| 659 | + ScreenUtil().setWidth(20), | ||
| 660 | + vertical: | ||
| 661 | + ScreenUtil().setWidth(30)), | ||
| 662 | + child: Row( | ||
| 663 | + children: [ | ||
| 664 | + Image.asset( | ||
| 665 | + Utils.getImgPath('warning'), | ||
| 666 | + width: ScreenUtil().setWidth(42), | ||
| 667 | + ), | ||
| 668 | + HEmptyView(15), | ||
| 669 | + Expanded( | ||
| 670 | + child: Text( | ||
| 671 | + '${customerProvider.guestSunmodel.tips.recover[0]}', | ||
| 672 | + maxLines: 10, | ||
| 673 | + overflow: TextOverflow.ellipsis, | ||
| 674 | + style: TextStyle( | ||
| 675 | + color: MyColours.color_333333, | ||
| 676 | + fontSize: | ||
| 677 | + ScreenUtil().setSp(32)), | ||
| 678 | + )), | ||
| 679 | + HEmptyView(20), | ||
| 680 | + RoundButton( | ||
| 681 | + text: '一键追回', | ||
| 682 | + padding: EdgeInsets.symmetric( | ||
| 683 | + horizontal: ScreenUtil() | ||
| 684 | + .setWidth(26)), | ||
| 685 | + gradientStart: | ||
| 686 | + MyColours.color_199095, | ||
| 687 | + gradientEnd: | ||
| 688 | + MyColours.color_199095, | ||
| 689 | + // borderColor: MyColours.color_999999, | ||
| 690 | + radius: ScreenUtil().setWidth(40), | ||
| 691 | + height: ScreenUtil().setWidth(64), | ||
| 692 | + width: ScreenUtil().setWidth(180), | ||
| 693 | + fontSize: 26, | ||
| 694 | + isBold: false, | ||
| 695 | + onPressed: () { | ||
| 696 | + NavigatorUtil.goMyMakeMarkingPage( | ||
| 697 | + context, | ||
| 698 | + fromPage: FromPage | ||
| 699 | + .FromPageMyCustomer, | ||
| 700 | + homeGid: Utils | ||
| 701 | + .listToStringEnglish1( | ||
| 702 | + customerProvider | ||
| 703 | + .guestSunmodel | ||
| 704 | + .tips | ||
| 705 | + .recover[1])); | ||
| 706 | + }, | ||
| 707 | + ), | ||
| 708 | + ], | ||
| 709 | + ), | ||
| 710 | + ), | ||
| 711 | + ], | ||
| 712 | + ); | ||
| 713 | + }), | ||
| 714 | + ListView.builder( | ||
| 715 | + controller: _controller, | ||
| 716 | + shrinkWrap: true, | ||
| 717 | + cacheExtent: ScreenUtil().setWidth(0), | ||
| 718 | + itemCount: customerProvider | ||
| 719 | + .guestSunmodel.tips.awaken == | ||
| 720 | + null || | ||
| 721 | + customerProvider.guestSunmodel.tips | ||
| 722 | + .awaken.length == | ||
| 723 | + 0 | ||
| 724 | + ? 0 | ||
| 725 | + : 1, | ||
| 726 | + itemBuilder: (BuildContext context, int index) { | ||
| 727 | + // locationState = state; | ||
| 728 | + | ||
| 729 | + return Column( | ||
| 730 | + children: [ | ||
| 731 | + VEmptyView(10), | ||
| 732 | + Container( | ||
| 733 | + color: MyColours.color_ffffff, | ||
| 734 | + padding: EdgeInsets.symmetric( | ||
| 735 | + horizontal: | ||
| 736 | + ScreenUtil().setWidth(20), | ||
| 737 | + vertical: | ||
| 738 | + ScreenUtil().setWidth(30)), | ||
| 739 | + child: Row( | ||
| 740 | + children: [ | ||
| 741 | + Image.asset( | ||
| 742 | + Utils.getImgPath('warning'), | ||
| 743 | + width: ScreenUtil().setWidth(42), | ||
| 744 | + ), | ||
| 745 | + HEmptyView(15), | ||
| 746 | + Expanded( | ||
| 747 | + child: Text( | ||
| 748 | + '${customerProvider.guestSunmodel.tips.awaken[0]}', | ||
| 749 | + maxLines: 10, | ||
| 750 | + overflow: TextOverflow.ellipsis, | ||
| 751 | + style: TextStyle( | ||
| 752 | + color: MyColours.color_333333, | ||
| 753 | + fontSize: | ||
| 754 | + ScreenUtil().setSp(32)), | ||
| 755 | + )), | ||
| 756 | + HEmptyView(20), | ||
| 757 | + RoundButton( | ||
| 758 | + text: '一键唤醒', | ||
| 759 | + padding: EdgeInsets.symmetric( | ||
| 760 | + horizontal: ScreenUtil() | ||
| 761 | + .setWidth(26)), | ||
| 762 | + gradientStart: | ||
| 763 | + MyColours.color_199095, | ||
| 764 | + gradientEnd: | ||
| 765 | + MyColours.color_199095, | ||
| 766 | + // borderColor: MyColours.color_999999, | ||
| 767 | + radius: ScreenUtil().setWidth(40), | ||
| 768 | + height: ScreenUtil().setWidth(64), | ||
| 769 | + width: ScreenUtil().setWidth(180), | ||
| 770 | + fontSize: 26, | ||
| 771 | + isBold: false, | ||
| 772 | + onPressed: () { | ||
| 773 | + NavigatorUtil.goMyMakeMarkingPage( | ||
| 774 | + context, | ||
| 775 | + fromPage: FromPage | ||
| 776 | + .FromPageMyCustomer, | ||
| 777 | + homeGid: Utils | ||
| 778 | + .listToStringEnglish1( | ||
| 779 | + customerProvider | ||
| 780 | + .guestSunmodel | ||
| 781 | + .tips | ||
| 782 | + .awaken[1])); | ||
| 783 | + }, | ||
| 784 | + ), | ||
| 785 | + ], | ||
| 786 | + ), | ||
| 787 | + ), | ||
| 788 | + ], | ||
| 789 | + ); | ||
| 790 | + }), | ||
| 791 | + _chart(), | ||
| 792 | + ListView.builder( | ||
| 793 | + itemCount: 10, | ||
| 794 | + shrinkWrap: true, | ||
| 795 | + controller: _controller, | ||
| 796 | + padding: | ||
| 797 | + EdgeInsets.symmetric(horizontal: w(10)), | ||
| 798 | + itemBuilder: (context, index) { | ||
| 799 | + return MonthItem(); | ||
| 800 | + }) | ||
| 801 | + ], | ||
| 802 | + ), | ||
| 803 | + )), | ||
| 804 | + Container( | ||
| 805 | + color: MyColours.color_FAFAFA, | ||
| 806 | + padding: EdgeInsets.only( | ||
| 807 | + top: w(13), | ||
| 808 | + bottom: w(26), | ||
| 809 | + left: w(45), | ||
| 810 | + right: (45)), | ||
| 811 | + child: Stack( | ||
| 812 | + children: [ | ||
| 813 | + RoundButton( | ||
| 814 | + onPressed: () { | ||
| 815 | + NavigatorUtil.goMyMarketingRecordsPage( | ||
| 816 | + context, FromPage.FromPageMyCustomer); | ||
| 817 | + }, | ||
| 818 | + text: '历史营销记录', | ||
| 819 | + fontSize: 32, | ||
| 820 | + isBold: true, | ||
| 821 | + // margin: EdgeInsets.only( | ||
| 822 | + // top: w(13), | ||
| 823 | + // bottom: w(26), | ||
| 824 | + // left: w(45), | ||
| 825 | + // right: (45)), | ||
| 826 | + textColor: MyColours.color_F8F9FD, | ||
| 827 | + gradientStart: MyColours.color_199095, | ||
| 828 | + gradientEnd: MyColours.color_199095, | ||
| 829 | + borderColor: MyColours.color_199095, | ||
| 830 | + height: ScreenUtil().setWidth(86), | ||
| 831 | + // width: ScreenUtil().setWidth(260), | ||
| 832 | + radius: ScreenUtil().setWidth(10), | ||
| 833 | + ), | ||
| 834 | + showWarning | ||
| 835 | + ? Positioned( | ||
| 836 | + right: ScreenUtil().setWidth(30), | ||
| 837 | + top: ScreenUtil().setWidth(45 / 2), | ||
| 838 | + child: Image.asset( | ||
| 839 | + Utils.getImgPath('warning'), | ||
| 840 | + width: ScreenUtil().setWidth(35), | ||
| 841 | + )) | ||
| 842 | + : SizedBox() | ||
| 843 | + ], | ||
| 844 | + )) | ||
| 845 | + ]); | ||
| 846 | + } | ||
| 847 | + })) | ||
| 848 | + ], | ||
| 849 | + ))); | ||
| 850 | + } | ||
| 851 | +} |
| @@ -182,6 +182,7 @@ import '../pages/feast/feast_wine_page.dart'; | @@ -182,6 +182,7 @@ import '../pages/feast/feast_wine_page.dart'; | ||
| 182 | import '../pages/message/message_recharge_info_page.dart'; | 182 | import '../pages/message/message_recharge_info_page.dart'; |
| 183 | import '../pages/my/customer_type/my_customer/my_customer_home_page.dart'; | 183 | import '../pages/my/customer_type/my_customer/my_customer_home_page.dart'; |
| 184 | import '../pages/my/customer_type/store_customer/store_customer_home_page.dart'; | 184 | import '../pages/my/customer_type/store_customer/store_customer_home_page.dart'; |
| 185 | +import '../pages/my/customer_type/store_customer/store_customer_home_left_page.dart'; | ||
| 185 | import '../pages/my/feast_manage/feast_deposit_type_page.dart'; | 186 | import '../pages/my/feast_manage/feast_deposit_type_page.dart'; |
| 186 | import '../pages/my/feast_manage/feast_dish_page.dart'; | 187 | import '../pages/my/feast_manage/feast_dish_page.dart'; |
| 187 | import '../pages/my/feast_manage/feast_dish_share_page.dart'; | 188 | import '../pages/my/feast_manage/feast_dish_share_page.dart'; |
-
Please register or login to post a comment