Commit fc2df683e8fb8c58d31549892083a0a3b206e33c

Authored by wdn127929
1 parent 4873126e

全店

@@ -2,6 +2,8 @@ import 'package:flutter/material.dart'; @@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
2 2
3 import 'package:flutter_screenutil/screenutil.dart'; 3 import 'package:flutter_screenutil/screenutil.dart';
4 import 'package:one_key/constant/state.dart'; 4 import 'package:one_key/constant/state.dart';
  5 +import 'package:one_key/models/customer_label_model.dart';
  6 +import 'package:one_key/models/filter_btn_model.dart';
5 7
6 import 'package:one_key/pages/my/customer_type/store_customer/contant_list_page.dart'; 8 import 'package:one_key/pages/my/customer_type/store_customer/contant_list_page.dart';
7 import 'package:one_key/provider/customer_making_provider.dart'; 9 import 'package:one_key/provider/customer_making_provider.dart';
@@ -25,11 +27,15 @@ import 'package:one_key/widgets/v_empty_view.dart'; @@ -25,11 +27,15 @@ import 'package:one_key/widgets/v_empty_view.dart';
25 import 'package:provider/provider.dart'; 27 import 'package:provider/provider.dart';
26 28
27 typedef ClickCallback = void Function(dynamic value); 29 typedef ClickCallback = void Function(dynamic value);
  30 +typedef ClickCall = void Function(FilterBtnModel value);
  31 +typedef ClickCallState = void Function(StateSetter state);
28 32
29 class CustomerListPage extends StatefulWidget { 33 class CustomerListPage extends StatefulWidget {
30 final FromPage fromPage; 34 final FromPage fromPage;
  35 + final String index;
31 36
32 - const CustomerListPage({Key key, this.fromPage}) : super(key: key); 37 + const CustomerListPage({Key key, this.fromPage, this.index})
  38 + : super(key: key);
33 @override 39 @override
34 _CustomerListPageState createState() => _CustomerListPageState(); 40 _CustomerListPageState createState() => _CustomerListPageState();
35 } 41 }
@@ -53,6 +59,7 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -53,6 +59,7 @@ class _CustomerListPageState extends State<CustomerListPage>
53 // timeTilte = ['大于', '等于', '小于']; 59 // timeTilte = ['大于', '等于', '小于'];
54 super.initState(); 60 super.initState();
55 tabController = TabController(length: 4, vsync: this); 61 tabController = TabController(length: 4, vsync: this);
  62 + tabController.index = int.parse(widget.index);
56 tabController.addListener(() { 63 tabController.addListener(() {
57 if (tabController.index == tabController.animation.value) { 64 if (tabController.index == tabController.animation.value) {
58 if (customerProvider.index == tabController.index) { 65 if (customerProvider.index == tabController.index) {
@@ -60,12 +67,36 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -60,12 +67,36 @@ class _CustomerListPageState extends State<CustomerListPage>
60 } 67 }
61 print(tabController.index); 68 print(tabController.index);
62 customerProvider.index = tabController.index; 69 customerProvider.index = tabController.index;
  70 + if (customerProvider.index != 0 && customerProvider.index != null) {
  71 + //1 活跃 2 沉睡 3 流失
  72 + for (FilterBtnModel item in customerProvider.filterHydList) {
  73 + item.select = false;
  74 + if (item.id == '${customerProvider.index}') {
  75 + item.select = true;
  76 + }
  77 + }
  78 + } else if (customerProvider.index == 0) {
  79 + customerProvider.hydSelAll = true;
  80 + for (FilterBtnModel item in customerProvider.filterHydList) {
  81 + item.select = true;
  82 + }
  83 + }
63 _getContantData(); 84 _getContantData();
64 } 85 }
65 }); 86 });
66 WidgetsBinding.instance.addPostFrameCallback((_) async { 87 WidgetsBinding.instance.addPostFrameCallback((_) async {
67 - _getContantData(); 88 + bool first = true;
  89 + customerProvider.index = tabController.index;
  90 + if (widget.fromPage == FromPage.FromPageMakeRecord) {
  91 + customerProvider.selectCustomerSeller = customerMakingProvider.selectCustomerSeller;
  92 + customerProvider.labels = customerMakingProvider.labels;
  93 + first = false;
  94 + }
  95 + customerProvider.initData();
  96 + _getContantData(first: first);
  97 + _filterLabelList();
68 }); 98 });
  99 +
