Showing
10 changed files
with
544 additions
and
378 deletions
| 1 | -class Manager{ | 1 | +class Manager { |
| 2 | dynamic id; | 2 | dynamic id; |
| 3 | String role_name; | 3 | String role_name; |
| 4 | String user_name; | 4 | String user_name; |
| @@ -8,30 +8,28 @@ class Manager{ | @@ -8,30 +8,28 @@ class Manager{ | ||
| 8 | 8 | ||
| 9 | Manager(); | 9 | Manager(); |
| 10 | 10 | ||
| 11 | - String get roleUserName{ | 11 | + String get roleUserName { |
| 12 | return "[$role_name]--$userName"; | 12 | return "[$role_name]--$userName"; |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | - String get userName{ | ||
| 16 | - return (nick_name==null||nick_name.isEmpty)?user_name:nick_name; | 15 | + String get userName { |
| 16 | + return (nick_name == null || nick_name.isEmpty) ? user_name : nick_name; | ||
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | - factory Manager.fromJson(Map<String,dynamic> json)=> | ||
| 20 | - Manager() | ||
| 21 | - ..id=json["id"] | ||
| 22 | - ..role_name=json["role_name"] | ||
| 23 | - ..user_name=json["user_name"] | ||
| 24 | - ..nick_name=json["nick_name"] | ||
| 25 | - ..user_phone=json["user_phone"] | ||
| 26 | - ..user_wechat=json["user_wechat"]; | 19 | + factory Manager.fromJson(Map<String, dynamic> json) => Manager() |
| 20 | + ..id = json["id"] | ||
| 21 | + ..role_name = json["role_name"] | ||
| 22 | + ..user_name = json["user_name"] | ||
| 23 | + ..nick_name = json["nick_name"] | ||
| 24 | + ..user_phone = json["user_phone"] | ||
| 25 | + ..user_wechat = json["user_wechat"]; | ||
| 27 | 26 | ||
| 28 | - Map<String,dynamic> toJson()=><String,dynamic> | ||
| 29 | - { | ||
| 30 | - "id":id, | ||
| 31 | - "role_name":role_name, | ||
| 32 | - "user_name":user_name, | ||
| 33 | - "nick_name":nick_name, | ||
| 34 | - "user_phone":user_phone, | ||
| 35 | - "user_wechat":user_wechat, | ||
| 36 | - }; | ||
| 37 | -} | ||
| 27 | + Map<String, dynamic> toJson() => <String, dynamic>{ | ||
| 28 | + "id": id, | ||
| 29 | + "role_name": role_name, | ||
| 30 | + "user_name": user_name, | ||
| 31 | + "nick_name": nick_name, | ||
| 32 | + "user_phone": user_phone, | ||
| 33 | + "user_wechat": user_wechat, | ||
| 34 | + }; | ||
| 35 | +} |
| @@ -37,13 +37,15 @@ class CustomerListPage extends StatefulWidget { | @@ -37,13 +37,15 @@ class CustomerListPage extends StatefulWidget { | ||
| 37 | final String index; | 37 | final String index; |
| 38 | final String uidStr; | 38 | final String uidStr; |
| 39 | final bool distribution; | 39 | final bool distribution; |
| 40 | + final List<SellerUser> sellerUser; | ||
| 40 | 41 | ||
| 41 | const CustomerListPage( | 42 | const CustomerListPage( |
| 42 | {Key key, | 43 | {Key key, |
| 43 | this.fromPage, | 44 | this.fromPage, |
| 44 | this.index, | 45 | this.index, |
| 45 | this.uidStr, | 46 | this.uidStr, |
| 46 | - this.distribution = false}) | 47 | + this.distribution = false, |
| 48 | + this.sellerUser}) | ||
| 47 | : super(key: key); | 49 | : super(key: key); |
| 48 | @override | 50 | @override |
| 49 | _CustomerListPageState createState() => _CustomerListPageState(); | 51 | _CustomerListPageState createState() => _CustomerListPageState(); |
| @@ -64,8 +66,12 @@ class _CustomerListPageState extends State<CustomerListPage> | @@ -64,8 +66,12 @@ class _CustomerListPageState extends State<CustomerListPage> | ||
| 64 | bool distribution = false; | 66 | bool distribution = false; |
| 65 | int page = 1; | 67 | int page = 1; |
| 66 | 68 | ||
| 69 | + String uidAct; | ||
| 70 | + | ||
| 67 | @override | 71 | @override |
| 68 | void initState() { | 72 | void initState() { |
| 73 | + uidAct = widget.uidStr; | ||
| 74 | + | ||
| 69 | distribution = widget.distribution; | 75 | distribution = widget.distribution; |
| 70 | _tabBarTitle = ['全部', '活跃', '沉睡', '流失']; | 76 | _tabBarTitle = ['全部', '活跃', '沉睡', '流失']; |
| 71 | // timeTilte = ['大于', '等于', '小于']; | 77 | // timeTilte = ['大于', '等于', '小于']; |
| @@ -119,6 +125,7 @@ class _CustomerListPageState extends State<CustomerListPage> | @@ -119,6 +125,7 @@ class _CustomerListPageState extends State<CustomerListPage> | ||
| 119 | }); | 125 | }); |
| 120 | WidgetsBinding.instance.addPostFrameCallback((_) async { | 126 | WidgetsBinding.instance.addPostFrameCallback((_) async { |
| 121 | bool first = true; | 127 | bool first = true; |
| 128 | + _getSeller(); | ||
| 122 | customerProvider.index = tabController.index; | 129 | customerProvider.index = tabController.index; |
| 123 | 130 | ||
| 124 | if (widget.fromPage == FromPage.FromPageMakeRecord) { | 131 | if (widget.fromPage == FromPage.FromPageMakeRecord) { |
| @@ -174,8 +181,8 @@ class _CustomerListPageState extends State<CustomerListPage> | @@ -174,8 +181,8 @@ class _CustomerListPageState extends State<CustomerListPage> | ||
| 174 | } | 181 | } |
| 175 | 182 | ||
| 176 | _getManagerAndList() async { | 183 | _getManagerAndList() async { |
| 177 | - await _getSellerGuestManage(); | ||
| 178 | - await _getContantData(); | 184 | + _getContantData(); |
| 185 | + // _getSellerGuestManage(); | ||
| 179 | } | 186 | } |
| 180 | 187 | ||
| 181 | _onload() { | 188 | _onload() { |
| @@ -193,10 +200,10 @@ class _CustomerListPageState extends State<CustomerListPage> | @@ -193,10 +200,10 @@ class _CustomerListPageState extends State<CustomerListPage> | ||
| 193 | // await customerProvider.getAuthUserLists(context); | 200 | // await customerProvider.getAuthUserLists(context); |
| 194 | // } | 201 | // } |
| 195 | 202 | ||
| 196 | - ///全店客情首页 ----- 获取经理数据 | ||
| 197 | - _getSellerGuestManage() async { | ||
| 198 | - StoreCustomerHomeSunModel model = | ||
| 199 | - await customerProvider.getSellerGuestManage(context); | 203 | + ///经理数据重组 |
| 204 | + _getSeller() async { | ||
| 205 | + // StoreCustomerHomeSunModel model = | ||
| 206 | + // await customerProvider.getSellerGuestManage(context); | ||
| 200 | customerProvider.filterManageList = []; | 207 | customerProvider.filterManageList = []; |
| 201 | FilterBtnModel model1 = FilterBtnModel(); | 208 | FilterBtnModel model1 = FilterBtnModel(); |
| 202 | // model.id = item.id; | 209 | // model.id = item.id; |
| @@ -206,10 +213,8 @@ class _CustomerListPageState extends State<CustomerListPage> | @@ -206,10 +213,8 @@ class _CustomerListPageState extends State<CustomerListPage> | ||
| 206 | model1.select = true; | 213 | model1.select = true; |
| 207 | } | 214 | } |
| 208 | customerProvider.filterManageList.add(model1); | 215 | customerProvider.filterManageList.add(model1); |
| 209 | - if (model != null && | ||
| 210 | - model.sellerUser != null && | ||
| 211 | - model.sellerUser.length > 0) { | ||
| 212 | - for (SellerUser item in model.sellerUser) { | 216 | + if (widget.sellerUser != null && widget.sellerUser.length > 0) { |
| 217 | + for (SellerUser item in widget.sellerUser) { | ||
| 213 | // if (item.nickName != null) { | 218 | // if (item.nickName != null) { |
| 214 | FilterBtnModel model = FilterBtnModel(); | 219 | FilterBtnModel model = FilterBtnModel(); |
| 215 | model.id = item.uid; | 220 | model.id = item.uid; |
| @@ -309,23 +314,27 @@ class _CustomerListPageState extends State<CustomerListPage> | @@ -309,23 +314,27 @@ class _CustomerListPageState extends State<CustomerListPage> | ||
| 309 | // if (first && widget.uidStr != null && widget.uidStr != '') { | 314 | // if (first && widget.uidStr != null && widget.uidStr != '') { |
| 310 | // params['uid'] = widget.uidStr; | 315 | // params['uid'] = widget.uidStr; |
| 311 | // } else { | 316 | // } else { |
| 312 | - String uid = ''; | ||
| 313 | - List<FilterBtnModel> tempfilterManage = | ||
| 314 | - List.from(customerProvider.filterManageList); | ||
| 315 | - if (tempfilterManage.length > 0) { | ||
| 316 | - tempfilterManage.removeAt(0); | ||
| 317 | - } | ||
| 318 | - for (FilterBtnModel item in tempfilterManage) { | ||
| 319 | - if (item.select) { | ||
| 320 | - uid += '${item.id},'; | ||
| 321 | - } | ||
| 322 | - } | 317 | + // String uid = ''; |
| 318 | + // List<FilterBtnModel> tempfilterManage = | ||
| 319 | + // List.from(customerProvider.filterManageList); | ||
| 320 | + // if (tempfilterManage.length > 0) { | ||
| 321 | + // tempfilterManage.removeAt(0); | ||
| 322 | + // } | ||
| 323 | + // for (FilterBtnModel item in tempfilterManage) { | ||
| 324 | + // if (item.select) { | ||
| 325 | + // uid += '${item.id},'; | ||
| 326 | + // } | ||
| 327 | + // } | ||
| 323 | 328 | ||
| 324 | - if (uid.length > 0) { | ||
| 325 | - if (uid.endsWith(',')) { | ||
| 326 | - uid = uid.substring(0, uid.length - 1); | ||
| 327 | - } | ||
| 328 | - params['uid'] = uid; | 329 | + // if (uid.length > 0) { |
| 330 | + // if (uid.endsWith(',')) { | ||
| 331 | + // uid = uid.substring(0, uid.length - 1); | ||
| 332 | + // } | ||
| 333 | + // params['uid'] = uid; | ||
| 334 | + // } | ||
| 335 | + | ||
| 336 | + if (uidAct != null && uidAct.length > 0) { | ||
| 337 | + params['uid'] = uidAct; | ||
| 329 | } | 338 | } |
| 330 | // } | 339 | // } |
| 331 | 340 | ||
| @@ -463,7 +472,8 @@ class _CustomerListPageState extends State<CustomerListPage> | @@ -463,7 +472,8 @@ class _CustomerListPageState extends State<CustomerListPage> | ||
| 463 | customerMakingProvider.selectCustomerSeller = | 472 | customerMakingProvider.selectCustomerSeller = |
| 464 | customerProvider.selectCustomerSeller; | 473 | customerProvider.selectCustomerSeller; |
| 465 | customerMakingProvider.fromPage = widget.fromPage; | 474 | customerMakingProvider.fromPage = widget.fromPage; |
| 466 | - NavigatorUtil.goMakeMarkingPage(context, | 475 | + NavigatorUtil.goMakeMarkingPage( |
| 476 | + context, {'object': widget.sellerUser}, | ||
| 467 | fromPage: FromPage.FromPageCustomerList); | 477 | fromPage: FromPage.FromPageCustomerList); |
| 468 | } else { | 478 | } else { |
| 469 | customerMakingProvider.labels = customerProvider.labels; | 479 | customerMakingProvider.labels = customerProvider.labels; |
| @@ -909,6 +919,27 @@ class _CustomerListPageState extends State<CustomerListPage> | @@ -909,6 +919,27 @@ class _CustomerListPageState extends State<CustomerListPage> | ||
| 909 | fontSize: ScreenUtil().setSp(size))); | 919 | fontSize: ScreenUtil().setSp(size))); |
| 910 | } | 920 | } |
| 911 | 921 | ||
| 922 | + _getUid() { | ||
| 923 | + String uid = ''; | ||
| 924 | + List<FilterBtnModel> tempfilterManage = | ||
| 925 | + List.from(customerProvider.filterManageList); | ||
| 926 | + if (tempfilterManage.length > 0) { | ||
| 927 | + tempfilterManage.removeAt(0); | ||
| 928 | + } | ||
| 929 | + for (FilterBtnModel item in tempfilterManage) { | ||
| 930 | + if (item.select) { | ||
| 931 | + uid += '${item.id},'; | ||
| 932 | + } | ||
| 933 | + } | ||
| 934 | + | ||
| 935 | + if (uid.length > 0) { | ||
| 936 | + if (uid.endsWith(',')) { | ||
| 937 | + uid = uid.substring(0, uid.length - 1); | ||
| 938 | + } | ||
| 939 | + uidAct = uid; | ||
| 940 | + } | ||
| 941 | + } | ||
| 942 | + | ||
| 912 | ///客户经理 | 943 | ///客户经理 |
| 913 | Widget _managerWidget(state) { | 944 | Widget _managerWidget(state) { |
| 914 | return Column( | 945 | return Column( |
| @@ -928,11 +959,13 @@ class _CustomerListPageState extends State<CustomerListPage> | @@ -928,11 +959,13 @@ class _CustomerListPageState extends State<CustomerListPage> | ||
| 928 | in customerProvider.filterManageList) { | 959 | in customerProvider.filterManageList) { |
| 929 | item.select = true; | 960 | item.select = true; |
| 930 | } | 961 | } |
| 962 | + _getUid(); | ||
| 931 | } else { | 963 | } else { |
| 932 | for (FilterBtnModel item | 964 | for (FilterBtnModel item |
| 933 | in customerProvider.filterManageList) { | 965 | in customerProvider.filterManageList) { |
| 934 | item.select = false; | 966 | item.select = false; |
| 935 | } | 967 | } |
| 968 | + _getUid(); | ||
| 936 | } | 969 | } |
| 937 | }); | 970 | }); |
| 938 | }, | 971 | }, |
| @@ -958,6 +991,7 @@ class _CustomerListPageState extends State<CustomerListPage> | @@ -958,6 +991,7 @@ class _CustomerListPageState extends State<CustomerListPage> | ||
| 958 | state(() { | 991 | state(() { |
| 959 | item.select = !item.select; | 992 | item.select = !item.select; |
| 960 | }); | 993 | }); |
| 994 | + _getUid(); | ||
| 961 | customerProvider.getCheckmanageSelAll(); | 995 | customerProvider.getCheckmanageSelAll(); |
| 962 | })), | 996 | })), |
| 963 | ], | 997 | ], |
| @@ -23,16 +23,20 @@ import 'package:one_key/widgets/system_app_bar.dart'; | @@ -23,16 +23,20 @@ import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 23 | import 'package:one_key/widgets/v_empty_view.dart'; | 23 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 24 | import 'package:provider/provider.dart'; | 24 | import 'package:provider/provider.dart'; |
| 25 | import 'package:sendsms/sendsms.dart'; | 25 | import 'package:sendsms/sendsms.dart'; |
| 26 | +import 'package:one_key/models/store_customer_home_model.dart' | ||
| 27 | + as storeCustomerHomeModel; | ||
| 26 | 28 | ||
| 27 | typedef ClickCallback = void Function(dynamic value); | 29 | typedef ClickCallback = void Function(dynamic value); |
| 28 | 30 | ||
| 29 | class MakeMarkingPage extends StatefulWidget { | 31 | class MakeMarkingPage extends StatefulWidget { |
| 30 | final FromPage fromPage; | 32 | final FromPage fromPage; |
| 31 | final MarketingByIdSunModel marketingByIdSunModel; | 33 | final MarketingByIdSunModel marketingByIdSunModel; |
| 34 | + final List<storeCustomerHomeModel.SellerUser> sellerUser; | ||
| 32 | MakeMarkingPage( | 35 | MakeMarkingPage( |
| 33 | {Key key, | 36 | {Key key, |
| 34 | this.marketingByIdSunModel, | 37 | this.marketingByIdSunModel, |
| 35 | - this.fromPage = FromPage.FromPageCustomerList}) | 38 | + this.fromPage = FromPage.FromPageCustomerList, |
| 39 | + this.sellerUser}) | ||
| 36 | : super(key: key); | 40 | : super(key: key); |
| 37 | 41 | ||
| 38 | @override | 42 | @override |
| @@ -566,7 +570,10 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> { | @@ -566,7 +570,10 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> { | ||
| 566 | customerProvider.selectCustomerSeller; | 570 | customerProvider.selectCustomerSeller; |
| 567 | 571 | ||
| 568 | await NavigatorUtil.goCustomerListPage( | 572 | await NavigatorUtil.goCustomerListPage( |
| 569 | - context, FromPage.FromPageMakeRecord, ''); | 573 | + context, |
| 574 | + FromPage.FromPageMakeRecord, | ||
| 575 | + '', | ||
| 576 | + {'object': widget.sellerUser}); | ||
| 570 | 577 | ||
| 571 | // Map temp = | 578 | // Map temp = |
| 572 | 579 |
| @@ -16,10 +16,14 @@ import 'package:one_key/widgets/row_multi_text.dart'; | @@ -16,10 +16,14 @@ import 'package:one_key/widgets/row_multi_text.dart'; | ||
| 16 | import 'package:one_key/widgets/system_app_bar.dart'; | 16 | import 'package:one_key/widgets/system_app_bar.dart'; |
| 17 | import 'package:one_key/widgets/v_empty_view.dart'; | 17 | import 'package:one_key/widgets/v_empty_view.dart'; |
| 18 | import 'package:provider/provider.dart'; | 18 | import 'package:provider/provider.dart'; |
| 19 | +import 'package:one_key/models/store_customer_home_model.dart' | ||
| 20 | + as storeCustomerHomeModel; | ||
| 19 | 21 | ||
| 20 | class MarketingRecordsDetailPage extends StatefulWidget { | 22 | class MarketingRecordsDetailPage extends StatefulWidget { |
| 21 | final String idstr; | 23 | final String idstr; |
| 22 | - MarketingRecordsDetailPage({Key key, this.idstr}) : super(key: key); | 24 | + final List<storeCustomerHomeModel.SellerUser> sellerUser; |
| 25 | + MarketingRecordsDetailPage({Key key, this.idstr, this.sellerUser}) | ||
| 26 | + : super(key: key); | ||
| 23 | 27 | ||
| 24 | @override | 28 | @override |
| 25 | _MarketingRecordsDetailPageState createState() => | 29 | _MarketingRecordsDetailPageState createState() => |
| @@ -378,7 +382,8 @@ class _MarketingRecordsDetailPageState | @@ -378,7 +382,8 @@ class _MarketingRecordsDetailPageState | ||
| 378 | // NavigatorUtil.goMyMakeMarkingPage(context, | 382 | // NavigatorUtil.goMyMakeMarkingPage(context, |
| 379 | // selfList: widget.selfList, | 383 | // selfList: widget.selfList, |
| 380 | // fromPage: FromPage.FromPageMakeRecordDetail); | 384 | // fromPage: FromPage.FromPageMakeRecordDetail); |
| 381 | - NavigatorUtil.goMakeMarkingPage(context, | 385 | + NavigatorUtil.goMakeMarkingPage( |
| 386 | + context, {'object': widget.sellerUser}, | ||
| 382 | marketingByIdSunModel: | 387 | marketingByIdSunModel: |
| 383 | model.marketingByIdSunModel, | 388 | model.marketingByIdSunModel, |
| 384 | fromPage: | 389 | fromPage: |
| @@ -13,6 +13,8 @@ import 'package:one_key/widgets/page_exception.dart'; | @@ -13,6 +13,8 @@ import 'package:one_key/widgets/page_exception.dart'; | ||
| 13 | import 'package:one_key/widgets/round_button.dart'; | 13 | import 'package:one_key/widgets/round_button.dart'; |
| 14 | import 'package:one_key/widgets/system_app_bar.dart'; | 14 | import 'package:one_key/widgets/system_app_bar.dart'; |
| 15 | import 'package:provider/provider.dart'; | 15 | import 'package:provider/provider.dart'; |
| 16 | +import 'package:one_key/models/store_customer_home_model.dart' | ||
| 17 | + as storeCustomerHomeModel; | ||
| 16 | /** | 18 | /** |
| 17 | * | 19 | * |
| 18 | * 全店营销记录 | 20 | * 全店营销记录 |
| @@ -21,7 +23,9 @@ import 'package:provider/provider.dart'; | @@ -21,7 +23,9 @@ import 'package:provider/provider.dart'; | ||
| 21 | 23 | ||
| 22 | class MarketingRecordsPage extends StatefulWidget { | 24 | class MarketingRecordsPage extends StatefulWidget { |
| 23 | final FromPage fromPage; | 25 | final FromPage fromPage; |
| 24 | - MarketingRecordsPage({Key key, this.fromPage}) : super(key: key); | 26 | + final List<storeCustomerHomeModel.SellerUser> sellerUser; |
| 27 | + MarketingRecordsPage({Key key, this.fromPage, this.sellerUser}) | ||
| 28 | + : super(key: key); | ||
| 25 | 29 | ||
| 26 | @override | 30 | @override |
| 27 | _MarketingRecordsPageState createState() => _MarketingRecordsPageState(); | 31 | _MarketingRecordsPageState createState() => _MarketingRecordsPageState(); |
| @@ -156,7 +160,9 @@ class _MarketingRecordsPageState extends State<MarketingRecordsPage> { | @@ -156,7 +160,9 @@ class _MarketingRecordsPageState extends State<MarketingRecordsPage> { | ||
| 156 | InkWell( | 160 | InkWell( |
| 157 | onTap: () { | 161 | onTap: () { |
| 158 | NavigatorUtil.goMarketingRecordsDetailPage( | 162 | NavigatorUtil.goMarketingRecordsDetailPage( |
| 159 | - context, data.id); | 163 | + context, |
| 164 | + data.id, | ||
| 165 | + {'object': widget.sellerUser}); | ||
| 160 | }, | 166 | }, |
| 161 | child: Text('查看详情', | 167 | child: Text('查看详情', |
| 162 | style: TextStyle( | 168 | style: TextStyle( |
| @@ -97,6 +97,8 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | @@ -97,6 +97,8 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | ||
| 97 | }; | 97 | }; |
| 98 | await widget.customerProvider | 98 | await widget.customerProvider |
| 99 | .getSellerCountsList(context, params, isShowLoading: isShowLoading); | 99 | .getSellerCountsList(context, params, isShowLoading: isShowLoading); |
| 100 | + widget.customerProvider.pageStateStoreHome = PageState.Success; | ||
| 101 | + setState(() {}); | ||
| 100 | if ((widget.customerProvider.homeStatisticsList == null || | 102 | if ((widget.customerProvider.homeStatisticsList == null || |
| 101 | widget.customerProvider.homeStatisticsList.length == 0) && | 103 | widget.customerProvider.homeStatisticsList.length == 0) && |
| 102 | callback != null) { | 104 | callback != null) { |
| @@ -121,6 +123,7 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | @@ -121,6 +123,7 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | ||
| 121 | index = '3'; | 123 | index = '3'; |
| 122 | } | 124 | } |
| 123 | NavigatorUtil.goCustomerListPage(context, FromPage.FromPageHome, uid, | 125 | NavigatorUtil.goCustomerListPage(context, FromPage.FromPageHome, uid, |
| 126 | + {'object': widget.customerProvider.storeSunmodel.sellerUser}, | ||
| 124 | index: index); | 127 | index: index); |
| 125 | }, | 128 | }, |
| 126 | child: Container( | 129 | child: Container( |
| @@ -165,7 +168,13 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | @@ -165,7 +168,13 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | ||
| 165 | index = '3'; | 168 | index = '3'; |
| 166 | } | 169 | } |
| 167 | NavigatorUtil.goCustomerListPage( | 170 | NavigatorUtil.goCustomerListPage( |
| 168 | - context, FromPage.FromPageHome, uid, | 171 | + context, |
| 172 | + FromPage.FromPageHome, | ||
| 173 | + uid, | ||
| 174 | + { | ||
| 175 | + 'object': | ||
| 176 | + widget.customerProvider.storeSunmodel.sellerUser | ||
| 177 | + }, | ||
| 169 | index: index); | 178 | index: index); |
| 170 | }, | 179 | }, |
| 171 | text: btnTitle, | 180 | text: btnTitle, |
| @@ -414,6 +423,7 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | @@ -414,6 +423,7 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | ||
| 414 | ); | 423 | ); |
| 415 | } | 424 | } |
| 416 | 425 | ||
| 426 | + /* | ||
| 417 | Widget _monthWidget() { | 427 | Widget _monthWidget() { |
| 418 | return Container( | 428 | return Container( |
| 419 | margin: EdgeInsets.symmetric(horizontal: w(10)), | 429 | margin: EdgeInsets.symmetric(horizontal: w(10)), |
| @@ -724,6 +734,7 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | @@ -724,6 +734,7 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | ||
| 724 | ), | 734 | ), |
| 725 | ); | 735 | ); |
| 726 | } | 736 | } |
| 737 | + */ | ||
| 727 | 738 | ||
| 728 | Widget _managerWidget( | 739 | Widget _managerWidget( |
| 729 | String pnum, String btnTitle, String percent, String detailStr, | 740 | String pnum, String btnTitle, String percent, String detailStr, |
| @@ -937,6 +948,7 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | @@ -937,6 +948,7 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | ||
| 937 | callback: () { | 948 | callback: () { |
| 938 | // getTableList(); | 949 | // getTableList(); |
| 939 | _getSellerGuestManage(); | 950 | _getSellerGuestManage(); |
| 951 | + _getSellerCountsList(); | ||
| 940 | }, | 952 | }, |
| 941 | emptyMsg: "暂时没有全店客情哦", | 953 | emptyMsg: "暂时没有全店客情哦", |
| 942 | emptyImg: "empty_search", | 954 | emptyImg: "empty_search", |
| @@ -949,147 +961,174 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | @@ -949,147 +961,174 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | ||
| 949 | controller: _controller, | 961 | controller: _controller, |
| 950 | child: Column( | 962 | child: Column( |
| 951 | children: [ | 963 | children: [ |
| 952 | - VEmptyView(10), | ||
| 953 | - // Stack( | ||
| 954 | - // children: [ | ||
| 955 | - InkWell( | ||
| 956 | - onTap: () { | ||
| 957 | - NavigatorUtil.goCustomerListPage( | ||
| 958 | - context, FromPage.FromPageHome, ''); | ||
| 959 | - }, | ||
| 960 | - child: Container( | ||
| 961 | - height: w(80), | ||
| 962 | - color: MyColours.color_ffffff, | ||
| 963 | - child: Row( | ||
| 964 | - mainAxisAlignment: MainAxisAlignment.center, | 964 | + if (widget.customerProvider.storeSunmodel != null) |
| 965 | + Column( | ||
| 966 | + children: [ | ||
| 967 | + VEmptyView(10), | ||
| 968 | + // Stack( | ||
| 969 | + // children: [ | ||
| 970 | + InkWell( | ||
| 971 | + onTap: () { | ||
| 972 | + NavigatorUtil.goCustomerListPage( | ||
| 973 | + context, | ||
| 974 | + FromPage.FromPageHome, | ||
| 975 | + '', | ||
| 976 | + { | ||
| 977 | + 'object': widget | ||
| 978 | + .customerProvider.storeSunmodel.sellerUser | ||
| 979 | + }, | ||
| 980 | + ); | ||
| 981 | + }, | ||
| 982 | + child: Container( | ||
| 983 | + height: w(80), | ||
| 984 | + color: MyColours.color_ffffff, | ||
| 985 | + child: Row( | ||
| 986 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 987 | + children: [ | ||
| 988 | + Text( | ||
| 989 | + '${widget.customerProvider.storeSunmodel.myCustomer}', | ||
| 990 | + style: TextStyle( | ||
| 991 | + color: MyColours.color_438E93, | ||
| 992 | + fontSize: ScreenUtil().setSp(64), | ||
| 993 | + fontWeight: FontWeight.bold), | ||
| 994 | + ), | ||
| 995 | + Text( | ||
| 996 | + '位', | ||
| 997 | + style: TextStyle( | ||
| 998 | + color: MyColours.color_515151, | ||
| 999 | + // fontWeight: FontWeight.bold, | ||
| 1000 | + fontSize: ScreenUtil().setSp(32)), | ||
| 1001 | + ) | ||
| 1002 | + ], | ||
| 1003 | + ), | ||
| 1004 | + )), | ||
| 1005 | + // Positioned( | ||
| 1006 | + // top: ScreenUtil().setWidth(30), | ||
| 1007 | + // right: ScreenUtil().setWidth(40), | ||
| 1008 | + // child: InkWell( | ||
| 1009 | + // onTap: () { | ||
| 1010 | + // NavigatorUtil.goCustomerSetPage(context); | ||
| 1011 | + // }, | ||
| 1012 | + // child: Image.asset(Utils.getImgPath('c_set'), | ||
| 1013 | + // width: ScreenUtil().setWidth(40)))) | ||
| 1014 | + // ], | ||
| 1015 | + // ), | ||
| 1016 | + VEmptyView(10), | ||
| 1017 | + Row( | ||
| 965 | children: [ | 1018 | children: [ |
| 966 | - Text( | ||
| 967 | - '${widget.customerProvider.storeSunmodel.myCustomer}', | ||
| 968 | - style: TextStyle( | ||
| 969 | - color: MyColours.color_438E93, | ||
| 970 | - fontSize: ScreenUtil().setSp(64), | ||
| 971 | - fontWeight: FontWeight.bold), | ||
| 972 | - ), | ||
| 973 | - Text( | ||
| 974 | - '位', | ||
| 975 | - style: TextStyle( | ||
| 976 | - color: MyColours.color_515151, | ||
| 977 | - // fontWeight: FontWeight.bold, | ||
| 978 | - fontSize: ScreenUtil().setSp(32)), | ||
| 979 | - ) | 1019 | + _percentWidget( |
| 1020 | + '${widget.customerProvider.storeSunmodel.active.count}', | ||
| 1021 | + '活跃', | ||
| 1022 | + '${widget.customerProvider.storeSunmodel.active.scale}'), | ||
| 1023 | + HEmptyView(10), | ||
| 1024 | + _percentWidget( | ||
| 1025 | + '${widget.customerProvider.storeSunmodel.sleep.count}', | ||
| 1026 | + '60天未到店', | ||
| 1027 | + '${widget.customerProvider.storeSunmodel.sleep.scale}'), | ||
| 1028 | + HEmptyView(10), | ||
| 1029 | + _percentWidget( | ||
| 1030 | + '${widget.customerProvider.storeSunmodel.drain.count}', | ||
| 1031 | + '120天未到店', | ||
| 1032 | + '${widget.customerProvider.storeSunmodel.drain.scale}'), | ||
| 980 | ], | 1033 | ], |
| 981 | ), | 1034 | ), |
| 982 | - )), | ||
| 983 | - // Positioned( | ||
| 984 | - // top: ScreenUtil().setWidth(30), | ||
| 985 | - // right: ScreenUtil().setWidth(40), | ||
| 986 | - // child: InkWell( | ||
| 987 | - // onTap: () { | ||
| 988 | - // NavigatorUtil.goCustomerSetPage(context); | ||
| 989 | - // }, | ||
| 990 | - // child: Image.asset(Utils.getImgPath('c_set'), | ||
| 991 | - // width: ScreenUtil().setWidth(40)))) | ||
| 992 | - // ], | ||
| 993 | - // ), | ||
| 994 | - VEmptyView(10), | ||
| 995 | - Row( | ||
| 996 | - children: [ | ||
| 997 | - _percentWidget( | ||
| 998 | - '${widget.customerProvider.storeSunmodel.active.count}', | ||
| 999 | - '活跃', | ||
| 1000 | - '${widget.customerProvider.storeSunmodel.active.scale}'), | ||
| 1001 | - HEmptyView(10), | ||
| 1002 | - _percentWidget( | ||
| 1003 | - '${widget.customerProvider.storeSunmodel.sleep.count}', | ||
| 1004 | - '60天未到店', | ||
| 1005 | - '${widget.customerProvider.storeSunmodel.sleep.scale}'), | ||
| 1006 | - HEmptyView(10), | ||
| 1007 | - _percentWidget( | ||
| 1008 | - '${widget.customerProvider.storeSunmodel.drain.count}', | ||
| 1009 | - '120天未到店', | ||
| 1010 | - '${widget.customerProvider.storeSunmodel.drain.scale}'), | ||
| 1011 | - ], | ||
| 1012 | - ), | ||
| 1013 | - // GridView.builder( | ||
| 1014 | - // controller: _controller, | ||
| 1015 | - // shrinkWrap: true, | ||
| 1016 | - // cacheExtent: ScreenUtil().setWidth(0), | ||
| 1017 | - // itemCount: 3, | ||
| 1018 | - // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | ||
| 1019 | - // crossAxisCount: 3, | ||
| 1020 | - // childAspectRatio: 1, | ||
| 1021 | - // mainAxisSpacing: ScreenUtil().setWidth(10), | ||
| 1022 | - // crossAxisSpacing: ScreenUtil().setWidth(10)), | ||
| 1023 | - // itemBuilder: (BuildContext context, int index) { | ||
| 1024 | - // // locationState = state; | ||
| 1025 | - // return _percentWidget('1999', '活跃客户', '39.20'); | ||
| 1026 | - // }), | ||
| 1027 | - // Row( | ||
| 1028 | - // children: [ | ||
| 1029 | - // _percentWidget('19992', '活跃客户', '90.90'), | ||
| 1030 | - // HEmptyView(10), | ||
| 1031 | - // _percentWidget('19992', '沉睡客户', '90.90'), | ||
| 1032 | - // HEmptyView(10), | ||
| 1033 | - // _percentWidget('19992', '流失客户', '5.90'), | ||
| 1034 | - // ], | ||
| 1035 | - // ), | ||
| 1036 | - // Padding( | ||
| 1037 | - // padding: EdgeInsets.symmetric( | ||
| 1038 | - // vertical: ScreenUtil().setWidth(30)), | ||
| 1039 | - // child: Text( | ||
| 1040 | - // '客户经理', | ||
| 1041 | - // style: TextStyle( | ||
| 1042 | - // fontSize: ScreenUtil().setSp(28), | ||
| 1043 | - // color: MyColours.color_333333), | ||
| 1044 | - // ), | ||
| 1045 | - // ), | ||
| 1046 | - VEmptyView(10), | ||
| 1047 | - GridView.builder( | ||
| 1048 | - controller: _controller, | ||
| 1049 | - shrinkWrap: true, | ||
| 1050 | - cacheExtent: ScreenUtil().setWidth(0), | ||
| 1051 | - itemCount: widget.customerProvider.storeSunmodel | ||
| 1052 | - .sellerUser.length + | ||
| 1053 | - 1, | ||
| 1054 | - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | ||
| 1055 | - crossAxisCount: 3, | ||
| 1056 | - childAspectRatio: 1.05, | ||
| 1057 | - mainAxisSpacing: ScreenUtil().setWidth(10), | ||
| 1058 | - crossAxisSpacing: ScreenUtil().setWidth(10)), | ||
| 1059 | - itemBuilder: (BuildContext context, int index) { | ||
| 1060 | - // locationState = state; | ||
| 1061 | - if (index == 0) { | ||
| 1062 | - return _managerWidget( | ||
| 1063 | - '${widget.customerProvider.storeSunmodel.distribution}', | ||
| 1064 | - '未分配经理', | ||
| 1065 | - null, | ||
| 1066 | - '${widget.customerProvider.storeSunmodel.distributionStr}', | ||
| 1067 | - onTap: () { | ||
| 1068 | - NavigatorUtil.goCustomerListPage( | ||
| 1069 | - context, FromPage.FromPageHome, '', | ||
| 1070 | - index: '0', distribution: true); | ||
| 1071 | - }); | ||
| 1072 | - } | 1035 | + // GridView.builder( |
| 1036 | + // controller: _controller, | ||
| 1037 | + // shrinkWrap: true, | ||
| 1038 | + // cacheExtent: ScreenUtil().setWidth(0), | ||
| 1039 | + // itemCount: 3, | ||
| 1040 | + // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | ||
| 1041 | + // crossAxisCount: 3, | ||
| 1042 | + // childAspectRatio: 1, | ||
| 1043 | + // mainAxisSpacing: ScreenUtil().setWidth(10), | ||
| 1044 | + // crossAxisSpacing: ScreenUtil().setWidth(10)), | ||
| 1045 | + // itemBuilder: (BuildContext context, int index) { | ||
| 1046 | + // // locationState = state; | ||
| 1047 | + // return _percentWidget('1999', '活跃客户', '39.20'); | ||
| 1048 | + // }), | ||
| 1049 | + // Row( | ||
| 1050 | + // children: [ | ||
| 1051 | + // _percentWidget('19992', '活跃客户', '90.90'), | ||
| 1052 | + // HEmptyView(10), | ||
| 1053 | + // _percentWidget('19992', '沉睡客户', '90.90'), | ||
| 1054 | + // HEmptyView(10), | ||
| 1055 | + // _percentWidget('19992', '流失客户', '5.90'), | ||
| 1056 | + // ], | ||
| 1057 | + // ), | ||
| 1058 | + // Padding( | ||
| 1059 | + // padding: EdgeInsets.symmetric( | ||
| 1060 | + // vertical: ScreenUtil().setWidth(30)), | ||
| 1061 | + // child: Text( | ||
| 1062 | + // '客户经理', | ||
| 1063 | + // style: TextStyle( | ||
| 1064 | + // fontSize: ScreenUtil().setSp(28), | ||
| 1065 | + // color: MyColours.color_333333), | ||
| 1066 | + // ), | ||
| 1067 | + // ), | ||
| 1068 | + VEmptyView(10), | ||
| 1069 | + GridView.builder( | ||
| 1070 | + controller: _controller, | ||
| 1071 | + shrinkWrap: true, | ||
| 1072 | + cacheExtent: ScreenUtil().setWidth(0), | ||
| 1073 | + itemCount: widget.customerProvider.storeSunmodel | ||
| 1074 | + .sellerUser.length + | ||
| 1075 | + 1, | ||
| 1076 | + gridDelegate: | ||
| 1077 | + SliverGridDelegateWithFixedCrossAxisCount( | ||
| 1078 | + crossAxisCount: 3, | ||
| 1079 | + childAspectRatio: 1.05, | ||
| 1080 | + mainAxisSpacing: ScreenUtil().setWidth(10), | ||
| 1081 | + crossAxisSpacing: | ||
| 1082 | + ScreenUtil().setWidth(10)), | ||
| 1083 | + itemBuilder: (BuildContext context, int index) { | ||
| 1084 | + // locationState = state; | ||
| 1085 | + if (index == 0) { | ||
| 1086 | + return _managerWidget( | ||
| 1087 | + '${widget.customerProvider.storeSunmodel.distribution}', | ||
| 1088 | + '未分配经理', | ||
| 1089 | + null, | ||
| 1090 | + '${widget.customerProvider.storeSunmodel.distributionStr}', | ||
| 1091 | + onTap: () { | ||
| 1092 | + NavigatorUtil.goCustomerListPage( | ||
| 1093 | + context, | ||
| 1094 | + FromPage.FromPageHome, | ||
| 1095 | + '', | ||
| 1096 | + { | ||
| 1097 | + 'object': widget.customerProvider | ||
| 1098 | + .storeSunmodel.sellerUser | ||
| 1099 | + }, | ||
| 1100 | + index: '0', | ||
| 1101 | + distribution: true); | ||
| 1102 | + }); | ||
| 1103 | + } | ||
| 1104 | + | ||
| 1105 | + return _managerWidget( | ||
| 1106 | + '${widget.customerProvider.storeSunmodel.sellerUser[index - 1].count}', | ||
| 1107 | + widget.customerProvider.storeSunmodel | ||
| 1108 | + .sellerUser[index - 1].account == | ||
| 1109 | + null | ||
| 1110 | + ? '' | ||
| 1111 | + : '${widget.customerProvider.storeSunmodel.sellerUser[index - 1].nickName ?? widget.customerProvider.storeSunmodel.sellerUser[index - 1].account}', | ||
| 1112 | + null, | ||
| 1113 | + '${widget.customerProvider.storeSunmodel.sellerUser[index - 1].detailStr}', | ||
| 1114 | + uid: widget.customerProvider.storeSunmodel | ||
| 1115 | + .sellerUser[index - 1].uid, onTap: () { | ||
| 1116 | + NavigatorUtil.goCustomerListPage( | ||
| 1117 | + context, | ||
| 1118 | + FromPage.FromPageHome, | ||
| 1119 | + widget.customerProvider.storeSunmodel | ||
| 1120 | + .sellerUser[index - 1].uid, | ||
| 1121 | + { | ||
| 1122 | + 'object': widget.customerProvider | ||
| 1123 | + .storeSunmodel.sellerUser | ||
| 1124 | + }, | ||
| 1125 | + index: '0', | ||
| 1126 | + ); | ||
| 1127 | + }); | ||
| 1128 | + }), | ||
| 1129 | + ], | ||
| 1130 | + ), | ||
| 1073 | 1131 | ||
| 1074 | - return _managerWidget( | ||
| 1075 | - '${widget.customerProvider.storeSunmodel.sellerUser[index - 1].count}', | ||
| 1076 | - widget.customerProvider.storeSunmodel | ||
| 1077 | - .sellerUser[index - 1].account == | ||
| 1078 | - null | ||
| 1079 | - ? '' | ||
| 1080 | - : '${widget.customerProvider.storeSunmodel.sellerUser[index - 1].nickName ?? widget.customerProvider.storeSunmodel.sellerUser[index - 1].account}', | ||
| 1081 | - null, | ||
| 1082 | - '${widget.customerProvider.storeSunmodel.sellerUser[index - 1].detailStr}', | ||
| 1083 | - uid: widget.customerProvider.storeSunmodel | ||
| 1084 | - .sellerUser[index - 1].uid, onTap: () { | ||
| 1085 | - NavigatorUtil.goCustomerListPage( | ||
| 1086 | - context, | ||
| 1087 | - FromPage.FromPageHome, | ||
| 1088 | - widget.customerProvider.storeSunmodel | ||
| 1089 | - .sellerUser[index - 1].uid, | ||
| 1090 | - index: '0'); | ||
| 1091 | - }); | ||
| 1092 | - }), | ||
| 1093 | VEmptyView(10), | 1132 | VEmptyView(10), |
| 1094 | // ListView.builder( | 1133 | // ListView.builder( |
| 1095 | // shrinkWrap: true, | 1134 | // shrinkWrap: true, |
| @@ -1131,28 +1170,37 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | @@ -1131,28 +1170,37 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | ||
| 1131 | // ), | 1170 | // ), |
| 1132 | // ); | 1171 | // ); |
| 1133 | // }), | 1172 | // }), |
| 1134 | - _chart(), | ||
| 1135 | - // _monthWidget(), | ||
| 1136 | 1173 | ||
| 1137 | - ListView.builder( | ||
| 1138 | - itemCount: | ||
| 1139 | - widget.customerProvider.homeStatisticsList.length, | ||
| 1140 | - shrinkWrap: true, | ||
| 1141 | - controller: _controller, | ||
| 1142 | - padding: EdgeInsets.symmetric(horizontal: w(10)), | ||
| 1143 | - itemBuilder: (context, index) { | ||
| 1144 | - SellerCountsListSunModel countsListSunModel = | ||
| 1145 | - widget.customerProvider.homeStatisticsList[index]; | ||
| 1146 | - return InkWell( | ||
| 1147 | - onTap: () { | ||
| 1148 | - NavigatorUtil.goMonthOrderPage( | ||
| 1149 | - context, | ||
| 1150 | - year.toString(), | ||
| 1151 | - countsListSunModel.monthss.toString()); | ||
| 1152 | - }, | ||
| 1153 | - child: MonthItem( | ||
| 1154 | - countsListSunModel: countsListSunModel)); | ||
| 1155 | - }), | 1174 | + if (widget.customerProvider.homeStatisticsList != null && |
| 1175 | + widget.customerProvider.homeStatisticsList.length > 0) | ||
| 1176 | + Column( | ||
| 1177 | + children: [ | ||
| 1178 | + _chart(), | ||
| 1179 | + // _monthWidget(), | ||
| 1180 | + | ||
| 1181 | + ListView.builder( | ||
| 1182 | + itemCount: widget | ||
| 1183 | + .customerProvider.homeStatisticsList.length, | ||
| 1184 | + shrinkWrap: true, | ||
| 1185 | + controller: _controller, | ||
| 1186 | + padding: EdgeInsets.symmetric(horizontal: w(10)), | ||
| 1187 | + itemBuilder: (context, index) { | ||
| 1188 | + SellerCountsListSunModel countsListSunModel = | ||
| 1189 | + widget.customerProvider | ||
| 1190 | + .homeStatisticsList[index]; | ||
| 1191 | + return InkWell( | ||
| 1192 | + onTap: () { | ||
| 1193 | + NavigatorUtil.goMonthOrderPage( | ||
| 1194 | + context, | ||
| 1195 | + year.toString(), | ||
| 1196 | + countsListSunModel.monthss.toString()); | ||
| 1197 | + }, | ||
| 1198 | + child: MonthItem( | ||
| 1199 | + countsListSunModel: countsListSunModel)); | ||
| 1200 | + }), | ||
| 1201 | + ], | ||
| 1202 | + ) | ||
| 1203 | + | ||
| 1156 | /** | 1204 | /** |
| 1157 | ListView.builder( | 1205 | ListView.builder( |
| 1158 | itemCount: 10, | 1206 | itemCount: 10, |
| @@ -1525,44 +1573,48 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | @@ -1525,44 +1573,48 @@ class _StoreCustomerHomeLeftPageState extends State<StoreCustomerHomeLeftPage> { | ||
| 1525 | ], | 1573 | ], |
| 1526 | ), | 1574 | ), |
| 1527 | )), | 1575 | )), |
| 1528 | - Container( | ||
| 1529 | - color: MyColours.color_FAFAFA, | ||
| 1530 | - padding: EdgeInsets.only( | ||
| 1531 | - top: w(13), bottom: w(26), left: w(45), right: (45)), | ||
| 1532 | - child: Stack( | ||
| 1533 | - children: [ | ||
| 1534 | - RoundButton( | ||
| 1535 | - onPressed: () { | ||
| 1536 | - NavigatorUtil.goMarketingRecordsPage( | ||
| 1537 | - context, FromPage.FromPageStoreCustomer); | ||
| 1538 | - }, | ||
| 1539 | - text: '历史营销记录', | ||
| 1540 | - fontSize: 32, | ||
| 1541 | - isBold: true, | ||
| 1542 | - // margin: EdgeInsets.only( | ||
| 1543 | - // top: w(13), | ||
| 1544 | - // bottom: w(26), | ||
| 1545 | - // left: w(45), | ||
| 1546 | - // right: (45)), | ||
| 1547 | - textColor: MyColours.color_F8F9FD, | ||
| 1548 | - gradientStart: MyColours.color_199095, | ||
| 1549 | - gradientEnd: MyColours.color_199095, | ||
| 1550 | - borderColor: MyColours.color_199095, | ||
| 1551 | - height: ScreenUtil().setWidth(86), | ||
| 1552 | - // width: ScreenUtil().setWidth(260), | ||
| 1553 | - radius: ScreenUtil().setWidth(10), | ||
| 1554 | - ), | ||
| 1555 | - showWarning | ||
| 1556 | - ? Positioned( | ||
| 1557 | - right: ScreenUtil().setWidth(30), | ||
| 1558 | - top: ScreenUtil().setWidth(45 / 2), | ||
| 1559 | - child: Image.asset( | ||
| 1560 | - Utils.getImgPath('warning'), | ||
| 1561 | - width: ScreenUtil().setWidth(35), | ||
| 1562 | - )) | ||
| 1563 | - : SizedBox() | ||
| 1564 | - ], | ||
| 1565 | - )) | 1576 | + if (widget.customerProvider.storeSunmodel != null) |
| 1577 | + Container( | ||
| 1578 | + color: MyColours.color_FAFAFA, | ||
| 1579 | + padding: EdgeInsets.only( | ||
| 1580 | + top: w(13), bottom: w(26), left: w(45), right: (45)), | ||
| 1581 | + child: Stack( | ||
| 1582 | + children: [ | ||
| 1583 | + RoundButton( | ||
| 1584 | + onPressed: () { | ||
| 1585 | + NavigatorUtil.goMarketingRecordsPage( | ||
| 1586 | + context, FromPage.FromPageStoreCustomer, { | ||
| 1587 | + 'object': | ||
| 1588 | + widget.customerProvider.storeSunmodel.sellerUser | ||
| 1589 | + }); | ||
| 1590 | + }, | ||
| 1591 | + text: '历史营销记录', | ||
| 1592 | + fontSize: 32, | ||
| 1593 | + isBold: true, | ||
| 1594 | + // margin: EdgeInsets.only( | ||
| 1595 | + // top: w(13), | ||
| 1596 | + // bottom: w(26), | ||
| 1597 | + // left: w(45), | ||
| 1598 | + // right: (45)), | ||
| 1599 | + textColor: MyColours.color_F8F9FD, | ||
| 1600 | + gradientStart: MyColours.color_199095, | ||
| 1601 | + gradientEnd: MyColours.color_199095, | ||
| 1602 | + borderColor: MyColours.color_199095, | ||
| 1603 | + height: ScreenUtil().setWidth(86), | ||
| 1604 | + // width: ScreenUtil().setWidth(260), | ||
| 1605 | + radius: ScreenUtil().setWidth(10), | ||
| 1606 | + ), | ||
| 1607 | + showWarning | ||
| 1608 | + ? Positioned( | ||
| 1609 | + right: ScreenUtil().setWidth(30), | ||
| 1610 | + top: ScreenUtil().setWidth(45 / 2), | ||
| 1611 | + child: Image.asset( | ||
| 1612 | + Utils.getImgPath('warning'), | ||
| 1613 | + width: ScreenUtil().setWidth(35), | ||
| 1614 | + )) | ||
| 1615 | + : SizedBox() | ||
| 1616 | + ], | ||
| 1617 | + )) | ||
| 1566 | ]); | 1618 | ]); |
| 1567 | } | 1619 | } |
| 1568 | })), | 1620 | })), |
| @@ -77,13 +77,13 @@ class _StoreCustomerHomeRightPageState | @@ -77,13 +77,13 @@ class _StoreCustomerHomeRightPageState | ||
| 77 | } | 77 | } |
| 78 | _couponNetworkData(); | 78 | _couponNetworkData(); |
| 79 | 79 | ||
| 80 | - _getMarketingByUid(); | 80 | + // _getMarketingByUid(); |
| 81 | _getSellerCountsList(); | 81 | _getSellerCountsList(); |
| 82 | } | 82 | } |
| 83 | }); | 83 | }); |
| 84 | bus.on("refresh_my_customer_home", (arg) { | 84 | bus.on("refresh_my_customer_home", (arg) { |
| 85 | // _getGuestManageData(isShowLoading: false); | 85 | // _getGuestManageData(isShowLoading: false); |
| 86 | - _getMarketingByUid(); | 86 | + // _getMarketingByUid(); |
| 87 | _getSellerCountsList(); | 87 | _getSellerCountsList(); |
| 88 | }); | 88 | }); |
| 89 | } | 89 | } |
| @@ -112,7 +112,7 @@ class _StoreCustomerHomeRightPageState | @@ -112,7 +112,7 @@ class _StoreCustomerHomeRightPageState | ||
| 112 | } | 112 | } |
| 113 | _couponNetworkData(); | 113 | _couponNetworkData(); |
| 114 | 114 | ||
| 115 | - _getMarketingByUid(); | 115 | + // _getMarketingByUid(); |
| 116 | _getSellerCountsList(); | 116 | _getSellerCountsList(); |
| 117 | } | 117 | } |
| 118 | 118 | ||
| @@ -130,6 +130,8 @@ class _StoreCustomerHomeRightPageState | @@ -130,6 +130,8 @@ class _StoreCustomerHomeRightPageState | ||
| 130 | }; | 130 | }; |
| 131 | await widget.customerProvider | 131 | await widget.customerProvider |
| 132 | .getSellerCountsList(context, params, isShowLoading: isShowLoading); | 132 | .getSellerCountsList(context, params, isShowLoading: isShowLoading); |
| 133 | + widget.customerProvider.pageStateMyHome = PageState.Success; | ||
| 134 | + setState(() {}); | ||
| 133 | if ((widget.customerProvider.managerStatisticsList == null || | 135 | if ((widget.customerProvider.managerStatisticsList == null || |
| 134 | widget.customerProvider.managerStatisticsList.length == 0) && | 136 | widget.customerProvider.managerStatisticsList.length == 0) && |
| 135 | callback != null) { | 137 | callback != null) { |
| @@ -426,7 +428,7 @@ class _StoreCustomerHomeRightPageState | @@ -426,7 +428,7 @@ class _StoreCustomerHomeRightPageState | ||
| 426 | } | 428 | } |
| 427 | menuTitle[index].select = true; | 429 | menuTitle[index].select = true; |
| 428 | setState(() {}); | 430 | setState(() {}); |
| 429 | - _getMarketingByUid(); | 431 | + // _getMarketingByUid(); |
| 430 | // _getSellerCountsList(); | 432 | // _getSellerCountsList(); |
| 431 | _getSellerCountsList( | 433 | _getSellerCountsList( |
| 432 | isShowLoading: true, callback: () {}); | 434 | isShowLoading: true, callback: () {}); |
| @@ -595,7 +597,7 @@ class _StoreCustomerHomeRightPageState | @@ -595,7 +597,7 @@ class _StoreCustomerHomeRightPageState | ||
| 595 | callback: () { | 597 | callback: () { |
| 596 | _couponNetworkData(); | 598 | _couponNetworkData(); |
| 597 | 599 | ||
| 598 | - _getMarketingByUid(); | 600 | + // _getMarketingByUid(); |
| 599 | _getSellerCountsList(); | 601 | _getSellerCountsList(); |
| 600 | }, | 602 | }, |
| 601 | emptyMsg: "暂时没有我的客情哦", | 603 | emptyMsg: "暂时没有我的客情哦", |
| @@ -609,83 +611,91 @@ class _StoreCustomerHomeRightPageState | @@ -609,83 +611,91 @@ class _StoreCustomerHomeRightPageState | ||
| 609 | child: Column( | 611 | child: Column( |
| 610 | children: [ | 612 | children: [ |
| 611 | // VEmptyView(10), | 613 | // VEmptyView(10), |
| 612 | - InkWell( | ||
| 613 | - onTap: () { | ||
| 614 | - String uid = ''; | ||
| 615 | - menuTitle.forEach((element) { | ||
| 616 | - if (element.select) { | ||
| 617 | - uid = element.uid; | ||
| 618 | - } | ||
| 619 | - }); | ||
| 620 | - NavigatorUtil.goMyCustomerListPage( | ||
| 621 | - context, FromPage.FromPageMyCustomer, uid); | ||
| 622 | - }, | ||
| 623 | - child: Container( | ||
| 624 | - height: w(80), | ||
| 625 | - color: MyColours.color_ffffff, | ||
| 626 | - child: Row( | ||
| 627 | - mainAxisAlignment: MainAxisAlignment.center, | 614 | + |
| 615 | + if (widget.customerProvider.guestSunmodel != null) | ||
| 616 | + Column( | ||
| 617 | + children: [ | ||
| 618 | + InkWell( | ||
| 619 | + onTap: () { | ||
| 620 | + String uid = ''; | ||
| 621 | + menuTitle.forEach((element) { | ||
| 622 | + if (element.select) { | ||
| 623 | + uid = element.uid; | ||
| 624 | + } | ||
| 625 | + }); | ||
| 626 | + NavigatorUtil.goMyCustomerListPage(context, | ||
| 627 | + FromPage.FromPageMyCustomer, uid); | ||
| 628 | + }, | ||
| 629 | + child: Container( | ||
| 630 | + height: w(80), | ||
| 631 | + color: MyColours.color_ffffff, | ||
| 632 | + child: Row( | ||
| 633 | + mainAxisAlignment: | ||
| 634 | + MainAxisAlignment.center, | ||
| 635 | + children: [ | ||
| 636 | + // Text( | ||
| 637 | + // '累计', | ||
| 638 | + // style: TextStyle( | ||
| 639 | + // color: MyColours.color_515151, | ||
| 640 | + // fontWeight: FontWeight.bold, | ||
| 641 | + // fontSize: ScreenUtil().setSp(32)), | ||
| 642 | + // ), | ||
| 643 | + Text( | ||
| 644 | + '${widget.customerProvider.guestSunmodel.myCustomer}', | ||
| 645 | + style: TextStyle( | ||
| 646 | + color: MyColours.color_199095, | ||
| 647 | + fontSize: ScreenUtil().setSp(64), | ||
| 648 | + fontWeight: FontWeight.bold), | ||
| 649 | + ), | ||
| 650 | + Text( | ||
| 651 | + '位', | ||
| 652 | + style: TextStyle( | ||
| 653 | + color: MyColours.color_515151, | ||
| 654 | + fontWeight: FontWeight.bold, | ||
| 655 | + fontSize: ScreenUtil().setSp(32)), | ||
| 656 | + ) | ||
| 657 | + ], | ||
| 658 | + ), | ||
| 659 | + )), | ||
| 660 | + VEmptyView(10), | ||
| 661 | + // GridView.builder( | ||
| 662 | + // controller: _controller, | ||
| 663 | + // shrinkWrap: true, | ||
| 664 | + // cacheExtent: ScreenUtil().setWidth(0), | ||
| 665 | + // itemCount: 3, | ||
| 666 | + // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | ||
| 667 | + // crossAxisCount: 3, | ||
| 668 | + // childAspectRatio: 1, | ||
| 669 | + // mainAxisSpacing: ScreenUtil().setWidth(10), | ||
| 670 | + // crossAxisSpacing: ScreenUtil().setWidth(10)), | ||
| 671 | + // itemBuilder: (BuildContext context, int index) { | ||
| 672 | + // // locationState = state; | ||
| 673 | + // return _percentWidget( | ||
| 674 | + // '${widget.customerProvider.guestSunmodel.active.count}', | ||
| 675 | + // '活跃客户', | ||
| 676 | + // '${widget.customerProvider.guestSunmodel.active.scale}'); | ||
| 677 | + // }), | ||
| 678 | + Row( | ||
| 628 | children: [ | 679 | children: [ |
| 629 | - // Text( | ||
| 630 | - // '累计', | ||
| 631 | - // style: TextStyle( | ||
| 632 | - // color: MyColours.color_515151, | ||
| 633 | - // fontWeight: FontWeight.bold, | ||
| 634 | - // fontSize: ScreenUtil().setSp(32)), | ||
| 635 | - // ), | ||
| 636 | - Text( | ||
| 637 | - '${widget.customerProvider.guestSunmodel.myCustomer}', | ||
| 638 | - style: TextStyle( | ||
| 639 | - color: MyColours.color_199095, | ||
| 640 | - fontSize: ScreenUtil().setSp(64), | ||
| 641 | - fontWeight: FontWeight.bold), | ||
| 642 | - ), | ||
| 643 | - Text( | ||
| 644 | - '位', | ||
| 645 | - style: TextStyle( | ||
| 646 | - color: MyColours.color_515151, | ||
| 647 | - fontWeight: FontWeight.bold, | ||
| 648 | - fontSize: ScreenUtil().setSp(32)), | ||
| 649 | - ) | 680 | + _percentWidget( |
| 681 | + '${widget.customerProvider.guestSunmodel.active.count}', | ||
| 682 | + '活跃', | ||
| 683 | + '${widget.customerProvider.guestSunmodel.active.scale}'), | ||
| 684 | + HEmptyView(10), | ||
| 685 | + _percentWidget( | ||
| 686 | + '${widget.customerProvider.guestSunmodel.sleep.count}', | ||
| 687 | + '60天未到店', | ||
| 688 | + '${widget.customerProvider.guestSunmodel.sleep.scale}'), | ||
| 689 | + HEmptyView(10), | ||
| 690 | + _percentWidget( | ||
| 691 | + '${widget.customerProvider.guestSunmodel.drain.count}', | ||
| 692 | + '120天未到店', | ||
| 693 | + '${widget.customerProvider.guestSunmodel.drain.scale}'), | ||
| 650 | ], | 694 | ], |
| 651 | ), | 695 | ), |
| 652 | - )), | ||
| 653 | - VEmptyView(10), | ||
| 654 | - // GridView.builder( | ||
| 655 | - // controller: _controller, | ||
| 656 | - // shrinkWrap: true, | ||
| 657 | - // cacheExtent: ScreenUtil().setWidth(0), | ||
| 658 | - // itemCount: 3, | ||
| 659 | - // gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | ||
| 660 | - // crossAxisCount: 3, | ||
| 661 | - // childAspectRatio: 1, | ||
| 662 | - // mainAxisSpacing: ScreenUtil().setWidth(10), | ||
| 663 | - // crossAxisSpacing: ScreenUtil().setWidth(10)), | ||
| 664 | - // itemBuilder: (BuildContext context, int index) { | ||
| 665 | - // // locationState = state; | ||
| 666 | - // return _percentWidget( | ||
| 667 | - // '${widget.customerProvider.guestSunmodel.active.count}', | ||
| 668 | - // '活跃客户', | ||
| 669 | - // '${widget.customerProvider.guestSunmodel.active.scale}'); | ||
| 670 | - // }), | ||
| 671 | - Row( | ||
| 672 | - children: [ | ||
| 673 | - _percentWidget( | ||
| 674 | - '${widget.customerProvider.guestSunmodel.active.count}', | ||
| 675 | - '活跃', | ||
| 676 | - '${widget.customerProvider.guestSunmodel.active.scale}'), | ||
| 677 | - HEmptyView(10), | ||
| 678 | - _percentWidget( | ||
| 679 | - '${widget.customerProvider.guestSunmodel.sleep.count}', | ||
| 680 | - '60天未到店', | ||
| 681 | - '${widget.customerProvider.guestSunmodel.sleep.scale}'), | ||
| 682 | - HEmptyView(10), | ||
| 683 | - _percentWidget( | ||
| 684 | - '${widget.customerProvider.guestSunmodel.drain.count}', | ||
| 685 | - '120天未到店', | ||
| 686 | - '${widget.customerProvider.guestSunmodel.drain.scale}'), | ||
| 687 | - ], | ||
| 688 | - ), | 696 | + ], |
| 697 | + ), | ||
| 698 | + | ||
| 689 | // ListView.builder( | 699 | // ListView.builder( |
| 690 | // controller: _controller, | 700 | // controller: _controller, |
| 691 | // shrinkWrap: true, | 701 | // shrinkWrap: true, |
| @@ -972,34 +982,47 @@ class _StoreCustomerHomeRightPageState | @@ -972,34 +982,47 @@ class _StoreCustomerHomeRightPageState | ||
| 972 | // ], | 982 | // ], |
| 973 | // ); | 983 | // ); |
| 974 | // }), | 984 | // }), |
| 975 | - _chart(), | ||
| 976 | - ListView.builder( | ||
| 977 | - itemCount: widget | ||
| 978 | - .customerProvider.managerStatisticsList.length, | ||
| 979 | - shrinkWrap: true, | ||
| 980 | - controller: _controller, | ||
| 981 | - padding: EdgeInsets.symmetric(horizontal: w(10)), | ||
| 982 | - itemBuilder: (context, index) { | ||
| 983 | - SellerCountsListSunModel countsListSunModel = | ||
| 984 | - widget.customerProvider | ||
| 985 | - .managerStatisticsList[index]; | ||
| 986 | - return InkWell( | ||
| 987 | - onTap: () { | ||
| 988 | - String uid = ''; | ||
| 989 | - menuTitle.forEach((element) { | ||
| 990 | - if (element.select) { | ||
| 991 | - uid = element.uid; | ||
| 992 | - } | ||
| 993 | - }); | ||
| 994 | - NavigatorUtil.goMonthOrderPage( | ||
| 995 | - context, | ||
| 996 | - year.toString(), | ||
| 997 | - countsListSunModel.monthss.toString(), | ||
| 998 | - uid: uid); | ||
| 999 | - }, | ||
| 1000 | - child: MonthItem( | ||
| 1001 | - countsListSunModel: countsListSunModel)); | ||
| 1002 | - }) | 985 | + if (widget.customerProvider.managerStatisticsList != |
| 986 | + null && | ||
| 987 | + widget.customerProvider.managerStatisticsList | ||
| 988 | + .length > | ||
| 989 | + 0) | ||
| 990 | + Column( | ||
| 991 | + children: [ | ||
| 992 | + _chart(), | ||
| 993 | + ListView.builder( | ||
| 994 | + itemCount: widget.customerProvider | ||
| 995 | + .managerStatisticsList.length, | ||
| 996 | + shrinkWrap: true, | ||
| 997 | + controller: _controller, | ||
| 998 | + padding: | ||
| 999 | + EdgeInsets.symmetric(horizontal: w(10)), | ||
| 1000 | + itemBuilder: (context, index) { | ||
| 1001 | + SellerCountsListSunModel | ||
| 1002 | + countsListSunModel = widget | ||
| 1003 | + .customerProvider | ||
| 1004 | + .managerStatisticsList[index]; | ||
| 1005 | + return InkWell( | ||
| 1006 | + onTap: () { | ||
| 1007 | + String uid = ''; | ||
| 1008 | + menuTitle.forEach((element) { | ||
| 1009 | + if (element.select) { | ||
| 1010 | + uid = element.uid; | ||
| 1011 | + } | ||
| 1012 | + }); | ||
| 1013 | + NavigatorUtil.goMonthOrderPage( | ||
| 1014 | + context, | ||
| 1015 | + year.toString(), | ||
| 1016 | + countsListSunModel.monthss | ||
| 1017 | + .toString(), | ||
| 1018 | + uid: uid); | ||
| 1019 | + }, | ||
| 1020 | + child: MonthItem( | ||
| 1021 | + countsListSunModel: | ||
| 1022 | + countsListSunModel)); | ||
| 1023 | + }) | ||
| 1024 | + ], | ||
| 1025 | + ) | ||
| 1003 | ], | 1026 | ], |
| 1004 | ), | 1027 | ), |
| 1005 | )); | 1028 | )); |
| @@ -220,6 +220,7 @@ class CustomerProvider extends ChangeNotifier { | @@ -220,6 +220,7 @@ class CustomerProvider extends ChangeNotifier { | ||
| 220 | homeStatisticsList = data; | 220 | homeStatisticsList = data; |
| 221 | chartHomeDataList = chartDataTemp; | 221 | chartHomeDataList = chartDataTemp; |
| 222 | } | 222 | } |
| 223 | + | ||
| 223 | notifyListeners(); | 224 | notifyListeners(); |
| 224 | } else { | 225 | } else { |
| 225 | if (baseResp != null) { | 226 | if (baseResp != null) { |
| @@ -266,6 +267,7 @@ class CustomerProvider extends ChangeNotifier { | @@ -266,6 +267,7 @@ class CustomerProvider extends ChangeNotifier { | ||
| 266 | } else { | 267 | } else { |
| 267 | manageSelAll = true; | 268 | manageSelAll = true; |
| 268 | } | 269 | } |
| 270 | + | ||
| 269 | notifyListeners(); | 271 | notifyListeners(); |
| 270 | } | 272 | } |
| 271 | 273 |
| @@ -588,13 +588,13 @@ class NavigatorUtil { | @@ -588,13 +588,13 @@ class NavigatorUtil { | ||
| 588 | 588 | ||
| 589 | /// 客情列表 | 589 | /// 客情列表 |
| 590 | static Future<dynamic> goCustomerListPage( | 590 | static Future<dynamic> goCustomerListPage( |
| 591 | - BuildContext context, FromPage fromPage, String uid, | 591 | + BuildContext context, FromPage fromPage, String uid, Map object, |
| 592 | {replace = false, | 592 | {replace = false, |
| 593 | bool needBtn = false, | 593 | bool needBtn = false, |
| 594 | String index = '0', | 594 | String index = '0', |
| 595 | bool distribution = false}) { | 595 | bool distribution = false}) { |
| 596 | return _navigateTo(context, | 596 | return _navigateTo(context, |
| 597 | - "${Routes.customer_list_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}&index=$index&uid=$uid&distribution=$distribution", | 597 | + "${Routes.customer_list_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}&index=$index&uid=$uid&distribution=$distribution&object=${FluroConvertUtils.object2string(object)}", |
| 598 | replace: replace); | 598 | replace: replace); |
| 599 | } | 599 | } |
| 600 | 600 | ||
| @@ -625,31 +625,32 @@ class NavigatorUtil { | @@ -625,31 +625,32 @@ class NavigatorUtil { | ||
| 625 | 625 | ||
| 626 | /// 全店营销记录 | 626 | /// 全店营销记录 |
| 627 | static Future<dynamic> goMarketingRecordsPage( | 627 | static Future<dynamic> goMarketingRecordsPage( |
| 628 | - BuildContext context, FromPage fromPage, | 628 | + BuildContext context, FromPage fromPage, Map object, |
| 629 | {replace = false}) { | 629 | {replace = false}) { |
| 630 | return _navigateTo(context, | 630 | return _navigateTo(context, |
| 631 | - "${Routes.marketing_records_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}", | 631 | + "${Routes.marketing_records_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}&object=${FluroConvertUtils.object2string(object)}", |
| 632 | replace: replace); | 632 | replace: replace); |
| 633 | } | 633 | } |
| 634 | 634 | ||
| 635 | /// 全店营销记录详情 | 635 | /// 全店营销记录详情 |
| 636 | static Future<dynamic> goMarketingRecordsDetailPage( | 636 | static Future<dynamic> goMarketingRecordsDetailPage( |
| 637 | - BuildContext context, String idstr, | 637 | + BuildContext context, String idstr, Map object, |
| 638 | {replace = false}) { | 638 | {replace = false}) { |
| 639 | - return _navigateTo( | ||
| 640 | - context, "${Routes.marketing_records_detail_page}?idstr=${idstr}", | 639 | + return _navigateTo(context, |
| 640 | + "${Routes.marketing_records_detail_page}?idstr=${idstr}&object=${FluroConvertUtils.object2string(object)}", | ||
| 641 | replace: replace); | 641 | replace: replace); |
| 642 | } | 642 | } |
| 643 | 643 | ||
| 644 | /// 创建营销 | 644 | /// 创建营销 |
| 645 | static Future<dynamic> goMakeMarkingPage( | 645 | static Future<dynamic> goMakeMarkingPage( |
| 646 | - BuildContext context, { | 646 | + BuildContext context, |
| 647 | + Map object, { | ||
| 647 | replace = false, | 648 | replace = false, |
| 648 | MarketingByIdSunModel marketingByIdSunModel, | 649 | MarketingByIdSunModel marketingByIdSunModel, |
| 649 | FromPage fromPage, | 650 | FromPage fromPage, |
| 650 | }) { | 651 | }) { |
| 651 | return _navigateTo(context, | 652 | return _navigateTo(context, |
| 652 | - "${Routes.make_marketing_page}?marketingByIdSunModel=${FluroConvertUtils.object2string(marketingByIdSunModel)}&fromPage=${FluroConvertUtils.enumToString(fromPage)}", | 653 | + "${Routes.make_marketing_page}?marketingByIdSunModel=${FluroConvertUtils.object2string(marketingByIdSunModel)}&fromPage=${FluroConvertUtils.enumToString(fromPage)}&object=${FluroConvertUtils.object2string(object)}", |
| 653 | replace: replace); | 654 | replace: replace); |
| 654 | } | 655 | } |
| 655 | 656 | ||
| @@ -717,7 +718,7 @@ class NavigatorUtil { | @@ -717,7 +718,7 @@ class NavigatorUtil { | ||
| 717 | 718 | ||
| 718 | /// 我的营销记录 | 719 | /// 我的营销记录 |
| 719 | static Future<dynamic> goMyMarketingRecordsPage( | 720 | static Future<dynamic> goMyMarketingRecordsPage( |
| 720 | - BuildContext context, FromPage fromPage,String uid, | 721 | + BuildContext context, FromPage fromPage, String uid, |
| 721 | {replace = false}) { | 722 | {replace = false}) { |
| 722 | return _navigateTo(context, | 723 | return _navigateTo(context, |
| 723 | "${Routes.my_marketing_records_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}&uid=$uid", | 724 | "${Routes.my_marketing_records_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}&uid=$uid", |
| @@ -726,7 +727,7 @@ class NavigatorUtil { | @@ -726,7 +727,7 @@ class NavigatorUtil { | ||
| 726 | 727 | ||
| 727 | /// 我的营销记录详情 --- 个人任务 | 728 | /// 我的营销记录详情 --- 个人任务 |
| 728 | static Future<dynamic> goMyMarketingRecordsDetailPage( | 729 | static Future<dynamic> goMyMarketingRecordsDetailPage( |
| 729 | - BuildContext context, String idstr, SelfList selfList,String uid, | 730 | + BuildContext context, String idstr, SelfList selfList, String uid, |
| 730 | {replace = false}) { | 731 | {replace = false}) { |
| 731 | return _navigateTo(context, | 732 | return _navigateTo(context, |
| 732 | "${Routes.my_marketing_records_detail_page}?idstr=${idstr}&selfList=${FluroConvertUtils.object2string(selfList)}&uid=$uid", | 733 | "${Routes.my_marketing_records_detail_page}?idstr=${idstr}&selfList=${FluroConvertUtils.object2string(selfList)}&uid=$uid", |
| @@ -242,6 +242,9 @@ import '../provider/marketing_center_provider.dart'; | @@ -242,6 +242,9 @@ import '../provider/marketing_center_provider.dart'; | ||
| 242 | import '../provider/plan_dish_provider.dart'; | 242 | import '../provider/plan_dish_provider.dart'; |
| 243 | import '../provider/store_wine_provider.dart'; | 243 | import '../provider/store_wine_provider.dart'; |
| 244 | 244 | ||
| 245 | +import 'package:one_key/models/store_customer_home_model.dart' | ||
| 246 | + as storeCustomerHomeModel; | ||
| 247 | + | ||
| 245 | // 登录页 | 248 | // 登录页 |
| 246 | var loginHandler = new Handler( | 249 | var loginHandler = new Handler( |
| 247 | handlerFunc: (BuildContext context, Map<String, List<Object>> params) { | 250 | handlerFunc: (BuildContext context, Map<String, List<Object>> params) { |
| @@ -1073,14 +1076,26 @@ var customerListPageHandle = new Handler( | @@ -1073,14 +1076,26 @@ var customerListPageHandle = new Handler( | ||
| 1073 | String uid = params["uid"].first; | 1076 | String uid = params["uid"].first; |
| 1074 | bool distribution = | 1077 | bool distribution = |
| 1075 | FluroConvertUtils.string2bool(params["distribution"].first); | 1078 | FluroConvertUtils.string2bool(params["distribution"].first); |
| 1079 | + // SellerUser sellerUser = SellerUser.fromJson(json.decode( | ||
| 1080 | + // FluroConvertUtils.fluroCnParamsDecode(params["sellerUser"].first))); | ||
| 1081 | + | ||
| 1082 | + Map object = FluroConvertUtils.string2map(params["object"].first); | ||
| 1083 | + List temp = object['object']; | ||
| 1084 | + List<storeCustomerHomeModel.SellerUser> sellerUser = []; | ||
| 1085 | + | ||
| 1086 | + for (var item in temp) { | ||
| 1087 | + sellerUser.add(storeCustomerHomeModel.SellerUser.fromJson(item)); | ||
| 1088 | + } | ||
| 1076 | 1089 | ||
| 1090 | + // banquetDetail = GetBanquetByIdNewSunModel.fromJson(temp); | ||
| 1077 | return ChangeNotifierProvider<CustomerProvider>( | 1091 | return ChangeNotifierProvider<CustomerProvider>( |
| 1078 | create: (_) => CustomerProvider(), | 1092 | create: (_) => CustomerProvider(), |
| 1079 | child: CustomerListPage( | 1093 | child: CustomerListPage( |
| 1080 | fromPage: fromPage, | 1094 | fromPage: fromPage, |
| 1081 | index: index, | 1095 | index: index, |
| 1082 | uidStr: uid, | 1096 | uidStr: uid, |
| 1083 | - distribution: distribution)); | 1097 | + distribution: distribution, |
| 1098 | + sellerUser: sellerUser)); | ||
| 1084 | }); | 1099 | }); |
| 1085 | 1100 | ||
| 1086 | ///仅供展示的客情列表 ---商家 | 1101 | ///仅供展示的客情列表 ---商家 |
| @@ -1137,9 +1152,16 @@ var marketingRecordsPageHandle = new Handler( | @@ -1137,9 +1152,16 @@ var marketingRecordsPageHandle = new Handler( | ||
| 1137 | FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>( | 1152 | FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>( |
| 1138 | FromPage.values, params["fromPage"].first); | 1153 | FromPage.values, params["fromPage"].first); |
| 1139 | print(fromPage); | 1154 | print(fromPage); |
| 1155 | + Map object = FluroConvertUtils.string2map(params["object"].first); | ||
| 1156 | + List temp = object['object']; | ||
| 1157 | + List<storeCustomerHomeModel.SellerUser> sellerUser = []; | ||
| 1158 | + | ||
| 1159 | + for (var item in temp) { | ||
| 1160 | + sellerUser.add(storeCustomerHomeModel.SellerUser.fromJson(item)); | ||
| 1161 | + } | ||
| 1140 | return ChangeNotifierProvider<CustomerProvider>( | 1162 | return ChangeNotifierProvider<CustomerProvider>( |
| 1141 | create: (_) => CustomerProvider(), | 1163 | create: (_) => CustomerProvider(), |
| 1142 | - child: MarketingRecordsPage(fromPage: fromPage)); | 1164 | + child: MarketingRecordsPage(fromPage: fromPage, sellerUser: sellerUser)); |
| 1143 | }); | 1165 | }); |
| 1144 | 1166 | ||
| 1145 | ///我的营销记录 | 1167 | ///我的营销记录 |
| @@ -1149,19 +1171,26 @@ var myMarketingRecordsPageHandle = new Handler( | @@ -1149,19 +1171,26 @@ var myMarketingRecordsPageHandle = new Handler( | ||
| 1149 | FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>( | 1171 | FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>( |
| 1150 | FromPage.values, params["fromPage"].first); | 1172 | FromPage.values, params["fromPage"].first); |
| 1151 | print(fromPage); | 1173 | print(fromPage); |
| 1152 | - String uid = params["uid"].first; | 1174 | + String uid = params["uid"].first; |
| 1153 | return ChangeNotifierProvider<CustomerProvider>( | 1175 | return ChangeNotifierProvider<CustomerProvider>( |
| 1154 | create: (_) => CustomerProvider(), | 1176 | create: (_) => CustomerProvider(), |
| 1155 | - child: MyMarketingRecordsPage(fromPage: fromPage,uid:uid)); | 1177 | + child: MyMarketingRecordsPage(fromPage: fromPage, uid: uid)); |
| 1156 | }); | 1178 | }); |
| 1157 | 1179 | ||
| 1158 | ///全店营销记录详情 | 1180 | ///全店营销记录详情 |
| 1159 | var marketingRecordsDetailPageHandle = new Handler( | 1181 | var marketingRecordsDetailPageHandle = new Handler( |
| 1160 | handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | 1182 | handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { |
| 1161 | String idstr = params["idstr"].first; | 1183 | String idstr = params["idstr"].first; |
| 1184 | + Map object = FluroConvertUtils.string2map(params["object"].first); | ||
| 1185 | + List temp = object['object']; | ||
| 1186 | + List<storeCustomerHomeModel.SellerUser> sellerUser = []; | ||
| 1187 | + | ||
| 1188 | + for (var item in temp) { | ||
| 1189 | + sellerUser.add(storeCustomerHomeModel.SellerUser.fromJson(item)); | ||
| 1190 | + } | ||
| 1162 | return ChangeNotifierProvider<CustomerProvider>( | 1191 | return ChangeNotifierProvider<CustomerProvider>( |
| 1163 | create: (_) => CustomerProvider(), | 1192 | create: (_) => CustomerProvider(), |
| 1164 | - child: MarketingRecordsDetailPage(idstr: idstr)); | 1193 | + child: MarketingRecordsDetailPage(idstr: idstr, sellerUser: sellerUser)); |
| 1165 | }); | 1194 | }); |
| 1166 | 1195 | ||
| 1167 | ///我的营销记录详情 ---- 个人任务 | 1196 | ///我的营销记录详情 ---- 个人任务 |
| @@ -1194,6 +1223,13 @@ var makeMarkingPageHandle = new Handler( | @@ -1194,6 +1223,13 @@ var makeMarkingPageHandle = new Handler( | ||
| 1194 | // String gid = params["gid"].first; | 1223 | // String gid = params["gid"].first; |
| 1195 | FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>( | 1224 | FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>( |
| 1196 | FromPage.values, params["fromPage"].first); | 1225 | FromPage.values, params["fromPage"].first); |
| 1226 | + Map object = FluroConvertUtils.string2map(params["object"].first); | ||
| 1227 | + List temp = object['object']; | ||
| 1228 | + List<storeCustomerHomeModel.SellerUser> sellerUser = []; | ||
| 1229 | + | ||
| 1230 | + for (var item in temp) { | ||
| 1231 | + sellerUser.add(storeCustomerHomeModel.SellerUser.fromJson(item)); | ||
| 1232 | + } | ||
| 1197 | if (fromPage == FromPage.FromPageMakeRecordDetail) { | 1233 | if (fromPage == FromPage.FromPageMakeRecordDetail) { |
| 1198 | MarketingByIdSunModel marketingByIdSunModel = | 1234 | MarketingByIdSunModel marketingByIdSunModel = |
| 1199 | MarketingByIdSunModel.fromJson(json.decode( | 1235 | MarketingByIdSunModel.fromJson(json.decode( |
| @@ -1202,12 +1238,14 @@ var makeMarkingPageHandle = new Handler( | @@ -1202,12 +1238,14 @@ var makeMarkingPageHandle = new Handler( | ||
| 1202 | return ChangeNotifierProvider<CustomerProvider>( | 1238 | return ChangeNotifierProvider<CustomerProvider>( |
| 1203 | create: (_) => CustomerProvider(), | 1239 | create: (_) => CustomerProvider(), |
| 1204 | child: MakeMarkingPage( | 1240 | child: MakeMarkingPage( |
| 1205 | - marketingByIdSunModel: marketingByIdSunModel, fromPage: fromPage)); | 1241 | + marketingByIdSunModel: marketingByIdSunModel, |
| 1242 | + fromPage: fromPage, | ||
| 1243 | + sellerUser: sellerUser)); | ||
| 1206 | } | 1244 | } |
| 1207 | 1245 | ||
| 1208 | return ChangeNotifierProvider<CustomerProvider>( | 1246 | return ChangeNotifierProvider<CustomerProvider>( |
| 1209 | create: (_) => CustomerProvider(), | 1247 | create: (_) => CustomerProvider(), |
| 1210 | - child: MakeMarkingPage(fromPage: fromPage)); | 1248 | + child: MakeMarkingPage(fromPage: fromPage, sellerUser: sellerUser)); |
| 1211 | }); | 1249 | }); |
| 1212 | 1250 | ||
| 1213 | ///我的创建营销 | 1251 | ///我的创建营销 |
-
Please register or login to post a comment