|
1
|
-
|
|
|
|
2
|
import 'package:flutter/material.dart';
|
1
|
import 'package:flutter/material.dart';
|
|
3
|
|
2
|
|
|
4
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
3
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
@@ -51,8 +50,7 @@ class MyCustomerListPage extends StatefulWidget { |
|
@@ -51,8 +50,7 @@ class MyCustomerListPage extends StatefulWidget { |
|
51
|
}
|
50
|
}
|
|
52
|
|
51
|
|
|
53
|
class _MyCustomerListPageState extends State<MyCustomerListPage>
|
52
|
class _MyCustomerListPageState extends State<MyCustomerListPage>
|
|
54
|
- with TickerProviderStateMixin
|
|
|
|
55
|
- {
|
53
|
+ with TickerProviderStateMixin {
|
|
56
|
late List _tabBarTitle;
|
54
|
late List _tabBarTitle;
|
|
57
|
TabController? tabController;
|
55
|
TabController? tabController;
|
|
58
|
|
56
|
|
|
@@ -127,7 +125,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
@@ -127,7 +125,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
127
|
bool first = true;
|
125
|
bool first = true;
|
|
128
|
customerProvider!.index = tabController!.index;
|
126
|
customerProvider!.index = tabController!.index;
|
|
129
|
if (widget.fromPage == FromPage.FromPageMakeRecord) {
|
127
|
if (widget.fromPage == FromPage.FromPageMakeRecord) {
|
|
130
|
- customerProvider!.selectCustomer = customerMakingProvider.selectCustomer;
|
128
|
+ customerProvider!.selectCustomer =
|
|
|
|
129
|
+ customerMakingProvider.selectCustomer;
|
|
131
|
customerProvider!.labels = customerMakingProvider.labels;
|
130
|
customerProvider!.labels = customerMakingProvider.labels;
|
|
132
|
first = false;
|
131
|
first = false;
|
|
133
|
}
|
132
|
}
|
|
@@ -350,8 +349,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
@@ -350,8 +349,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
350
|
// params['reserve_num'] 时间内预定次数
|
349
|
// params['reserve_num'] 时间内预定次数
|
|
351
|
// params['reserve_sort'] 1 等于 2 小于 3 大于
|
350
|
// params['reserve_sort'] 1 等于 2 小于 3 大于
|
|
352
|
|
351
|
|
|
353
|
- await customerProvider!.getCustomerList(context, params,
|
|
|
|
354
|
- load: load, labels: widget.labels);
|
352
|
+ await customerProvider!
|
|
|
|
353
|
+ .getCustomerList(context, params, load: load, labels: widget.labels);
|
|
355
|
|
354
|
|
|
356
|
print(first);
|
355
|
print(first);
|
|
357
|
// if (customerProvider.userHistorys.length ==
|
356
|
// if (customerProvider.userHistorys.length ==
|
|
@@ -618,53 +617,51 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
@@ -618,53 +617,51 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
618
|
// ))
|
617
|
// ))
|
|
619
|
])));
|
618
|
])));
|
|
620
|
}
|
619
|
}
|
|
621
|
- _filterMethod(){
|
|
|
|
622
|
- Navigator.of(context).pop();
|
|
|
|
623
|
- if (customerProvider!.hydSelAll) {
|
|
|
|
624
|
- //全选,默认全部
|
|
|
|
625
|
- tabController!.index = 0;
|
|
|
|
626
|
- customerProvider!.index = 0;
|
|
|
|
627
|
- } else {
|
|
|
|
628
|
- int tag = 0; //有几个选中的项目
|
|
|
|
629
|
- for (FilterBtnModel value
|
|
|
|
630
|
- in customerProvider!.filterHydList) {
|
|
|
|
631
|
- if (value.select!) {
|
|
|
|
632
|
- tag++;
|
|
|
|
633
|
- }
|
|
|
|
634
|
- }
|
|
|
|
635
|
- if (tag == 0) {
|
|
|
|
636
|
- //全不选,默认全部
|
|
|
|
637
|
- tabController!.index = 0;
|
|
|
|
638
|
- customerProvider!.index = 0;
|
|
|
|
639
|
- } else if (tag == 1) {
|
|
|
|
640
|
- for (FilterBtnModel value
|
|
|
|
641
|
- in customerProvider!.filterHydList) {
|
|
|
|
642
|
- if (value.select!) {
|
|
|
|
643
|
- if (value.title == '活跃') {
|
|
|
|
644
|
- tabController!.index = 1;
|
|
|
|
645
|
- customerProvider!.index = 1;
|
|
|
|
646
|
- } else if (value.title == '沉睡') {
|
|
|
|
647
|
- tabController!.index = 2;
|
|
|
|
648
|
- customerProvider!.index = 2;
|
|
|
|
649
|
- } else if (value.title == '流失') {
|
|
|
|
650
|
- tabController!.index = 3;
|
|
|
|
651
|
- customerProvider!.index = 3;
|
|
|
|
652
|
- }
|
|
|
|
653
|
- }
|
|
|
|
654
|
- }
|
|
|
|
655
|
- } else if (tag == 2) {
|
|
|
|
656
|
- //选中2个的,默认全部
|
|
|
|
657
|
- tabController!.index = 0;
|
|
|
|
658
|
- customerProvider!.index = 0;
|
|
|
|
659
|
- }
|
|
|
|
660
|
- }
|
|
|
|
661
|
- setState(() {
|
|
|
|
662
|
- showFilter = false;
|
|
|
|
663
|
- });
|
|
|
|
664
|
- page = 1;
|
|
|
|
665
|
- customerProvider!.pageDataMy = [];
|
|
|
|
666
|
- _getContantData();
|
|
|
|
667
|
-
|
620
|
+
|
|
|
|
621
|
+ _filterMethod() {
|
|
|
|
622
|
+ Navigator.of(context).pop();
|
|
|
|
623
|
+ if (customerProvider!.hydSelAll) {
|
|
|
|
624
|
+ //全选,默认全部
|
|
|
|
625
|
+ tabController!.index = 0;
|
|
|
|
626
|
+ customerProvider!.index = 0;
|
|
|
|
627
|
+ } else {
|
|
|
|
628
|
+ int tag = 0; //有几个选中的项目
|
|
|
|
629
|
+ for (FilterBtnModel value in customerProvider!.filterHydList) {
|
|
|
|
630
|
+ if (value.select!) {
|
|
|
|
631
|
+ tag++;
|
|
|
|
632
|
+ }
|
|
|
|
633
|
+ }
|
|
|
|
634
|
+ if (tag == 0) {
|
|
|
|
635
|
+ //全不选,默认全部
|
|
|
|
636
|
+ tabController!.index = 0;
|
|
|
|
637
|
+ customerProvider!.index = 0;
|
|
|
|
638
|
+ } else if (tag == 1) {
|
|
|
|
639
|
+ for (FilterBtnModel value in customerProvider!.filterHydList) {
|
|
|
|
640
|
+ if (value.select!) {
|
|
|
|
641
|
+ if (value.title == '活跃') {
|
|
|
|
642
|
+ tabController!.index = 1;
|
|
|
|
643
|
+ customerProvider!.index = 1;
|
|
|
|
644
|
+ } else if (value.title == '沉睡') {
|
|
|
|
645
|
+ tabController!.index = 2;
|
|
|
|
646
|
+ customerProvider!.index = 2;
|
|
|
|
647
|
+ } else if (value.title == '流失') {
|
|
|
|
648
|
+ tabController!.index = 3;
|
|
|
|
649
|
+ customerProvider!.index = 3;
|
|
|
|
650
|
+ }
|
|
|
|
651
|
+ }
|
|
|
|
652
|
+ }
|
|
|
|
653
|
+ } else if (tag == 2) {
|
|
|
|
654
|
+ //选中2个的,默认全部
|
|
|
|
655
|
+ tabController!.index = 0;
|
|
|
|
656
|
+ customerProvider!.index = 0;
|
|
|
|
657
|
+ }
|
|
|
|
658
|
+ }
|
|
|
|
659
|
+ setState(() {
|
|
|
|
660
|
+ showFilter = false;
|
|
|
|
661
|
+ });
|
|
|
|
662
|
+ page = 1;
|
|
|
|
663
|
+ customerProvider!.pageDataMy = [];
|
|
|
|
664
|
+ _getContantData();
|
|
668
|
}
|
665
|
}
|
|
669
|
|
666
|
|
|
670
|
Widget _menuWidget() {
|
667
|
Widget _menuWidget() {
|
|
@@ -774,7 +771,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
@@ -774,7 +771,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
774
|
// return;
|
771
|
// return;
|
|
775
|
// }
|
772
|
// }
|
|
776
|
// }
|
773
|
// }
|
|
777
|
- bool temp = customerProvider!.filterDayList.any((value) {
|
774
|
+ bool temp = customerProvider!.filterDayList.any((value) {
|
|
778
|
return value.select == true;
|
775
|
return value.select == true;
|
|
779
|
});
|
776
|
});
|
|
780
|
if (customerProvider!.controllerstime.text.trim().length >
|
777
|
if (customerProvider!.controllerstime.text.trim().length >
|
|
@@ -791,7 +788,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
@@ -791,7 +788,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
791
|
Utils.showToast('请输入开始天数');
|
788
|
Utils.showToast('请输入开始天数');
|
|
792
|
return;
|
789
|
return;
|
|
793
|
}
|
790
|
}
|
|
794
|
- bool isGet = false;
|
791
|
+
|
|
795
|
if (temp == true ||
|
792
|
if (temp == true ||
|
|
796
|
(customerProvider!.controllerstime.text.trim().length >
|
793
|
(customerProvider!.controllerstime.text.trim().length >
|
|
797
|
0 &&
|
794
|
0 &&
|
|
@@ -799,7 +796,6 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
@@ -799,7 +796,6 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
799
|
.trim()
|
796
|
.trim()
|
|
800
|
.length >
|
797
|
.length >
|
|
801
|
0)) {
|
798
|
0)) {
|
|
802
|
- isGet = true;
|
|
|
|
803
|
//选择了天数,则必须选择次数
|
799
|
//选择了天数,则必须选择次数
|
|
804
|
if (customerProvider!.controllernum.text.trim().length ==
|
800
|
if (customerProvider!.controllernum.text.trim().length ==
|
|
805
|
0) {
|
801
|
0) {
|
|
@@ -809,8 +805,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
@@ -809,8 +805,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
809
|
// 请求筛选
|
805
|
// 请求筛选
|
|
810
|
_filterMethod();
|
806
|
_filterMethod();
|
|
811
|
}
|
807
|
}
|
|
812
|
- }
|
|
|
|
813
|
- if (!isGet) {
|
808
|
+ } else {
|
|
814
|
if (customerProvider!.controllernum.text.trim().length >
|
809
|
if (customerProvider!.controllernum.text.trim().length >
|
|
815
|
0) {
|
810
|
0) {
|
|
816
|
//选择了预定次数
|
811
|
//选择了预定次数
|
|
@@ -829,6 +824,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
@@ -829,6 +824,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
829
|
Utils.showToast('请选择时间');
|
824
|
Utils.showToast('请选择时间');
|
|
830
|
return;
|
825
|
return;
|
|
831
|
}
|
826
|
}
|
|
|
|
827
|
+ } else {
|
|
|
|
828
|
+ _filterMethod();
|
|
832
|
}
|
829
|
}
|
|
833
|
// if (customerProvider.controllernum.text.trim().length >
|
830
|
// if (customerProvider.controllernum.text.trim().length >
|
|
834
|
// 0) {
|
831
|
// 0) {
|
|
@@ -836,7 +833,6 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
@@ -836,7 +833,6 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
836
|
// return;
|
833
|
// return;
|
|
837
|
// }
|
834
|
// }
|
|
838
|
}
|
835
|
}
|
|
839
|
-
|
|
|
|
840
|
}, tapWhiteBack: () {
|
836
|
}, tapWhiteBack: () {
|
|
841
|
Navigator.of(context).pop();
|
837
|
Navigator.of(context).pop();
|
|
842
|
setState(() {
|
838
|
setState(() {
|
|
@@ -1275,7 +1271,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
@@ -1275,7 +1271,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
1275
|
Expanded(
|
1271
|
Expanded(
|
|
1276
|
child: _textFeildWidget(customerProvider!.controllerstime,
|
1272
|
child: _textFeildWidget(customerProvider!.controllerstime,
|
|
1277
|
customerProvider!.stimeFocus, state, (value) {
|
1273
|
customerProvider!.stimeFocus, state, (value) {
|
|
1278
|
- for (FilterBtnModel value in customerProvider!.filterDayList) {
|
1274
|
+ for (FilterBtnModel value
|
|
|
|
1275
|
+ in customerProvider!.filterDayList) {
|
|
1279
|
value.select = false;
|
1276
|
value.select = false;
|
|
1280
|
}
|
1277
|
}
|
|
1281
|
// customerProvider.controllernum.text = '';
|
1278
|
// customerProvider.controllernum.text = '';
|
|
@@ -1291,7 +1288,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
@@ -1291,7 +1288,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
1291
|
Expanded(
|
1288
|
Expanded(
|
|
1292
|
child: _textFeildWidget(customerProvider!.controlleretime,
|
1289
|
child: _textFeildWidget(customerProvider!.controlleretime,
|
|
1293
|
customerProvider!.etimeFocus, state, (value) {
|
1290
|
customerProvider!.etimeFocus, state, (value) {
|
|
1294
|
- for (FilterBtnModel value in customerProvider!.filterDayList) {
|
1291
|
+ for (FilterBtnModel value
|
|
|
|
1292
|
+ in customerProvider!.filterDayList) {
|
|
1295
|
value.select = false;
|
1293
|
value.select = false;
|
|
1296
|
}
|
1294
|
}
|
|
1297
|
// customerProvider.controllernum.text = '';
|
1295
|
// customerProvider.controllernum.text = '';
|