69 bus.on("refresh_guest_list", (arg) { 100 bus.on("refresh_guest_list", (arg) {
70 _getContantData(); 101 _getContantData();
71 }); 102 });
@@ -77,7 +108,22 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -77,7 +108,22 @@ class _CustomerListPageState extends State<CustomerListPage>
77 super.dispose(); 108 super.dispose();
78 } 109 }
79 110
80 - _getContantData({bool showLoading = true}) async { 111 + _filterLabelList() async {
  112 + await customerProvider.getLabelBySellerid(context);
  113 + if (customerProvider.labelList != null &&
  114 + customerProvider.labelList.length > 0) {
  115 + customerProvider.filterLabelList = [];
  116 + for (CustomerLabelSunModel item in customerProvider.labelList) {
  117 + FilterBtnModel model = FilterBtnModel();
  118 + model.title = item.label;
  119 + model.id = item.id;
  120 + model.select = false;
  121 + customerProvider.filterLabelList.add(model);
  122 + }
  123 + }
  124 + }
  125 +
  126 + _getContantData({bool showLoading = true, bool first = false}) async {
81 if (showLoading) { 127 if (showLoading) {
82 customerProvider.pageState = PageState.Loading; 128 customerProvider.pageState = PageState.Loading;
83 } 129 }
@@ -85,23 +131,62 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -85,23 +131,62 @@ class _CustomerListPageState extends State<CustomerListPage>
85 Map<String, String> params = { 131 Map<String, String> params = {
86 "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid, 132 "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
87 }; 133 };
  134 +
88 if (customerProvider.index != 0 && customerProvider.index != null) { 135 if (customerProvider.index != 0 && customerProvider.index != null) {
89 - params['active'] = '${customerProvider.index}'; //1 活跃 2 沉睡 3 流失 136 + //1 活跃 2 沉睡 3 流失
  137 + for (FilterBtnModel item in customerProvider.filterHydList) {
  138 + if (item.id == '${customerProvider.index}') {
  139 + item.select = true;
  140 + }
  141 + }
90 } 142 }
  143 + String active = '';
  144 + for (FilterBtnModel item in customerProvider.filterHydList) {
  145 + if (item.select) {
  146 + active += '${item.id},';
  147 + }
  148 + }
  149 + if (active.length > 0) {
  150 + if (active.endsWith(',')) {
  151 + active = active.substring(0, active.length - 1);
  152 + }
  153 + params['active'] = active;
  154 + }
  155 +
91 if (customerProvider.controller.text.trim().length > 0) { 156 if (customerProvider.controller.text.trim().length > 0) {
92 params['keyword'] = customerProvider.controller.text; //搜索手机号/姓名 157 params['keyword'] = customerProvider.controller.text; //搜索手机号/姓名
93 } 158 }
  159 + String labels = '';
  160 + for (FilterBtnModel item in customerProvider.filterLabelList) {
  161 + if (item.select) {
  162 + labels += '${item.id},';
  163 + }
  164 + }
  165 + if (labels.length > 0) {
  166 + if (labels.endsWith(',')) {
  167 + labels = labels.substring(0, labels.length - 1);
  168 + }
  169 + params['labelid'] = labels;
  170 + }
94 // 171 //
95 // 172 //
96 // params['uid'] 经理ID 173 // params['uid'] 经理ID
97 - // params['labelid'] 标签ID  
98 - // params['stime'] 起始天数,例: 60  
99 - // params['etime'] 截止天数,例: 120  
100 - // params['reserve_date'] XX天内,例:30  
101 - // params['reserve_num'] 时间内预定次数  
102 - // params['reserve_sort'] 1 等于 2 小于 3 大于 174 +
  175 + if (customerProvider.controllerstime.text.trim().length > 0) {
  176 + params['stime'] = customerProvider.controllerstime.text;
  177 + }
  178 + if (customerProvider.controlleretime.text.trim().length > 0) {
  179 + params['etime'] = customerProvider.controlleretime.text;
  180 + }
  181 + if (customerProvider.controllernum.text.trim().length > 0) {
  182 + params['reserve_num'] = customerProvider.controlleretime.text;
  183 + params['reserve_sort'] = '${dropValue + 1}';
  184 + }
103 185
104 await customerProvider.getCustomerBySeller(context, params); 186 await customerProvider.getCustomerBySeller(context, params);
  187 + if (first) {
  188 + customerProvider.addAll();
  189 + }
105 } 190 }
106 191
107 // ///选中的联系人widget 192 // ///选中的联系人widget
@@ -127,9 +212,9 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -127,9 +212,9 @@ class _CustomerListPageState extends State<CustomerListPage>
127 InkWell( 212 InkWell(
128 onTap: () { 213 onTap: () {
129 if (customerProvider.checkValue) { 214 if (customerProvider.checkValue) {
130 - // customerProvider.cancelAll(); 215 + customerProvider.cancelAll();
131 } else { 216 } else {
132 - // customerProvider.addAll(); 217 + customerProvider.addAll();
133 } 218 }
134 }, 219 },
135 child: Row( 220 child: Row(
@@ -154,20 +239,29 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -154,20 +239,29 @@ class _CustomerListPageState extends State<CustomerListPage>
154 Expanded( 239 Expanded(
155 child: InkWell( 240 child: InkWell(
156 onTap: () { 241 onTap: () {
157 - if (customerProvider.selectCustomer == null ||  
158 - customerProvider.selectCustomer.length == 0) { 242 + if (customerProvider.selectCustomerSeller == null ||
  243 + customerProvider.selectCustomerSeller.length == 0) {
159 Utils.showToast('请至少选择1名顾客'); 244 Utils.showToast('请至少选择1名顾客');
160 return; 245 return;
161 } 246 }
162 if (widget.fromPage == FromPage.FromPageHome) { 247 if (widget.fromPage == FromPage.FromPageHome) {
163 customerMakingProvider.labels = customerProvider.labels; 248 customerMakingProvider.labels = customerProvider.labels;
164 - customerMakingProvider.selectCustomer =  
165 - customerProvider.selectCustomer; 249 + customerMakingProvider.selectCustomerSeller =
  250 + customerProvider.selectCustomerSeller;
166 customerMakingProvider.fromPage = widget.fromPage; 251 customerMakingProvider.fromPage = widget.fromPage;
167 NavigatorUtil.goMakeMarkingPage(context, 252 NavigatorUtil.goMakeMarkingPage(context,
168 fromPage: FromPage.FromPageCustomerList); 253 fromPage: FromPage.FromPageCustomerList);
169 } else { 254 } else {
  255 + customerMakingProvider.labels = customerProvider.labels;
  256 + customerMakingProvider.selectCustomerSeller =
  257 + customerProvider.selectCustomerSeller;
  258 + customerMakingProvider.fromPage = widget.fromPage;
170 Navigator.pop(context); 259 Navigator.pop(context);
  260 + // Map temp = {
  261 + // 'labels': customerProvider.labels,
  262 + // 'selectCustomerSeller': customerProvider.selectCustomerSeller
  263 + // };
  264 + // Navigator.of(context).pop(temp);
171 } 265 }
172 }, 266 },
173 child: Container( 267 child: Container(
@@ -178,7 +272,7 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -178,7 +272,7 @@ class _CustomerListPageState extends State<CustomerListPage>
178 BorderRadius.circular(ScreenUtil().setWidth(40)), 272 BorderRadius.circular(ScreenUtil().setWidth(40)),
179 color: MyColours.color_199095), 273 color: MyColours.color_199095),
180 child: Text( 274 child: Text(
181 - '已选[${customerProvider.labels}]${customerProvider.selectCustomer.length}位顾客,下发营销任务', 275 + '已选[${customerProvider.labels}]${customerProvider.selectCustomerSeller.length}位顾客,下发营销任务',
182 overflow: TextOverflow.ellipsis, 276 overflow: TextOverflow.ellipsis,
183 maxLines: 1, 277 maxLines: 1,
184 style: TextStyle( 278 style: TextStyle(
@@ -268,10 +362,12 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -268,10 +362,12 @@ class _CustomerListPageState extends State<CustomerListPage>
268 // setState(() {}); 362 // setState(() {});
269 // _searchSellerLocation(); 363 // _searchSellerLocation();
270 // customerProvider.searchData(value); 364 // customerProvider.searchData(value);
  365 + _getContantData(showLoading: false);
271 }, 366 },
272 onEditingComplete: () { 367 onEditingComplete: () {
273 FocusScope.of(context) 368 FocusScope.of(context)
274 .requestFocus(FocusNode()); //点击空白处隐藏键盘 369 .requestFocus(FocusNode()); //点击空白处隐藏键盘
  370 + _getContantData(showLoading: false);
275 // contantShowModel.searchData( 371 // contantShowModel.searchData(
276 // contantShowModel.controller.text); 372 // contantShowModel.controller.text);
277 // _searchSellerLocation(); 373 // _searchSellerLocation();
@@ -298,6 +394,9 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -298,6 +394,9 @@ class _CustomerListPageState extends State<CustomerListPage>
298 onTap: () { 394 onTap: () {
299 WidgetsBinding.instance.addPostFrameCallback(((_) { 395 WidgetsBinding.instance.addPostFrameCallback(((_) {
300 customerProvider.controller.clear(); 396 customerProvider.controller.clear();
  397 + FocusScope.of(context)
  398 + .requestFocus(FocusNode()); //点击空白处隐藏键盘
  399 + _getContantData(showLoading: false);
301 // customerProvider.searchData(''); 400 // customerProvider.searchData('');
302 })); 401 }));
303 }, 402 },
@@ -377,16 +476,33 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -377,16 +476,33 @@ class _CustomerListPageState extends State<CustomerListPage>
377 showFilter = !showFilter; 476 showFilter = !showFilter;
378 }); 477 });
379 if (showFilter) { 478 if (showFilter) {
380 - _showFilterDialogFromTop(context, onPressedReset: () {  
381 - Navigator.of(context).pop();  
382 - setState(() {  
383 - showFilter = false; 479 + _showFilterDialogFromTop(context, onPressedReset: (state) {
  480 + // Navigator.of(context).pop();
  481 + // setState(() {
  482 + // showFilter = false;
  483 + // });
  484 + state(() {
  485 + customerProvider.hydSelAll = false;
  486 + for (FilterBtnModel item
  487 + in customerProvider.filterHydList) {
  488 + item.select = false;
  489 + }
  490 + customerProvider.labelSelAll = false;
  491 + for (FilterBtnModel item
  492 + in customerProvider.filterLabelList) {
  493 + item.select = false;
  494 + }
  495 + customerProvider.controllerstime.text = '';
  496 + customerProvider.controlleretime.text = '';
  497 + customerProvider.controllernum.text = '';
  498 + dropValue = 0;
384 }); 499 });
385 }, onPressedComplete: () { 500 }, onPressedComplete: () {
386 Navigator.of(context).pop(); 501 Navigator.of(context).pop();
387 setState(() { 502 setState(() {
388 showFilter = false; 503 showFilter = false;
389 }); 504 });
  505 + _getContantData();
390 }, tapWhiteBack: () { 506 }, tapWhiteBack: () {
391 // Navigator.of(context).pop(); 507 // Navigator.of(context).pop();
392 // setState(() { 508 // setState(() {
@@ -424,7 +540,7 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -424,7 +540,7 @@ class _CustomerListPageState extends State<CustomerListPage>
424 540
425 ///筛选弹框 541 ///筛选弹框
426 _showFilterDialogFromTop(BuildContext context, 542 _showFilterDialogFromTop(BuildContext context,
427 - {VoidCallback onPressedReset, 543 + {ClickCallState onPressedReset,
428 VoidCallback onPressedComplete, 544 VoidCallback onPressedComplete,
429 GestureTapCallback tapWhiteBack}) { 545 GestureTapCallback tapWhiteBack}) {
430 showGeneralDialog( 546 showGeneralDialog(
@@ -499,7 +615,7 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -499,7 +615,7 @@ class _CustomerListPageState extends State<CustomerListPage>
499 } 615 }
500 616
501 ///活跃度 617 ///活跃度
502 - Widget _activityWidget() { 618 + Widget _activityWidget(state) {
503 return Column( 619 return Column(
504 crossAxisAlignment: CrossAxisAlignment.start, 620 crossAxisAlignment: CrossAxisAlignment.start,
505 children: [ 621 children: [
@@ -508,9 +624,29 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -508,9 +624,29 @@ class _CustomerListPageState extends State<CustomerListPage>
508 children: [ 624 children: [
509 _textWidget('活跃度', MyColours.color_333333, FontWeight.bold, 28), 625 _textWidget('活跃度', MyColours.color_333333, FontWeight.bold, 28),
510 GestureDetector( 626 GestureDetector(
511 - onTap: () {},  
512 - child: _textWidget(  
513 - '全选', MyColours.color_199095, FontWeight.normal, 24), 627 + onTap: () {
  628 + state(() {
  629 + customerProvider.hydSelAll = !customerProvider.hydSelAll;
  630 + if (customerProvider.hydSelAll) {
  631 + for (FilterBtnModel item
  632 + in customerProvider.filterHydList) {
  633 + item.select = true;
  634 + }
  635 + } else {
  636 + for (FilterBtnModel item
  637 + in customerProvider.filterHydList) {
  638 + item.select = false;
  639 + }
  640 + }
  641 + });
  642 + },
  643 + child: Container(
  644 + color: Colors.white,
  645 + height: ScreenUtil().setWidth(40),
  646 + alignment: Alignment.center,
  647 + padding: EdgeInsets.only(left: ScreenUtil().setWidth(130)),
  648 + child: _textWidget(customerProvider.hydSelAll ? '全不选' : '全选',
  649 + MyColours.color_199095, FontWeight.normal, 24)),
514 ) 650 )
515 ], 651 ],
516 ), 652 ),
@@ -518,24 +654,18 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -518,24 +654,18 @@ class _CustomerListPageState extends State<CustomerListPage>
518 Wrap( 654 Wrap(
519 spacing: ScreenUtil().setWidth(20), 655 spacing: ScreenUtil().setWidth(20),
520 runSpacing: ScreenUtil().setWidth(20), 656 runSpacing: ScreenUtil().setWidth(20),
521 - children: _buildFilterItem([  
522 - {'title': 'kkkk', 'select': false},  
523 - {'title': 'kkkk', 'select': true},  
524 - {'title': 'kkkk', 'select': true},  
525 - {'title': 'kkkk', 'select': true},  
526 - {'title': 'k', 'select': true},  
527 - {'title': 'kkkk', 'select': true},  
528 - {'title': 'kkkk', 'select': true},  
529 - {'title': 'k', 'select': true},  
530 - {'title': 'kdsfjsfsdfhjsdfh', 'select': true},  
531 - {'title': 'kkkk', 'select': true},  
532 - ], false)), 657 + children: _buildFilterItem(customerProvider.filterHydList, false,
  658 + (FilterBtnModel item) {
  659 + state(() {
  660 + item.select = !item.select;
  661 + });
  662 + })),
533 ], 663 ],
534 ); 664 );
535 } 665 }
536 666
537 ///自定义标签 667 ///自定义标签
538 - Widget _labelWidget() { 668 + Widget _labelWidget(StateSetter state) {
539 return Column( 669 return Column(
540 crossAxisAlignment: CrossAxisAlignment.start, 670 crossAxisAlignment: CrossAxisAlignment.start,
541 children: [ 671 children: [
@@ -544,28 +674,45 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -544,28 +674,45 @@ class _CustomerListPageState extends State<CustomerListPage>
544 children: [ 674 children: [
545 _textWidget('自定义标签', MyColours.color_333333, FontWeight.bold, 28), 675 _textWidget('自定义标签', MyColours.color_333333, FontWeight.bold, 28),
546 GestureDetector( 676 GestureDetector(
547 - onTap: () {},  
548 - child: _textWidget(  
549 - '全选', MyColours.color_199095, FontWeight.normal, 24),  
550 - ) 677 + onTap: () {
  678 + state(() {
  679 + customerProvider.labelSelAll =
  680 + !customerProvider.labelSelAll;
  681 + if (customerProvider.labelSelAll) {
  682 + for (FilterBtnModel item
  683 + in customerProvider.filterLabelList) {
  684 + item.select = true;
  685 + }
  686 + } else {
  687 + for (FilterBtnModel item
  688 + in customerProvider.filterLabelList) {
  689 + item.select = false;
  690 + }
  691 + }
  692 + });
  693 + },
  694 + child: Container(
  695 + color: Colors.white,
  696 + height: ScreenUtil().setWidth(40),
  697 + alignment: Alignment.center,
  698 + padding: EdgeInsets.only(left: ScreenUtil().setWidth(130)),
  699 + child: _textWidget(
  700 + customerProvider.labelSelAll ? '全不选' : '全选',
  701 + MyColours.color_199095,
  702 + FontWeight.normal,
  703 + 24))),
551 ], 704 ],
552 ), 705 ),
553 VEmptyView(30), 706 VEmptyView(30),
554 Wrap( 707 Wrap(
555 spacing: ScreenUtil().setWidth(20), 708 spacing: ScreenUtil().setWidth(20),
556 runSpacing: ScreenUtil().setWidth(20), 709 runSpacing: ScreenUtil().setWidth(20),
557 - children: _buildFilterItem([  
558 - {'title': 'kkkk', 'select': false},  
559 - {'title': 'kkkk', 'select': true},  
560 - {'title': 'kkkk', 'select': true},  
561 - {'title': 'kkkk', 'select': true},  
562 - {'title': 'k', 'select': true},  
563 - {'title': 'kkkk', 'select': true},  
564 - {'title': 'kkkk', 'select': true},  
565 - {'title': 'k', 'select': true},  
566 - {'title': 'kdsfjsfsdfhjsdfh', 'select': false},  
567 - {'title': 'kkkk', 'select': true},  
568 - ], true)), 710 + children: _buildFilterItem(customerProvider.filterLabelList, true,
  711 + (FilterBtnModel item) {
  712 + state(() {
  713 + item.select = !item.select;
  714 + });
  715 + })),
569 ], 716 ],
570 ); 717 );
571 } 718 }
@@ -624,7 +771,7 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -624,7 +771,7 @@ class _CustomerListPageState extends State<CustomerListPage>
624 } 771 }
625 772
626 ///高级筛选 773 ///高级筛选
627 - Widget _advancedFilterWidget(state) { 774 + Widget _advancedFilterWidget(StateSetter state) {
628 return Column( 775 return Column(
629 crossAxisAlignment: CrossAxisAlignment.start, 776 crossAxisAlignment: CrossAxisAlignment.start,
630 children: [ 777 children: [
@@ -633,32 +780,54 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -633,32 +780,54 @@ class _CustomerListPageState extends State<CustomerListPage>
633 children: [ 780 children: [
634 _textWidget('高级筛选', MyColours.color_333333, FontWeight.bold, 28), 781 _textWidget('高级筛选', MyColours.color_333333, FontWeight.bold, 28),
635 GestureDetector( 782 GestureDetector(
636 - onTap: () {},  
637 - child: _textWidget(  
638 - '清空', MyColours.color_199095, FontWeight.normal, 24),  
639 - ) 783 + onTap: () {
  784 + customerProvider.controllerstime.text = '';
  785 + customerProvider.controlleretime.text = '';
  786 + customerProvider.controllernum.text = '';
  787 + state(() {
  788 + dropValue = 0;
  789 + });
  790 + },
  791 + child: Container(
  792 + color: Colors.white,
  793 + height: ScreenUtil().setWidth(40),
  794 + alignment: Alignment.center,
  795 + padding: EdgeInsets.only(left: ScreenUtil().setWidth(130)),
  796 + child: _textWidget(
  797 + '清空', MyColours.color_199095, FontWeight.normal, 24),
  798 + ))
640 ], 799 ],
641 ), 800 ),
642 VEmptyView(30), 801 VEmptyView(30),
643 Row( 802 Row(
644 children: [ 803 children: [
645 - Expanded(child: _textFeildWidget()), 804 + Expanded(
  805 + child: _textFeildWidget(customerProvider.controllerstime,
  806 + customerProvider.stimeFocus)),
646 HEmptyView(10), 807 HEmptyView(10),
647 _textWidget('至', MyColours.color_199095, FontWeight.normal, 24), 808 _textWidget('至', MyColours.color_199095, FontWeight.normal, 24),
648 HEmptyView(10), 809 HEmptyView(10),
649 - Expanded(child: _textFeildWidget()), 810 + Expanded(
  811 + child: _textFeildWidget(customerProvider.controlleretime,
  812 + customerProvider.etimeFocus)),
650 ], 813 ],
651 ), 814 ),
652 VEmptyView(30), 815 VEmptyView(30),
653 Wrap( 816 Wrap(
654 spacing: ScreenUtil().setWidth(20), 817 spacing: ScreenUtil().setWidth(20),
655 runSpacing: ScreenUtil().setWidth(20), 818 runSpacing: ScreenUtil().setWidth(20),
656 - children: _buildFilterItem([  
657 - {'title': '7天', 'select': true},  
658 - {'title': '30天', 'select': true},  
659 - {'title': '60天', 'select': true},  
660 - {'title': '120天', 'select': true},  
661 - ], true, grayBack: true)), 819 + children: _buildFilterItem(customerProvider.filterDayList, true,
  820 + (FilterBtnModel item) {
  821 + if (customerProvider.stimeFocus.hasFocus) {
  822 + customerProvider.controllerstime.text = item.id;
  823 + }
  824 + if (customerProvider.etimeFocus.hasFocus) {
  825 + customerProvider.controlleretime.text = item.id;
  826 + }
  827 + // state(() {
  828 + // item.select = !item.select;
  829 + // });
  830 + }, grayBack: true)),
662 VEmptyView(30), 831 VEmptyView(30),
663 _textWidget('时间内预订次数', MyColours.color_333333, FontWeight.normal, 24), 832 _textWidget('时间内预订次数', MyColours.color_333333, FontWeight.normal, 24),
664 VEmptyView(30), 833 VEmptyView(30),
@@ -729,6 +898,8 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -729,6 +898,8 @@ class _CustomerListPageState extends State<CustomerListPage>
729 ), 898 ),
730 onChanged: (value) { 899 onChanged: (value) {
731 print(value); 900 print(value);
  901 + FocusScope.of(context)
  902 + .requestFocus(FocusNode()); //点击空白处隐藏键盘
732 state(() => dropValue = value); 903 state(() => dropValue = value);
733 }))), 904 }))),
734 HEmptyView(20), 905 HEmptyView(20),
@@ -749,7 +920,7 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -749,7 +920,7 @@ class _CustomerListPageState extends State<CustomerListPage>
749 color: MyColours.color_ffffff, 920 color: MyColours.color_ffffff,
750 child: TextField( 921 child: TextField(
751 maxLines: 1, 922 maxLines: 1,
752 - controller: customerProvider.controller, 923 + controller: customerProvider.controllernum,
753 // focusNode: _focusNode, 924 // focusNode: _focusNode,
754 // autofocus: true, 925 // autofocus: true,
755 926
@@ -768,7 +939,7 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -768,7 +939,7 @@ class _CustomerListPageState extends State<CustomerListPage>
768 border: OutlineInputBorder(borderSide: BorderSide.none), 939 border: OutlineInputBorder(borderSide: BorderSide.none),
769 contentPadding: EdgeInsets.zero, 940 contentPadding: EdgeInsets.zero,
770 ), 941 ),
771 - keyboardType: TextInputType.text, 942 + keyboardType: TextInputType.number,
772 textInputAction: TextInputAction.done, 943 textInputAction: TextInputAction.done,
773 944
774 onChanged: (value) { 945 onChanged: (value) {
@@ -789,7 +960,7 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -789,7 +960,7 @@ class _CustomerListPageState extends State<CustomerListPage>
789 HEmptyView(20), 960 HEmptyView(20),
790 _textWidget('次预订', MyColours.color_333333, FontWeight.normal, 24), 961 _textWidget('次预订', MyColours.color_333333, FontWeight.normal, 24),
791 ]), 962 ]),
792 - VEmptyView(30), 963 + VEmptyView(50),
793 ], 964 ],
794 ); 965 );
795 } 966 }
@@ -830,7 +1001,8 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -830,7 +1001,8 @@ class _CustomerListPageState extends State<CustomerListPage>
830 } 1001 }
831 1002
832 /// 高级筛选输入框 1003 /// 高级筛选输入框
833 - Widget _textFeildWidget() { 1004 + Widget _textFeildWidget(
  1005 + TextEditingController controller, FocusNode focusNode) {
834 return Container( 1006 return Container(
835 padding: EdgeInsets.symmetric( 1007 padding: EdgeInsets.symmetric(
836 horizontal: ScreenUtil().setWidth(20), 1008 horizontal: ScreenUtil().setWidth(20),
@@ -846,8 +1018,8 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -846,8 +1018,8 @@ class _CustomerListPageState extends State<CustomerListPage>
846 Expanded( 1018 Expanded(
847 child: TextField( 1019 child: TextField(
848 maxLines: 1, 1020 maxLines: 1,
849 - controller: customerProvider.controller,  
850 - // focusNode: _focusNode, 1021 + controller: controller,
  1022 + focusNode: focusNode,
851 // autofocus: true, 1023 // autofocus: true,
852 1024
853 style: TextStyle( 1025 style: TextStyle(
@@ -855,7 +1027,7 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -855,7 +1027,7 @@ class _CustomerListPageState extends State<CustomerListPage>
855 fontSize: ScreenUtil().setSp(26)), 1027 fontSize: ScreenUtil().setSp(26)),
856 // textAlignVertical: TextAlignVertical.center, 1028 // textAlignVertical: TextAlignVertical.center,
857 decoration: InputDecoration( 1029 decoration: InputDecoration(
858 - hintText: "xxx", 1030 + hintText: "",
859 hintStyle: TextStyle( 1031 hintStyle: TextStyle(
860 color: MyColours.color_999999, 1032 color: MyColours.color_999999,
861 fontSize: ScreenUtil().setSp(26), 1033 fontSize: ScreenUtil().setSp(26),
@@ -865,7 +1037,7 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -865,7 +1037,7 @@ class _CustomerListPageState extends State<CustomerListPage>
865 border: OutlineInputBorder(borderSide: BorderSide.none), 1037 border: OutlineInputBorder(borderSide: BorderSide.none),
866 contentPadding: EdgeInsets.zero, 1038 contentPadding: EdgeInsets.zero,
867 ), 1039 ),
868 - keyboardType: TextInputType.text, 1040 + keyboardType: TextInputType.number,
869 textInputAction: TextInputAction.done, 1041 textInputAction: TextInputAction.done,
870 1042
871 onChanged: (value) { 1043 onChanged: (value) {
@@ -890,7 +1062,7 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -890,7 +1062,7 @@ class _CustomerListPageState extends State<CustomerListPage>
890 ///筛选布局 1062 ///筛选布局
891 Widget _filterWidget( 1063 Widget _filterWidget(
892 StateSetter state, 1064 StateSetter state,
893 - VoidCallback onPressedReset, 1065 + ClickCallState onPressedReset,
894 VoidCallback onPressedComplete, 1066 VoidCallback onPressedComplete,
895 ) { 1067 ) {
896 return Container( 1068 return Container(
@@ -919,33 +1091,34 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -919,33 +1091,34 @@ class _CustomerListPageState extends State<CustomerListPage>
919 child: Column( 1091 child: Column(
920 children: [ 1092 children: [
921 Expanded( 1093 Expanded(
922 - child: Scrollbar(  
923 - isAlwaysShown: true, //设置滚动条常亮  
924 - controller: _scrollCrl, //必须设置一个controller 1094 + // child: Scrollbar(
  1095 + // isAlwaysShown: true, //设置滚动条常亮
  1096 + // controller: _scrollCrl, //必须设置一个controller
925 1097
926 - ///添加进度条  
927 - child: SingleChildScrollView(  
928 - controller: _scrollCrl,  
929 - // primary: true,  
930 - // reverse: true,  
931 - // physics: BouncingScrollPhysics(),  
932 - // padding: EdgeInsets.only(  
933 - // bottom:  
934 - // MediaQuery.of(context).viewInsets.bottom),  
935 - child: Column(  
936 - crossAxisAlignment: CrossAxisAlignment.start,  
937 - children: [  
938 - VEmptyView(20),  
939 - _managerWidget(),  
940 - VEmptyView(30),  
941 - _activityWidget(),  
942 - VEmptyView(30),  
943 - _labelWidget(),  
944 - VEmptyView(30),  
945 - _advancedFilterWidget(state)  
946 - ],  
947 - ),  
948 - ))), 1098 + // ///添加进度条
  1099 + child: SingleChildScrollView(
  1100 + controller: _scrollCrl,
  1101 + // primary: true,
  1102 + // reverse: true,
  1103 + // physics: BouncingScrollPhysics(),
  1104 + // padding: EdgeInsets.only(
  1105 + // bottom:
  1106 + // MediaQuery.of(context).viewInsets.bottom),
  1107 + child: Column(
  1108 + crossAxisAlignment: CrossAxisAlignment.start,
  1109 + children: [
  1110 + VEmptyView(20),
  1111 + // _managerWidget(),
  1112 + // VEmptyView(30),
  1113 + _activityWidget(state),
  1114 + VEmptyView(30),
  1115 + _labelWidget(state),
  1116 + VEmptyView(30),
  1117 + _advancedFilterWidget(state)
  1118 + ],
  1119 + ),
  1120 + )),
  1121 + // ),
949 Row( 1122 Row(
950 children: [ 1123 children: [
951 Container( 1124 Container(
@@ -972,7 +1145,9 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -972,7 +1145,9 @@ class _CustomerListPageState extends State<CustomerListPage>
972 flex: 1, 1145 flex: 1,
973 child: Material( 1146 child: Material(
974 child: InkWell( 1147 child: InkWell(
975 - onTap: onPressedReset, 1148 + onTap: () {
  1149 + onPressedReset(state);
  1150 + },
976 child: Container( 1151 child: Container(
977 decoration: BoxDecoration( 1152 decoration: BoxDecoration(
978 color: MyColours.color_ffffff, 1153 color: MyColours.color_ffffff,
@@ -1028,44 +1203,51 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -1028,44 +1203,51 @@ class _CustomerListPageState extends State<CustomerListPage>
1028 } 1203 }
1029 1204
1030 //构建筛选按钮 1205 //构建筛选按钮
1031 - List<Widget> _buildFilterItem(List<Map> data, bool round, 1206 + List<Widget> _buildFilterItem(
  1207 + List<FilterBtnModel> data, bool round, ClickCall onTap,
1032 {bool grayBack = false}) { 1208 {bool grayBack = false}) {
1033 List<Widget> items = []; 1209 List<Widget> items = [];
1034 -  
1035 - for (Map item in data) {  
1036 - items.add(Container(  
1037 - padding: EdgeInsets.symmetric(  
1038 - horizontal: ScreenUtil().setWidth(20),  
1039 - vertical: ScreenUtil().setWidth(6)),  
1040 - decoration: BoxDecoration(  
1041 - color: grayBack  
1042 - ? Color.fromRGBO(239, 239, 239, 1)  
1043 - : item['select']  
1044 - ? MyColours.color_199095  
1045 - : MyColours.color_ffffff,  
1046 - border: Border.all(  
1047 - color: grayBack  
1048 - ? Color.fromRGBO(239, 239, 239, 1)  
1049 - : item['select']  
1050 - ? MyColours.color_199095  
1051 - : round  
1052 - ? Color.fromRGBO(155, 155, 155, 1)  
1053 - : MyColours.color_199095,  
1054 - width: ScreenUtil().setWidth(2)),  
1055 - borderRadius: BorderRadius.circular(  
1056 - ScreenUtil().setWidth(round ? 30 : 10))),  
1057 - child: _textWidget(  
1058 - item['title'],  
1059 - grayBack  
1060 - ? MyColours.color_333333  
1061 - : item['select']  
1062 - ? MyColours.color_ffffff  
1063 - : round  
1064 - ? MyColours.color_333333  
1065 - : MyColours.color_199095,  
1066 - FontWeight.normal,  
1067 - 24))); 1210 + if (data != null && data.length > 0) {
  1211 + for (FilterBtnModel item in data) {
  1212 + items.add(InkWell(
  1213 + onTap: () {
  1214 + onTap(item);
  1215 + },
  1216 + child: Container(
  1217 + padding: EdgeInsets.symmetric(
  1218 + horizontal: ScreenUtil().setWidth(20),
  1219 + vertical: ScreenUtil().setWidth(6)),
  1220 + decoration: BoxDecoration(
  1221 + color: grayBack
  1222 + ? Color.fromRGBO(239, 239, 239, 1)
  1223 + : item.select
  1224 + ? MyColours.color_199095
  1225 + : MyColours.color_ffffff,
  1226 + border: Border.all(
  1227 + color: grayBack
  1228 + ? Color.fromRGBO(239, 239, 239, 1)
  1229 + : item.select
  1230 + ? MyColours.color_199095
  1231 + : round
  1232 + ? Color.fromRGBO(155, 155, 155, 1)
  1233 + : MyColours.color_199095,
  1234 + width: ScreenUtil().setWidth(2)),
  1235 + borderRadius: BorderRadius.circular(
  1236 + ScreenUtil().setWidth(round ? 30 : 10))),
  1237 + child: _textWidget(
  1238 + item.title,
  1239 + grayBack
  1240 + ? MyColours.color_333333
  1241 + : item.select
  1242 + ? MyColours.color_ffffff
  1243 + : round
  1244 + ? MyColours.color_333333
  1245 + : MyColours.color_199095,
  1246 + FontWeight.normal,
  1247 + 24))));
  1248 + }
1068 } 1249 }
  1250 +
1069 return items; 1251 return items;
1070 } 1252 }
1071 1253
@@ -1125,7 +1307,8 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -1125,7 +1307,8 @@ class _CustomerListPageState extends State<CustomerListPage>
1125 controller: tabController, 1307 controller: tabController,
1126 physics: NeverScrollableScrollPhysics(), 1308 physics: NeverScrollableScrollPhysics(),
1127 children: _returnListWidget())), 1309 children: _returnListWidget())),
1128 - customerProvider.pageState == PageState.Success 1310 + customerProvider.pageState == PageState.Success &&
  1311 + customerProvider.selectCustomerSeller.length > 0
1129 ? _selectContantWidget() 1312 ? _selectContantWidget()
1130 : SizedBox(), 1313 : SizedBox(),
1131 1314
@@ -5,6 +5,7 @@ import 'package:flutter/material.dart'; @@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
5 import 'package:flutter_screenutil/screenutil.dart'; 5 import 'package:flutter_screenutil/screenutil.dart';
6 import 'package:flutter_sms/flutter_sms.dart'; 6 import 'package:flutter_sms/flutter_sms.dart';
7 import 'package:one_key/constant/state.dart'; 7 import 'package:one_key/constant/state.dart';
  8 +import 'package:one_key/models/customer_by_seller_model.dart';
8 import 'package:one_key/models/customer_list_model.dart'; 9 import 'package:one_key/models/customer_list_model.dart';
9 import 'package:one_key/models/marketing_by_id_model.dart'; 10 import 'package:one_key/models/marketing_by_id_model.dart';
10 import 'package:one_key/pages/coupon/coupon_page.dart'; 11 import 'package:one_key/pages/coupon/coupon_page.dart';
@@ -68,7 +69,7 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> { @@ -68,7 +69,7 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> {
68 } 69 }
69 }); 70 });
70 WidgetsBinding.instance.addPostFrameCallback((_) async { 71 WidgetsBinding.instance.addPostFrameCallback((_) async {
71 - for (CustomerListSunModel item in customerMakingProvider.selectCustomer) { 72 + for (CustomerBySellerSunModel item in customerMakingProvider.selectCustomerSeller) {
72 gid += '${item.id},'; 73 gid += '${item.id},';
73 if (Platform.isIOS) { 74 if (Platform.isIOS) {
74 iosPhone.add(item.phone); 75 iosPhone.add(item.phone);
@@ -110,7 +111,7 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> { @@ -110,7 +111,7 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> {
110 ); 111 );
111 print('''object'''); 112 print('''object''');
112 customerMakingProvider.labels = customerProvider.labels; 113 customerMakingProvider.labels = customerProvider.labels;
113 - customerMakingProvider.selectCustomer = customerProvider.selectCustomer; 114 + customerMakingProvider.selectCustomerSeller = customerProvider.selectCustomerSeller;
114 // customerMakingProvider.fromPage = widget.fromPage; 115 // customerMakingProvider.fromPage = widget.fromPage;
115 customerMakingProvider.controller.text = 116 customerMakingProvider.controller.text =
116 widget.marketingByIdSunModel.content; 117 widget.marketingByIdSunModel.content;
@@ -375,7 +376,7 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> { @@ -375,7 +376,7 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> {
375 fontSize: ScreenUtil().setSp(26))), 376 fontSize: ScreenUtil().setSp(26))),
376 )), 377 )),
377 Text( 378 Text(
378 - '共 ${customerMakingProvider.controller.text.length} 字 ${customerMakingProvider.selectCustomer.length} 条短信', 379 + '共 ${customerMakingProvider.controller.text.length} 字 ${customerMakingProvider.selectCustomerSeller.length} 条短信',
379 style: TextStyle( 380 style: TextStyle(
380 color: MyColours.color_333333, 381 color: MyColours.color_333333,
381 fontSize: ScreenUtil().setSp(26))), 382 fontSize: ScreenUtil().setSp(26))),
@@ -595,7 +596,7 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> { @@ -595,7 +596,7 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> {
595 children: [ 596 children: [
596 Expanded( 597 Expanded(
597 child: Text( 598 child: Text(
598 - '已选[${customerMakingProvider.labels}]${customerMakingProvider.selectCustomer.length}位顾客', 599 + '已选[${customerMakingProvider.labels}]${customerMakingProvider.selectCustomerSeller.length}位顾客',
599 style: TextStyle( 600 style: TextStyle(
600 color: MyColours.color_ffffff, 601 color: MyColours.color_ffffff,
601 fontSize: ScreenUtil().setSp(32)), 602 fontSize: ScreenUtil().setSp(32)),
@@ -100,7 +100,18 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> { @@ -100,7 +100,18 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> {
100 ), 100 ),
101 VEmptyView(20), 101 VEmptyView(20),
102 RoundButton( 102 RoundButton(
103 - onPressed: () async {}, 103 + onPressed: () async {
  104 + String index = '0';
  105 + if (btnTitle == '活跃客户') {
  106 + index = '1';
  107 + } else if (btnTitle == '沉睡客户') {
  108 + index = '2';
  109 + } else if (btnTitle == '流失客户') {
  110 + index = '3';
  111 + }
  112 + NavigatorUtil.goCustomerListPage(
  113 + context, FromPage.FromPageHome,index:index);
  114 + },
104 text: btnTitle, 115 text: btnTitle,
105 fontSize: 24, 116 fontSize: 24,
106 isBold: false, 117 isBold: false,
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 import 'package:one_key/constant/state.dart'; 2 import 'package:one_key/constant/state.dart';
  3 +import 'package:one_key/models/customer_by_seller_model.dart';
3 import 'package:one_key/models/customer_list_model.dart'; 4 import 'package:one_key/models/customer_list_model.dart';
4 5
5 class CustomerMakingProvider extends ChangeNotifier { 6 class CustomerMakingProvider extends ChangeNotifier {
@@ -13,6 +14,7 @@ class CustomerMakingProvider extends ChangeNotifier { @@ -13,6 +14,7 @@ class CustomerMakingProvider extends ChangeNotifier {
13 bool isUpdate = true; //客户经理不可修改短信内容 14 bool isUpdate = true; //客户经理不可修改短信内容
14 bool isDate = true; //最晚完成期限 15 bool isDate = true; //最晚完成期限
15 String edate = ''; 16 String edate = '';
  17 + List<CustomerBySellerSunModel> selectCustomerSeller = [];
16 18
17 clearData() { 19 clearData() {
18 labels = ''; 20 labels = '';
@@ -25,5 +27,6 @@ class CustomerMakingProvider extends ChangeNotifier { @@ -25,5 +27,6 @@ class CustomerMakingProvider extends ChangeNotifier {
25 isUpdate = true; //客户经理不可修改短信内容 27 isUpdate = true; //客户经理不可修改短信内容
26 isDate = true; //最晚完成期限 28 isDate = true; //最晚完成期限
27 edate = ''; 29 edate = '';
  30 + selectCustomerSeller = [];
28 } 31 }
29 } 32 }
@@ -53,7 +53,8 @@ class CustomerProvider extends ChangeNotifier { @@ -53,7 +53,8 @@ class CustomerProvider extends ChangeNotifier {
53 53
54 GuestInfoSunModel guestInfoSunModel; 54 GuestInfoSunModel guestInfoSunModel;
55 GuestReserveSunModel guestReserveSunModel; 55 GuestReserveSunModel guestReserveSunModel;
56 - List<CustomerListSunModel> selectCustomer = []; 56 + List<CustomerListSunModel> selectCustomer = []; //我的客情选中
  57 + List<CustomerBySellerSunModel> selectCustomerSeller = []; //商家客情选中
57 int index = 0; 58 int index = 0;
58 bool checkValue = true; 59 bool checkValue = true;
59 String labels = ''; 60 String labels = '';
@@ -1051,6 +1052,80 @@ class CustomerProvider extends ChangeNotifier { @@ -1051,6 +1052,80 @@ class CustomerProvider extends ChangeNotifier {
1051 return storeSunmodel; 1052 return storeSunmodel;
1052 } 1053 }
1053 1054
  1055 + //全选按钮执行“全选”
  1056 + addAll() async {
  1057 + //把数据状态全部改成true,即选中状态
  1058 + selectCustomerSeller = [];
  1059 + for (var i = 0; i < customerBySellerList.length; i++) {
  1060 + customerBySellerList[i].select = true;
  1061 + selectCustomerSeller.add(customerBySellerList[i]);
  1062 + }
  1063 + checkValue = true;
  1064 + labelsValue();
  1065 + notifyListeners();
  1066 + }
  1067 +
  1068 + labelsValue() {
  1069 + List<String> tempLabel = [];
  1070 + for (CustomerBySellerSunModel item in customerBySellerList) {
  1071 + if (item.select && item.attr != null) {
  1072 + tempLabel.add(item.attr);
  1073 + }
  1074 + }
  1075 + tempLabel = tempLabel.toSet().toList();
  1076 + labels = Utils.listToStringEnglish(tempLabel);
  1077 + }
  1078 +
  1079 + ///清除选择
  1080 + // clearSelect() {
  1081 + // // selectCustomer = [];
  1082 + // // labelsValue();
  1083 + // // couponsShow = [];
  1084 + // }
  1085 +
  1086 +//全选按钮执行“全不选”
  1087 + cancelAll() async {
  1088 + selectCustomerSeller = [];
  1089 + //把数据状态全部改成false,即不选中状态
  1090 + for (var i = 0; i < customerBySellerList.length; i++) {
  1091 + customerBySellerList[i].select = false;
  1092 + }
  1093 +
  1094 + checkValue = false;
  1095 + labels = '';
  1096 + notifyListeners();
  1097 + }
  1098 +
  1099 +//选中
  1100 + addData(int index) {
  1101 + // userHistorys[index].select = true;
  1102 + selectCustomerSeller.add(customerBySellerList[index]);
  1103 + labelsValueMy();
  1104 + notifyListeners();
  1105 + }
  1106 +
  1107 +//未选中
  1108 + cancelData(int index) {
  1109 + // userHistorys[index].select = false;
  1110 + selectCustomerSeller
  1111 + .removeWhere((element) => element.id == customerBySellerList[index].id);
  1112 + labelsValueMy();
  1113 + notifyListeners();
  1114 + }
  1115 +
  1116 + //获取全选按钮的状态 true or false
  1117 + getCheckValue() {
  1118 + bool temp = customerBySellerList.any((value) {
  1119 + return value.select == false;
  1120 + });
  1121 + if (temp == true) {
  1122 + checkValue = false;
  1123 + } else {
  1124 + checkValue = true;
  1125 + }
  1126 + notifyListeners();
  1127 + }
  1128 +
1054 //获取商家客户列表 1129 //获取商家客户列表
1055 getCustomerBySeller(BuildContext context, Map<String, String> params) async { 1130 getCustomerBySeller(BuildContext context, Map<String, String> params) async {
1056 BaseResp<List> baseResp = await DioUtil() 1131 BaseResp<List> baseResp = await DioUtil()
@@ -542,9 +542,9 @@ class NavigatorUtil { @@ -542,9 +542,9 @@ class NavigatorUtil {
542 /// 客情列表 542 /// 客情列表
543 static Future<dynamic> goCustomerListPage( 543 static Future<dynamic> goCustomerListPage(
544 BuildContext context, FromPage fromPage, 544 BuildContext context, FromPage fromPage,
545 - {replace = false, bool needBtn = false}) { 545 + {replace = false, bool needBtn = false, String index = '0'}) {
546 return _navigateTo(context, 546 return _navigateTo(context,
547 - "${Routes.customer_list_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}", 547 + "${Routes.customer_list_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}&index=$index",
548 replace: replace); 548 replace: replace);
549 } 549 }
550 550
@@ -875,9 +875,10 @@ var customerListPageHandle = new Handler( @@ -875,9 +875,10 @@ var customerListPageHandle = new Handler(
875 FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>( 875 FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>(
876 FromPage.values, params["fromPage"].first); 876 FromPage.values, params["fromPage"].first);
877 print(fromPage); 877 print(fromPage);
  878 + String index = params["index"].first;
878 return ChangeNotifierProvider<CustomerProvider>( 879 return ChangeNotifierProvider<CustomerProvider>(
879 create: (_) => CustomerProvider(), 880 create: (_) => CustomerProvider(),
880 - child: CustomerListPage(fromPage: fromPage)); 881 + child: CustomerListPage(fromPage: fromPage,index:index));
881 }); 882 });
882 883
883 ///仅供展示的客情列表 884 ///仅供展示的客情列表
@@ -887,6 +888,7 @@ var showCustomerListPageHandle = new Handler( @@ -887,6 +888,7 @@ var showCustomerListPageHandle = new Handler(
887 FromPage.values, params["fromPage"].first); 888 FromPage.values, params["fromPage"].first);
888 print(fromPage); 889 print(fromPage);
889 String gid = params["gid"].first; 890 String gid = params["gid"].first;
  891 +
890 return ChangeNotifierProvider<CustomerProvider>( 892 return ChangeNotifierProvider<CustomerProvider>(
891 create: (_) => CustomerProvider(), 893 create: (_) => CustomerProvider(),
892 child: ShowCustomerListPage(fromPage: fromPage, gid: gid)); 894 child: ShowCustomerListPage(fromPage: fromPage, gid: gid));
@@ -901,7 +903,7 @@ var myCustomerListPageHandle = new Handler( @@ -901,7 +903,7 @@ var myCustomerListPageHandle = new Handler(
901 String index = params["index"].first; 903 String index = params["index"].first;
902 return ChangeNotifierProvider<CustomerProvider>( 904 return ChangeNotifierProvider<CustomerProvider>(
903 create: (_) => CustomerProvider(), 905 create: (_) => CustomerProvider(),
904 - child: MyCustomerListPage(fromPage: fromPage,index:index)); 906 + child: MyCustomerListPage(fromPage: fromPage, index: index));
905 }); 907 });
906 908
907 ///客情设置 909 ///客情设置