|
...
|
...
|
@@ -2,6 +2,8 @@ import 'package:flutter/material.dart'; |
|
|
|
|
|
|
|
import 'package:flutter_screenutil/screenutil.dart';
|
|
|
|
import 'package:one_key/constant/state.dart';
|
|
|
|
import 'package:one_key/models/customer_label_model.dart';
|
|
|
|
import 'package:one_key/models/filter_btn_model.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/pages/my/customer_type/store_customer/contant_list_page.dart';
|
|
|
|
import 'package:one_key/provider/customer_making_provider.dart';
|
|
...
|
...
|
@@ -25,11 +27,15 @@ import 'package:one_key/widgets/v_empty_view.dart'; |
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
typedef ClickCallback = void Function(dynamic value);
|
|
|
|
typedef ClickCall = void Function(FilterBtnModel value);
|
|
|
|
typedef ClickCallState = void Function(StateSetter state);
|
|
|
|
|
|
|
|
class CustomerListPage extends StatefulWidget {
|
|
|
|
final FromPage fromPage;
|
|
|
|
final String index;
|
|
|
|
|
|
|
|
const CustomerListPage({Key key, this.fromPage}) : super(key: key);
|
|
|
|
const CustomerListPage({Key key, this.fromPage, this.index})
|
|
|
|
: super(key: key);
|
|
|
|
@override
|
|
|
|
_CustomerListPageState createState() => _CustomerListPageState();
|
|
|
|
}
|
|
...
|
...
|
@@ -53,6 +59,7 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
// timeTilte = ['大于', '等于', '小于'];
|
|
|
|
super.initState();
|
|
|
|
tabController = TabController(length: 4, vsync: this);
|
|
|
|
tabController.index = int.parse(widget.index);
|
|
|
|
tabController.addListener(() {
|
|
|
|
if (tabController.index == tabController.animation.value) {
|
|
|
|
if (customerProvider.index == tabController.index) {
|
|
...
|
...
|
@@ -60,12 +67,36 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
}
|
|
|
|
print(tabController.index);
|
|
|
|
customerProvider.index = tabController.index;
|
|
|
|
if (customerProvider.index != 0 && customerProvider.index != null) {
|
|
|
|
//1 活跃 2 沉睡 3 流失
|
|
|
|
for (FilterBtnModel item in customerProvider.filterHydList) {
|
|
|
|
item.select = false;
|
|
|
|
if (item.id == '${customerProvider.index}') {
|
|
|
|
item.select = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (customerProvider.index == 0) {
|
|
|
|
customerProvider.hydSelAll = true;
|
|
|
|
for (FilterBtnModel item in customerProvider.filterHydList) {
|
|
|
|
item.select = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_getContantData();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
|
|
_getContantData();
|
|
|
|
bool first = true;
|
|
|
|
customerProvider.index = tabController.index;
|
|
|
|
if (widget.fromPage == FromPage.FromPageMakeRecord) {
|
|
|
|
customerProvider.selectCustomerSeller = customerMakingProvider.selectCustomerSeller;
|
|
|
|
customerProvider.labels = customerMakingProvider.labels;
|
|
|
|
first = false;
|
|
|
|
}
|
|
|
|
customerProvider.initData();
|
|
|
|
_getContantData(first: first);
|
|
|
|
_filterLabelList();
|
|
|
|
});
|
|
|
|
|
|
|
|
bus.on("refresh_guest_list", (arg) {
|
|
|
|
_getContantData();
|
|
|
|
});
|
|
...
|
...
|
@@ -77,7 +108,22 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
_getContantData({bool showLoading = true}) async {
|
|
|
|
_filterLabelList() async {
|
|
|
|
await customerProvider.getLabelBySellerid(context);
|
|
|
|
if (customerProvider.labelList != null &&
|
|
|
|
customerProvider.labelList.length > 0) {
|
|
|
|
customerProvider.filterLabelList = [];
|
|
|
|
for (CustomerLabelSunModel item in customerProvider.labelList) {
|
|
|
|
FilterBtnModel model = FilterBtnModel();
|
|
|
|
model.title = item.label;
|
|
|
|
model.id = item.id;
|
|
|
|
model.select = false;
|
|
|
|
customerProvider.filterLabelList.add(model);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
_getContantData({bool showLoading = true, bool first = false}) async {
|
|
|
|
if (showLoading) {
|
|
|
|
customerProvider.pageState = PageState.Loading;
|
|
|
|
}
|
|
...
|
...
|
@@ -85,23 +131,62 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
Map<String, String> params = {
|
|
|
|
"sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
};
|
|
|
|
|
|
|
|
if (customerProvider.index != 0 && customerProvider.index != null) {
|
|
|
|
params['active'] = '${customerProvider.index}'; //1 活跃 2 沉睡 3 流失
|
|
|
|
//1 活跃 2 沉睡 3 流失
|
|
|
|
for (FilterBtnModel item in customerProvider.filterHydList) {
|
|
|
|
if (item.id == '${customerProvider.index}') {
|
|
|
|
item.select = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String active = '';
|
|
|
|
for (FilterBtnModel item in customerProvider.filterHydList) {
|
|
|
|
if (item.select) {
|
|
|
|
active += '${item.id},';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (active.length > 0) {
|
|
|
|
if (active.endsWith(',')) {
|
|
|
|
active = active.substring(0, active.length - 1);
|
|
|
|
}
|
|
|
|
params['active'] = active;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (customerProvider.controller.text.trim().length > 0) {
|
|
|
|
params['keyword'] = customerProvider.controller.text; //搜索手机号/姓名
|
|
|
|
}
|
|
|
|
String labels = '';
|
|
|
|
for (FilterBtnModel item in customerProvider.filterLabelList) {
|
|
|
|
if (item.select) {
|
|
|
|
labels += '${item.id},';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (labels.length > 0) {
|
|
|
|
if (labels.endsWith(',')) {
|
|
|
|
labels = labels.substring(0, labels.length - 1);
|
|
|
|
}
|
|
|
|
params['labelid'] = labels;
|
|
|
|
}
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// params['uid'] 经理ID
|
|
|
|
// params['labelid'] 标签ID
|
|
|
|
// params['stime'] 起始天数,例: 60
|
|
|
|
// params['etime'] 截止天数,例: 120
|
|
|
|
// params['reserve_date'] XX天内,例:30
|
|
|
|
// params['reserve_num'] 时间内预定次数
|
|
|
|
// params['reserve_sort'] 1 等于 2 小于 3 大于
|
|
|
|
|
|
|
|
if (customerProvider.controllerstime.text.trim().length > 0) {
|
|
|
|
params['stime'] = customerProvider.controllerstime.text;
|
|
|
|
}
|
|
|
|
if (customerProvider.controlleretime.text.trim().length > 0) {
|
|
|
|
params['etime'] = customerProvider.controlleretime.text;
|
|
|
|
}
|
|
|
|
if (customerProvider.controllernum.text.trim().length > 0) {
|
|
|
|
params['reserve_num'] = customerProvider.controlleretime.text;
|
|
|
|
params['reserve_sort'] = '${dropValue + 1}';
|
|
|
|
}
|
|
|
|
|
|
|
|
await customerProvider.getCustomerBySeller(context, params);
|
|
|
|
if (first) {
|
|
|
|
customerProvider.addAll();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ///选中的联系人widget
|
|
...
|
...
|
@@ -127,9 +212,9 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
if (customerProvider.checkValue) {
|
|
|
|
// customerProvider.cancelAll();
|
|
|
|
customerProvider.cancelAll();
|
|
|
|
} else {
|
|
|
|
// customerProvider.addAll();
|
|
|
|
customerProvider.addAll();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Row(
|
|
...
|
...
|
@@ -154,20 +239,29 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
Expanded(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
if (customerProvider.selectCustomer == null ||
|
|
|
|
customerProvider.selectCustomer.length == 0) {
|
|
|
|
if (customerProvider.selectCustomerSeller == null ||
|
|
|
|
customerProvider.selectCustomerSeller.length == 0) {
|
|
|
|
Utils.showToast('请至少选择1名顾客');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (widget.fromPage == FromPage.FromPageHome) {
|
|
|
|
customerMakingProvider.labels = customerProvider.labels;
|
|
|
|
customerMakingProvider.selectCustomer =
|
|
|
|
customerProvider.selectCustomer;
|
|
|
|
customerMakingProvider.selectCustomerSeller =
|
|
|
|
customerProvider.selectCustomerSeller;
|
|
|
|
customerMakingProvider.fromPage = widget.fromPage;
|
|
|
|
NavigatorUtil.goMakeMarkingPage(context,
|
|
|
|
fromPage: FromPage.FromPageCustomerList);
|
|
|
|
} else {
|
|
|
|
customerMakingProvider.labels = customerProvider.labels;
|
|
|
|
customerMakingProvider.selectCustomerSeller =
|
|
|
|
customerProvider.selectCustomerSeller;
|
|
|
|
customerMakingProvider.fromPage = widget.fromPage;
|
|
|
|
Navigator.pop(context);
|
|
|
|
// Map temp = {
|
|
|
|
// 'labels': customerProvider.labels,
|
|
|
|
// 'selectCustomerSeller': customerProvider.selectCustomerSeller
|
|
|
|
// };
|
|
|
|
// Navigator.of(context).pop(temp);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Container(
|
|
...
|
...
|
@@ -178,7 +272,7 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(40)),
|
|
|
|
color: MyColours.color_199095),
|
|
|
|
child: Text(
|
|
|
|
'已选[${customerProvider.labels}]${customerProvider.selectCustomer.length}位顾客,下发营销任务',
|
|
|
|
'已选[${customerProvider.labels}]${customerProvider.selectCustomerSeller.length}位顾客,下发营销任务',
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
maxLines: 1,
|
|
|
|
style: TextStyle(
|
|
...
|
...
|
@@ -268,10 +362,12 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
// setState(() {});
|
|
|
|
// _searchSellerLocation();
|
|
|
|
// customerProvider.searchData(value);
|
|
|
|
_getContantData(showLoading: false);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
_getContantData(showLoading: false);
|
|
|
|
// contantShowModel.searchData(
|
|
|
|
// contantShowModel.controller.text);
|
|
|
|
// _searchSellerLocation();
|
|
...
|
...
|
@@ -298,6 +394,9 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
onTap: () {
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback(((_) {
|
|
|
|
customerProvider.controller.clear();
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
_getContantData(showLoading: false);
|
|
|
|
// customerProvider.searchData('');
|
|
|
|
}));
|
|
|
|
},
|
|
...
|
...
|
@@ -377,16 +476,33 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
showFilter = !showFilter;
|
|
|
|
});
|
|
|
|
if (showFilter) {
|
|
|
|
_showFilterDialogFromTop(context, onPressedReset: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
setState(() {
|
|
|
|
showFilter = false;
|
|
|
|
_showFilterDialogFromTop(context, onPressedReset: (state) {
|
|
|
|
// Navigator.of(context).pop();
|
|
|
|
// setState(() {
|
|
|
|
// showFilter = false;
|
|
|
|
// });
|
|
|
|
state(() {
|
|
|
|
customerProvider.hydSelAll = false;
|
|
|
|
for (FilterBtnModel item
|
|
|
|
in customerProvider.filterHydList) {
|
|
|
|
item.select = false;
|
|
|
|
}
|
|
|
|
customerProvider.labelSelAll = false;
|
|
|
|
for (FilterBtnModel item
|
|
|
|
in customerProvider.filterLabelList) {
|
|
|
|
item.select = false;
|
|
|
|
}
|
|
|
|
customerProvider.controllerstime.text = '';
|
|
|
|
customerProvider.controlleretime.text = '';
|
|
|
|
customerProvider.controllernum.text = '';
|
|
|
|
dropValue = 0;
|
|
|
|
});
|
|
|
|
}, onPressedComplete: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
setState(() {
|
|
|
|
showFilter = false;
|
|
|
|
});
|
|
|
|
_getContantData();
|
|
|
|
}, tapWhiteBack: () {
|
|
|
|
// Navigator.of(context).pop();
|
|
|
|
// setState(() {
|
|
...
|
...
|
@@ -424,7 +540,7 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
|
|
|
|
///筛选弹框
|
|
|
|
_showFilterDialogFromTop(BuildContext context,
|
|
|
|
{VoidCallback onPressedReset,
|
|
|
|
{ClickCallState onPressedReset,
|
|
|
|
VoidCallback onPressedComplete,
|
|
|
|
GestureTapCallback tapWhiteBack}) {
|
|
|
|
showGeneralDialog(
|
|
...
|
...
|
@@ -499,7 +615,7 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
}
|
|
|
|
|
|
|
|
///活跃度
|
|
|
|
Widget _activityWidget() {
|
|
|
|
Widget _activityWidget(state) {
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
...
|
...
|
@@ -508,9 +624,29 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
children: [
|
|
|
|
_textWidget('活跃度', MyColours.color_333333, FontWeight.bold, 28),
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () {},
|
|
|
|
child: _textWidget(
|
|
|
|
'全选', MyColours.color_199095, FontWeight.normal, 24),
|
|
|
|
onTap: () {
|
|
|
|
state(() {
|
|
|
|
customerProvider.hydSelAll = !customerProvider.hydSelAll;
|
|
|
|
if (customerProvider.hydSelAll) {
|
|
|
|
for (FilterBtnModel item
|
|
|
|
in customerProvider.filterHydList) {
|
|
|
|
item.select = true;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for (FilterBtnModel item
|
|
|
|
in customerProvider.filterHydList) {
|
|
|
|
item.select = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
color: Colors.white,
|
|
|
|
height: ScreenUtil().setWidth(40),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
padding: EdgeInsets.only(left: ScreenUtil().setWidth(130)),
|
|
|
|
child: _textWidget(customerProvider.hydSelAll ? '全不选' : '全选',
|
|
|
|
MyColours.color_199095, FontWeight.normal, 24)),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
...
|
...
|
@@ -518,24 +654,18 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
Wrap(
|
|
|
|
spacing: ScreenUtil().setWidth(20),
|
|
|
|
runSpacing: ScreenUtil().setWidth(20),
|
|
|
|
children: _buildFilterItem([
|
|
|
|
{'title': 'kkkk', 'select': false},
|
|
|
|
{'title': 'kkkk', 'select': true},
|
|
|
|
{'title': 'kkkk', 'select': true},
|
|
|
|
{'title': 'kkkk', 'select': true},
|
|
|
|
{'title': 'k', 'select': true},
|
|
|
|
{'title': 'kkkk', 'select': true},
|
|
|
|
{'title': 'kkkk', 'select': true},
|
|
|
|
{'title': 'k', 'select': true},
|
|
|
|
{'title': 'kdsfjsfsdfhjsdfh', 'select': true},
|
|
|
|
{'title': 'kkkk', 'select': true},
|
|
|
|
], false)),
|
|
|
|
children: _buildFilterItem(customerProvider.filterHydList, false,
|
|
|
|
(FilterBtnModel item) {
|
|
|
|
state(() {
|
|
|
|
item.select = !item.select;
|
|
|
|
});
|
|
|
|
})),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///自定义标签
|
|
|
|
Widget _labelWidget() {
|
|
|
|
Widget _labelWidget(StateSetter state) {
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
...
|
...
|
@@ -544,28 +674,45 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
children: [
|
|
|
|
_textWidget('自定义标签', MyColours.color_333333, FontWeight.bold, 28),
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () {},
|
|
|
|
child: _textWidget(
|
|
|
|
'全选', MyColours.color_199095, FontWeight.normal, 24),
|
|
|
|
)
|
|
|
|
onTap: () {
|
|
|
|
state(() {
|
|
|
|
customerProvider.labelSelAll =
|
|
|
|
!customerProvider.labelSelAll;
|
|
|
|
if (customerProvider.labelSelAll) {
|
|
|
|
for (FilterBtnModel item
|
|
|
|
in customerProvider.filterLabelList) {
|
|
|
|
item.select = true;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
for (FilterBtnModel item
|
|
|
|
in customerProvider.filterLabelList) {
|
|
|
|
item.select = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
color: Colors.white,
|
|
|
|
height: ScreenUtil().setWidth(40),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
padding: EdgeInsets.only(left: ScreenUtil().setWidth(130)),
|
|
|
|
child: _textWidget(
|
|
|
|
customerProvider.labelSelAll ? '全不选' : '全选',
|
|
|
|
MyColours.color_199095,
|
|
|
|
FontWeight.normal,
|
|
|
|
24))),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(30),
|
|
|
|
Wrap(
|
|
|
|
spacing: ScreenUtil().setWidth(20),
|
|
|
|
runSpacing: ScreenUtil().setWidth(20),
|
|
|
|
children: _buildFilterItem([
|
|
|
|
{'title': 'kkkk', 'select': false},
|
|
|
|
{'title': 'kkkk', 'select': true},
|
|
|
|
{'title': 'kkkk', 'select': true},
|
|
|
|
{'title': 'kkkk', 'select': true},
|
|
|
|
{'title': 'k', 'select': true},
|
|
|
|
{'title': 'kkkk', 'select': true},
|
|
|
|
{'title': 'kkkk', 'select': true},
|
|
|
|
{'title': 'k', 'select': true},
|
|
|
|
{'title': 'kdsfjsfsdfhjsdfh', 'select': false},
|
|
|
|
{'title': 'kkkk', 'select': true},
|
|
|
|
], true)),
|
|
|
|
children: _buildFilterItem(customerProvider.filterLabelList, true,
|
|
|
|
(FilterBtnModel item) {
|
|
|
|
state(() {
|
|
|
|
item.select = !item.select;
|
|
|
|
});
|
|
|
|
})),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
...
|
...
|
@@ -624,7 +771,7 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
}
|
|
|
|
|
|
|
|
///高级筛选
|
|
|
|
Widget _advancedFilterWidget(state) {
|
|
|
|
Widget _advancedFilterWidget(StateSetter state) {
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
...
|
...
|
@@ -633,32 +780,54 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
children: [
|
|
|
|
_textWidget('高级筛选', MyColours.color_333333, FontWeight.bold, 28),
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () {},
|
|
|
|
child: _textWidget(
|
|
|
|
'清空', MyColours.color_199095, FontWeight.normal, 24),
|
|
|
|
)
|
|
|
|
onTap: () {
|
|
|
|
customerProvider.controllerstime.text = '';
|
|
|
|
customerProvider.controlleretime.text = '';
|
|
|
|
customerProvider.controllernum.text = '';
|
|
|
|
state(() {
|
|
|
|
dropValue = 0;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
color: Colors.white,
|
|
|
|
height: ScreenUtil().setWidth(40),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
padding: EdgeInsets.only(left: ScreenUtil().setWidth(130)),
|
|
|
|
child: _textWidget(
|
|
|
|
'清空', MyColours.color_199095, FontWeight.normal, 24),
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(30),
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Expanded(child: _textFeildWidget()),
|
|
|
|
Expanded(
|
|
|
|
child: _textFeildWidget(customerProvider.controllerstime,
|
|
|
|
customerProvider.stimeFocus)),
|
|
|
|
HEmptyView(10),
|
|
|
|
_textWidget('至', MyColours.color_199095, FontWeight.normal, 24),
|
|
|
|
HEmptyView(10),
|
|
|
|
Expanded(child: _textFeildWidget()),
|
|
|
|
Expanded(
|
|
|
|
child: _textFeildWidget(customerProvider.controlleretime,
|
|
|
|
customerProvider.etimeFocus)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(30),
|
|
|
|
Wrap(
|
|
|
|
spacing: ScreenUtil().setWidth(20),
|
|
|
|
runSpacing: ScreenUtil().setWidth(20),
|
|
|
|
children: _buildFilterItem([
|
|
|
|
{'title': '7天', 'select': true},
|
|
|
|
{'title': '30天', 'select': true},
|
|
|
|
{'title': '60天', 'select': true},
|
|
|
|
{'title': '120天', 'select': true},
|
|
|
|
], true, grayBack: true)),
|
|
|
|
children: _buildFilterItem(customerProvider.filterDayList, true,
|
|
|
|
(FilterBtnModel item) {
|
|
|
|
if (customerProvider.stimeFocus.hasFocus) {
|
|
|
|
customerProvider.controllerstime.text = item.id;
|
|
|
|
}
|
|
|
|
if (customerProvider.etimeFocus.hasFocus) {
|
|
|
|
customerProvider.controlleretime.text = item.id;
|
|
|
|
}
|
|
|
|
// state(() {
|
|
|
|
// item.select = !item.select;
|
|
|
|
// });
|
|
|
|
}, grayBack: true)),
|
|
|
|
VEmptyView(30),
|
|
|
|
_textWidget('时间内预订次数', MyColours.color_333333, FontWeight.normal, 24),
|
|
|
|
VEmptyView(30),
|
|
...
|
...
|
@@ -729,6 +898,8 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
print(value);
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
state(() => dropValue = value);
|
|
|
|
}))),
|
|
|
|
HEmptyView(20),
|
|
...
|
...
|
@@ -749,7 +920,7 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
controller: customerProvider.controller,
|
|
|
|
controller: customerProvider.controllernum,
|
|
|
|
// focusNode: _focusNode,
|
|
|
|
// autofocus: true,
|
|
|
|
|
|
...
|
...
|
@@ -768,7 +939,7 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
),
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
|
|
|
|
onChanged: (value) {
|
|
...
|
...
|
@@ -789,7 +960,7 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
HEmptyView(20),
|
|
|
|
_textWidget('次预订', MyColours.color_333333, FontWeight.normal, 24),
|
|
|
|
]),
|
|
|
|
VEmptyView(30),
|
|
|
|
VEmptyView(50),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
...
|
...
|
@@ -830,7 +1001,8 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
}
|
|
|
|
|
|
|
|
/// 高级筛选输入框
|
|
|
|
Widget _textFeildWidget() {
|
|
|
|
Widget _textFeildWidget(
|
|
|
|
TextEditingController controller, FocusNode focusNode) {
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(20),
|
|
...
|
...
|
@@ -846,8 +1018,8 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
controller: customerProvider.controller,
|
|
|
|
// focusNode: _focusNode,
|
|
|
|
controller: controller,
|
|
|
|
focusNode: focusNode,
|
|
|
|
// autofocus: true,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
...
|
...
|
@@ -855,7 +1027,7 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
fontSize: ScreenUtil().setSp(26)),
|
|
|
|
// textAlignVertical: TextAlignVertical.center,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "xxx",
|
|
|
|
hintText: "",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(26),
|
|
...
|
...
|
@@ -865,7 +1037,7 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
),
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
|
|
|
|
onChanged: (value) {
|
|
...
|
...
|
@@ -890,7 +1062,7 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
///筛选布局
|
|
|
|
Widget _filterWidget(
|
|
|
|
StateSetter state,
|
|
|
|
VoidCallback onPressedReset,
|
|
|
|
ClickCallState onPressedReset,
|
|
|
|
VoidCallback onPressedComplete,
|
|
|
|
) {
|
|
|
|
return Container(
|
|
...
|
...
|
@@ -919,33 +1091,34 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Scrollbar(
|
|
|
|
isAlwaysShown: true, //设置滚动条常亮
|
|
|
|
controller: _scrollCrl, //必须设置一个controller
|
|
|
|
// child: Scrollbar(
|
|
|
|
// isAlwaysShown: true, //设置滚动条常亮
|
|
|
|
// controller: _scrollCrl, //必须设置一个controller
|
|
|
|
|
|
|
|
///添加进度条
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
controller: _scrollCrl,
|
|
|
|
// primary: true,
|
|
|
|
// reverse: true,
|
|
|
|
// physics: BouncingScrollPhysics(),
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// bottom:
|
|
|
|
// MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
VEmptyView(20),
|
|
|
|
_managerWidget(),
|
|
|
|
VEmptyView(30),
|
|
|
|
_activityWidget(),
|
|
|
|
VEmptyView(30),
|
|
|
|
_labelWidget(),
|
|
|
|
VEmptyView(30),
|
|
|
|
_advancedFilterWidget(state)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
))),
|
|
|
|
// ///添加进度条
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
controller: _scrollCrl,
|
|
|
|
// primary: true,
|
|
|
|
// reverse: true,
|
|
|
|
// physics: BouncingScrollPhysics(),
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// bottom:
|
|
|
|
// MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
VEmptyView(20),
|
|
|
|
// _managerWidget(),
|
|
|
|
// VEmptyView(30),
|
|
|
|
_activityWidget(state),
|
|
|
|
VEmptyView(30),
|
|
|
|
_labelWidget(state),
|
|
|
|
VEmptyView(30),
|
|
|
|
_advancedFilterWidget(state)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
// ),
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
...
|
...
|
@@ -972,7 +1145,9 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
flex: 1,
|
|
|
|
child: Material(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: onPressedReset,
|
|
|
|
onTap: () {
|
|
|
|
onPressedReset(state);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
...
|
...
|
@@ -1028,44 +1203,51 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
}
|
|
|
|
|
|
|
|
//构建筛选按钮
|
|
|
|
List<Widget> _buildFilterItem(List<Map> data, bool round,
|
|
|
|
List<Widget> _buildFilterItem(
|
|
|
|
List<FilterBtnModel> data, bool round, ClickCall onTap,
|
|
|
|
{bool grayBack = false}) {
|
|
|
|
List<Widget> items = [];
|
|
|
|
|
|
|
|
for (Map item in data) {
|
|
|
|
items.add(Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(20),
|
|
|
|
vertical: ScreenUtil().setWidth(6)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: grayBack
|
|
|
|
? Color.fromRGBO(239, 239, 239, 1)
|
|
|
|
: item['select']
|
|
|
|
? MyColours.color_199095
|
|
|
|
: MyColours.color_ffffff,
|
|
|
|
border: Border.all(
|
|
|
|
color: grayBack
|
|
|
|
? Color.fromRGBO(239, 239, 239, 1)
|
|
|
|
: item['select']
|
|
|
|
? MyColours.color_199095
|
|
|
|
: round
|
|
|
|
? Color.fromRGBO(155, 155, 155, 1)
|
|
|
|
: MyColours.color_199095,
|
|
|
|
width: ScreenUtil().setWidth(2)),
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(round ? 30 : 10))),
|
|
|
|
child: _textWidget(
|
|
|
|
item['title'],
|
|
|
|
grayBack
|
|
|
|
? MyColours.color_333333
|
|
|
|
: item['select']
|
|
|
|
? MyColours.color_ffffff
|
|
|
|
: round
|
|
|
|
? MyColours.color_333333
|
|
|
|
: MyColours.color_199095,
|
|
|
|
FontWeight.normal,
|
|
|
|
24)));
|
|
|
|
if (data != null && data.length > 0) {
|
|
|
|
for (FilterBtnModel item in data) {
|
|
|
|
items.add(InkWell(
|
|
|
|
onTap: () {
|
|
|
|
onTap(item);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(20),
|
|
|
|
vertical: ScreenUtil().setWidth(6)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: grayBack
|
|
|
|
? Color.fromRGBO(239, 239, 239, 1)
|
|
|
|
: item.select
|
|
|
|
? MyColours.color_199095
|
|
|
|
: MyColours.color_ffffff,
|
|
|
|
border: Border.all(
|
|
|
|
color: grayBack
|
|
|
|
? Color.fromRGBO(239, 239, 239, 1)
|
|
|
|
: item.select
|
|
|
|
? MyColours.color_199095
|
|
|
|
: round
|
|
|
|
? Color.fromRGBO(155, 155, 155, 1)
|
|
|
|
: MyColours.color_199095,
|
|
|
|
width: ScreenUtil().setWidth(2)),
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(round ? 30 : 10))),
|
|
|
|
child: _textWidget(
|
|
|
|
item.title,
|
|
|
|
grayBack
|
|
|
|
? MyColours.color_333333
|
|
|
|
: item.select
|
|
|
|
? MyColours.color_ffffff
|
|
|
|
: round
|
|
|
|
? MyColours.color_333333
|
|
|
|
: MyColours.color_199095,
|
|
|
|
FontWeight.normal,
|
|
|
|
24))));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return items;
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -1125,7 +1307,8 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
controller: tabController,
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
children: _returnListWidget())),
|
|
|
|
customerProvider.pageState == PageState.Success
|
|
|
|
customerProvider.pageState == PageState.Success &&
|
|
|
|
customerProvider.selectCustomerSeller.length > 0
|
|
|
|
? _selectContantWidget()
|
|
|
|
: SizedBox(),
|
|
|
|
|
...
|
...
|
|