Showing
30 changed files
with
1452 additions
and
349 deletions
| @@ -30,6 +30,7 @@ apply plugin: 'com.huawei.agconnect' | @@ -30,6 +30,7 @@ apply plugin: 'com.huawei.agconnect' | ||
| 30 | android { | 30 | android { |
| 31 | compileSdkVersion 28 | 31 | compileSdkVersion 28 |
| 32 | 32 | ||
| 33 | + | ||
| 33 | sourceSets { | 34 | sourceSets { |
| 34 | main.java.srcDirs += 'src/main/kotlin' | 35 | main.java.srcDirs += 'src/main/kotlin' |
| 35 | } | 36 | } |
| @@ -3,6 +3,7 @@ buildscript { | @@ -3,6 +3,7 @@ buildscript { | ||
| 3 | repositories { | 3 | repositories { |
| 4 | google() | 4 | google() |
| 5 | jcenter() | 5 | jcenter() |
| 6 | + | ||
| 6 | maven {url 'http://developer.huawei.com/repo/'} | 7 | maven {url 'http://developer.huawei.com/repo/'} |
| 7 | } | 8 | } |
| 8 | 9 | ||
| @@ -17,6 +18,7 @@ allprojects { | @@ -17,6 +18,7 @@ allprojects { | ||
| 17 | repositories { | 18 | repositories { |
| 18 | google() | 19 | google() |
| 19 | jcenter() | 20 | jcenter() |
| 21 | + | ||
| 20 | maven {url 'http://developer.huawei.com/repo/'} | 22 | maven {url 'http://developer.huawei.com/repo/'} |
| 21 | } | 23 | } |
| 22 | } | 24 | } |
| 1 | -#Fri Jun 23 08:50:38 CEST 2017 | 1 | +#Mon Dec 20 13:10:07 CST 2021 |
| 2 | distributionBase=GRADLE_USER_HOME | 2 | distributionBase=GRADLE_USER_HOME |
| 3 | +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip | ||
| 3 | distributionPath=wrapper/dists | 4 | distributionPath=wrapper/dists |
| 4 | -zipStoreBase=GRADLE_USER_HOME | ||
| 5 | zipStorePath=wrapper/dists | 5 | zipStorePath=wrapper/dists |
| 6 | -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip | 6 | +zipStoreBase=GRADLE_USER_HOME |
assets/c_arrow_down.png
0 → 100755
6.52 KB
assets/c_arrow_left.png
0 → 100755
5.82 KB
assets/c_arrow_left_gray.png
0 → 100755
10.7 KB
assets/c_arrow_right.png
0 → 100755
6.3 KB
assets/c_arrow_right_gray.png
0 → 100755
11.9 KB
assets/c_arrow_up.png
0 → 100755
6.21 KB
assets/c_edit.png
0 → 100755
7.2 KB
assets/c_mul_select.png
0 → 100755
6.76 KB
assets/c_mul_select_un.png
0 → 100755
16.4 KB
assets/c_phone.png
0 → 100755
6.83 KB
assets/c_set.png
0 → 100755
11 KB
assets/c_state_cancel.png
0 → 100755
13.8 KB
assets/c_state_done.png
0 → 100755
12.5 KB
assets/c_state_ing.png
0 → 100755
10.8 KB
assets/warning.png
0 → 100755
8.31 KB
| @@ -27,6 +27,27 @@ class UserHistoryEntity extends Object with ISuspensionBean { | @@ -27,6 +27,27 @@ class UserHistoryEntity extends Object with ISuspensionBean { | ||
| 27 | String pinyin; //全拼字母 | 27 | String pinyin; //全拼字母 |
| 28 | String pinyinFirst; //首字母 | 28 | String pinyinFirst; //首字母 |
| 29 | String tagIndex; //abcdefg | 29 | String tagIndex; //abcdefg |
| 30 | + String get rnameStr { | ||
| 31 | + if (rname == null || rname == '') return ""; | ||
| 32 | + return rname; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + String get sexStr { | ||
| 36 | + if (sex == null || sex == '') return ""; | ||
| 37 | + switch (sex.toString()) { | ||
| 38 | + case "1": //先生 | ||
| 39 | + case "男": | ||
| 40 | + case "先生": | ||
| 41 | + return "先生"; | ||
| 42 | + case "2": //女士 | ||
| 43 | + case "女": | ||
| 44 | + case "女士": | ||
| 45 | + return "女士"; | ||
| 46 | + case "3": //公司 | ||
| 47 | + case "公司": | ||
| 48 | + return "公司"; | ||
| 49 | + } | ||
| 50 | + } | ||
| 30 | 51 | ||
| 31 | UserHistoryEntity( | 52 | UserHistoryEntity( |
| 32 | this.id, | 53 | this.id, |
| 1 | import 'package:azlistview/azlistview.dart'; | 1 | import 'package:azlistview/azlistview.dart'; |
| 2 | import 'package:flutter/material.dart'; | 2 | import 'package:flutter/material.dart'; |
| 3 | -import 'package:flutter/services.dart'; | ||
| 4 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 5 | -import 'package:lpinyin/lpinyin.dart'; | 4 | + |
| 6 | import 'package:one_key/models/user_history_entity.dart'; | 5 | import 'package:one_key/models/user_history_entity.dart'; |
| 7 | -import 'package:one_key/provider/contact_model.dart'; | 6 | +import 'package:one_key/provider/customer_provider.dart'; |
| 8 | import 'package:one_key/res/colors.dart'; | 7 | import 'package:one_key/res/colors.dart'; |
| 9 | import 'package:one_key/utils/utils.dart'; | 8 | import 'package:one_key/utils/utils.dart'; |
| 9 | +import 'package:one_key/widgets/h_empty_view.dart'; | ||
| 10 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 10 | 11 | ||
| 11 | class ContactListPage extends StatefulWidget { | 12 | class ContactListPage extends StatefulWidget { |
| 12 | final List<UserHistoryEntity> contacts; | 13 | final List<UserHistoryEntity> contacts; |
| 14 | + final CustomerProvider provider; | ||
| 13 | 15 | ||
| 14 | - const ContactListPage({Key key, this.contacts}) : super(key: key); | 16 | + const ContactListPage({Key key, this.contacts, this.provider}) |
| 17 | + : super(key: key); | ||
| 15 | @override | 18 | @override |
| 16 | State<StatefulWidget> createState() { | 19 | State<StatefulWidget> createState() { |
| 17 | return new _ContactListPageState(); | 20 | return new _ContactListPageState(); |
| @@ -26,7 +29,7 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -26,7 +29,7 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 26 | void initState() { | 29 | void initState() { |
| 27 | super.initState(); | 30 | super.initState(); |
| 28 | // loadData(); | 31 | // loadData(); |
| 29 | - _handleList(widget.contacts); | 32 | + widget.provider.handleList(widget.contacts); |
| 30 | } | 33 | } |
| 31 | 34 | ||
| 32 | // void loadData() async { | 35 | // void loadData() async { |
| @@ -40,36 +43,6 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -40,36 +43,6 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 40 | // }); | 43 | // }); |
| 41 | // } | 44 | // } |
| 42 | 45 | ||
| 43 | - void _handleList(List<UserHistoryEntity> list) { | ||
| 44 | - if (list == null || list.isEmpty) return; | ||
| 45 | - for (int i = 0, length = list.length; i < length; i++) { | ||
| 46 | - String pinyin = ''; | ||
| 47 | - String tag = ''; | ||
| 48 | - | ||
| 49 | - if (list[i].pinyin == null || list[i].pinyin == '') { | ||
| 50 | - // list[i].pinyin = pinyin; | ||
| 51 | - } else { | ||
| 52 | - tag = list[i].pinyin.substring(0, 1).toUpperCase(); | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | - if (RegExp("[A-Z]").hasMatch(tag)) { | ||
| 56 | - list[i].tagIndex = tag; | ||
| 57 | - } else { | ||
| 58 | - list[i].tagIndex = "#"; | ||
| 59 | - } | ||
| 60 | - } | ||
| 61 | - // A-Z sort. | ||
| 62 | - SuspensionUtil.sortListBySuspensionTag(widget.contacts); | ||
| 63 | - | ||
| 64 | - // show sus tag. | ||
| 65 | - SuspensionUtil.setShowSuspensionStatus(widget.contacts); | ||
| 66 | - | ||
| 67 | - // add header. | ||
| 68 | - // _contacts.insert(0, UserHistoryEntity(name: 'header', tagIndex: '↑')); | ||
| 69 | - | ||
| 70 | - setState(() {}); | ||
| 71 | - } | ||
| 72 | - | ||
| 73 | Widget _buildHeader() { | 46 | Widget _buildHeader() { |
| 74 | return Container( | 47 | return Container( |
| 75 | padding: EdgeInsets.all(20), | 48 | padding: EdgeInsets.all(20), |
| @@ -120,11 +93,13 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -120,11 +93,13 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 120 | offstage: model.isShowSuspension != true, | 93 | offstage: model.isShowSuspension != true, |
| 121 | child: _buildSusWidget(susTag), | 94 | child: _buildSusWidget(susTag), |
| 122 | ), | 95 | ), |
| 96 | + model.isShowSuspension ? VEmptyView(20) : SizedBox(), | ||
| 123 | Container( | 97 | Container( |
| 124 | padding: EdgeInsets.only( | 98 | padding: EdgeInsets.only( |
| 125 | left: ScreenUtil().setWidth(30), | 99 | left: ScreenUtil().setWidth(30), |
| 126 | right: ScreenUtil().setWidth(30), | 100 | right: ScreenUtil().setWidth(30), |
| 127 | - bottom: ScreenUtil().setWidth(30)), | 101 | + bottom: ScreenUtil().setWidth(30), |
| 102 | + top: model.isShowSuspension ? 0 : ScreenUtil().setWidth(30)), | ||
| 128 | decoration: BoxDecoration( | 103 | decoration: BoxDecoration( |
| 129 | border: Border( | 104 | border: Border( |
| 130 | bottom: BorderSide( | 105 | bottom: BorderSide( |
| @@ -144,8 +119,8 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -144,8 +119,8 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 144 | radius: ScreenUtil().setWidth(60), | 119 | radius: ScreenUtil().setWidth(60), |
| 145 | backgroundColor: Color.fromRGBO(239, 239, 239, 1), | 120 | backgroundColor: Color.fromRGBO(239, 239, 239, 1), |
| 146 | child: Text( | 121 | child: Text( |
| 147 | - model.rname != null && model.rname != '' | ||
| 148 | - ? model.rname.substring(0, 1) | 122 | + model.rnameStr != '' |
| 123 | + ? model.rnameStr.substring(0, 1) | ||
| 149 | : '', | 124 | : '', |
| 150 | style: TextStyle( | 125 | style: TextStyle( |
| 151 | color: Color.fromRGBO(206, 206, 206, 1), | 126 | color: Color.fromRGBO(206, 206, 206, 1), |
| @@ -177,7 +152,97 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -177,7 +152,97 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 177 | color: MyColours.color_ffffff, | 152 | color: MyColours.color_ffffff, |
| 178 | fontSize: ScreenUtil().setSp(28))))) | 153 | fontSize: ScreenUtil().setSp(28))))) |
| 179 | ], | 154 | ], |
| 180 | - ) | 155 | + ), |
| 156 | + HEmptyView(20), | ||
| 157 | + Expanded( | ||
| 158 | + child: Column( | ||
| 159 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 160 | + children: [ | ||
| 161 | + Row( | ||
| 162 | + crossAxisAlignment: CrossAxisAlignment.end, | ||
| 163 | + children: [ | ||
| 164 | + Container( | ||
| 165 | + constraints: BoxConstraints( | ||
| 166 | + maxWidth: ScreenUtil().setWidth(200)), | ||
| 167 | + child: Text( | ||
| 168 | + model.rnameStr, | ||
| 169 | + overflow: TextOverflow.ellipsis, | ||
| 170 | + style: TextStyle( | ||
| 171 | + color: MyColours.color_333333, | ||
| 172 | + fontSize: ScreenUtil().setSp(36), | ||
| 173 | + fontWeight: FontWeight.bold), | ||
| 174 | + )), | ||
| 175 | + HEmptyView(10), | ||
| 176 | + Text( | ||
| 177 | + model.sexStr != '' ? '[${model.sexStr}]' : '', | ||
| 178 | + style: TextStyle( | ||
| 179 | + color: MyColours.color_333333, | ||
| 180 | + fontSize: ScreenUtil().setSp(22), | ||
| 181 | + ), | ||
| 182 | + ), | ||
| 183 | + HEmptyView(10), | ||
| 184 | + Container( | ||
| 185 | + constraints: BoxConstraints( | ||
| 186 | + maxWidth: ScreenUtil().setWidth(150)), | ||
| 187 | + child: Text( | ||
| 188 | + '低频高消费', | ||
| 189 | + overflow: TextOverflow.ellipsis, | ||
| 190 | + style: TextStyle( | ||
| 191 | + color: Color.fromRGBO(193, 194, 63, 1), | ||
| 192 | + fontSize: ScreenUtil().setSp(22), | ||
| 193 | + ), | ||
| 194 | + )) | ||
| 195 | + ], | ||
| 196 | + ), | ||
| 197 | + VEmptyView(10), | ||
| 198 | + Row( | ||
| 199 | + // crossAxisAlignment: CrossAxisAlignment.end, | ||
| 200 | + children: [ | ||
| 201 | + Text( | ||
| 202 | + '28天前', | ||
| 203 | + style: TextStyle( | ||
| 204 | + color: Color.fromRGBO(208, 31, 37, 1), | ||
| 205 | + fontSize: ScreenUtil().setSp(24), | ||
| 206 | + fontWeight: FontWeight.bold), | ||
| 207 | + ), | ||
| 208 | + HEmptyView(10), | ||
| 209 | + Text( | ||
| 210 | + '午餐', | ||
| 211 | + style: TextStyle( | ||
| 212 | + color: Color.fromRGBO(208, 31, 37, 1), | ||
| 213 | + fontSize: ScreenUtil().setSp(24), | ||
| 214 | + ), | ||
| 215 | + ), | ||
| 216 | + HEmptyView(10), | ||
| 217 | + Text( | ||
| 218 | + '累计80单', | ||
| 219 | + style: TextStyle( | ||
| 220 | + color: MyColours.color_199095, | ||
| 221 | + fontSize: ScreenUtil().setSp(24), | ||
| 222 | + ), | ||
| 223 | + ) | ||
| 224 | + ], | ||
| 225 | + ), | ||
| 226 | + VEmptyView(10), | ||
| 227 | + Container( | ||
| 228 | + padding: EdgeInsets.symmetric( | ||
| 229 | + horizontal: ScreenUtil().setWidth(12), | ||
| 230 | + ), | ||
| 231 | + decoration: BoxDecoration( | ||
| 232 | + border: Border.all( | ||
| 233 | + color: MyColours.color_199095, | ||
| 234 | + width: ScreenUtil().setWidth(2)), | ||
| 235 | + borderRadius: | ||
| 236 | + BorderRadius.circular(ScreenUtil().setWidth(10))), | ||
| 237 | + child: Text( | ||
| 238 | + 'xx经理', | ||
| 239 | + style: TextStyle( | ||
| 240 | + fontSize: ScreenUtil().setSp(24), | ||
| 241 | + color: MyColours.color_333333), | ||
| 242 | + ), | ||
| 243 | + ) | ||
| 244 | + ], | ||
| 245 | + )) | ||
| 181 | ], | 246 | ], |
| 182 | ), | 247 | ), |
| 183 | ) | 248 | ) |
| @@ -197,7 +262,7 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -197,7 +262,7 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 197 | return BoxDecoration( | 262 | return BoxDecoration( |
| 198 | color: color, | 263 | color: color, |
| 199 | borderRadius: BorderRadius.circular(20.0), | 264 | borderRadius: BorderRadius.circular(20.0), |
| 200 | - border: Border.all(color: Colors.grey[300], width: .5)); | 265 | + border: Border.all(color: color, width: .5)); |
| 201 | } | 266 | } |
| 202 | 267 | ||
| 203 | @override | 268 | @override |
| @@ -208,9 +273,7 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -208,9 +273,7 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 208 | itemBuilder: (BuildContext context, int index) { | 273 | itemBuilder: (BuildContext context, int index) { |
| 209 | // if (index == 0) return _buildHeader(); | 274 | // if (index == 0) return _buildHeader(); |
| 210 | UserHistoryEntity model = widget.contacts[index]; | 275 | UserHistoryEntity model = widget.contacts[index]; |
| 211 | - return Padding( | ||
| 212 | - padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(40)), | ||
| 213 | - child: _buildListItem(model)); | 276 | + return _buildListItem(model); |
| 214 | }, | 277 | }, |
| 215 | physics: BouncingScrollPhysics(), | 278 | physics: BouncingScrollPhysics(), |
| 216 | indexBarData: SuspensionUtil.getTagIndexList(widget.contacts), | 279 | indexBarData: SuspensionUtil.getTagIndexList(widget.contacts), |
| @@ -230,8 +293,10 @@ class _ContactListPageState extends State<ContactListPage> { | @@ -230,8 +293,10 @@ class _ContactListPageState extends State<ContactListPage> { | ||
| 230 | indexBarMargin: EdgeInsets.all(10), | 293 | indexBarMargin: EdgeInsets.all(10), |
| 231 | indexBarOptions: IndexBarOptions( | 294 | indexBarOptions: IndexBarOptions( |
| 232 | needRebuild: true, | 295 | needRebuild: true, |
| 233 | - decoration: getIndexBarDecoration(Colors.grey[50]), | ||
| 234 | - downDecoration: getIndexBarDecoration(Colors.grey[200]), | 296 | + textStyle: TextStyle( |
| 297 | + fontSize: ScreenUtil().setSp(24), color: MyColours.color_199095), | ||
| 298 | + decoration: getIndexBarDecoration(Colors.transparent), | ||
| 299 | + downDecoration: getIndexBarDecoration(Colors.transparent), | ||
| 235 | ), | 300 | ), |
| 236 | ); | 301 | ); |
| 237 | } | 302 | } |
| @@ -2,26 +2,28 @@ import 'package:flutter/material.dart'; | @@ -2,26 +2,28 @@ import 'package:flutter/material.dart'; | ||
| 2 | 2 | ||
| 3 | import 'package:flutter_screenutil/screenutil.dart'; | 3 | import 'package:flutter_screenutil/screenutil.dart'; |
| 4 | import 'package:one_key/constant/state.dart'; | 4 | import 'package:one_key/constant/state.dart'; |
| 5 | -import 'package:one_key/pages/my/contant_item_page.dart'; | 5 | + |
| 6 | import 'package:one_key/pages/my/customer_type/contant_list_page.dart'; | 6 | import 'package:one_key/pages/my/customer_type/contant_list_page.dart'; |
| 7 | 7 | ||
| 8 | -import 'package:one_key/provider/contant_show_model.dart'; | ||
| 9 | import 'package:one_key/provider/customer_provider.dart'; | 8 | import 'package:one_key/provider/customer_provider.dart'; |
| 10 | import 'package:one_key/provider/user_model.dart'; | 9 | import 'package:one_key/provider/user_model.dart'; |
| 11 | import 'package:one_key/res/colors.dart'; | 10 | import 'package:one_key/res/colors.dart'; |
| 12 | -import 'package:one_key/utils/dialog_util.dart'; | 11 | + |
| 13 | import 'package:one_key/utils/event_bus.dart'; | 12 | import 'package:one_key/utils/event_bus.dart'; |
| 14 | import 'package:one_key/utils/utils.dart'; | 13 | import 'package:one_key/utils/utils.dart'; |
| 14 | +import 'package:one_key/widgets/common_button_flat.dart'; | ||
| 15 | 15 | ||
| 16 | import 'package:one_key/widgets/custom_tab_indicator.dart'; | 16 | import 'package:one_key/widgets/custom_tab_indicator.dart'; |
| 17 | import 'package:one_key/widgets/h_empty_view.dart'; | 17 | import 'package:one_key/widgets/h_empty_view.dart'; |
| 18 | import 'package:one_key/widgets/page_exception.dart'; | 18 | import 'package:one_key/widgets/page_exception.dart'; |
| 19 | + | ||
| 19 | import 'package:one_key/widgets/system_app_bar.dart'; | 20 | import 'package:one_key/widgets/system_app_bar.dart'; |
| 20 | import 'package:one_key/widgets/v_empty_view.dart'; | 21 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 21 | -import 'package:azlistview/azlistview.dart'; | ||
| 22 | 22 | ||
| 23 | import 'package:provider/provider.dart'; | 23 | import 'package:provider/provider.dart'; |
| 24 | 24 | ||
| 25 | +typedef ClickCallback = void Function(dynamic value); | ||
| 26 | + | ||
| 25 | class CustomerListPage extends StatefulWidget { | 27 | class CustomerListPage extends StatefulWidget { |
| 26 | @override | 28 | @override |
| 27 | _CustomerListPageState createState() => _CustomerListPageState(); | 29 | _CustomerListPageState createState() => _CustomerListPageState(); |
| @@ -33,9 +35,16 @@ class _CustomerListPageState extends State<CustomerListPage> | @@ -33,9 +35,16 @@ class _CustomerListPageState extends State<CustomerListPage> | ||
| 33 | TabController tabController; | 35 | TabController tabController; |
| 34 | 36 | ||
| 35 | CustomerProvider customerProvider; | 37 | CustomerProvider customerProvider; |
| 38 | + bool showFilter = false; | ||
| 39 | + ScrollController _scrollCrl = ScrollController(); | ||
| 40 | + int dropValue = 0; | ||
| 41 | + bool showDrop = true; | ||
| 42 | + List<String> timeTilte = ['大于', '等于', '小于']; | ||
| 43 | + | ||
| 36 | @override | 44 | @override |
| 37 | void initState() { | 45 | void initState() { |
| 38 | _tabBarTitle = ['全部', '活跃', '沉睡', '流失']; | 46 | _tabBarTitle = ['全部', '活跃', '沉睡', '流失']; |
| 47 | + // timeTilte = ['大于', '等于', '小于']; | ||
| 39 | super.initState(); | 48 | super.initState(); |
| 40 | tabController = TabController(length: 4, vsync: this); | 49 | tabController = TabController(length: 4, vsync: this); |
| 41 | WidgetsBinding.instance.addPostFrameCallback((_) async { | 50 | WidgetsBinding.instance.addPostFrameCallback((_) async { |
| @@ -51,302 +60,1005 @@ class _CustomerListPageState extends State<CustomerListPage> | @@ -51,302 +60,1005 @@ class _CustomerListPageState extends State<CustomerListPage> | ||
| 51 | await customerProvider.searchData(customerProvider.controller.text); | 60 | await customerProvider.searchData(customerProvider.controller.text); |
| 52 | } | 61 | } |
| 53 | 62 | ||
| 54 | - @override | ||
| 55 | - Widget build(BuildContext context) { | ||
| 56 | - customerProvider = Provider.of<CustomerProvider>(context, listen: true); | ||
| 57 | - return Material( | ||
| 58 | - child: InkWell( | ||
| 59 | - onTap: () { | ||
| 60 | - // FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 61 | - }, | ||
| 62 | - child: Scaffold( | ||
| 63 | - resizeToAvoidBottomInset: false, | ||
| 64 | - backgroundColor: MyColours.color_ffffff, | ||
| 65 | - appBar: SystemAppBar( | ||
| 66 | - '全店客户', | ||
| 67 | - onTap: () { | ||
| 68 | - EventBus().emit('changeStatusColor'); | 63 | + ///选中的联系人widget |
| 64 | + Widget _selectContantWidget() { | ||
| 65 | + return Container( | ||
| 66 | + // constraints: BoxConstraints(maxHeight: ScreenUtil().setWidth(760)), | ||
| 67 | + // height: ScreenUtil().setWidth(400), | ||
| 68 | + width: double.infinity, | ||
| 69 | + padding: EdgeInsets.all(ScreenUtil().setWidth(40)), | ||
| 70 | + decoration: BoxDecoration( | ||
| 71 | + color: MyColours.color_ffffff, | ||
| 72 | + boxShadow: [ | ||
| 73 | + BoxShadow( | ||
| 74 | + color: MyColours.color_333333, | ||
| 75 | + blurRadius: ScreenUtil().setWidth(14)) | ||
| 76 | + ], | ||
| 77 | + borderRadius: BorderRadius.only( | ||
| 78 | + topLeft: Radius.circular(ScreenUtil().setWidth(30)), | ||
| 79 | + topRight: Radius.circular(ScreenUtil().setWidth(30)), | ||
| 80 | + )), | ||
| 81 | + child: Row( | ||
| 82 | + children: [ | ||
| 83 | + Image.asset(Utils.getImgPath('select'), | ||
| 84 | + width: ScreenUtil().setWidth(30)), | ||
| 85 | + HEmptyView(10), | ||
| 86 | + Text( | ||
| 87 | + '全选', | ||
| 88 | + style: TextStyle( | ||
| 89 | + fontSize: ScreenUtil().setSp(26), | ||
| 90 | + color: MyColours.color_333333), | ||
| 91 | + ), | ||
| 92 | + HEmptyView(20), | ||
| 93 | + Expanded( | ||
| 94 | + child: InkWell( | ||
| 95 | + child: Container( | ||
| 96 | + alignment: Alignment.center, | ||
| 97 | + padding: EdgeInsets.all(ScreenUtil().setWidth(20)), | ||
| 98 | + decoration: BoxDecoration( | ||
| 99 | + borderRadius: | ||
| 100 | + BorderRadius.circular(ScreenUtil().setWidth(40)), | ||
| 101 | + color: MyColours.color_199095), | ||
| 102 | + child: Text( | ||
| 103 | + '已选[全部]10000位顾客,下发营销任务', | ||
| 104 | + overflow: TextOverflow.ellipsis, | ||
| 105 | + maxLines: 1, | ||
| 106 | + style: TextStyle( | ||
| 107 | + fontSize: ScreenUtil().setSp(28), | ||
| 108 | + color: MyColours.color_ffffff, | ||
| 109 | + ), | ||
| 110 | + )), | ||
| 111 | + )), | ||
| 112 | + // Expanded( | ||
| 113 | + // child: RoundButton( | ||
| 114 | + // // width: ScreenUtil().setWidth(600), | ||
| 115 | + // height: ScreenUtil().setWidth(80), | ||
| 116 | + // radius: ScreenUtil().setWidth(40), | ||
| 117 | + // text: '已选 [全部] 80位顾客,下发营销任务frfrfrfrfrffrfrfr', | ||
| 118 | + // fontSize: 28, | ||
| 119 | + // textColor: MyColours.color_ffffff, | ||
| 120 | + // gradientStart: MyColours.color_199095, | ||
| 121 | + // gradientEnd: MyColours.color_199095, | ||
| 122 | + // onPressed: () {}, | ||
| 123 | + // )) | ||
| 124 | + ], | ||
| 125 | + ), | ||
| 126 | + ); | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + /// 搜索框 | ||
| 130 | + Widget _searchWidget() { | ||
| 131 | + return Container( | ||
| 132 | + color: MyColours.color_ffffff, | ||
| 133 | + padding: EdgeInsets.symmetric( | ||
| 134 | + horizontal: ScreenUtil().setWidth(40), | ||
| 135 | + ), | ||
| 136 | + height: ScreenUtil().setWidth(45 * 2), | ||
| 137 | + // alignment: Alignment.center, | ||
| 138 | + | ||
| 139 | + child: Container( | ||
| 140 | + alignment: Alignment.center, | ||
| 141 | + padding: EdgeInsets.only( | ||
| 142 | + left: ScreenUtil().setWidth(20 * 2), | ||
| 143 | + ), | ||
| 144 | + decoration: BoxDecoration( | ||
| 145 | + color: MyColours.color_ffffff, | ||
| 146 | + borderRadius: | ||
| 147 | + BorderRadius.circular(ScreenUtil().setWidth(24 * 2)), | ||
| 148 | + border: Border.all(color: Color.fromRGBO(228, 228, 228, 1)), | ||
| 149 | + boxShadow: [ | ||
| 150 | + BoxShadow( | ||
| 151 | + color: Color.fromRGBO(220, 220, 220, 1), //投影颜色 | ||
| 152 | + offset: Offset(2, 3), //x,y轴 | ||
| 153 | + blurRadius: ScreenUtil().setWidth(6) //投影距离 | ||
| 154 | + ) | ||
| 155 | + ]), | ||
| 156 | + child: Row(children: [ | ||
| 157 | + Expanded( | ||
| 158 | + child: TextField( | ||
| 159 | + maxLines: 1, | ||
| 160 | + controller: customerProvider.controller, | ||
| 161 | + // focusNode: _focusNode, | ||
| 162 | + // autofocus: true, | ||
| 163 | + | ||
| 164 | + style: TextStyle( | ||
| 165 | + color: MyColours.color_333333, | ||
| 166 | + fontSize: ScreenUtil().setSp(26)), | ||
| 167 | + // textAlignVertical: TextAlignVertical.center, | ||
| 168 | + decoration: InputDecoration( | ||
| 169 | + hintText: "输入手机号或姓名", | ||
| 170 | + hintStyle: TextStyle( | ||
| 171 | + color: MyColours.color_999999, | ||
| 172 | + fontSize: ScreenUtil().setSp(26), | ||
| 173 | + ), | ||
| 174 | + // isCollapsed: | ||
| 175 | + // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度 | ||
| 176 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 177 | + contentPadding: EdgeInsets.zero, | ||
| 178 | + // 左边图标设置 | ||
| 179 | + icon: Image.asset( | ||
| 180 | + Utils.getImgPath('search'), | ||
| 181 | + width: ScreenUtil().setWidth(30), | ||
| 182 | + ), | ||
| 183 | + //右边图标设置 | ||
| 184 | + // suffixIcon: | ||
| 185 | + ), | ||
| 186 | + keyboardType: TextInputType.text, | ||
| 187 | + textInputAction: TextInputAction.done, | ||
| 188 | + | ||
| 189 | + onChanged: (value) { | ||
| 190 | + // setState(() {}); | ||
| 191 | + // _searchSellerLocation(); | ||
| 192 | + customerProvider.searchData(value); | ||
| 193 | + }, | ||
| 194 | + onEditingComplete: () { | ||
| 195 | + FocusScope.of(context) | ||
| 196 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 197 | + // contantShowModel.searchData( | ||
| 198 | + // contantShowModel.controller.text); | ||
| 199 | + // _searchSellerLocation(); | ||
| 200 | + // _focusNode.unfocus(); | ||
| 201 | + }, | ||
| 202 | + ), | ||
| 203 | + ), | ||
| 204 | + Offstage( | ||
| 205 | + offstage: customerProvider.controller.text == '', | ||
| 206 | + child: GestureDetector( | ||
| 207 | + child: Container( | ||
| 208 | + padding: EdgeInsets.symmetric( | ||
| 209 | + horizontal: ScreenUtil().setWidth(40), | ||
| 210 | + vertical: ScreenUtil().setWidth(20), | ||
| 211 | + ), | ||
| 212 | + // color: Colors.orange, | ||
| 213 | + alignment: Alignment.centerRight, | ||
| 214 | + child: Image.asset( | ||
| 215 | + Utils.getImgPath('clear'), | ||
| 216 | + width: ScreenUtil().setWidth(30), | ||
| 217 | + height: ScreenUtil().setWidth(30), | ||
| 218 | + ), | ||
| 219 | + ), | ||
| 220 | + onTap: () { | ||
| 221 | + WidgetsBinding.instance.addPostFrameCallback(((_) { | ||
| 222 | + customerProvider.controller.clear(); | ||
| 223 | + customerProvider.searchData(''); | ||
| 224 | + })); | ||
| 225 | + }, | ||
| 226 | + )), | ||
| 227 | + // Offstage( | ||
| 228 | + // offstage: false, | ||
| 229 | + // child: GestureDetector( | ||
| 230 | + // child: Container( | ||
| 231 | + // padding: EdgeInsets.only( | ||
| 232 | + // right: ScreenUtil().setWidth(30), | ||
| 233 | + // bottom: ScreenUtil().setWidth(20), | ||
| 234 | + // top: ScreenUtil().setWidth(20), | ||
| 235 | + // ), | ||
| 236 | + // child: Text( | ||
| 237 | + // '搜索', | ||
| 238 | + // style: TextStyle( | ||
| 239 | + // color: MyColours.color_199095, | ||
| 240 | + // fontSize: ScreenUtil().setSp(28)), | ||
| 241 | + // ), | ||
| 242 | + // ), | ||
| 243 | + // onTap: () { | ||
| 244 | + // customerProvider.searchData( | ||
| 245 | + // customerProvider.controller.text); | ||
| 246 | + // }, | ||
| 247 | + // )) | ||
| 248 | + ]))); | ||
| 249 | + } | ||
| 250 | + | ||
| 251 | + Widget _menuWidget() { | ||
| 252 | + return Container( | ||
| 253 | + margin: EdgeInsets.symmetric( | ||
| 254 | + horizontal: ScreenUtil().setWidth(40), | ||
| 255 | + vertical: ScreenUtil().setWidth(20)), | ||
| 256 | + decoration: BoxDecoration(color: MyColours.color_ffffff, boxShadow: [ | ||
| 257 | + BoxShadow( | ||
| 258 | + // color: Colors.red, | ||
| 259 | + color: Color.fromRGBO(220, 220, 220, 1), //投影颜色 | ||
| 260 | + offset: Offset(2, 2), //x,y轴 | ||
| 261 | + blurRadius: ScreenUtil().setWidth(6) //投影距离 | ||
| 262 | + ) | ||
| 263 | + ]), | ||
| 264 | + child: Row( | ||
| 265 | + children: [ | ||
| 266 | + Expanded( | ||
| 267 | + child: Container( | ||
| 268 | + padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)), | ||
| 269 | + margin: | ||
| 270 | + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(30)), | ||
| 271 | + child: TabBar( | ||
| 272 | + controller: tabController, | ||
| 273 | + indicator: CustomTabIndicator( | ||
| 274 | + radius: 0, | ||
| 275 | + ), | ||
| 276 | + indicatorColor: MyColours.color_199095, | ||
| 277 | + indicatorSize: TabBarIndicatorSize.tab, | ||
| 278 | + // indicatorPadding: EdgeInsets.symmetric( | ||
| 279 | + // horizontal: ScreenUtil().setWidth(12)), | ||
| 280 | + labelColor: MyColours.color_199095, | ||
| 281 | + labelStyle: TextStyle( | ||
| 282 | + fontSize: ScreenUtil().setSp(32), | ||
| 283 | + fontWeight: FontWeight.bold), | ||
| 284 | + labelPadding: EdgeInsets.zero, | ||
| 285 | + unselectedLabelStyle: TextStyle( | ||
| 286 | + fontWeight: FontWeight.normal, | ||
| 287 | + fontSize: ScreenUtil().setSp(28), | ||
| 288 | + ), | ||
| 289 | + unselectedLabelColor: MyColours.color_999999, | ||
| 290 | + tabs: _tabBarTitle.map((value) { | ||
| 291 | + return Tab( | ||
| 292 | + child: Text(value), | ||
| 293 | + ); | ||
| 294 | + }).toList()), | ||
| 295 | + )), | ||
| 296 | + InkWell( | ||
| 297 | + onTap: () { | ||
| 298 | + setState(() { | ||
| 299 | + showFilter = !showFilter; | ||
| 300 | + }); | ||
| 301 | + if (showFilter) { | ||
| 302 | + _showFilterDialogFromTop(context, onPressedReset: () { | ||
| 303 | + Navigator.of(context).pop(); | ||
| 304 | + setState(() { | ||
| 305 | + showFilter = false; | ||
| 306 | + }); | ||
| 307 | + }, onPressedComplete: () { | ||
| 69 | Navigator.of(context).pop(); | 308 | Navigator.of(context).pop(); |
| 309 | + setState(() { | ||
| 310 | + showFilter = false; | ||
| 311 | + }); | ||
| 312 | + }, tapWhiteBack: () { | ||
| 313 | + // Navigator.of(context).pop(); | ||
| 314 | + // setState(() { | ||
| 315 | + // showFilter = false; | ||
| 316 | + // }); | ||
| 317 | + }); | ||
| 318 | + } | ||
| 319 | + }, | ||
| 320 | + child: Container( | ||
| 321 | + padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(10)), | ||
| 322 | + margin: EdgeInsets.only(right: ScreenUtil().setWidth(30)), | ||
| 323 | + width: ScreenUtil().setWidth(100), | ||
| 324 | + // height: ScreenUtil().setWidth(50), | ||
| 325 | + child: Row( | ||
| 326 | + children: [ | ||
| 327 | + Text( | ||
| 328 | + '筛选', | ||
| 329 | + style: TextStyle( | ||
| 330 | + fontSize: ScreenUtil().setSp(28), | ||
| 331 | + color: MyColours.color_999999), | ||
| 332 | + ), | ||
| 333 | + HEmptyView(10), | ||
| 334 | + Image.asset( | ||
| 335 | + Utils.getImgPath( | ||
| 336 | + showFilter ? 'c_arrow_up' : 'c_arrow_down'), | ||
| 337 | + width: ScreenUtil().setWidth(24), | ||
| 338 | + // height: ScreenUtil().setWidth(10), | ||
| 339 | + ) | ||
| 340 | + ], | ||
| 341 | + )), | ||
| 342 | + ) | ||
| 343 | + ], | ||
| 344 | + )); | ||
| 345 | + } | ||
| 346 | + | ||
| 347 | + ///筛选弹框 | ||
| 348 | + _showFilterDialogFromTop(BuildContext context, | ||
| 349 | + {VoidCallback onPressedReset, | ||
| 350 | + VoidCallback onPressedComplete, | ||
| 351 | + GestureTapCallback tapWhiteBack}) { | ||
| 352 | + showGeneralDialog( | ||
| 353 | + context: context, | ||
| 354 | + barrierDismissible: false, | ||
| 355 | + barrierColor: Colors.transparent, | ||
| 356 | + barrierLabel: | ||
| 357 | + MaterialLocalizations.of(context).modalBarrierDismissLabel, | ||
| 358 | + transitionDuration: const Duration(milliseconds: 150), | ||
| 359 | + pageBuilder: (BuildContext context, Animation animation, | ||
| 360 | + Animation secondaryAnimation) { | ||
| 361 | + return Scaffold( | ||
| 362 | + backgroundColor: Colors.transparent, | ||
| 363 | + // resizeToAvoidBottomInset: false, | ||
| 364 | + body: StatefulBuilder(builder: (context, state) { | ||
| 365 | + return GestureDetector( | ||
| 366 | + // behavior: HitTestBehavior.opaque, | ||
| 367 | + onTap: tapWhiteBack, | ||
| 368 | + child: _filterWidget( | ||
| 369 | + state, | ||
| 370 | + onPressedReset, | ||
| 371 | + onPressedComplete, | ||
| 372 | + )); | ||
| 373 | + })); | ||
| 374 | + }); | ||
| 375 | + } | ||
| 376 | + | ||
| 377 | + ///弹框text | ||
| 378 | + _textWidget(String title, Color textColor, FontWeight fontWeight, int size) { | ||
| 379 | + return Text(title, | ||
| 380 | + style: TextStyle( | ||
| 381 | + color: textColor, | ||
| 382 | + decoration: TextDecoration.none, | ||
| 383 | + fontWeight: fontWeight, | ||
| 384 | + fontSize: ScreenUtil().setSp(size))); | ||
| 385 | + } | ||
| 386 | + | ||
| 387 | + ///客户经理 | ||
| 388 | + Widget _managerWidget() { | ||
| 389 | + return Column( | ||
| 390 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 391 | + children: [ | ||
| 392 | + Row( | ||
| 393 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 394 | + children: [ | ||
| 395 | + _textWidget('客户经理', MyColours.color_333333, FontWeight.bold, 28), | ||
| 396 | + GestureDetector( | ||
| 397 | + onTap: () {}, | ||
| 398 | + child: _textWidget( | ||
| 399 | + '全选', MyColours.color_199095, FontWeight.normal, 24), | ||
| 400 | + ) | ||
| 401 | + ], | ||
| 402 | + ), | ||
| 403 | + VEmptyView(30), | ||
| 404 | + Wrap( | ||
| 405 | + spacing: ScreenUtil().setWidth(20), | ||
| 406 | + runSpacing: ScreenUtil().setWidth(20), | ||
| 407 | + children: _buildFilterItem([ | ||
| 408 | + {'title': 'kkkk', 'select': false}, | ||
| 409 | + {'title': 'kkkk', 'select': true}, | ||
| 410 | + {'title': 'kkkk', 'select': true}, | ||
| 411 | + {'title': 'kkkk', 'select': true}, | ||
| 412 | + {'title': 'k', 'select': true}, | ||
| 413 | + {'title': 'kkkk', 'select': true}, | ||
| 414 | + {'title': 'kkkk', 'select': true}, | ||
| 415 | + {'title': 'k', 'select': true}, | ||
| 416 | + {'title': 'kdsfjsfsdfhjsdfh', 'select': true}, | ||
| 417 | + {'title': 'kkkk', 'select': true}, | ||
| 418 | + ], false)), | ||
| 419 | + ], | ||
| 420 | + ); | ||
| 421 | + } | ||
| 422 | + | ||
| 423 | + ///活跃度 | ||
| 424 | + Widget _activityWidget() { | ||
| 425 | + return Column( | ||
| 426 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 427 | + children: [ | ||
| 428 | + Row( | ||
| 429 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 430 | + children: [ | ||
| 431 | + _textWidget('活跃度', MyColours.color_333333, FontWeight.bold, 28), | ||
| 432 | + GestureDetector( | ||
| 433 | + onTap: () {}, | ||
| 434 | + child: _textWidget( | ||
| 435 | + '全选', MyColours.color_199095, FontWeight.normal, 24), | ||
| 436 | + ) | ||
| 437 | + ], | ||
| 438 | + ), | ||
| 439 | + VEmptyView(30), | ||
| 440 | + Wrap( | ||
| 441 | + spacing: ScreenUtil().setWidth(20), | ||
| 442 | + runSpacing: ScreenUtil().setWidth(20), | ||
| 443 | + children: _buildFilterItem([ | ||
| 444 | + {'title': 'kkkk', 'select': false}, | ||
| 445 | + {'title': 'kkkk', 'select': true}, | ||
| 446 | + {'title': 'kkkk', 'select': true}, | ||
| 447 | + {'title': 'kkkk', 'select': true}, | ||
| 448 | + {'title': 'k', 'select': true}, | ||
| 449 | + {'title': 'kkkk', 'select': true}, | ||
| 450 | + {'title': 'kkkk', 'select': true}, | ||
| 451 | + {'title': 'k', 'select': true}, | ||
| 452 | + {'title': 'kdsfjsfsdfhjsdfh', 'select': true}, | ||
| 453 | + {'title': 'kkkk', 'select': true}, | ||
| 454 | + ], false)), | ||
| 455 | + ], | ||
| 456 | + ); | ||
| 457 | + } | ||
| 458 | + | ||
| 459 | + ///自定义标签 | ||
| 460 | + Widget _labelWidget() { | ||
| 461 | + return Column( | ||
| 462 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 463 | + children: [ | ||
| 464 | + Row( | ||
| 465 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 466 | + children: [ | ||
| 467 | + _textWidget('自定义标签', MyColours.color_333333, FontWeight.bold, 28), | ||
| 468 | + GestureDetector( | ||
| 469 | + onTap: () {}, | ||
| 470 | + child: _textWidget( | ||
| 471 | + '全选', MyColours.color_199095, FontWeight.normal, 24), | ||
| 472 | + ) | ||
| 473 | + ], | ||
| 474 | + ), | ||
| 475 | + VEmptyView(30), | ||
| 476 | + Wrap( | ||
| 477 | + spacing: ScreenUtil().setWidth(20), | ||
| 478 | + runSpacing: ScreenUtil().setWidth(20), | ||
| 479 | + children: _buildFilterItem([ | ||
| 480 | + {'title': 'kkkk', 'select': false}, | ||
| 481 | + {'title': 'kkkk', 'select': true}, | ||
| 482 | + {'title': 'kkkk', 'select': true}, | ||
| 483 | + {'title': 'kkkk', 'select': true}, | ||
| 484 | + {'title': 'k', 'select': true}, | ||
| 485 | + {'title': 'kkkk', 'select': true}, | ||
| 486 | + {'title': 'kkkk', 'select': true}, | ||
| 487 | + {'title': 'k', 'select': true}, | ||
| 488 | + {'title': 'kdsfjsfsdfhjsdfh', 'select': false}, | ||
| 489 | + {'title': 'kkkk', 'select': true}, | ||
| 490 | + ], true)), | ||
| 491 | + ], | ||
| 492 | + ); | ||
| 493 | + } | ||
| 494 | + | ||
| 495 | + ///大于、等于、小于 | ||
| 496 | + List<DropdownMenuItem> _dropdownMenuItem() { | ||
| 497 | + List<DropdownMenuItem> list = []; | ||
| 498 | + for (int i = 0; i < timeTilte.length; i++) { | ||
| 499 | + list.add(DropdownMenuItem( | ||
| 500 | + child: _textWidget( | ||
| 501 | + timeTilte[i], MyColours.color_199095, FontWeight.normal, 24), | ||
| 502 | + value: i)); | ||
| 503 | + } | ||
| 504 | + return list; | ||
| 505 | + } | ||
| 506 | + | ||
| 507 | + _selectWidget(List<String> data, ClickCallback onTap) { | ||
| 508 | + return Container( | ||
| 509 | + decoration: BoxDecoration( | ||
| 510 | + color: MyColours.color_ffffff, | ||
| 511 | + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)), | ||
| 512 | + border: Border.all( | ||
| 513 | + color: MyColours.color_cccccc, | ||
| 514 | + width: ScreenUtil().setWidth(2))), | ||
| 515 | + width: ScreenUtil().setWidth(130 * 2), | ||
| 516 | + // constraints: BoxConstraints( | ||
| 517 | + // maxHeight: ScreenUtil().setWidth(130 * 2), | ||
| 518 | + // ), | ||
| 519 | + child: ListView.builder( | ||
| 520 | + shrinkWrap: true, | ||
| 521 | + padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(8)), | ||
| 522 | + itemCount: data.length, | ||
| 523 | + itemBuilder: (context, index) { | ||
| 524 | + return InkWell( | ||
| 525 | + onTap: () { | ||
| 526 | + onTap(index); | ||
| 527 | + }, | ||
| 528 | + child: Container( | ||
| 529 | + padding: | ||
| 530 | + EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(20)), | ||
| 531 | + decoration: BoxDecoration( | ||
| 532 | + border: Border( | ||
| 533 | + bottom: BorderSide( | ||
| 534 | + color: MyColours.color_efefef, | ||
| 535 | + width: data.length - 1 == index | ||
| 536 | + ? 0 | ||
| 537 | + : ScreenUtil().setWidth(2)))), | ||
| 538 | + child: Text(data[index], | ||
| 539 | + style: TextStyle( | ||
| 540 | + color: MyColours.color_199095, | ||
| 541 | + fontWeight: FontWeight.bold, | ||
| 542 | + fontSize: ScreenUtil().setSp(28))), | ||
| 543 | + ), | ||
| 544 | + ); | ||
| 545 | + })); | ||
| 546 | + } | ||
| 547 | + | ||
| 548 | + ///高级筛选 | ||
| 549 | + Widget _advancedFilterWidget(state) { | ||
| 550 | + return Column( | ||
| 551 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 552 | + children: [ | ||
| 553 | + Row( | ||
| 554 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 555 | + children: [ | ||
| 556 | + _textWidget('高级筛选', MyColours.color_333333, FontWeight.bold, 28), | ||
| 557 | + GestureDetector( | ||
| 558 | + onTap: () {}, | ||
| 559 | + child: _textWidget( | ||
| 560 | + '清空', MyColours.color_199095, FontWeight.normal, 24), | ||
| 561 | + ) | ||
| 562 | + ], | ||
| 563 | + ), | ||
| 564 | + VEmptyView(30), | ||
| 565 | + Row( | ||
| 566 | + children: [ | ||
| 567 | + Expanded(child: _textFeildWidget()), | ||
| 568 | + HEmptyView(10), | ||
| 569 | + _textWidget('至', MyColours.color_199095, FontWeight.normal, 24), | ||
| 570 | + HEmptyView(10), | ||
| 571 | + Expanded(child: _textFeildWidget()), | ||
| 572 | + ], | ||
| 573 | + ), | ||
| 574 | + VEmptyView(30), | ||
| 575 | + Wrap( | ||
| 576 | + spacing: ScreenUtil().setWidth(20), | ||
| 577 | + runSpacing: ScreenUtil().setWidth(20), | ||
| 578 | + children: _buildFilterItem([ | ||
| 579 | + {'title': '7天', 'select': true}, | ||
| 580 | + {'title': '30天', 'select': true}, | ||
| 581 | + {'title': '60天', 'select': true}, | ||
| 582 | + {'title': '120天', 'select': true}, | ||
| 583 | + ], true, grayBack: true)), | ||
| 584 | + VEmptyView(30), | ||
| 585 | + _textWidget('时间内预订次数', MyColours.color_333333, FontWeight.normal, 24), | ||
| 586 | + VEmptyView(30), | ||
| 587 | + /** | ||
| 588 | + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ | ||
| 589 | + Material( | ||
| 590 | + child: Container( | ||
| 591 | + height: ScreenUtil().setWidth(50), | ||
| 592 | + width: ScreenUtil().setWidth(130), | ||
| 593 | + decoration: BoxDecoration( | ||
| 594 | + borderRadius: | ||
| 595 | + BorderRadius.circular(ScreenUtil().setWidth(30)), | ||
| 596 | + color: Color.fromRGBO(239, 239, 239, 1)), | ||
| 597 | + child: _buttonChoose(dropValue, (value) { | ||
| 598 | + state(() { | ||
| 599 | + showDrop = !showDrop; | ||
| 600 | + _scrollCrl.jumpTo(_scrollCrl.position.maxScrollExtent); | ||
| 601 | + }); | ||
| 602 | + | ||
| 603 | + // _scrollCrl.position | ||
| 604 | + // .didUpdateScrollPositionBy(2); //这里触发更新滚动条 | ||
| 605 | + }))), | ||
| 606 | + VEmptyView(10), | ||
| 607 | + Material( | ||
| 608 | + child: Offstage( | ||
| 609 | + offstage: showDrop, | ||
| 610 | + child: _selectWidget(timeTilte, (index) { | ||
| 611 | + print(timeTilte[index]); | ||
| 612 | + state(() { | ||
| 613 | + showDrop = !showDrop; | ||
| 614 | + // _provider.currentIndex = index; | ||
| 615 | + dropValue = timeTilte[index]; | ||
| 616 | + }); | ||
| 617 | + }), | ||
| 618 | + )), | ||
| 619 | + ]), | ||
| 620 | + VEmptyView(50), | ||
| 621 | + */ | ||
| 622 | + Row(children: [ | ||
| 623 | + Material( | ||
| 624 | + child: Container( | ||
| 625 | + height: ScreenUtil().setWidth(50), | ||
| 626 | + // width: ScreenUtil().setWidth(100), | ||
| 627 | + padding: EdgeInsets.symmetric( | ||
| 628 | + horizontal: ScreenUtil().setWidth(20)), | ||
| 629 | + decoration: BoxDecoration( | ||
| 630 | + borderRadius: | ||
| 631 | + BorderRadius.circular(ScreenUtil().setWidth(30)), | ||
| 632 | + color: Color.fromRGBO(239, 239, 239, 1)), | ||
| 633 | + child: DropdownButton( | ||
| 634 | + underline: SizedBox(), | ||
| 635 | + value: dropValue, | ||
| 636 | + isDense: true, | ||
| 637 | + style: TextStyle( | ||
| 638 | + color: MyColours.color_333333, | ||
| 639 | + fontSize: ScreenUtil().setSp(28)), | ||
| 640 | + focusColor: MyColours.color_199095, | ||
| 641 | + items: _dropdownMenuItem(), | ||
| 642 | + icon: Row( | ||
| 643 | + children: [ | ||
| 644 | + HEmptyView(10), | ||
| 645 | + Image.asset( | ||
| 646 | + Utils.getImgPath('c_arrow_down'), | ||
| 647 | + width: ScreenUtil().setWidth(24), | ||
| 648 | + // height: ScreenUtil().setWidth(10), | ||
| 649 | + ) | ||
| 650 | + ], | ||
| 651 | + ), | ||
| 652 | + onChanged: (value) { | ||
| 653 | + print(value); | ||
| 654 | + state(() => dropValue = value); | ||
| 655 | + }))), | ||
| 656 | + HEmptyView(20), | ||
| 657 | + Container( | ||
| 658 | + // padding: EdgeInsets.symmetric( | ||
| 659 | + // horizontal: ScreenUtil().setWidth(20), | ||
| 660 | + // ), | ||
| 661 | + width: ScreenUtil().setWidth(160), | ||
| 662 | + height: ScreenUtil().setWidth(50), | ||
| 663 | + // alignment: Alignment.center, | ||
| 664 | + decoration: BoxDecoration( | ||
| 665 | + border: Border( | ||
| 666 | + bottom: BorderSide( | ||
| 667 | + color: Color.fromRGBO(180, 180, 180, 1), | ||
| 668 | + width: ScreenUtil().setWidth(2))), | ||
| 669 | + ), | ||
| 670 | + child: Material( | ||
| 671 | + color: MyColours.color_ffffff, | ||
| 672 | + child: TextField( | ||
| 673 | + maxLines: 1, | ||
| 674 | + controller: customerProvider.controller, | ||
| 675 | + // focusNode: _focusNode, | ||
| 676 | + // autofocus: true, | ||
| 677 | + | ||
| 678 | + style: TextStyle( | ||
| 679 | + color: MyColours.color_333333, | ||
| 680 | + fontSize: ScreenUtil().setSp(26)), | ||
| 681 | + // textAlignVertical: TextAlignVertical.center, | ||
| 682 | + decoration: InputDecoration( | ||
| 683 | + // hintText: "xxx", | ||
| 684 | + hintStyle: TextStyle( | ||
| 685 | + color: MyColours.color_999999, | ||
| 686 | + fontSize: ScreenUtil().setSp(26), | ||
| 687 | + ), | ||
| 688 | + // isCollapsed: | ||
| 689 | + // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度 | ||
| 690 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 691 | + contentPadding: EdgeInsets.zero, | ||
| 692 | + ), | ||
| 693 | + keyboardType: TextInputType.text, | ||
| 694 | + textInputAction: TextInputAction.done, | ||
| 695 | + | ||
| 696 | + onChanged: (value) { | ||
| 697 | + // setState(() {}); | ||
| 698 | + // _searchSellerLocation(); | ||
| 699 | + customerProvider.searchData(value); | ||
| 700 | + }, | ||
| 701 | + onEditingComplete: () { | ||
| 702 | + FocusScope.of(context) | ||
| 703 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 704 | + // contantShowModel.searchData( | ||
| 705 | + // contantShowModel.controller.text); | ||
| 706 | + // _searchSellerLocation(); | ||
| 707 | + // _focusNode.unfocus(); | ||
| 70 | }, | 708 | }, |
| 71 | ), | 709 | ), |
| 72 | - body: WillPopScope( | ||
| 73 | - child: SafeArea( | ||
| 74 | - child: Column( | ||
| 75 | - children: <Widget>[ | ||
| 76 | - Container( | ||
| 77 | - color: MyColours.color_ffffff, | ||
| 78 | - padding: EdgeInsets.symmetric( | ||
| 79 | - horizontal: ScreenUtil().setWidth(40), | ||
| 80 | - vertical: ScreenUtil().setWidth(10)), | ||
| 81 | - height: ScreenUtil().setWidth(45 * 2), | ||
| 82 | - // alignment: Alignment.center, | 710 | + )), |
| 711 | + HEmptyView(20), | ||
| 712 | + _textWidget('次预订', MyColours.color_333333, FontWeight.normal, 24), | ||
| 713 | + ]), | ||
| 714 | + VEmptyView(30), | ||
| 715 | + ], | ||
| 716 | + ); | ||
| 717 | + } | ||
| 83 | 718 | ||
| 84 | - child: Stack( | ||
| 85 | - children: [ | ||
| 86 | - Container( | ||
| 87 | - alignment: Alignment.center, | ||
| 88 | - padding: EdgeInsets.symmetric( | ||
| 89 | - horizontal: ScreenUtil().setWidth(20 * 2), | ||
| 90 | - vertical: ScreenUtil().setWidth(14)), | ||
| 91 | - decoration: BoxDecoration( | ||
| 92 | - color: MyColours.color_ffffff, | ||
| 93 | - borderRadius: BorderRadius.circular( | ||
| 94 | - ScreenUtil().setWidth(24 * 2)), | ||
| 95 | - border: Border.all( | ||
| 96 | - color: | ||
| 97 | - Color.fromRGBO(228, 228, 228, 1)), | ||
| 98 | - boxShadow: [ | ||
| 99 | - BoxShadow( | ||
| 100 | - color: Color.fromRGBO( | ||
| 101 | - 220, 220, 220, 1), //投影颜色 | ||
| 102 | - offset: Offset(2, 3), //x,y轴 | ||
| 103 | - blurRadius: | ||
| 104 | - ScreenUtil().setWidth(6) //投影距离 | ||
| 105 | - ) | ||
| 106 | - ]), | ||
| 107 | - child: TextField( | ||
| 108 | - maxLines: 1, | ||
| 109 | - controller: customerProvider.controller, | ||
| 110 | - // focusNode: _focusNode, | ||
| 111 | - // autofocus: true, | ||
| 112 | - style: TextStyle( | ||
| 113 | - color: MyColours.color_333333, | ||
| 114 | - fontSize: ScreenUtil().setSp(26)), | ||
| 115 | - // textAlignVertical: TextAlignVertical.center, | ||
| 116 | - decoration: InputDecoration( | ||
| 117 | - contentPadding: EdgeInsets.only( | ||
| 118 | - right: ScreenUtil().setWidth(40 * 2)), | ||
| 119 | - hintText: "输入手机号或姓名", | ||
| 120 | - hintStyle: TextStyle( | ||
| 121 | - color: MyColours.color_999999, | ||
| 122 | - fontSize: ScreenUtil().setSp(26), | ||
| 123 | - ), | ||
| 124 | - isCollapsed: | ||
| 125 | - true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度 | ||
| 126 | - border: OutlineInputBorder( | ||
| 127 | - borderSide: BorderSide.none), | ||
| 128 | - // 左边图标设置 | ||
| 129 | - icon: Image.asset( | ||
| 130 | - Utils.getImgPath('search'), | ||
| 131 | - width: ScreenUtil().setWidth(30), | ||
| 132 | - ), | ||
| 133 | - //右边图标设置 | ||
| 134 | - // suffixIcon: | ||
| 135 | - ), | ||
| 136 | - keyboardType: TextInputType.text, | ||
| 137 | - textInputAction: TextInputAction.done, | ||
| 138 | - | ||
| 139 | - onChanged: (value) { | ||
| 140 | - // setState(() {}); | ||
| 141 | - // _searchSellerLocation(); | ||
| 142 | - customerProvider.searchData(value); | ||
| 143 | - }, | ||
| 144 | - onEditingComplete: () { | ||
| 145 | - FocusScope.of(context).requestFocus( | ||
| 146 | - FocusNode()); //点击空白处隐藏键盘 | ||
| 147 | - // contantShowModel.searchData( | ||
| 148 | - // contantShowModel.controller.text); | ||
| 149 | - // _searchSellerLocation(); | ||
| 150 | - // _focusNode.unfocus(); | ||
| 151 | - }, | ||
| 152 | - ), | ||
| 153 | - ), | ||
| 154 | - Positioned( | ||
| 155 | - right: 0, | ||
| 156 | - top: 0, | ||
| 157 | - bottom: 0, | ||
| 158 | - child: Offstage( | ||
| 159 | - offstage: | ||
| 160 | - customerProvider.controller.text == | ||
| 161 | - '', | ||
| 162 | - child: GestureDetector( | ||
| 163 | - child: Container( | ||
| 164 | - padding: EdgeInsets.only( | ||
| 165 | - right: ScreenUtil() | ||
| 166 | - .setWidth(20 * 2)), | ||
| 167 | - // color: Colors.orange, | ||
| 168 | - height: | ||
| 169 | - ScreenUtil().setWidth(45 * 2), | ||
| 170 | - width: | ||
| 171 | - ScreenUtil().setWidth(100 * 2), | ||
| 172 | - alignment: Alignment.centerRight, | ||
| 173 | - child: Image.asset( | ||
| 174 | - Utils.getImgPath('clear'), | ||
| 175 | - width: ScreenUtil().setWidth(30), | ||
| 176 | - height: ScreenUtil().setWidth(30), | ||
| 177 | - ), | ||
| 178 | - ), | ||
| 179 | - onTap: () { | ||
| 180 | - WidgetsBinding.instance | ||
| 181 | - .addPostFrameCallback(((_) { | ||
| 182 | - customerProvider.controller | ||
| 183 | - .clear(); | ||
| 184 | - customerProvider.searchData(''); | ||
| 185 | - })); | ||
| 186 | - }, | ||
| 187 | - ))) | ||
| 188 | - ], | ||
| 189 | - )), | ||
| 190 | - Container( | ||
| 191 | - margin: EdgeInsets.symmetric( | ||
| 192 | - horizontal: ScreenUtil().setWidth(40), | ||
| 193 | - vertical: ScreenUtil().setWidth(20)), | ||
| 194 | - decoration: BoxDecoration( | ||
| 195 | - color: MyColours.color_ffffff, | ||
| 196 | - boxShadow: [ | ||
| 197 | - BoxShadow( | ||
| 198 | - // color: Colors.red, | ||
| 199 | - color: Color.fromRGBO( | ||
| 200 | - 220, 220, 220, 1), //投影颜色 | ||
| 201 | - offset: Offset(2, 2), //x,y轴 | ||
| 202 | - blurRadius: | ||
| 203 | - ScreenUtil().setWidth(6) //投影距离 | ||
| 204 | - ) | ||
| 205 | - ]), | ||
| 206 | - child: Row( | 719 | + _buttonChoose(String title, ClickCallback callback) { |
| 720 | + return InkWell( | ||
| 721 | + onTap: () { | ||
| 722 | + callback(title); | ||
| 723 | + }, | ||
| 724 | + child: Container( | ||
| 725 | + padding: EdgeInsets.symmetric( | ||
| 726 | + horizontal: ScreenUtil().setWidth(20), | ||
| 727 | + vertical: ScreenUtil().setWidth(10)), | ||
| 728 | + height: ScreenUtil().setWidth(60), | ||
| 729 | + decoration: BoxDecoration( | ||
| 730 | + // border: Border.all( | ||
| 731 | + // width: ScreenUtil().setWidth(2), | ||
| 732 | + // color: MyColours.color_199095), | ||
| 733 | + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(30))), | ||
| 734 | + child: Row( | ||
| 735 | + children: [ | ||
| 736 | + Text( | ||
| 737 | + title, | ||
| 738 | + style: TextStyle( | ||
| 739 | + color: title == '时间(选填)' || title == '(选填)' | ||
| 740 | + ? MyColours.color_999999 | ||
| 741 | + : MyColours.color_199095, | ||
| 742 | + fontSize: ScreenUtil().setWidth(28)), | ||
| 743 | + ), | ||
| 744 | + HEmptyView(10), | ||
| 745 | + Image.asset( | ||
| 746 | + Utils.getImgPath('enter_order_arrow'), | ||
| 747 | + width: ScreenUtil().setWidth(20), | ||
| 748 | + height: ScreenUtil().setWidth(10), | ||
| 749 | + ) | ||
| 750 | + ], | ||
| 751 | + ))); | ||
| 752 | + } | ||
| 753 | + | ||
| 754 | + /// 高级筛选输入框 | ||
| 755 | + Widget _textFeildWidget() { | ||
| 756 | + return Container( | ||
| 757 | + padding: EdgeInsets.symmetric( | ||
| 758 | + horizontal: ScreenUtil().setWidth(20), | ||
| 759 | + ), | ||
| 760 | + height: ScreenUtil().setWidth(50), | ||
| 761 | + // alignment: Alignment.center, | ||
| 762 | + decoration: BoxDecoration( | ||
| 763 | + color: Color.fromRGBO(239, 239, 239, 1), | ||
| 764 | + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(30))), | ||
| 765 | + child: Material( | ||
| 766 | + color: Color.fromRGBO(239, 239, 239, 1), | ||
| 767 | + child: Row(children: [ | ||
| 768 | + Expanded( | ||
| 769 | + child: TextField( | ||
| 770 | + maxLines: 1, | ||
| 771 | + controller: customerProvider.controller, | ||
| 772 | + // focusNode: _focusNode, | ||
| 773 | + // autofocus: true, | ||
| 774 | + | ||
| 775 | + style: TextStyle( | ||
| 776 | + color: MyColours.color_333333, | ||
| 777 | + fontSize: ScreenUtil().setSp(26)), | ||
| 778 | + // textAlignVertical: TextAlignVertical.center, | ||
| 779 | + decoration: InputDecoration( | ||
| 780 | + hintText: "xxx", | ||
| 781 | + hintStyle: TextStyle( | ||
| 782 | + color: MyColours.color_999999, | ||
| 783 | + fontSize: ScreenUtil().setSp(26), | ||
| 784 | + ), | ||
| 785 | + // isCollapsed: | ||
| 786 | + // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度 | ||
| 787 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 788 | + contentPadding: EdgeInsets.zero, | ||
| 789 | + ), | ||
| 790 | + keyboardType: TextInputType.text, | ||
| 791 | + textInputAction: TextInputAction.done, | ||
| 792 | + | ||
| 793 | + onChanged: (value) { | ||
| 794 | + // setState(() {}); | ||
| 795 | + // _searchSellerLocation(); | ||
| 796 | + customerProvider.searchData(value); | ||
| 797 | + }, | ||
| 798 | + onEditingComplete: () { | ||
| 799 | + FocusScope.of(context) | ||
| 800 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 801 | + // contantShowModel.searchData( | ||
| 802 | + // contantShowModel.controller.text); | ||
| 803 | + // _searchSellerLocation(); | ||
| 804 | + // _focusNode.unfocus(); | ||
| 805 | + }, | ||
| 806 | + ), | ||
| 807 | + ), | ||
| 808 | + _textWidget('天', MyColours.color_333333, FontWeight.normal, 24), | ||
| 809 | + ]))); | ||
| 810 | + } | ||
| 811 | + | ||
| 812 | + ///筛选布局 | ||
| 813 | + Widget _filterWidget( | ||
| 814 | + StateSetter state, | ||
| 815 | + VoidCallback onPressedReset, | ||
| 816 | + VoidCallback onPressedComplete, | ||
| 817 | + ) { | ||
| 818 | + return Container( | ||
| 819 | + padding: EdgeInsets.symmetric( | ||
| 820 | + // horizontal: ScreenUtil().setWidth(30), | ||
| 821 | + ), | ||
| 822 | + // height: ScreenUtil().setWidth(100), | ||
| 823 | + margin: EdgeInsets.only( | ||
| 824 | + top: ScreenUtil().setWidth(92 + 52 + 30 * 3 + 90) + | ||
| 825 | + ScreenUtil.statusBarHeight), | ||
| 826 | + color: Color.fromRGBO(00, 00, 00, 0.49), | ||
| 827 | + child: Align( | ||
| 828 | + alignment: Alignment.topCenter, | ||
| 829 | + child: Container( | ||
| 830 | + decoration: BoxDecoration( | ||
| 831 | + color: MyColours.color_ffffff, | ||
| 832 | + borderRadius: BorderRadius.only( | ||
| 833 | + bottomRight: Radius.circular(ScreenUtil().setWidth(20)), | ||
| 834 | + bottomLeft: Radius.circular(ScreenUtil().setWidth(20)))), | ||
| 835 | + margin: EdgeInsets.only( | ||
| 836 | + left: ScreenUtil().setWidth(40), | ||
| 837 | + bottom: ScreenUtil().setWidth(140), | ||
| 838 | + right: ScreenUtil().setWidth(40)), | ||
| 839 | + padding: | ||
| 840 | + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)), | ||
| 841 | + child: Column( | ||
| 842 | + children: [ | ||
| 843 | + Expanded( | ||
| 844 | + child: Scrollbar( | ||
| 845 | + isAlwaysShown: true, //设置滚动条常亮 | ||
| 846 | + controller: _scrollCrl, //必须设置一个controller | ||
| 847 | + | ||
| 848 | + ///添加进度条 | ||
| 849 | + child: SingleChildScrollView( | ||
| 850 | + controller: _scrollCrl, | ||
| 851 | + // primary: true, | ||
| 852 | + // reverse: true, | ||
| 853 | + // physics: BouncingScrollPhysics(), | ||
| 854 | + // padding: EdgeInsets.only( | ||
| 855 | + // bottom: | ||
| 856 | + // MediaQuery.of(context).viewInsets.bottom), | ||
| 857 | + child: Column( | ||
| 858 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 207 | children: [ | 859 | children: [ |
| 208 | - Expanded( | ||
| 209 | - child: Container( | ||
| 210 | - padding: EdgeInsets.only( | ||
| 211 | - bottom: ScreenUtil().setWidth(10)), | ||
| 212 | - margin: EdgeInsets.symmetric( | ||
| 213 | - horizontal: ScreenUtil().setWidth(30)), | ||
| 214 | - child: TabBar( | ||
| 215 | - controller: tabController, | ||
| 216 | - indicator: CustomTabIndicator( | ||
| 217 | - radius: 0, | ||
| 218 | - ), | ||
| 219 | - indicatorColor: MyColours.color_199095, | ||
| 220 | - indicatorSize: TabBarIndicatorSize.tab, | ||
| 221 | - // indicatorPadding: EdgeInsets.symmetric( | ||
| 222 | - // horizontal: ScreenUtil().setWidth(12)), | ||
| 223 | - labelColor: MyColours.color_199095, | ||
| 224 | - labelStyle: TextStyle( | ||
| 225 | - fontSize: ScreenUtil().setSp(32), | ||
| 226 | - fontWeight: FontWeight.bold), | ||
| 227 | - labelPadding: EdgeInsets.zero, | ||
| 228 | - unselectedLabelStyle: TextStyle( | ||
| 229 | - fontWeight: FontWeight.normal, | ||
| 230 | - fontSize: ScreenUtil().setSp(28), | ||
| 231 | - ), | ||
| 232 | - unselectedLabelColor: | ||
| 233 | - MyColours.color_999999, | ||
| 234 | - tabs: _tabBarTitle.map((value) { | ||
| 235 | - return Tab( | ||
| 236 | - child: Text(value), | ||
| 237 | - ); | ||
| 238 | - }).toList()), | ||
| 239 | - )), | ||
| 240 | - InkWell( | ||
| 241 | - onTap: () {}, | ||
| 242 | - child: Container( | ||
| 243 | - padding: EdgeInsets.only( | ||
| 244 | - bottom: ScreenUtil().setWidth(10)), | ||
| 245 | - margin: EdgeInsets.only( | ||
| 246 | - right: ScreenUtil().setWidth(30)), | ||
| 247 | - width: ScreenUtil().setWidth(100), | ||
| 248 | - // height: ScreenUtil().setWidth(50), | ||
| 249 | - child: Row( | ||
| 250 | - children: [ | ||
| 251 | - Text( | ||
| 252 | - '筛选', | ||
| 253 | - style: TextStyle( | ||
| 254 | - fontSize: | ||
| 255 | - ScreenUtil().setSp(28), | ||
| 256 | - color: MyColours.color_999999), | ||
| 257 | - ), | ||
| 258 | - HEmptyView(10), | ||
| 259 | - Image.asset( | ||
| 260 | - Utils.getImgPath( | ||
| 261 | - 'enter_order_arrow'), | ||
| 262 | - width: ScreenUtil().setWidth(20), | ||
| 263 | - height: ScreenUtil().setWidth(10), | ||
| 264 | - ) | ||
| 265 | - ], | ||
| 266 | - )), | ||
| 267 | - ) | 860 | + VEmptyView(20), |
| 861 | + _managerWidget(), | ||
| 862 | + VEmptyView(30), | ||
| 863 | + _activityWidget(), | ||
| 864 | + VEmptyView(30), | ||
| 865 | + _labelWidget(), | ||
| 866 | + VEmptyView(30), | ||
| 867 | + _advancedFilterWidget(state) | ||
| 268 | ], | 868 | ], |
| 869 | + ), | ||
| 870 | + ))), | ||
| 871 | + Row( | ||
| 872 | + children: [ | ||
| 873 | + Container( | ||
| 874 | + width: ScreenUtil.screenWidthDp - | ||
| 875 | + ScreenUtil().setWidth(40 * 4), | ||
| 876 | + height: ScreenUtil().setWidth(100), | ||
| 877 | + // padding: EdgeInsets.symmetric( | ||
| 878 | + // horizontal: ScreenUtil().setWidth(40)), | ||
| 879 | + decoration: BoxDecoration( | ||
| 880 | + boxShadow: [ | ||
| 881 | + BoxShadow( | ||
| 882 | + color: MyColours.color_E0E0E0, | ||
| 883 | + blurRadius: ScreenUtil().setWidth(14)) | ||
| 884 | + ], | ||
| 885 | + color: MyColours.color_ffffff, | ||
| 886 | + borderRadius: BorderRadius.circular( | ||
| 887 | + ScreenUtil().setWidth(20), | ||
| 269 | )), | 888 | )), |
| 270 | - VEmptyView(10), | ||
| 271 | - Expanded( | ||
| 272 | - child: TabBarView( | ||
| 273 | - controller: tabController, | ||
| 274 | - // physics: NeverScrollableScrollPhysics(), | 889 | + child: Row( |
| 890 | + // mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
| 891 | + // crossAxisAlignment: CrossAxisAlignment.center, | ||
| 275 | children: <Widget>[ | 892 | children: <Widget>[ |
| 276 | - Consumer<CustomerProvider>( | ||
| 277 | - builder: (context, model, _) { | ||
| 278 | - if (model.pageState != PageState.Success) { | ||
| 279 | - return ExceptionPage( | ||
| 280 | - pageState: model.pageState, | ||
| 281 | - callback: () { | ||
| 282 | - model.pageState = PageState.Loading; | ||
| 283 | - model.notifyListeners(); | ||
| 284 | - _getContantData(); | ||
| 285 | - }, | ||
| 286 | - emptyMsg: "暂时没有联系人哦", | ||
| 287 | - emptyImg: "empty_search", | ||
| 288 | - showMsg: "加载中,请稍后...", | ||
| 289 | - ); | ||
| 290 | - } else { | ||
| 291 | - return ContactListPage( | ||
| 292 | - contacts: model.userHistorysShow); | ||
| 293 | - // return ListView.builder( | ||
| 294 | - // itemCount: model.userHistorysShow.length, | ||
| 295 | - // itemBuilder: | ||
| 296 | - // (BuildContext context, int index) { | ||
| 297 | - // String phone = model | ||
| 298 | - // .userHistorysShow[index] | ||
| 299 | - // .phone == | ||
| 300 | - // null || | ||
| 301 | - // model.userHistorysShow[index] | ||
| 302 | - // .phone == | ||
| 303 | - // '' | ||
| 304 | - // ? '' | ||
| 305 | - // : model | ||
| 306 | - // .userHistorysShow[index].phone; | ||
| 307 | - // return ContantItemPage( | ||
| 308 | - // onTap: () { | ||
| 309 | - // if (model.userHistorysShow[index] | ||
| 310 | - // .phone != | ||
| 311 | - // null && | ||
| 312 | - // model.userHistorysShow[index] | ||
| 313 | - // .phone != | ||
| 314 | - // '') { | ||
| 315 | - // DialogUtil.goPhone(model | ||
| 316 | - // .userHistorysShow[index] | ||
| 317 | - // .phone); | ||
| 318 | - // } | ||
| 319 | - // }, | ||
| 320 | - // index: index, | ||
| 321 | - // model: customerProvider, | ||
| 322 | - // data: model.userHistorysShow, | ||
| 323 | - // ); | ||
| 324 | - // }); | ||
| 325 | - } | ||
| 326 | - }, | ||
| 327 | - ), | ||
| 328 | - Container( | ||
| 329 | - height: 200, | ||
| 330 | - width: 300, | ||
| 331 | - color: Colors.red, | ||
| 332 | - ), | ||
| 333 | - Container( | ||
| 334 | - height: 200, | ||
| 335 | - width: 300, | ||
| 336 | - color: Colors.red, | ||
| 337 | - ), | ||
| 338 | - Container( | ||
| 339 | - height: 200, | ||
| 340 | - width: 300, | ||
| 341 | - color: Colors.red, | ||
| 342 | - ) | 893 | + Expanded( |
| 894 | + flex: 1, | ||
| 895 | + child: Material( | ||
| 896 | + child: InkWell( | ||
| 897 | + onTap: onPressedReset, | ||
| 898 | + child: Container( | ||
| 899 | + decoration: BoxDecoration( | ||
| 900 | + color: MyColours.color_ffffff, | ||
| 901 | + borderRadius: BorderRadius.only( | ||
| 902 | + bottomLeft: Radius.circular( | ||
| 903 | + ScreenUtil().setWidth(20)), | ||
| 904 | + topLeft: Radius.circular( | ||
| 905 | + ScreenUtil().setWidth(20)), | ||
| 906 | + )), | ||
| 907 | + child: Align( | ||
| 908 | + alignment: Alignment.center, | ||
| 909 | + child: _textWidget( | ||
| 910 | + '重置', | ||
| 911 | + MyColours.color_333333, | ||
| 912 | + FontWeight.normal, | ||
| 913 | + 30), | ||
| 914 | + ), | ||
| 915 | + ), | ||
| 916 | + ))), | ||
| 917 | + Expanded( | ||
| 918 | + flex: 1, | ||
| 919 | + child: Material( | ||
| 920 | + child: InkWell( | ||
| 921 | + onTap: onPressedComplete, | ||
| 922 | + child: Container( | ||
| 923 | + decoration: BoxDecoration( | ||
| 924 | + color: MyColours.color_199095, | ||
| 925 | + borderRadius: BorderRadius.only( | ||
| 926 | + topRight: Radius.circular( | ||
| 927 | + ScreenUtil().setWidth(20)), | ||
| 928 | + bottomRight: Radius.circular( | ||
| 929 | + ScreenUtil().setWidth(20)), | ||
| 930 | + )), | ||
| 931 | + child: Align( | ||
| 932 | + alignment: Alignment.center, | ||
| 933 | + child: _textWidget( | ||
| 934 | + '确定', | ||
| 935 | + MyColours.color_ffffff, | ||
| 936 | + FontWeight.normal, | ||
| 937 | + 30), | ||
| 938 | + ), | ||
| 939 | + ), | ||
| 940 | + ))) | ||
| 343 | ], | 941 | ], |
| 344 | - )), | ||
| 345 | - ], | ||
| 346 | - )), | ||
| 347 | - onWillPop: () async { | ||
| 348 | - EventBus().emit('changeStatusColor'); | ||
| 349 | - return true; | ||
| 350 | - })))); | 942 | + ), |
| 943 | + ), | ||
| 944 | + ], | ||
| 945 | + ), | ||
| 946 | + VEmptyView(30) | ||
| 947 | + ], | ||
| 948 | + ), | ||
| 949 | + ))); | ||
| 950 | + } | ||
| 951 | + | ||
| 952 | + //构建筛选按钮 | ||
| 953 | + List<Widget> _buildFilterItem(List<Map> data, bool round, | ||
| 954 | + {bool grayBack = false}) { | ||
| 955 | + List<Widget> items = []; | ||
| 956 | + | ||
| 957 | + for (Map item in data) { | ||
| 958 | + items.add(Container( | ||
| 959 | + padding: EdgeInsets.symmetric( | ||
| 960 | + horizontal: ScreenUtil().setWidth(20), | ||
| 961 | + vertical: ScreenUtil().setWidth(6)), | ||
| 962 | + decoration: BoxDecoration( | ||
| 963 | + color: grayBack | ||
| 964 | + ? Color.fromRGBO(239, 239, 239, 1) | ||
| 965 | + : item['select'] | ||
| 966 | + ? MyColours.color_199095 | ||
| 967 | + : MyColours.color_ffffff, | ||
| 968 | + border: Border.all( | ||
| 969 | + color: grayBack | ||
| 970 | + ? Color.fromRGBO(239, 239, 239, 1) | ||
| 971 | + : item['select'] | ||
| 972 | + ? MyColours.color_199095 | ||
| 973 | + : round | ||
| 974 | + ? Color.fromRGBO(155, 155, 155, 1) | ||
| 975 | + : MyColours.color_199095, | ||
| 976 | + width: ScreenUtil().setWidth(2)), | ||
| 977 | + borderRadius: BorderRadius.circular( | ||
| 978 | + ScreenUtil().setWidth(round ? 30 : 10))), | ||
| 979 | + child: _textWidget( | ||
| 980 | + item['title'], | ||
| 981 | + grayBack | ||
| 982 | + ? MyColours.color_333333 | ||
| 983 | + : item['select'] | ||
| 984 | + ? MyColours.color_ffffff | ||
| 985 | + : round | ||
| 986 | + ? MyColours.color_333333 | ||
| 987 | + : MyColours.color_199095, | ||
| 988 | + FontWeight.normal, | ||
| 989 | + 24))); | ||
| 990 | + } | ||
| 991 | + return items; | ||
| 992 | + } | ||
| 993 | + | ||
| 994 | + @override | ||
| 995 | + Widget build(BuildContext context) { | ||
| 996 | + customerProvider = Provider.of<CustomerProvider>(context, listen: true); | ||
| 997 | + return Material( | ||
| 998 | + child: InkWell( | ||
| 999 | + onTap: () { | ||
| 1000 | + // FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 1001 | + }, | ||
| 1002 | + child: Scaffold( | ||
| 1003 | + resizeToAvoidBottomInset: false, | ||
| 1004 | + backgroundColor: MyColours.color_ffffff, | ||
| 1005 | + appBar: SystemAppBar( | ||
| 1006 | + '全店客户', | ||
| 1007 | + onTap: () { | ||
| 1008 | + Navigator.of(context).pop(); | ||
| 1009 | + }, | ||
| 1010 | + ), | ||
| 1011 | + body: SafeArea( | ||
| 1012 | + child: Column(children: [ | ||
| 1013 | + _searchWidget(), _menuWidget(), | ||
| 1014 | + Expanded(child: | ||
| 1015 | + Consumer<CustomerProvider>(builder: (context, model, _) { | ||
| 1016 | + if (model.pageState != PageState.Success) { | ||
| 1017 | + return ExceptionPage( | ||
| 1018 | + pageState: model.pageState, | ||
| 1019 | + callback: () { | ||
| 1020 | + model.pageState = PageState.Loading; | ||
| 1021 | + model.notifyListeners(); | ||
| 1022 | + _getContantData(); | ||
| 1023 | + }, | ||
| 1024 | + emptyMsg: "暂时没有联系人哦", | ||
| 1025 | + emptyImg: "empty_search", | ||
| 1026 | + showMsg: "加载中,请稍后...", | ||
| 1027 | + ); | ||
| 1028 | + } else { | ||
| 1029 | + return Column(children: [ | ||
| 1030 | + Expanded( | ||
| 1031 | + child: TabBarView( | ||
| 1032 | + controller: tabController, | ||
| 1033 | + physics: NeverScrollableScrollPhysics(), | ||
| 1034 | + children: <Widget>[ | ||
| 1035 | + ContactListPage( | ||
| 1036 | + contacts: model.userHistorysShow, | ||
| 1037 | + provider: customerProvider), | ||
| 1038 | + ContactListPage( | ||
| 1039 | + contacts: model.userHistorysShow, | ||
| 1040 | + provider: customerProvider), | ||
| 1041 | + ContactListPage( | ||
| 1042 | + contacts: model.userHistorysShow, | ||
| 1043 | + provider: customerProvider), | ||
| 1044 | + ContactListPage( | ||
| 1045 | + contacts: model.userHistorysShow, | ||
| 1046 | + provider: customerProvider), | ||
| 1047 | + ])), | ||
| 1048 | + customerProvider.pageState == PageState.Success | ||
| 1049 | + ? _selectContantWidget() | ||
| 1050 | + : SizedBox(), | ||
| 1051 | + ]); | ||
| 1052 | + } | ||
| 1053 | + })), | ||
| 1054 | + // _searchWidget(), | ||
| 1055 | + // Positioned( | ||
| 1056 | + // top: 0, | ||
| 1057 | + // left: ScreenUtil().setWidth(40), | ||
| 1058 | + // right: ScreenUtil().setWidth(40), | ||
| 1059 | + // child: _filterWidget()) | ||
| 1060 | + // ], | ||
| 1061 | + ])), | ||
| 1062 | + ))); | ||
| 351 | } | 1063 | } |
| 352 | } | 1064 | } |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | +import 'package:one_key/res/colors.dart'; | ||
| 4 | +import 'package:one_key/utils/dialog_util.dart'; | ||
| 5 | +import 'package:one_key/utils/utils.dart'; | ||
| 6 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 7 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 8 | + | ||
| 9 | +class CustomerSettingPage extends StatefulWidget { | ||
| 10 | + CustomerSettingPage({Key key}) : super(key: key); | ||
| 11 | + | ||
| 12 | + @override | ||
| 13 | + _CustomerSettingPageState createState() => _CustomerSettingPageState(); | ||
| 14 | +} | ||
| 15 | + | ||
| 16 | +class _CustomerSettingPageState extends State<CustomerSettingPage> { | ||
| 17 | + bool swichState = true; | ||
| 18 | + | ||
| 19 | + //构建标签 | ||
| 20 | + List<Widget> _buildLabelItem(List<String> data) { | ||
| 21 | + List<Widget> items = []; | ||
| 22 | + | ||
| 23 | + for (String item in data) { | ||
| 24 | + items.add(InkWell( | ||
| 25 | + onTap: () { | ||
| 26 | + DialogUtil.textfeildAlertDialog(context, | ||
| 27 | + title: '自定义标签名称', | ||
| 28 | + hintText: '例:高频客户', | ||
| 29 | + text: item, | ||
| 30 | + lenghtLimit: false, | ||
| 31 | + toast: '请输入标签名称', rCallback: (name) { | ||
| 32 | + print(name); | ||
| 33 | + // _addCookbookClass(name, showLoading: true); | ||
| 34 | + }); | ||
| 35 | + }, | ||
| 36 | + child: Container( | ||
| 37 | + height: ScreenUtil().setWidth(40), | ||
| 38 | + child: Text( | ||
| 39 | + item, | ||
| 40 | + style: TextStyle( | ||
| 41 | + color: Color.fromRGBO(193, 194, 63, 1), | ||
| 42 | + fontSize: ScreenUtil().setSp(26), | ||
| 43 | + ), | ||
| 44 | + ), | ||
| 45 | + ))); | ||
| 46 | + } | ||
| 47 | + items.add(InkWell( | ||
| 48 | + onTap: () { | ||
| 49 | + DialogUtil.textfeildAlertDialog(context, | ||
| 50 | + title: '自定义标签名称', | ||
| 51 | + hintText: '例:高频客户', | ||
| 52 | + text: '', | ||
| 53 | + lenghtLimit: false, | ||
| 54 | + toast: '请输入标签名称', rCallback: (name) { | ||
| 55 | + print(name); | ||
| 56 | + // _addCookbookClass(name, showLoading: true); | ||
| 57 | + }); | ||
| 58 | + }, | ||
| 59 | + child: Container( | ||
| 60 | + width: ScreenUtil().setWidth(90), | ||
| 61 | + height: ScreenUtil().setWidth(40), | ||
| 62 | + alignment: Alignment.center, | ||
| 63 | + decoration: BoxDecoration( | ||
| 64 | + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)), | ||
| 65 | + border: Border.all( | ||
| 66 | + color: MyColours.color_199095, | ||
| 67 | + width: ScreenUtil().setWidth(2))), | ||
| 68 | + child: Image.asset(Utils.getImgPath('add_area'), | ||
| 69 | + width: ScreenUtil().setWidth(14)), | ||
| 70 | + ), | ||
| 71 | + )); | ||
| 72 | + return items; | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + @override | ||
| 76 | + Widget build(BuildContext context) { | ||
| 77 | + return Scaffold( | ||
| 78 | + backgroundColor: Color.fromRGBO(246, 248, 250, 1), | ||
| 79 | + appBar: SystemAppBar( | ||
| 80 | + '客情设置', | ||
| 81 | + onTap: () { | ||
| 82 | + Navigator.pop(context); | ||
| 83 | + }, | ||
| 84 | + ), | ||
| 85 | + body: Padding( | ||
| 86 | + padding: EdgeInsets.symmetric( | ||
| 87 | + horizontal: ScreenUtil().setWidth(40), | ||
| 88 | + vertical: ScreenUtil().setWidth(40)), | ||
| 89 | + child: SingleChildScrollView( | ||
| 90 | + child: Column( | ||
| 91 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 92 | + children: [ | ||
| 93 | + InkWell( | ||
| 94 | + onTap: () { | ||
| 95 | + setState(() { | ||
| 96 | + swichState = !swichState; | ||
| 97 | + }); | ||
| 98 | + }, | ||
| 99 | + child: Row( | ||
| 100 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 101 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 102 | + children: [ | ||
| 103 | + Text('预订要求补录客人信息', | ||
| 104 | + style: TextStyle( | ||
| 105 | + color: MyColours.color_333333, | ||
| 106 | + fontSize: ScreenUtil().setSp(30))), | ||
| 107 | + Image.asset( | ||
| 108 | + swichState | ||
| 109 | + ? Utils.getImgPath('f_swich_on') | ||
| 110 | + : Utils.getImgPath('f_swich_off'), | ||
| 111 | + width: ScreenUtil().setWidth(70), | ||
| 112 | + // height: ScreenUtil().setWidth(82), | ||
| 113 | + ), | ||
| 114 | + ], | ||
| 115 | + ), | ||
| 116 | + ), | ||
| 117 | + VEmptyView(50), | ||
| 118 | + Text('店内自定义标签', | ||
| 119 | + style: TextStyle( | ||
| 120 | + color: MyColours.color_333333, | ||
| 121 | + fontSize: ScreenUtil().setSp(30))), | ||
| 122 | + VEmptyView(30), | ||
| 123 | + Wrap( | ||
| 124 | + spacing: ScreenUtil().setWidth(20), | ||
| 125 | + runSpacing: ScreenUtil().setWidth(10), | ||
| 126 | + children: _buildLabelItem([ | ||
| 127 | + '低频高消费', | ||
| 128 | + 'fdsfsdf', | ||
| 129 | + 'dfsdfsf', | ||
| 130 | + 'ff', | ||
| 131 | + 'ff', | ||
| 132 | + 'sfsuhfsuhfiuhfuaihuf' | ||
| 133 | + ])), | ||
| 134 | + ], | ||
| 135 | + )), | ||
| 136 | + ), | ||
| 137 | + ); | ||
| 138 | + } | ||
| 139 | +} |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | +import 'package:one_key/res/colors.dart'; | ||
| 4 | +import 'package:one_key/utils/utils.dart'; | ||
| 5 | +import 'package:one_key/widgets/h_empty_view.dart'; | ||
| 6 | +import 'package:one_key/widgets/round_button.dart'; | ||
| 7 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 8 | + | ||
| 9 | +class MarketingRecordsPage extends StatefulWidget { | ||
| 10 | + MarketingRecordsPage({Key key}) : super(key: key); | ||
| 11 | + | ||
| 12 | + @override | ||
| 13 | + _MarketingRecordsPageState createState() => _MarketingRecordsPageState(); | ||
| 14 | +} | ||
| 15 | + | ||
| 16 | +class _MarketingRecordsPageState extends State<MarketingRecordsPage> { | ||
| 17 | + @override | ||
| 18 | + Widget build(BuildContext context) { | ||
| 19 | + return Scaffold( | ||
| 20 | + backgroundColor: MyColours.color_ffffff, | ||
| 21 | + appBar: SystemAppBar( | ||
| 22 | + '全店营销记录', | ||
| 23 | + onTap: () { | ||
| 24 | + Navigator.pop(context); | ||
| 25 | + }, | ||
| 26 | + ), | ||
| 27 | + body: ListView.builder( | ||
| 28 | + padding: EdgeInsets.symmetric( | ||
| 29 | + horizontal: ScreenUtil().setWidth(20), | ||
| 30 | + // vertical: ScreenUtil().setWidth(40) | ||
| 31 | + ), | ||
| 32 | + itemCount: 100, | ||
| 33 | + itemBuilder: (BuildContext context, int index) { | ||
| 34 | + return Padding( | ||
| 35 | + padding: | ||
| 36 | + EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(20)), | ||
| 37 | + child: Row( | ||
| 38 | + children: [ | ||
| 39 | + Image.asset(Utils.getImgPath('warning'), | ||
| 40 | + width: ScreenUtil().setWidth(30)), | ||
| 41 | + HEmptyView(20), | ||
| 42 | + Text('2021-12-22', | ||
| 43 | + style: TextStyle( | ||
| 44 | + color: MyColours.color_333333, | ||
| 45 | + fontSize: ScreenUtil().setSp(26))), | ||
| 46 | + HEmptyView(10), | ||
| 47 | + RoundButton( | ||
| 48 | + text: '全店任务', | ||
| 49 | + gradientStart: MyColours.color_199095, | ||
| 50 | + gradientEnd: MyColours.color_199095, | ||
| 51 | + // borderColor: MyColours.color_999999, | ||
| 52 | + radius: ScreenUtil().setWidth(10), | ||
| 53 | + height: ScreenUtil().setWidth(50), | ||
| 54 | + fontSize: 26, | ||
| 55 | + padding: EdgeInsets.symmetric( | ||
| 56 | + horizontal: ScreenUtil().setWidth(10)), | ||
| 57 | + isBold: false, | ||
| 58 | + onPressed: () { | ||
| 59 | + // NavigatorUtil.goEnterStoreEnvironmentPage(context); | ||
| 60 | + }, | ||
| 61 | + ), | ||
| 62 | + HEmptyView(10), | ||
| 63 | + Expanded( | ||
| 64 | + child: Text('30位未完成', | ||
| 65 | + overflow: TextOverflow.ellipsis, | ||
| 66 | + style: TextStyle( | ||
| 67 | + color: MyColours.color_333333, | ||
| 68 | + fontSize: ScreenUtil().setSp(26)))), | ||
| 69 | + HEmptyView(10), | ||
| 70 | + Expanded( | ||
| 71 | + child: Text('剩余1天', | ||
| 72 | + overflow: TextOverflow.ellipsis, | ||
| 73 | + style: TextStyle( | ||
| 74 | + color: MyColours.color_333333, | ||
| 75 | + fontSize: ScreenUtil().setSp(26)))), | ||
| 76 | + HEmptyView(10), | ||
| 77 | + Text('查看详情', | ||
| 78 | + style: TextStyle( | ||
| 79 | + decoration: TextDecoration.underline, | ||
| 80 | + color: MyColours.color_199095, | ||
| 81 | + fontSize: ScreenUtil().setSp(26))), | ||
| 82 | + ], | ||
| 83 | + )); | ||
| 84 | + }), | ||
| 85 | + ); | ||
| 86 | + } | ||
| 87 | +} |
| @@ -136,10 +136,14 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> { | @@ -136,10 +136,14 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> { | ||
| 136 | ), | 136 | ), |
| 137 | ), | 137 | ), |
| 138 | Positioned( | 138 | Positioned( |
| 139 | - top: ScreenUtil().setWidth(20), | 139 | + top: ScreenUtil().setWidth(30), |
| 140 | right: ScreenUtil().setWidth(40), | 140 | right: ScreenUtil().setWidth(40), |
| 141 | - child: Image.asset(Utils.getImgPath('add_area'), | ||
| 142 | - width: ScreenUtil().setWidth(30))) | 141 | + child: InkWell( |
| 142 | + onTap: () { | ||
| 143 | + NavigatorUtil.goCustomerSetPage(context); | ||
| 144 | + }, | ||
| 145 | + child: Image.asset(Utils.getImgPath('c_set'), | ||
| 146 | + width: ScreenUtil().setWidth(40)))) | ||
| 143 | ], | 147 | ], |
| 144 | ), | 148 | ), |
| 145 | VEmptyView(10), | 149 | VEmptyView(10), |
| @@ -196,7 +200,9 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> { | @@ -196,7 +200,9 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> { | ||
| 196 | Padding( | 200 | Padding( |
| 197 | padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(30)), | 201 | padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(30)), |
| 198 | child: RoundButton( | 202 | child: RoundButton( |
| 199 | - onPressed: () async {}, | 203 | + onPressed: () { |
| 204 | + NavigatorUtil.goMarketingRecordsPage(context); | ||
| 205 | + }, | ||
| 200 | text: '营销记录', | 206 | text: '营销记录', |
| 201 | fontSize: 24, | 207 | fontSize: 24, |
| 202 | isBold: false, | 208 | isBold: false, |
| 1 | +import 'package:azlistview/azlistview.dart'; | ||
| 1 | import 'package:flutter/material.dart'; | 2 | import 'package:flutter/material.dart'; |
| 2 | import 'package:lpinyin/lpinyin.dart'; | 3 | import 'package:lpinyin/lpinyin.dart'; |
| 3 | import 'package:one_key/constant/constant.dart'; | 4 | import 'package:one_key/constant/constant.dart'; |
| @@ -112,6 +113,7 @@ class CustomerProvider extends ChangeNotifier { | @@ -112,6 +113,7 @@ class CustomerProvider extends ChangeNotifier { | ||
| 112 | // } | 113 | // } |
| 113 | if (userHistorysShow.length == 0) { | 114 | if (userHistorysShow.length == 0) { |
| 114 | pageState = PageState.Empty; | 115 | pageState = PageState.Empty; |
| 116 | + notifyListeners(); | ||
| 115 | } else { | 117 | } else { |
| 116 | pageState = PageState.Success; | 118 | pageState = PageState.Success; |
| 117 | } | 119 | } |
| @@ -122,6 +124,37 @@ class CustomerProvider extends ChangeNotifier { | @@ -122,6 +124,37 @@ class CustomerProvider extends ChangeNotifier { | ||
| 122 | // } | 124 | // } |
| 123 | } | 125 | } |
| 124 | 126 | ||
| 125 | - notifyListeners(); | 127 | + handleList(userHistorysShow, needRefresh: true); |
| 128 | + } | ||
| 129 | + | ||
| 130 | + handleList(List<UserHistoryEntity> list, {bool needRefresh = false}) { | ||
| 131 | + if (list == null || list.isEmpty) return; | ||
| 132 | + for (int i = 0, length = list.length; i < length; i++) { | ||
| 133 | + String pinyin = ''; | ||
| 134 | + String tag = ''; | ||
| 135 | + | ||
| 136 | + if (list[i].pinyin == null || list[i].pinyin == '') { | ||
| 137 | + // list[i].pinyin = pinyin; | ||
| 138 | + } else { | ||
| 139 | + tag = list[i].pinyin.substring(0, 1).toUpperCase(); | ||
| 140 | + } | ||
| 141 | + | ||
| 142 | + if (RegExp("[A-Z]").hasMatch(tag)) { | ||
| 143 | + list[i].tagIndex = tag; | ||
| 144 | + } else { | ||
| 145 | + list[i].tagIndex = "#"; | ||
| 146 | + } | ||
| 147 | + } | ||
| 148 | + // A-Z sort. | ||
| 149 | + SuspensionUtil.sortListBySuspensionTag(list); | ||
| 150 | + | ||
| 151 | + // show sus tag. | ||
| 152 | + SuspensionUtil.setShowSuspensionStatus(list); | ||
| 153 | + | ||
| 154 | + // add header. | ||
| 155 | + // _contacts.insert(0, UserHistoryEntity(name: 'header', tagIndex: '↑')); | ||
| 156 | + if (needRefresh) { | ||
| 157 | + notifyListeners(); | ||
| 158 | + } | ||
| 126 | } | 159 | } |
| 127 | } | 160 | } |
| @@ -526,4 +526,18 @@ class NavigatorUtil { | @@ -526,4 +526,18 @@ class NavigatorUtil { | ||
| 526 | return _navigateTo(context, "${Routes.customer_list_page}", | 526 | return _navigateTo(context, "${Routes.customer_list_page}", |
| 527 | replace: replace); | 527 | replace: replace); |
| 528 | } | 528 | } |
| 529 | + | ||
| 530 | + /// 客情设置 | ||
| 531 | + static Future<dynamic> goCustomerSetPage(BuildContext context, | ||
| 532 | + {replace = false}) { | ||
| 533 | + return _navigateTo(context, "${Routes.customer_set_page}", | ||
| 534 | + replace: replace); | ||
| 535 | + } | ||
| 536 | + | ||
| 537 | + /// 全店营销记录 | ||
| 538 | + static Future<dynamic> goMarketingRecordsPage(BuildContext context, | ||
| 539 | + {replace = false}) { | ||
| 540 | + return _navigateTo(context, "${Routes.marketing_records_page}", | ||
| 541 | + replace: replace); | ||
| 542 | + } | ||
| 529 | } | 543 | } |
| @@ -40,6 +40,8 @@ import 'package:one_key/pages/detail/notebook_detail_page.dart'; | @@ -40,6 +40,8 @@ import 'package:one_key/pages/detail/notebook_detail_page.dart'; | ||
| 40 | import 'package:one_key/pages/login/web_page.dart'; | 40 | import 'package:one_key/pages/login/web_page.dart'; |
| 41 | import 'package:one_key/pages/message/message_order_menu.dart'; | 41 | import 'package:one_key/pages/message/message_order_menu.dart'; |
| 42 | import 'package:one_key/pages/my/customer_type/customer_list_page.dart'; | 42 | import 'package:one_key/pages/my/customer_type/customer_list_page.dart'; |
| 43 | +import 'package:one_key/pages/my/customer_type/customer_setting_page.dart'; | ||
| 44 | +import 'package:one_key/pages/my/customer_type/marketing_records_page.dart'; | ||
| 43 | import 'package:one_key/pages/my/customer_type/store_customer_page.dart'; | 45 | import 'package:one_key/pages/my/customer_type/store_customer_page.dart'; |
| 44 | import 'package:one_key/pages/my/personnel_type/personnel_detail_page.dart'; | 46 | import 'package:one_key/pages/my/personnel_type/personnel_detail_page.dart'; |
| 45 | import 'package:one_key/pages/my/personnel_type/personnel_manage_page.dart'; | 47 | import 'package:one_key/pages/my/personnel_type/personnel_manage_page.dart'; |
| @@ -833,3 +835,19 @@ var customerListPageHandle = new Handler( | @@ -833,3 +835,19 @@ var customerListPageHandle = new Handler( | ||
| 833 | return ChangeNotifierProvider<CustomerProvider>( | 835 | return ChangeNotifierProvider<CustomerProvider>( |
| 834 | create: (_) => CustomerProvider(), child: CustomerListPage()); | 836 | create: (_) => CustomerProvider(), child: CustomerListPage()); |
| 835 | }); | 837 | }); |
| 838 | + | ||
| 839 | +///客情设置 | ||
| 840 | +var customerSettingPageHandle = new Handler( | ||
| 841 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 842 | + // String idstr = params["idstr"].first; | ||
| 843 | + return ChangeNotifierProvider<CustomerProvider>( | ||
| 844 | + create: (_) => CustomerProvider(), child: CustomerSettingPage()); | ||
| 845 | +}); | ||
| 846 | + | ||
| 847 | +///全店营销记录 | ||
| 848 | +var marketingRecordsPageHandle = new Handler( | ||
| 849 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 850 | + // String idstr = params["idstr"].first; | ||
| 851 | + return ChangeNotifierProvider<CustomerProvider>( | ||
| 852 | + create: (_) => CustomerProvider(), child: MarketingRecordsPage()); | ||
| 853 | +}); |
| @@ -69,6 +69,8 @@ class Routes { | @@ -69,6 +69,8 @@ class Routes { | ||
| 69 | static String edit_reserver_page = "/edit_reserver_page"; //填写预订联系人 | 69 | static String edit_reserver_page = "/edit_reserver_page"; //填写预订联系人 |
| 70 | static String store_customer_page = "/store_customer_page"; //全店客情 | 70 | static String store_customer_page = "/store_customer_page"; //全店客情 |
| 71 | static String customer_list_page = "/customer_list_page"; //客情列表 | 71 | static String customer_list_page = "/customer_list_page"; //客情列表 |
| 72 | + static String customer_set_page = "/customer_set_page"; //客情设置 | ||
| 73 | + static String marketing_records_page = "/marketing_records_page"; //全店营销记录 | ||
| 72 | 74 | ||
| 73 | static void configureRoutes(FluroRouter router) { | 75 | static void configureRoutes(FluroRouter router) { |
| 74 | router.notFoundHandler = new Handler( | 76 | router.notFoundHandler = new Handler( |
| @@ -144,9 +146,10 @@ class Routes { | @@ -144,9 +146,10 @@ class Routes { | ||
| 144 | router.define(change_detail_f, handler: noteBookChangeFPageHandle); | 146 | router.define(change_detail_f, handler: noteBookChangeFPageHandle); |
| 145 | router.define(photo_manager_page, handler: photoManagerPageHandle); | 147 | router.define(photo_manager_page, handler: photoManagerPageHandle); |
| 146 | router.define(edit_reserver_page, handler: editReserverPageHandle); | 148 | router.define(edit_reserver_page, handler: editReserverPageHandle); |
| 147 | - router.define(store_customer_page, handler: storeCustomerPageHandle); | ||
| 148 | - router.define(customer_list_page, handler: customerListPageHandle); | ||
| 149 | - | 149 | + router.define(store_customer_page, handler: storeCustomerPageHandle); |
| 150 | + router.define(customer_list_page, handler: customerListPageHandle); | ||
| 151 | + router.define(customer_set_page, handler: customerSettingPageHandle); | ||
| 152 | + router.define(marketing_records_page, handler: marketingRecordsPageHandle); | ||
| 150 | 153 | ||
| 151 | } | 154 | } |
| 152 | } | 155 | } |
| @@ -97,6 +97,7 @@ class RoundButton extends StatelessWidget { | @@ -97,6 +97,7 @@ class RoundButton extends StatelessWidget { | ||
| 97 | : Text(''), | 97 | : Text(''), |
| 98 | Text( | 98 | Text( |
| 99 | text, | 99 | text, |
| 100 | + overflow: TextOverflow.ellipsis, | ||
| 100 | style: style ?? | 101 | style: style ?? |
| 101 | new TextStyle( | 102 | new TextStyle( |
| 102 | color: textColor, | 103 | color: textColor, |
-
Please register or login to post a comment