|
...
|
...
|
@@ -2,26 +2,28 @@ import 'package:flutter/material.dart'; |
|
|
|
|
|
|
|
import 'package:flutter_screenutil/screenutil.dart';
|
|
|
|
import 'package:one_key/constant/state.dart';
|
|
|
|
import 'package:one_key/pages/my/contant_item_page.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/pages/my/customer_type/contant_list_page.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/provider/contant_show_model.dart';
|
|
|
|
import 'package:one_key/provider/customer_provider.dart';
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
|
|
import 'package:one_key/res/colors.dart';
|
|
|
|
import 'package:one_key/utils/dialog_util.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/utils/event_bus.dart';
|
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
|
|
import 'package:one_key/widgets/common_button_flat.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/widgets/custom_tab_indicator.dart';
|
|
|
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
import 'package:one_key/widgets/page_exception.dart';
|
|
|
|
|
|
|
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
import 'package:azlistview/azlistview.dart';
|
|
|
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
typedef ClickCallback = void Function(dynamic value);
|
|
|
|
|
|
|
|
class CustomerListPage extends StatefulWidget {
|
|
|
|
@override
|
|
|
|
_CustomerListPageState createState() => _CustomerListPageState();
|
|
...
|
...
|
@@ -33,9 +35,16 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
TabController tabController;
|
|
|
|
|
|
|
|
CustomerProvider customerProvider;
|
|
|
|
bool showFilter = false;
|
|
|
|
ScrollController _scrollCrl = ScrollController();
|
|
|
|
int dropValue = 0;
|
|
|
|
bool showDrop = true;
|
|
|
|
List<String> timeTilte = ['大于', '等于', '小于'];
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
_tabBarTitle = ['全部', '活跃', '沉睡', '流失'];
|
|
|
|
// timeTilte = ['大于', '等于', '小于'];
|
|
|
|
super.initState();
|
|
|
|
tabController = TabController(length: 4, vsync: this);
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
|
...
|
...
|
@@ -51,302 +60,1005 @@ class _CustomerListPageState extends State<CustomerListPage> |
|
|
|
await customerProvider.searchData(customerProvider.controller.text);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
customerProvider = Provider.of<CustomerProvider>(context, listen: true);
|
|
|
|
return Material(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
child: Scaffold(
|
|
|
|
resizeToAvoidBottomInset: false,
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar(
|
|
|
|
'全店客户',
|
|
|
|
onTap: () {
|
|
|
|
EventBus().emit('changeStatusColor');
|
|
|
|
///选中的联系人widget
|
|
|
|
Widget _selectContantWidget() {
|
|
|
|
return Container(
|
|
|
|
// constraints: BoxConstraints(maxHeight: ScreenUtil().setWidth(760)),
|
|
|
|
// height: ScreenUtil().setWidth(400),
|
|
|
|
width: double.infinity,
|
|
|
|
padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
blurRadius: ScreenUtil().setWidth(14))
|
|
|
|
],
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
topLeft: Radius.circular(ScreenUtil().setWidth(30)),
|
|
|
|
topRight: Radius.circular(ScreenUtil().setWidth(30)),
|
|
|
|
)),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Image.asset(Utils.getImgPath('select'),
|
|
|
|
width: ScreenUtil().setWidth(30)),
|
|
|
|
HEmptyView(10),
|
|
|
|
Text(
|
|
|
|
'全选',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(26),
|
|
|
|
color: MyColours.color_333333),
|
|
|
|
),
|
|
|
|
HEmptyView(20),
|
|
|
|
Expanded(
|
|
|
|
child: InkWell(
|
|
|
|
child: Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
padding: EdgeInsets.all(ScreenUtil().setWidth(20)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(40)),
|
|
|
|
color: MyColours.color_199095),
|
|
|
|
child: Text(
|
|
|
|
'已选[全部]10000位顾客,下发营销任务',
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
maxLines: 1,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
)),
|
|
|
|
// Expanded(
|
|
|
|
// child: RoundButton(
|
|
|
|
// // width: ScreenUtil().setWidth(600),
|
|
|
|
// height: ScreenUtil().setWidth(80),
|
|
|
|
// radius: ScreenUtil().setWidth(40),
|
|
|
|
// text: '已选 [全部] 80位顾客,下发营销任务frfrfrfrfrffrfrfr',
|
|
|
|
// fontSize: 28,
|
|
|
|
// textColor: MyColours.color_ffffff,
|
|
|
|
// gradientStart: MyColours.color_199095,
|
|
|
|
// gradientEnd: MyColours.color_199095,
|
|
|
|
// onPressed: () {},
|
|
|
|
// ))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// 搜索框
|
|
|
|
Widget _searchWidget() {
|
|
|
|
return Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
),
|
|
|
|
height: ScreenUtil().setWidth(45 * 2),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
|
|
|
|
child: Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: ScreenUtil().setWidth(20 * 2),
|
|
|
|
),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(24 * 2)),
|
|
|
|
border: Border.all(color: Color.fromRGBO(228, 228, 228, 1)),
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
color: Color.fromRGBO(220, 220, 220, 1), //投影颜色
|
|
|
|
offset: Offset(2, 3), //x,y轴
|
|
|
|
blurRadius: ScreenUtil().setWidth(6) //投影距离
|
|
|
|
)
|
|
|
|
]),
|
|
|
|
child: Row(children: [
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
controller: customerProvider.controller,
|
|
|
|
// focusNode: _focusNode,
|
|
|
|
// autofocus: true,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(26)),
|
|
|
|
// textAlignVertical: TextAlignVertical.center,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "输入手机号或姓名",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(26),
|
|
|
|
),
|
|
|
|
// isCollapsed:
|
|
|
|
// true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
|
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
// 左边图标设置
|
|
|
|
icon: Image.asset(
|
|
|
|
Utils.getImgPath('search'),
|
|
|
|
width: ScreenUtil().setWidth(30),
|
|
|
|
),
|
|
|
|
//右边图标设置
|
|
|
|
// suffixIcon:
|
|
|
|
),
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
|
|
|
|
onChanged: (value) {
|
|
|
|
// setState(() {});
|
|
|
|
// _searchSellerLocation();
|
|
|
|
customerProvider.searchData(value);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// contantShowModel.searchData(
|
|
|
|
// contantShowModel.controller.text);
|
|
|
|
// _searchSellerLocation();
|
|
|
|
// _focusNode.unfocus();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Offstage(
|
|
|
|
offstage: customerProvider.controller.text == '',
|
|
|
|
child: GestureDetector(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
vertical: ScreenUtil().setWidth(20),
|
|
|
|
),
|
|
|
|
// color: Colors.orange,
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('clear'),
|
|
|
|
width: ScreenUtil().setWidth(30),
|
|
|
|
height: ScreenUtil().setWidth(30),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback(((_) {
|
|
|
|
customerProvider.controller.clear();
|
|
|
|
customerProvider.searchData('');
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
// Offstage(
|
|
|
|
// offstage: false,
|
|
|
|
// child: GestureDetector(
|
|
|
|
// child: Container(
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// right: ScreenUtil().setWidth(30),
|
|
|
|
// bottom: ScreenUtil().setWidth(20),
|
|
|
|
// top: ScreenUtil().setWidth(20),
|
|
|
|
// ),
|
|
|
|
// child: Text(
|
|
|
|
// '搜索',
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_199095,
|
|
|
|
// fontSize: ScreenUtil().setSp(28)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// onTap: () {
|
|
|
|
// customerProvider.searchData(
|
|
|
|
// customerProvider.controller.text);
|
|
|
|
// },
|
|
|
|
// ))
|
|
|
|
])));
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _menuWidget() {
|
|
|
|
return Container(
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
vertical: ScreenUtil().setWidth(20)),
|
|
|
|
decoration: BoxDecoration(color: MyColours.color_ffffff, boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
// color: Colors.red,
|
|
|
|
color: Color.fromRGBO(220, 220, 220, 1), //投影颜色
|
|
|
|
offset: Offset(2, 2), //x,y轴
|
|
|
|
blurRadius: ScreenUtil().setWidth(6) //投影距离
|
|
|
|
)
|
|
|
|
]),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)),
|
|
|
|
margin:
|
|
|
|
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(30)),
|
|
|
|
child: TabBar(
|
|
|
|
controller: tabController,
|
|
|
|
indicator: CustomTabIndicator(
|
|
|
|
radius: 0,
|
|
|
|
),
|
|
|
|
indicatorColor: MyColours.color_199095,
|
|
|
|
indicatorSize: TabBarIndicatorSize.tab,
|
|
|
|
// indicatorPadding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: ScreenUtil().setWidth(12)),
|
|
|
|
labelColor: MyColours.color_199095,
|
|
|
|
labelStyle: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
labelPadding: EdgeInsets.zero,
|
|
|
|
unselectedLabelStyle: TextStyle(
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
unselectedLabelColor: MyColours.color_999999,
|
|
|
|
tabs: _tabBarTitle.map((value) {
|
|
|
|
return Tab(
|
|
|
|
child: Text(value),
|
|
|
|
);
|
|
|
|
}).toList()),
|
|
|
|
)),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
setState(() {
|
|
|
|
showFilter = !showFilter;
|
|
|
|
});
|
|
|
|
if (showFilter) {
|
|
|
|
_showFilterDialogFromTop(context, onPressedReset: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
setState(() {
|
|
|
|
showFilter = false;
|
|
|
|
});
|
|
|
|
}, onPressedComplete: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
setState(() {
|
|
|
|
showFilter = false;
|
|
|
|
});
|
|
|
|
}, tapWhiteBack: () {
|
|
|
|
// Navigator.of(context).pop();
|
|
|
|
// setState(() {
|
|
|
|
// showFilter = false;
|
|
|
|
// });
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)),
|
|
|
|
margin: EdgeInsets.only(right: ScreenUtil().setWidth(30)),
|
|
|
|
width: ScreenUtil().setWidth(100),
|
|
|
|
// height: ScreenUtil().setWidth(50),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'筛选',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_999999),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
showFilter ? 'c_arrow_up' : 'c_arrow_down'),
|
|
|
|
width: ScreenUtil().setWidth(24),
|
|
|
|
// height: ScreenUtil().setWidth(10),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
));
|
|
|
|
}
|
|
|
|
|
|
|
|
///筛选弹框
|
|
|
|
_showFilterDialogFromTop(BuildContext context,
|
|
|
|
{VoidCallback onPressedReset,
|
|
|
|
VoidCallback onPressedComplete,
|
|
|
|
GestureTapCallback tapWhiteBack}) {
|
|
|
|
showGeneralDialog(
|
|
|
|
context: context,
|
|
|
|
barrierDismissible: false,
|
|
|
|
barrierColor: Colors.transparent,
|
|
|
|
barrierLabel:
|
|
|
|
MaterialLocalizations.of(context).modalBarrierDismissLabel,
|
|
|
|
transitionDuration: const Duration(milliseconds: 150),
|
|
|
|
pageBuilder: (BuildContext context, Animation animation,
|
|
|
|
Animation secondaryAnimation) {
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
// resizeToAvoidBottomInset: false,
|
|
|
|
body: StatefulBuilder(builder: (context, state) {
|
|
|
|
return GestureDetector(
|
|
|
|
// behavior: HitTestBehavior.opaque,
|
|
|
|
onTap: tapWhiteBack,
|
|
|
|
child: _filterWidget(
|
|
|
|
state,
|
|
|
|
onPressedReset,
|
|
|
|
onPressedComplete,
|
|
|
|
));
|
|
|
|
}));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
///弹框text
|
|
|
|
_textWidget(String title, Color textColor, FontWeight fontWeight, int size) {
|
|
|
|
return Text(title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: textColor,
|
|
|
|
decoration: TextDecoration.none,
|
|
|
|
fontWeight: fontWeight,
|
|
|
|
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 _activityWidget() {
|
|
|
|
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 _labelWidget() {
|
|
|
|
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': false},
|
|
|
|
{'title': 'kkkk', 'select': true},
|
|
|
|
], true)),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///大于、等于、小于
|
|
|
|
List<DropdownMenuItem> _dropdownMenuItem() {
|
|
|
|
List<DropdownMenuItem> list = [];
|
|
|
|
for (int i = 0; i < timeTilte.length; i++) {
|
|
|
|
list.add(DropdownMenuItem(
|
|
|
|
child: _textWidget(
|
|
|
|
timeTilte[i], MyColours.color_199095, FontWeight.normal, 24),
|
|
|
|
value: i));
|
|
|
|
}
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
_selectWidget(List<String> data, ClickCallback onTap) {
|
|
|
|
return Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
border: Border.all(
|
|
|
|
color: MyColours.color_cccccc,
|
|
|
|
width: ScreenUtil().setWidth(2))),
|
|
|
|
width: ScreenUtil().setWidth(130 * 2),
|
|
|
|
// constraints: BoxConstraints(
|
|
|
|
// maxHeight: ScreenUtil().setWidth(130 * 2),
|
|
|
|
// ),
|
|
|
|
child: ListView.builder(
|
|
|
|
shrinkWrap: true,
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(8)),
|
|
|
|
itemCount: data.length,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
onTap(index);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(20)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
color: MyColours.color_efefef,
|
|
|
|
width: data.length - 1 == index
|
|
|
|
? 0
|
|
|
|
: ScreenUtil().setWidth(2)))),
|
|
|
|
child: Text(data[index],
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: ScreenUtil().setSp(28))),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
|
|
|
|
///高级筛选
|
|
|
|
Widget _advancedFilterWidget(state) {
|
|
|
|
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),
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Expanded(child: _textFeildWidget()),
|
|
|
|
HEmptyView(10),
|
|
|
|
_textWidget('至', MyColours.color_199095, FontWeight.normal, 24),
|
|
|
|
HEmptyView(10),
|
|
|
|
Expanded(child: _textFeildWidget()),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
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)),
|
|
|
|
VEmptyView(30),
|
|
|
|
_textWidget('时间内预订次数', MyColours.color_333333, FontWeight.normal, 24),
|
|
|
|
VEmptyView(30),
|
|
|
|
/**
|
|
|
|
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
|
|
|
Material(
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(50),
|
|
|
|
width: ScreenUtil().setWidth(130),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(30)),
|
|
|
|
color: Color.fromRGBO(239, 239, 239, 1)),
|
|
|
|
child: _buttonChoose(dropValue, (value) {
|
|
|
|
state(() {
|
|
|
|
showDrop = !showDrop;
|
|
|
|
_scrollCrl.jumpTo(_scrollCrl.position.maxScrollExtent);
|
|
|
|
});
|
|
|
|
|
|
|
|
// _scrollCrl.position
|
|
|
|
// .didUpdateScrollPositionBy(2); //这里触发更新滚动条
|
|
|
|
}))),
|
|
|
|
VEmptyView(10),
|
|
|
|
Material(
|
|
|
|
child: Offstage(
|
|
|
|
offstage: showDrop,
|
|
|
|
child: _selectWidget(timeTilte, (index) {
|
|
|
|
print(timeTilte[index]);
|
|
|
|
state(() {
|
|
|
|
showDrop = !showDrop;
|
|
|
|
// _provider.currentIndex = index;
|
|
|
|
dropValue = timeTilte[index];
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
)),
|
|
|
|
]),
|
|
|
|
VEmptyView(50),
|
|
|
|
*/
|
|
|
|
Row(children: [
|
|
|
|
Material(
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(50),
|
|
|
|
// width: ScreenUtil().setWidth(100),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(20)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(30)),
|
|
|
|
color: Color.fromRGBO(239, 239, 239, 1)),
|
|
|
|
child: DropdownButton(
|
|
|
|
underline: SizedBox(),
|
|
|
|
value: dropValue,
|
|
|
|
isDense: true,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
focusColor: MyColours.color_199095,
|
|
|
|
items: _dropdownMenuItem(),
|
|
|
|
icon: Row(
|
|
|
|
children: [
|
|
|
|
HEmptyView(10),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('c_arrow_down'),
|
|
|
|
width: ScreenUtil().setWidth(24),
|
|
|
|
// height: ScreenUtil().setWidth(10),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
onChanged: (value) {
|
|
|
|
print(value);
|
|
|
|
state(() => dropValue = value);
|
|
|
|
}))),
|
|
|
|
HEmptyView(20),
|
|
|
|
Container(
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: ScreenUtil().setWidth(20),
|
|
|
|
// ),
|
|
|
|
width: ScreenUtil().setWidth(160),
|
|
|
|
height: ScreenUtil().setWidth(50),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
color: Color.fromRGBO(180, 180, 180, 1),
|
|
|
|
width: ScreenUtil().setWidth(2))),
|
|
|
|
),
|
|
|
|
child: Material(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
controller: customerProvider.controller,
|
|
|
|
// focusNode: _focusNode,
|
|
|
|
// autofocus: true,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(26)),
|
|
|
|
// textAlignVertical: TextAlignVertical.center,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
// hintText: "xxx",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(26),
|
|
|
|
),
|
|
|
|
// isCollapsed:
|
|
|
|
// true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
|
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
),
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
|
|
|
|
onChanged: (value) {
|
|
|
|
// setState(() {});
|
|
|
|
// _searchSellerLocation();
|
|
|
|
customerProvider.searchData(value);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// contantShowModel.searchData(
|
|
|
|
// contantShowModel.controller.text);
|
|
|
|
// _searchSellerLocation();
|
|
|
|
// _focusNode.unfocus();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
body: WillPopScope(
|
|
|
|
child: SafeArea(
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
vertical: ScreenUtil().setWidth(10)),
|
|
|
|
height: ScreenUtil().setWidth(45 * 2),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
)),
|
|
|
|
HEmptyView(20),
|
|
|
|
_textWidget('次预订', MyColours.color_333333, FontWeight.normal, 24),
|
|
|
|
]),
|
|
|
|
VEmptyView(30),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
child: Stack(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(20 * 2),
|
|
|
|
vertical: ScreenUtil().setWidth(14)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(24 * 2)),
|
|
|
|
border: Border.all(
|
|
|
|
color:
|
|
|
|
Color.fromRGBO(228, 228, 228, 1)),
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
color: Color.fromRGBO(
|
|
|
|
220, 220, 220, 1), //投影颜色
|
|
|
|
offset: Offset(2, 3), //x,y轴
|
|
|
|
blurRadius:
|
|
|
|
ScreenUtil().setWidth(6) //投影距离
|
|
|
|
)
|
|
|
|
]),
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
controller: customerProvider.controller,
|
|
|
|
// focusNode: _focusNode,
|
|
|
|
// autofocus: true,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(26)),
|
|
|
|
// textAlignVertical: TextAlignVertical.center,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
contentPadding: EdgeInsets.only(
|
|
|
|
right: ScreenUtil().setWidth(40 * 2)),
|
|
|
|
hintText: "输入手机号或姓名",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(26),
|
|
|
|
),
|
|
|
|
isCollapsed:
|
|
|
|
true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none),
|
|
|
|
// 左边图标设置
|
|
|
|
icon: Image.asset(
|
|
|
|
Utils.getImgPath('search'),
|
|
|
|
width: ScreenUtil().setWidth(30),
|
|
|
|
),
|
|
|
|
//右边图标设置
|
|
|
|
// suffixIcon:
|
|
|
|
),
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
|
|
|
|
onChanged: (value) {
|
|
|
|
// setState(() {});
|
|
|
|
// _searchSellerLocation();
|
|
|
|
customerProvider.searchData(value);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context).requestFocus(
|
|
|
|
FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// contantShowModel.searchData(
|
|
|
|
// contantShowModel.controller.text);
|
|
|
|
// _searchSellerLocation();
|
|
|
|
// _focusNode.unfocus();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Positioned(
|
|
|
|
right: 0,
|
|
|
|
top: 0,
|
|
|
|
bottom: 0,
|
|
|
|
child: Offstage(
|
|
|
|
offstage:
|
|
|
|
customerProvider.controller.text ==
|
|
|
|
'',
|
|
|
|
child: GestureDetector(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
right: ScreenUtil()
|
|
|
|
.setWidth(20 * 2)),
|
|
|
|
// color: Colors.orange,
|
|
|
|
height:
|
|
|
|
ScreenUtil().setWidth(45 * 2),
|
|
|
|
width:
|
|
|
|
ScreenUtil().setWidth(100 * 2),
|
|
|
|
alignment: Alignment.centerRight,
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath('clear'),
|
|
|
|
width: ScreenUtil().setWidth(30),
|
|
|
|
height: ScreenUtil().setWidth(30),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
WidgetsBinding.instance
|
|
|
|
.addPostFrameCallback(((_) {
|
|
|
|
customerProvider.controller
|
|
|
|
.clear();
|
|
|
|
customerProvider.searchData('');
|
|
|
|
}));
|
|
|
|
},
|
|
|
|
)))
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
Container(
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
vertical: ScreenUtil().setWidth(20)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
// color: Colors.red,
|
|
|
|
color: Color.fromRGBO(
|
|
|
|
220, 220, 220, 1), //投影颜色
|
|
|
|
offset: Offset(2, 2), //x,y轴
|
|
|
|
blurRadius:
|
|
|
|
ScreenUtil().setWidth(6) //投影距离
|
|
|
|
)
|
|
|
|
]),
|
|
|
|
child: Row(
|
|
|
|
_buttonChoose(String title, ClickCallback callback) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: () {
|
|
|
|
callback(title);
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(20),
|
|
|
|
vertical: ScreenUtil().setWidth(10)),
|
|
|
|
height: ScreenUtil().setWidth(60),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
// border: Border.all(
|
|
|
|
// width: ScreenUtil().setWidth(2),
|
|
|
|
// color: MyColours.color_199095),
|
|
|
|
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(30))),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: title == '时间(选填)' || title == '(选填)'
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_199095,
|
|
|
|
fontSize: ScreenUtil().setWidth(28)),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('enter_order_arrow'),
|
|
|
|
width: ScreenUtil().setWidth(20),
|
|
|
|
height: ScreenUtil().setWidth(10),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
|
|
|
|
/// 高级筛选输入框
|
|
|
|
Widget _textFeildWidget() {
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(20),
|
|
|
|
),
|
|
|
|
height: ScreenUtil().setWidth(50),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: Color.fromRGBO(239, 239, 239, 1),
|
|
|
|
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(30))),
|
|
|
|
child: Material(
|
|
|
|
color: Color.fromRGBO(239, 239, 239, 1),
|
|
|
|
child: Row(children: [
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
controller: customerProvider.controller,
|
|
|
|
// focusNode: _focusNode,
|
|
|
|
// autofocus: true,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(26)),
|
|
|
|
// textAlignVertical: TextAlignVertical.center,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "xxx",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(26),
|
|
|
|
),
|
|
|
|
// isCollapsed:
|
|
|
|
// true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
|
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
),
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
|
|
|
|
onChanged: (value) {
|
|
|
|
// setState(() {});
|
|
|
|
// _searchSellerLocation();
|
|
|
|
customerProvider.searchData(value);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// contantShowModel.searchData(
|
|
|
|
// contantShowModel.controller.text);
|
|
|
|
// _searchSellerLocation();
|
|
|
|
// _focusNode.unfocus();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
_textWidget('天', MyColours.color_333333, FontWeight.normal, 24),
|
|
|
|
])));
|
|
|
|
}
|
|
|
|
|
|
|
|
///筛选布局
|
|
|
|
Widget _filterWidget(
|
|
|
|
StateSetter state,
|
|
|
|
VoidCallback onPressedReset,
|
|
|
|
VoidCallback onPressedComplete,
|
|
|
|
) {
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: ScreenUtil().setWidth(30),
|
|
|
|
),
|
|
|
|
// height: ScreenUtil().setWidth(100),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
top: ScreenUtil().setWidth(92 + 52 + 30 * 3 + 90) +
|
|
|
|
ScreenUtil.statusBarHeight),
|
|
|
|
color: Color.fromRGBO(00, 00, 00, 0.49),
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.topCenter,
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
bottomRight: Radius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
bottomLeft: Radius.circular(ScreenUtil().setWidth(20)))),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
left: ScreenUtil().setWidth(40),
|
|
|
|
bottom: ScreenUtil().setWidth(140),
|
|
|
|
right: ScreenUtil().setWidth(40)),
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
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: [
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
bottom: ScreenUtil().setWidth(10)),
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(30)),
|
|
|
|
child: TabBar(
|
|
|
|
controller: tabController,
|
|
|
|
indicator: CustomTabIndicator(
|
|
|
|
radius: 0,
|
|
|
|
),
|
|
|
|
indicatorColor: MyColours.color_199095,
|
|
|
|
indicatorSize: TabBarIndicatorSize.tab,
|
|
|
|
// indicatorPadding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: ScreenUtil().setWidth(12)),
|
|
|
|
labelColor: MyColours.color_199095,
|
|
|
|
labelStyle: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
labelPadding: EdgeInsets.zero,
|
|
|
|
unselectedLabelStyle: TextStyle(
|
|
|
|
fontWeight: FontWeight.normal,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
unselectedLabelColor:
|
|
|
|
MyColours.color_999999,
|
|
|
|
tabs: _tabBarTitle.map((value) {
|
|
|
|
return Tab(
|
|
|
|
child: Text(value),
|
|
|
|
);
|
|
|
|
}).toList()),
|
|
|
|
)),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
bottom: ScreenUtil().setWidth(10)),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
right: ScreenUtil().setWidth(30)),
|
|
|
|
width: ScreenUtil().setWidth(100),
|
|
|
|
// height: ScreenUtil().setWidth(50),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'筛选',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(28),
|
|
|
|
color: MyColours.color_999999),
|
|
|
|
),
|
|
|
|
HEmptyView(10),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
'enter_order_arrow'),
|
|
|
|
width: ScreenUtil().setWidth(20),
|
|
|
|
height: ScreenUtil().setWidth(10),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
)
|
|
|
|
VEmptyView(20),
|
|
|
|
_managerWidget(),
|
|
|
|
VEmptyView(30),
|
|
|
|
_activityWidget(),
|
|
|
|
VEmptyView(30),
|
|
|
|
_labelWidget(),
|
|
|
|
VEmptyView(30),
|
|
|
|
_advancedFilterWidget(state)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
))),
|
|
|
|
Row(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
width: ScreenUtil.screenWidthDp -
|
|
|
|
ScreenUtil().setWidth(40 * 4),
|
|
|
|
height: ScreenUtil().setWidth(100),
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: ScreenUtil().setWidth(40)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
boxShadow: [
|
|
|
|
BoxShadow(
|
|
|
|
color: MyColours.color_E0E0E0,
|
|
|
|
blurRadius: ScreenUtil().setWidth(14))
|
|
|
|
],
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(20),
|
|
|
|
)),
|
|
|
|
VEmptyView(10),
|
|
|
|
Expanded(
|
|
|
|
child: TabBarView(
|
|
|
|
controller: tabController,
|
|
|
|
// physics: NeverScrollableScrollPhysics(),
|
|
|
|
child: Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: <Widget>[
|
|
|
|
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 ContactListPage(
|
|
|
|
contacts: model.userHistorysShow);
|
|
|
|
// return ListView.builder(
|
|
|
|
// itemCount: model.userHistorysShow.length,
|
|
|
|
// itemBuilder:
|
|
|
|
// (BuildContext context, int index) {
|
|
|
|
// String phone = model
|
|
|
|
// .userHistorysShow[index]
|
|
|
|
// .phone ==
|
|
|
|
// null ||
|
|
|
|
// model.userHistorysShow[index]
|
|
|
|
// .phone ==
|
|
|
|
// ''
|
|
|
|
// ? ''
|
|
|
|
// : model
|
|
|
|
// .userHistorysShow[index].phone;
|
|
|
|
// return ContantItemPage(
|
|
|
|
// onTap: () {
|
|
|
|
// if (model.userHistorysShow[index]
|
|
|
|
// .phone !=
|
|
|
|
// null &&
|
|
|
|
// model.userHistorysShow[index]
|
|
|
|
// .phone !=
|
|
|
|
// '') {
|
|
|
|
// DialogUtil.goPhone(model
|
|
|
|
// .userHistorysShow[index]
|
|
|
|
// .phone);
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// index: index,
|
|
|
|
// model: customerProvider,
|
|
|
|
// data: model.userHistorysShow,
|
|
|
|
// );
|
|
|
|
// });
|
|
|
|
}
|
|
|
|
},
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
height: 200,
|
|
|
|
width: 300,
|
|
|
|
color: Colors.red,
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
height: 200,
|
|
|
|
width: 300,
|
|
|
|
color: Colors.red,
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
height: 200,
|
|
|
|
width: 300,
|
|
|
|
color: Colors.red,
|
|
|
|
)
|
|
|
|
Expanded(
|
|
|
|
flex: 1,
|
|
|
|
child: Material(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: onPressedReset,
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
bottomLeft: Radius.circular(
|
|
|
|
ScreenUtil().setWidth(20)),
|
|
|
|
topLeft: Radius.circular(
|
|
|
|
ScreenUtil().setWidth(20)),
|
|
|
|
)),
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: _textWidget(
|
|
|
|
'重置',
|
|
|
|
MyColours.color_333333,
|
|
|
|
FontWeight.normal,
|
|
|
|
30),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
))),
|
|
|
|
Expanded(
|
|
|
|
flex: 1,
|
|
|
|
child: Material(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: onPressedComplete,
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
topRight: Radius.circular(
|
|
|
|
ScreenUtil().setWidth(20)),
|
|
|
|
bottomRight: Radius.circular(
|
|
|
|
ScreenUtil().setWidth(20)),
|
|
|
|
)),
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: _textWidget(
|
|
|
|
'确定',
|
|
|
|
MyColours.color_ffffff,
|
|
|
|
FontWeight.normal,
|
|
|
|
30),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)))
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
onWillPop: () async {
|
|
|
|
EventBus().emit('changeStatusColor');
|
|
|
|
return true;
|
|
|
|
}))));
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
VEmptyView(30)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
|
|
|
|
//构建筛选按钮
|
|
|
|
List<Widget> _buildFilterItem(List<Map> data, bool round,
|
|
|
|
{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)));
|
|
|
|
}
|
|
|
|
return items;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
customerProvider = Provider.of<CustomerProvider>(context, listen: true);
|
|
|
|
return Material(
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
child: Scaffold(
|
|
|
|
resizeToAvoidBottomInset: false,
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
appBar: SystemAppBar(
|
|
|
|
'全店客户',
|
|
|
|
onTap: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
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>[
|
|
|
|
ContactListPage(
|
|
|
|
contacts: model.userHistorysShow,
|
|
|
|
provider: customerProvider),
|
|
|
|
ContactListPage(
|
|
|
|
contacts: model.userHistorysShow,
|
|
|
|
provider: customerProvider),
|
|
|
|
ContactListPage(
|
|
|
|
contacts: model.userHistorysShow,
|
|
|
|
provider: customerProvider),
|
|
|
|
ContactListPage(
|
|
|
|
contacts: model.userHistorysShow,
|
|
|
|
provider: customerProvider),
|
|
|
|
])),
|
|
|
|
customerProvider.pageState == PageState.Success
|
|
|
|
? _selectContantWidget()
|
|
|
|
: SizedBox(),
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
})),
|
|
|
|
// _searchWidget(),
|
|
|
|
// Positioned(
|
|
|
|
// top: 0,
|
|
|
|
// left: ScreenUtil().setWidth(40),
|
|
|
|
// right: ScreenUtil().setWidth(40),
|
|
|
|
// child: _filterWidget())
|
|
|
|
// ],
|
|
|
|
])),
|
|
|
|
)));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|