|
...
|
...
|
@@ -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/my_customer/my_contant_list_page.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/provider/customer_making_provider.dart';
|
|
...
|
...
|
@@ -25,6 +27,8 @@ 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 MyCustomerListPage extends StatefulWidget {
|
|
|
|
final FromPage fromPage;
|
|
...
|
...
|
@@ -45,7 +49,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
ScrollController _scrollCrl = ScrollController();
|
|
|
|
int dropValue = 0;
|
|
|
|
bool showDrop = true;
|
|
|
|
List<String> timeTilte = ['大于', '等于', '小于'];
|
|
|
|
List<String> timeTilte = ['等于', '小于', '大于'];
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
...
|
...
|
@@ -55,13 +59,27 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
tabController = TabController(length: 4, vsync: this);
|
|
|
|
tabController.addListener(() {
|
|
|
|
if (tabController.index == tabController.animation.value) {
|
|
|
|
if (customerProvider.index == tabController.index) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
print(tabController.index);
|
|
|
|
customerProvider.index = tabController.index;
|
|
|
|
customerProvider.searchData(customerProvider.controller.text);
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_getContantData();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
|
|
customerProvider.initData();
|
|
|
|
_getContantData();
|
|
|
|
_filterLabelList();
|
|
|
|
});
|
|
|
|
bus.on("refresh_guest_list", (arg) {
|
|
|
|
_getContantData();
|
|
...
|
...
|
@@ -74,10 +92,80 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
super.dispose();
|
|
|
|
}
|
|
|
|
|
|
|
|
_getContantData() 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}) async {
|
|
|
|
if (showLoading) {
|
|
|
|
customerProvider.pageState = PageState.Loading;
|
|
|
|
}
|
|
|
|
customerProvider.notifyListeners();
|
|
|
|
Map<String, String> params = {
|
|
|
|
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
};
|
|
|
|
if (customerProvider.index != 0 && customerProvider.index != null) {
|
|
|
|
//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;
|
|
|
|
}
|
|
|
|
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}';
|
|
|
|
}
|
|
|
|
|
|
|
|
// params['reserve_date'] XX天内,例:30
|
|
|
|
// params['reserve_num'] 时间内预定次数
|
|
|
|
// params['reserve_sort'] 1 等于 2 小于 3 大于
|
|
|
|
|
|
|
|
await customerProvider.getCustomerList(context, params);
|
|
|
|
// await customerProvider.searchData(customerProvider.controller.text);
|
|
|
|
}
|
|
...
|
...
|
@@ -244,7 +332,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
onChanged: (value) {
|
|
|
|
// setState(() {});
|
|
|
|
// _searchSellerLocation();
|
|
|
|
customerProvider.searchData(value);
|
|
|
|
// customerProvider.searchData(value);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
...
|
...
|
@@ -275,7 +363,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
onTap: () {
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback(((_) {
|
|
|
|
customerProvider.controller.clear();
|
|
|
|
customerProvider.searchData('');
|
|
|
|
// customerProvider.searchData('');
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
)),
|
|
...
|
...
|
@@ -354,16 +442,33 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
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(() {
|
|
...
|
...
|
@@ -401,7 +506,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
|
|
|
|
///筛选弹框
|
|
|
|
_showFilterDialogFromTop(BuildContext context,
|
|
|
|
{VoidCallback onPressedReset,
|
|
|
|
{ClickCallState onPressedReset,
|
|
|
|
VoidCallback onPressedComplete,
|
|
|
|
GestureTapCallback tapWhiteBack}) {
|
|
|
|
showGeneralDialog(
|
|
...
|
...
|
@@ -439,44 +544,44 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
fontSize: ScreenUtil().setSp(size)));
|
|
|
|
}
|
|
|
|
|
|
|
|
///客户经理
|
|
|
|
Widget _managerWidget() {
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
_textWidget('客户经理', MyColours.color_333333, FontWeight.bold, 28),
|
|
|
|
GestureDetector(
|
|
|
|
onTap: () {},
|
|
|
|
child: _textWidget(
|
|
|
|
'全选', 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': true},
|
|
|
|
{'title': 'kkkk', 'select': true},
|
|
|
|
], false)),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
// ///客户经理
|
|
|
|
// Widget _managerWidget() {
|
|
|
|
// return Column(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
// children: [
|
|
|
|
// Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
// children: [
|
|
|
|
// _textWidget('客户经理', MyColours.color_333333, FontWeight.bold, 28),
|
|
|
|
// GestureDetector(
|
|
|
|
// onTap: () {},
|
|
|
|
// child: _textWidget(
|
|
|
|
// '全选', 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': true},
|
|
|
|
// {'title': 'kkkk', 'select': true},
|
|
|
|
// ], false)),
|
|
|
|
// ],
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
|
|
|
|
///活跃度
|
|
|
|
Widget _activityWidget() {
|
|
|
|
Widget _activityWidget(StateSetter state) {
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
...
|
...
|
@@ -485,9 +590,29 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
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)),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
...
|
...
|
@@ -495,24 +620,18 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
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: [
|
|
...
|
...
|
@@ -521,28 +640,45 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
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;
|
|
|
|
});
|
|
|
|
})),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
...
|
...
|
@@ -601,7 +737,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
}
|
|
|
|
|
|
|
|
///高级筛选
|
|
|
|
Widget _advancedFilterWidget(state) {
|
|
|
|
Widget _advancedFilterWidget(StateSetter state) {
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
...
|
...
|
@@ -610,32 +746,54 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
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),
|
|
...
|
...
|
@@ -706,6 +864,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
print(value);
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
state(() => dropValue = value);
|
|
|
|
}))),
|
|
|
|
HEmptyView(20),
|
|
...
|
...
|
@@ -726,7 +886,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
controller: customerProvider.controller,
|
|
|
|
controller: customerProvider.controllernum,
|
|
|
|
// focusNode: _focusNode,
|
|
|
|
// autofocus: true,
|
|
|
|
|
|
...
|
...
|
@@ -745,13 +905,13 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
),
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
|
|
|
|
onChanged: (value) {
|
|
|
|
// setState(() {});
|
|
|
|
// _searchSellerLocation();
|
|
|
|
customerProvider.searchData(value);
|
|
|
|
// customerProvider.searchData(value);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
...
|
...
|
@@ -766,7 +926,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
HEmptyView(20),
|
|
|
|
_textWidget('次预订', MyColours.color_333333, FontWeight.normal, 24),
|
|
|
|
]),
|
|
|
|
VEmptyView(30),
|
|
|
|
VEmptyView(50),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
...
|
...
|
@@ -807,7 +967,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
}
|
|
|
|
|
|
|
|
/// 高级筛选输入框
|
|
|
|
Widget _textFeildWidget() {
|
|
|
|
Widget _textFeildWidget(
|
|
|
|
TextEditingController controller, FocusNode focusNode) {
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(20),
|
|
...
|
...
|
@@ -823,8 +984,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
controller: customerProvider.controller,
|
|
|
|
// focusNode: _focusNode,
|
|
|
|
controller: controller,
|
|
|
|
focusNode: focusNode,
|
|
|
|
// autofocus: true,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
...
|
...
|
@@ -832,7 +993,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
fontSize: ScreenUtil().setSp(26)),
|
|
|
|
// textAlignVertical: TextAlignVertical.center,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "xxx",
|
|
|
|
hintText: "",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(26),
|
|
...
|
...
|
@@ -842,13 +1003,13 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
),
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
|
|
|
|
onChanged: (value) {
|
|
|
|
// setState(() {});
|
|
|
|
// _searchSellerLocation();
|
|
|
|
customerProvider.searchData(value);
|
|
|
|
// customerProvider.searchData(value);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
...
|
...
|
@@ -867,7 +1028,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
///筛选布局
|
|
|
|
Widget _filterWidget(
|
|
|
|
StateSetter state,
|
|
|
|
VoidCallback onPressedReset,
|
|
|
|
ClickCallState onPressedReset,
|
|
|
|
VoidCallback onPressedComplete,
|
|
|
|
) {
|
|
|
|
return Container(
|
|
...
|
...
|
@@ -896,33 +1057,34 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
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(
|
|
...
|
...
|
@@ -949,7 +1111,9 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
flex: 1,
|
|
|
|
child: Material(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: onPressedReset,
|
|
|
|
onTap: () {
|
|
|
|
onPressedReset(state);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
...
|
...
|
@@ -1005,47 +1169,81 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
}
|
|
|
|
|
|
|
|
//构建筛选按钮
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
List<Widget> _returnListWidget() {
|
|
|
|
List<Widget> list = [];
|
|
|
|
for (int i = 0; i < 4; i++) {
|
|
|
|
list.add(Consumer<CustomerProvider>(builder: (context, model, _) {
|
|
|
|
if (model.pageState != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageState,
|
|
|
|
callback: () {
|
|
|
|
model.pageState = PageState.Loading;
|
|
|
|
model.notifyListeners();
|
|
|
|
_getContantData();
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有客户哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return MyContactListPage(
|
|
|
|
contacts: model.userHistorys,
|
|
|
|
provider: customerProvider,
|
|
|
|
fromPage: widget.fromPage);
|
|
|
|
}
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
customerProvider = Provider.of<CustomerProvider>(context, listen: true);
|
|
...
|
...
|
@@ -1069,110 +1267,14 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> |
|
|
|
body: SafeArea(
|
|
|
|
child: Column(children: [
|
|
|
|
_searchWidget(), _menuWidget(),
|
|
|
|
Expanded(child:
|
|
|
|
Consumer<CustomerProvider>(builder: (context, model, _) {
|
|
|
|
if (model.pageState != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageState,
|
|
|
|
callback: () {
|
|
|
|
model.pageState = PageState.Loading;
|
|
|
|
model.notifyListeners();
|
|
|
|
_getContantData();
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有客户哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return Column(children: [
|
|
|
|
Expanded(
|
|
|
|
child: TabBarView(
|
|
|
|
controller: tabController,
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
children: <Widget>[
|
|
|
|
MyContactListPage(
|
|
|
|
contacts: model.userHistorysShow,
|
|
|
|
provider: customerProvider,
|
|
|
|
fromPage: widget.fromPage),
|
|
|
|
Consumer<CustomerProvider>(
|
|
|
|
builder: (context, model, _) {
|
|
|
|
if (model.pageStateHuoyue != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageStateHuoyue,
|
|
|
|
callback: () {
|
|
|
|
model.pageStateHuoyue = PageState.Loading;
|
|
|
|
model.notifyListeners();
|
|
|
|
_getContantData();
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有客户哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return MyContactListPage(
|
|
|
|
contacts: model.userHistorysShowHuoyue,
|
|
|
|
provider: customerProvider,
|
|
|
|
fromPage: widget.fromPage);
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
Consumer<CustomerProvider>(
|
|
|
|
builder: (context, model, _) {
|
|
|
|
if (model.pageStateChenshui !=
|
|
|
|
PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageStateChenshui,
|
|
|
|
callback: () {
|
|
|
|
model.pageStateChenshui = PageState.Loading;
|
|
|
|
model.notifyListeners();
|
|
|
|
_getContantData();
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有客户哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return MyContactListPage(
|
|
|
|
contacts: model.userHistorysShowChenshui,
|
|
|
|
provider: customerProvider,
|
|
|
|
fromPage: widget.fromPage);
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
Consumer<CustomerProvider>(
|
|
|
|
builder: (context, model, _) {
|
|
|
|
if (model.pageStateLiushi != PageState.Success) {
|
|
|
|
return ExceptionPage(
|
|
|
|
pageState: model.pageStateLiushi,
|
|
|
|
callback: () {
|
|
|
|
model.pageStateLiushi = PageState.Loading;
|
|
|
|
model.notifyListeners();
|
|
|
|
_getContantData();
|
|
|
|
},
|
|
|
|
emptyMsg: "暂时没有客户哦",
|
|
|
|
emptyImg: "empty_search",
|
|
|
|
showMsg: "加载中,请稍后...",
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
return MyContactListPage(
|
|
|
|
contacts: model.userHistorysShowLiushi,
|
|
|
|
provider: customerProvider,
|
|
|
|
fromPage: widget.fromPage);
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
// ContactListPage(
|
|
|
|
// contacts: model.userHistorysShowChenshui,
|
|
|
|
// provider: customerProvider,
|
|
|
|
// fromPage: widget.fromPage),
|
|
|
|
// ContactListPage(
|
|
|
|
// contacts: model.userHistorysShowLiushi,
|
|
|
|
// provider: customerProvider,
|
|
|
|
// fromPage: widget.fromPage),
|
|
|
|
])),
|
|
|
|
customerProvider.pageState == PageState.Success
|
|
|
|
? _selectContantWidget()
|
|
|
|
: SizedBox(),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
})),
|
|
|
|
Expanded(
|
|
|
|
child: TabBarView(
|
|
|
|
controller: tabController,
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
children: _returnListWidget())),
|
|
|
|
customerProvider.pageState == PageState.Success
|
|
|
|
? _selectContantWidget()
|
|
|
|
: SizedBox(),
|
|
|
|
// _searchWidget(),
|
|
|
|
// Positioned(
|
|
|
|
// top: 0,
|
...
|
...
|
|