Commit f02b6a19f6c3a34a34151c034c7fc51361c2c5e2

Authored by wdn127929
1 parent 2402df49

差部分

@@ -12,14 +12,14 @@ if (flutterRoot == null) { @@ -12,14 +12,14 @@ if (flutterRoot == null) {
12 } 12 }
13 13
14 14
15 -def flutterVersionCode = "321" 15 +def flutterVersionCode = "325"
16 if (flutterVersionCode == null) { 16 if (flutterVersionCode == null) {
17 - flutterVersionCode = '321' 17 + flutterVersionCode = '325'
18 } 18 }
19 19
20 -def flutterVersionName = "3.2.1" 20 +def flutterVersionName = "3.2.5"
21 if (flutterVersionName == null) { 21 if (flutterVersionName == null) {
22 - flutterVersionName = '3.2.1' 22 + flutterVersionName = '3.2.5'
23 } 23 }
24 apply plugin: 'com.android.application' 24 apply plugin: 'com.android.application'
25 apply plugin: 'kotlin-android' 25 apply plugin: 'kotlin-android'
@@ -67,7 +67,7 @@ class CustomerBySellerSunModel extends Object with ISuspensionBean { @@ -67,7 +67,7 @@ class CustomerBySellerSunModel extends Object with ISuspensionBean {
67 @JsonKey(name: 'label') 67 @JsonKey(name: 'label')
68 String label; 68 String label;
69 69
70 - bool select = true; 70 + bool select = false;
71 71
72 String pinyin; 72 String pinyin;
73 String tagIndex; //abcdefg 73 String tagIndex; //abcdefg
@@ -77,7 +77,7 @@ class CustomerBySellerSunModel extends Object with ISuspensionBean { @@ -77,7 +77,7 @@ class CustomerBySellerSunModel extends Object with ISuspensionBean {
77 } 77 }
78 78
79 String get sexStr { 79 String get sexStr {
80 - if (sex == null || sex == '') return ""; 80 + if (sex == null || sex == '' || sex == '0') return "";
81 switch (sex.toString()) { 81 switch (sex.toString()) {
82 case "1": //先生 82 case "1": //先生
83 case "男": 83 case "男":
@@ -88,12 +88,19 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -88,12 +88,19 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
88 WidgetsBinding.instance.addPostFrameCallback((_) async { 88 WidgetsBinding.instance.addPostFrameCallback((_) async {
89 bool first = true; 89 bool first = true;
90 customerProvider.index = tabController.index; 90 customerProvider.index = tabController.index;
91 - if (widget.fromPage == FromPage.FromPageMakeRecord) { 91 + if (widget.fromPage == FromPage.FromPageMakeRecord ||
  92 + widget.fromPage == FromPage.FromPageMyCustomer) {
92 customerProvider.selectCustomer = customerMakingProvider.selectCustomer; 93 customerProvider.selectCustomer = customerMakingProvider.selectCustomer;
93 customerProvider.labels = customerMakingProvider.labels; 94 customerProvider.labels = customerMakingProvider.labels;
94 first = false; 95 first = false;
95 } 96 }
96 customerProvider.initData(); 97 customerProvider.initData();
  98 + if (tabController.index == 0) {
  99 + customerProvider.hydSelAll = true;
  100 + for (FilterBtnModel item in customerProvider.filterHydList) {
  101 + item.select = true;
  102 + }
  103 + }
97 _getContantData(first: first); 104 _getContantData(first: first);
98 _filterLabelList(); 105 _filterLabelList();
99 }); 106 });
@@ -183,6 +190,13 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -183,6 +190,13 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
183 // params['reserve_sort'] 1 等于 2 小于 3 大于 190 // params['reserve_sort'] 1 等于 2 小于 3 大于
184 191
185 await customerProvider.getCustomerList(context, params); 192 await customerProvider.getCustomerList(context, params);
  193 + // if (customerProvider.userHistorys.length ==
  194 + // customerProvider.selectCustomer.length) {
  195 + // customerProvider.checkValue = true;
  196 + // } else {
  197 + // customerProvider.checkValue = false;
  198 + // }
  199 + // if (first || customerProvider.checkValue) {
186 if (first) { 200 if (first) {
187 customerProvider.addAllMy(); 201 customerProvider.addAllMy();
188 } 202 }
@@ -398,8 +398,7 @@ class _MyCustomerPageState extends State<MyCustomerPage> { @@ -398,8 +398,7 @@ class _MyCustomerPageState extends State<MyCustomerPage> {
398 itemCount: 398 itemCount:
399 customerProvider.guestSunmodel.tips.recover == null 399 customerProvider.guestSunmodel.tips.recover == null
400 ? 0 400 ? 0
401 - : customerProvider  
402 - .guestSunmodel.tips.recover.length, 401 + : 1,
403 itemBuilder: (BuildContext context, int index) { 402 itemBuilder: (BuildContext context, int index) {
404 // locationState = state; 403 // locationState = state;
405 404
@@ -420,7 +419,7 @@ class _MyCustomerPageState extends State<MyCustomerPage> { @@ -420,7 +419,7 @@ class _MyCustomerPageState extends State<MyCustomerPage> {
420 HEmptyView(15), 419 HEmptyView(15),
421 Expanded( 420 Expanded(
422 child: Text( 421 child: Text(
423 - '${customerProvider.guestSunmodel.tips.recover[index]}', 422 + '${customerProvider.guestSunmodel.tips.recover[0]}',
424 maxLines: 10, 423 maxLines: 10,
425 overflow: TextOverflow.ellipsis, 424 overflow: TextOverflow.ellipsis,
426 style: TextStyle( 425 style: TextStyle(
@@ -442,11 +441,13 @@ class _MyCustomerPageState extends State<MyCustomerPage> { @@ -442,11 +441,13 @@ class _MyCustomerPageState extends State<MyCustomerPage> {
442 fontSize: 26, 441 fontSize: 26,
443 isBold: false, 442 isBold: false,
444 onPressed: () { 443 onPressed: () {
445 - // NavigatorUtil.goMyMakeMarkingPage(  
446 - // context,  
447 - // selfList: widget.selfList,  
448 - // fromPage: FromPage  
449 - // .FromPageMakeRecordDetail); 444 + NavigatorUtil.goMyMakeMarkingPage(
  445 + context,
  446 + fromPage:
  447 + FromPage.FromPageMyCustomer,
  448 + homeGid: Utils.listToStringEnglish1(
  449 + customerProvider.guestSunmodel
  450 + .tips.recover[1]));
450 }, 451 },
451 ), 452 ),
452 ], 453 ],
@@ -459,10 +460,10 @@ class _MyCustomerPageState extends State<MyCustomerPage> { @@ -459,10 +460,10 @@ class _MyCustomerPageState extends State<MyCustomerPage> {
459 controller: _controller, 460 controller: _controller,
460 shrinkWrap: true, 461 shrinkWrap: true,
461 cacheExtent: ScreenUtil().setWidth(0), 462 cacheExtent: ScreenUtil().setWidth(0),
462 - itemCount: customerProvider.guestSunmodel.tips.awaken ==  
463 - null  
464 - ? 0  
465 - : customerProvider.guestSunmodel.tips.awaken.length, 463 + itemCount:
  464 + customerProvider.guestSunmodel.tips.awaken == null
  465 + ? 0
  466 + : 1,
466 itemBuilder: (BuildContext context, int index) { 467 itemBuilder: (BuildContext context, int index) {
467 // locationState = state; 468 // locationState = state;
468 469
@@ -483,7 +484,7 @@ class _MyCustomerPageState extends State<MyCustomerPage> { @@ -483,7 +484,7 @@ class _MyCustomerPageState extends State<MyCustomerPage> {
483 HEmptyView(15), 484 HEmptyView(15),
484 Expanded( 485 Expanded(
485 child: Text( 486 child: Text(
486 - '${customerProvider.guestSunmodel.tips.awaken[index]}', 487 + '${customerProvider.guestSunmodel.tips.awaken[0]}',
487 maxLines: 10, 488 maxLines: 10,
488 overflow: TextOverflow.ellipsis, 489 overflow: TextOverflow.ellipsis,
489 style: TextStyle( 490 style: TextStyle(
@@ -505,11 +506,13 @@ class _MyCustomerPageState extends State<MyCustomerPage> { @@ -505,11 +506,13 @@ class _MyCustomerPageState extends State<MyCustomerPage> {
505 fontSize: 26, 506 fontSize: 26,
506 isBold: false, 507 isBold: false,
507 onPressed: () { 508 onPressed: () {
508 - // NavigatorUtil.goMyMakeMarkingPage(  
509 - // context,  
510 - // selfList: widget.selfList,  
511 - // fromPage: FromPage  
512 - // .FromPageMakeRecordDetail); 509 + NavigatorUtil.goMyMakeMarkingPage(
  510 + context,
  511 + fromPage:
  512 + FromPage.FromPageMyCustomer,
  513 + homeGid: Utils.listToStringEnglish1(
  514 + customerProvider.guestSunmodel
  515 + .tips.awaken[1]));
513 }, 516 },
514 ), 517 ),
515 ], 518 ],
@@ -28,8 +28,12 @@ typedef ClickCallback = void Function(dynamic value); @@ -28,8 +28,12 @@ typedef ClickCallback = void Function(dynamic value);
28 class MyMakeMarkingPage extends StatefulWidget { 28 class MyMakeMarkingPage extends StatefulWidget {
29 final FromPage fromPage; 29 final FromPage fromPage;
30 final SelfList selfList; 30 final SelfList selfList;
  31 + final String homeGid;
31 MyMakeMarkingPage( 32 MyMakeMarkingPage(
32 - {Key key, this.fromPage = FromPage.FromPageCustomerList, this.selfList}) 33 + {Key key,
  34 + this.fromPage = FromPage.FromPageCustomerList,
  35 + this.selfList,
  36 + this.homeGid})
33 : super(key: key); 37 : super(key: key);
34 38
35 @override 39 @override
@@ -69,7 +73,11 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> { @@ -69,7 +73,11 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> {
69 WidgetsBinding.instance.addPostFrameCallback((_) async { 73 WidgetsBinding.instance.addPostFrameCallback((_) async {
70 _couponNetworkData(isShowLoading: false); 74 _couponNetworkData(isShowLoading: false);
71 if (widget.fromPage == FromPage.FromPageMakeRecordDetail) { 75 if (widget.fromPage == FromPage.FromPageMakeRecordDetail) {
72 - _getGuestByGid(); 76 + _getGuestByGid(widget.selfList.gid);
  77 + } else if (widget.fromPage == FromPage.FromPageMyCustomer) {
  78 + _getGuestByGid(widget.homeGid);
  79 + } else {
  80 + _getPhoneAndGid();
73 } 81 }
74 }); 82 });
75 } 83 }
@@ -77,6 +85,7 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> { @@ -77,6 +85,7 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> {
77 _getPhoneAndGid() { 85 _getPhoneAndGid() {
78 andriodPhone = ''; 86 andriodPhone = '';
79 iosPhone = []; 87 iosPhone = [];
  88 + gid = '';
80 for (CustomerListSunModel item in customerMakingProvider.selectCustomer) { 89 for (CustomerListSunModel item in customerMakingProvider.selectCustomer) {
81 gid += '${item.id},'; 90 gid += '${item.id},';
82 if (Platform.isIOS) { 91 if (Platform.isIOS) {
@@ -103,34 +112,34 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> { @@ -103,34 +112,34 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> {
103 } 112 }
104 113
105 ///客户经理营销中的用户列表 114 ///客户经理营销中的用户列表
106 - _getGuestByGid({bool isShowLoading = true}) async { 115 + _getGuestByGid(String gidtemp, {bool isShowLoading = true}) async {
107 // customerMakingProvider.couponSelectIndex = 0; 116 // customerMakingProvider.couponSelectIndex = 0;
108 - Map<String, String> params = {  
109 - "gid": widget.selfList.gid,  
110 - }; 117 + Map<String, String> params = {"gid": gidtemp};
111 await customerProvider.getGuestByGid( 118 await customerProvider.getGuestByGid(
112 context, 119 context,
113 params, 120 params,
114 ); 121 );
115 print('''object'''); 122 print('''object''');
116 - gid = widget.selfList.gid; 123 + gid = gidtemp;
117 customerMakingProvider.labels = customerProvider.labels; 124 customerMakingProvider.labels = customerProvider.labels;
118 customerMakingProvider.selectCustomer = customerProvider.selectCustomer; 125 customerMakingProvider.selectCustomer = customerProvider.selectCustomer;
119 _getPhoneAndGid(); 126 _getPhoneAndGid();
120 // customerMakingProvider.fromPage = widget.fromPage; 127 // customerMakingProvider.fromPage = widget.fromPage;
121 -  
122 - customerMakingProvider.controller.text = widget.selfList.content;  
123 - if (widget.selfList.aid != null) {  
124 - //之前绑定过优惠  
125 - customerMakingProvider.isUse = true;  
126 - for (int i = 0; i < customerProvider.couponListSelect.length; i++) {  
127 - if (widget.selfList.aid == customerProvider.couponListSelect[i].id) {  
128 - customerMakingProvider.youhui =  
129 - customerProvider.couponListSelect[i].aname;  
130 - customerMakingProvider.couponSelectIndex = i; 128 + if (widget.selfList != null) {
  129 + customerMakingProvider.controller.text = widget.selfList.content;
  130 + if (widget.selfList.aid != null) {
  131 + //之前绑定过优惠
  132 + customerMakingProvider.isUse = true;
  133 + for (int i = 0; i < customerProvider.couponListSelect.length; i++) {
  134 + if (widget.selfList.aid == customerProvider.couponListSelect[i].id) {
  135 + customerMakingProvider.youhui =
  136 + customerProvider.couponListSelect[i].aname;
  137 + customerMakingProvider.couponSelectIndex = i;
  138 + }
131 } 139 }
132 } 140 }
133 } 141 }
  142 +
134 customerMakingProvider.isUpdate = true; 143 customerMakingProvider.isUpdate = true;
135 setState(() {}); 144 setState(() {});
136 } 145 }
@@ -179,41 +188,6 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> { @@ -179,41 +188,6 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> {
179 _goSms(); 188 _goSms();
180 } 189 }
181 190
182 - /// 商家创建营销  
183 - _createMarketingBySeller() async {  
184 - if (customerMakingProvider.controller.text.trim().length == 0) {  
185 - Utils.showToast('请输入营销内容');  
186 - return;  
187 - }  
188 - Map<String, String> params = {  
189 - "uid": Provider.of<UserModel>(context, listen: false).user.openid,  
190 - "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,  
191 - "gid": gid,  
192 - "content": customerMakingProvider.controller.text,  
193 - 'is_update': customerMakingProvider.isUpdate ? '0' : '1',  
194 - 'create_user':  
195 - Provider.of<UserModel>(context, listen: false).user.role_name  
196 - };  
197 -  
198 - if (customerMakingProvider.youhui != '选择优惠' &&  
199 - customerMakingProvider.isUse) {  
200 - params['aid'] =  
201 - '${customerProvider.couponListSelect[customerMakingProvider.couponSelectIndex].id}';  
202 - }  
203 - if (customerMakingProvider.isDate) {  
204 - if (customerMakingProvider.edate == '' ||  
205 - customerMakingProvider.edate == null) {  
206 - Utils.showToast('请选择最晚完成期限');  
207 - return;  
208 - }  
209 - params['edate'] = customerMakingProvider.edate;  
210 - }  
211 -  
212 - await customerProvider.createMarketingBySeller(context, params,  
213 - showLoading: true);  
214 - _goSms();  
215 - }  
216 -  
217 _goSms() async { 191 _goSms() async {
218 // DialogUtil.cupertinoAlertDialog(context, 192 // DialogUtil.cupertinoAlertDialog(context,
219 // title: '确认发送', content: '是否确定为当前所选顾客发送该优惠券', lCallback: () { 193 // title: '确认发送', content: '是否确定为当前所选顾客发送该优惠券', lCallback: () {
@@ -500,7 +474,7 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> { @@ -500,7 +474,7 @@ class _MyMakeMarkingPageState extends State<MyMakeMarkingPage> {
500 onTap: () async { 474 onTap: () async {
501 needClear = false; 475 needClear = false;
502 if (widget.fromPage == 476 if (widget.fromPage ==
503 - FromPage.FromPageMakeRecordDetail) { 477 + FromPage.FromPageMakeRecordDetail || widget.fromPage == FromPage.FromPageMyCustomer){
504 customerMakingProvider.selectCustomer = 478 customerMakingProvider.selectCustomer =
505 customerProvider.selectCustomer; 479 customerProvider.selectCustomer;
506 480
@@ -26,6 +26,7 @@ typedef ClickCallback = void Function(dynamic value); @@ -26,6 +26,7 @@ typedef ClickCallback = void Function(dynamic value);
26 26
27 class MyMakeMarkingPageOnlyShow extends StatefulWidget { 27 class MyMakeMarkingPageOnlyShow extends StatefulWidget {
28 final SellerList sellerList; 28 final SellerList sellerList;
  29 +
29 MyMakeMarkingPageOnlyShow({Key key, this.sellerList}) : super(key: key); 30 MyMakeMarkingPageOnlyShow({Key key, this.sellerList}) : super(key: key);
30 31
31 @override 32 @override
@@ -172,51 +173,17 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { @@ -172,51 +173,17 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> {
172 } 173 }
173 174
174 _createMarketing() async { 175 _createMarketing() async {
175 - Map<String, String> params = {  
176 - "uid": Provider.of<UserModel>(context, listen: false).user.openid,  
177 - "gid": gid,  
178 - "content": customerMakingProvider.controller.text  
179 - };  
180 - if (widget.sellerList.aid != null) {  
181 - params['aid'] = widget.sellerList.aid;  
182 - }  
183 - await customerProvider.createMarketing(context, params, showLoading: true);  
184 - _goSms();  
185 - }  
186 -  
187 - /// 商家创建营销  
188 - _createMarketingBySeller() async {  
189 - if (customerMakingProvider.controller.text.trim().length == 0) {  
190 - Utils.showToast('请输入营销内容');  
191 - return;  
192 - }  
193 - Map<String, String> params = {  
194 - "uid": Provider.of<UserModel>(context, listen: false).user.openid,  
195 - "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,  
196 - "gid": gid,  
197 - "content": customerMakingProvider.controller.text,  
198 - 'is_update': customerMakingProvider.isUpdate ? '0' : '1',  
199 - 'create_user':  
200 - Provider.of<UserModel>(context, listen: false).user.role_name  
201 - };  
202 -  
203 - if (customerMakingProvider.youhui != '选择优惠' &&  
204 - customerMakingProvider.isUse) {  
205 - params['aid'] =  
206 - '${customerProvider.couponListSelect[customerMakingProvider.couponSelectIndex].id}';  
207 - }  
208 - if (customerMakingProvider.isDate) {  
209 - if (customerMakingProvider.edate == '' ||  
210 - customerMakingProvider.edate == null) {  
211 - Utils.showToast('请选择最晚完成期限');  
212 - return;  
213 - }  
214 - params['edate'] = customerMakingProvider.edate;  
215 - }  
216 -  
217 - await customerProvider.createMarketingBySeller(context, params,  
218 - showLoading: true);  
219 - _goSms(); 176 + //这块需要调用经理完成全店任务的接口,不是经理创建营销的接口
  177 + // Map<String, String> params = {
  178 + // "uid": Provider.of<UserModel>(context, listen: false).user.openid,
  179 + // "gid": gid,
  180 + // "content": customerMakingProvider.controller.text
  181 + // };
  182 + // if (widget.sellerList.aid != null) {
  183 + // params['aid'] = widget.sellerList.aid;
  184 + // }
  185 + // await customerProvider.createMarketing(context, params, showLoading: true);
  186 + // _goSms();
220 } 187 }
221 188
222 _goSms() async { 189 _goSms() async {
@@ -310,9 +277,12 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> { @@ -310,9 +277,12 @@ class _MyMakeMarkingPageOnlyShowState extends State<MyMakeMarkingPageOnlyShow> {
310 // VEmptyView(30), 277 // VEmptyView(30),
311 TextField( 278 TextField(
312 // enabled: false, 279 // enabled: false,
313 - enableInteractiveSelection: false, 280 + enableInteractiveSelection:
  281 + widget.sellerList.isUpdate == '1' ? true : false,
314 onTap: () { 282 onTap: () {
315 - FocusScope.of(context).requestFocus(new FocusNode()); 283 + if (widget.sellerList.isUpdate != '1') {
  284 + FocusScope.of(context).requestFocus(new FocusNode());
  285 + }
316 }, 286 },
317 // enableInteractiveSelection: false, 287 // enableInteractiveSelection: false,
318 controller: customerMakingProvider.controller, 288 controller: customerMakingProvider.controller,
@@ -293,7 +293,9 @@ class _SellerMyMarketingRecordsDetailPageState @@ -293,7 +293,9 @@ class _SellerMyMarketingRecordsDetailPageState
293 isBold: false, 293 isBold: false,
294 onPressed: () { 294 onPressed: () {
295 NavigatorUtil.goMyMakeMarkingPageOnlyShow( 295 NavigatorUtil.goMyMakeMarkingPageOnlyShow(
296 - context, sellerList); 296 + context,
  297 + sellerList,
  298 + );
297 }, 299 },
298 ) 300 )
299 : SizedBox(), 301 : SizedBox(),
@@ -188,7 +188,12 @@ class _ContactListPageState extends State<ContactListPage> { @@ -188,7 +188,12 @@ class _ContactListPageState extends State<ContactListPage> {
188 Expanded( 188 Expanded(
189 child: GestureDetector( 189 child: GestureDetector(
190 behavior: HitTestBehavior.opaque, 190 behavior: HitTestBehavior.opaque,
191 - onTap: () {}, 191 + onTap: () {
  192 + if (model.gid != null) {
  193 + NavigatorUtil.goCustomerDetailPage(
  194 + context, model, widget.fromPage, model.nickName);
  195 + }
  196 + },
192 child: Column( 197 child: Column(
193 crossAxisAlignment: CrossAxisAlignment.start, 198 crossAxisAlignment: CrossAxisAlignment.start,
194 children: [ 199 children: [
@@ -293,6 +298,7 @@ class _ContactListPageState extends State<ContactListPage> { @@ -293,6 +298,7 @@ class _ContactListPageState extends State<ContactListPage> {
293 ) 298 )
294 ], 299 ],
295 ), 300 ),
  301 + // model.gid == null ||
296 model.nickName == null 302 model.nickName == null
297 ? SizedBox() 303 ? SizedBox()
298 : Container( 304 : Container(
@@ -348,12 +354,7 @@ class _ContactListPageState extends State<ContactListPage> { @@ -348,12 +354,7 @@ class _ContactListPageState extends State<ContactListPage> {
348 itemBuilder: (BuildContext context, int index) { 354 itemBuilder: (BuildContext context, int index) {
349 // if (index == 0) return _buildHeader(); 355 // if (index == 0) return _buildHeader();
350 CustomerBySellerSunModel model = widget.contacts[index]; 356 CustomerBySellerSunModel model = widget.contacts[index];
351 - return InkWell(  
352 - onTap: () {  
353 - NavigatorUtil.goCustomerDetailPage(context, model, widget.fromPage);  
354 - },  
355 - child: _buildListItem(model, index),  
356 - ); 357 + return _buildListItem(model, index);
357 }, 358 },
358 physics: BouncingScrollPhysics(), 359 physics: BouncingScrollPhysics(),
359 indexBarData: SuspensionUtil.getTagIndexList(widget.contacts), 360 indexBarData: SuspensionUtil.getTagIndexList(widget.contacts),
@@ -21,8 +21,10 @@ import 'package:provider/provider.dart'; @@ -21,8 +21,10 @@ import 'package:provider/provider.dart';
21 class CustomerDetailPage extends StatefulWidget { 21 class CustomerDetailPage extends StatefulWidget {
22 final CustomerBySellerSunModel userHistoryEntity; 22 final CustomerBySellerSunModel userHistoryEntity;
23 final FromPage fromPage; 23 final FromPage fromPage;
  24 + final String nickName;
24 25
25 - CustomerDetailPage({Key key, this.userHistoryEntity, this.fromPage}) 26 + CustomerDetailPage(
  27 + {Key key, this.userHistoryEntity, this.fromPage, this.nickName})
26 : super(key: key); 28 : super(key: key);
27 29
28 @override 30 @override
@@ -53,7 +55,7 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { @@ -53,7 +55,7 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
53 55
54 _getGuestInfo() async { 56 _getGuestInfo() async {
55 Map<String, String> params = { 57 Map<String, String> params = {
56 - // "id": widget.userHistoryEntity.id, 58 + "id": widget.userHistoryEntity.gid,
57 'phone': widget.userHistoryEntity.phone 59 'phone': widget.userHistoryEntity.phone
58 }; 60 };
59 await customerProvider.getGuestInfo(context, params); 61 await customerProvider.getGuestInfo(context, params);
@@ -141,10 +143,12 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { @@ -141,10 +143,12 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
141 ], 143 ],
142 ), 144 ),
143 Container( 145 Container(
144 - padding: EdgeInsets.only(  
145 - top: ScreenUtil().setWidth(40),  
146 - left: ScreenUtil().setWidth(10),  
147 - right: ScreenUtil().setWidth(10)), 146 + margin: EdgeInsets.only(
  147 + top: ScreenUtil().setWidth(40),
  148 + ),
  149 + padding: EdgeInsets.symmetric(
  150 + horizontal: ScreenUtil().setWidth(10),
  151 + vertical: ScreenUtil().setWidth(4)),
148 decoration: BoxDecoration( 152 decoration: BoxDecoration(
149 border: Border.all( 153 border: Border.all(
150 color: MyColours.color_199095, 154 color: MyColours.color_199095,
@@ -155,7 +159,7 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { @@ -155,7 +159,7 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
155 // widget.userHistoryEntity.rnameStr == '' 159 // widget.userHistoryEntity.rnameStr == ''
156 // ? '未指派经理' 160 // ? '未指派经理'
157 // : widget.userHistoryEntity.rnameStr, 161 // : widget.userHistoryEntity.rnameStr,
158 - 'xxx经理', 162 + '${widget.nickName}经理',
159 style: TextStyle( 163 style: TextStyle(
160 color: MyColours.color_333333, 164 color: MyColours.color_333333,
161 fontSize: ScreenUtil().setSp(26)), 165 fontSize: ScreenUtil().setSp(26)),
@@ -501,11 +505,11 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> { @@ -501,11 +505,11 @@ class _CustomerDetailPageState extends State<CustomerDetailPage> {
501 fontSize: 26, 505 fontSize: 26,
502 isBold: false, 506 isBold: false,
503 onPressed: () { 507 onPressed: () {
504 - // NavigatorUtil.goFestivalEditPage(  
505 - // context,  
506 - // customerProvider.guestInfoSunModel.guest,  
507 - // widget.userHistoryEntity.id,  
508 - // widget.userHistoryEntity.phone); 508 + NavigatorUtil.goFestivalEditPage(
  509 + context,
  510 + customerProvider.guestInfoSunModel.guest,
  511 + widget.userHistoryEntity.gid,
  512 + widget.userHistoryEntity.phone);
509 }, 513 },
510 ), 514 ),
511 ], 515 ],
@@ -34,8 +34,9 @@ typedef ClickCallState = void Function(StateSetter state); @@ -34,8 +34,9 @@ typedef ClickCallState = void Function(StateSetter state);
34 class CustomerListPage extends StatefulWidget { 34 class CustomerListPage extends StatefulWidget {
35 final FromPage fromPage; 35 final FromPage fromPage;
36 final String index; 36 final String index;
  37 + final String uidStr;
37 38
38 - const CustomerListPage({Key key, this.fromPage, this.index}) 39 + const CustomerListPage({Key key, this.fromPage, this.index, this.uidStr})
39 : super(key: key); 40 : super(key: key);
40 @override 41 @override
41 _CustomerListPageState createState() => _CustomerListPageState(); 42 _CustomerListPageState createState() => _CustomerListPageState();
@@ -136,7 +137,12 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -136,7 +137,12 @@ class _CustomerListPageState extends State<CustomerListPage>
136 FilterBtnModel model = FilterBtnModel(); 137 FilterBtnModel model = FilterBtnModel();
137 model.id = item.uid; 138 model.id = item.uid;
138 model.title = item.nickName; 139 model.title = item.nickName;
139 - model.select = false; 140 + if (widget.uidStr == model.id) {
  141 + model.select = true;
  142 + } else {
  143 + model.select = false;
  144 + }
  145 +
140 customerProvider.filterManageList.add(model); 146 customerProvider.filterManageList.add(model);
141 } 147 }
142 } 148 }
@@ -207,17 +213,22 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -207,17 +213,22 @@ class _CustomerListPageState extends State<CustomerListPage>
207 // 213 //
208 // 214 //
209 // params['uid'] 经理ID 215 // params['uid'] 经理ID
210 - String uid = '';  
211 - for (FilterBtnModel item in customerProvider.filterManageList) {  
212 - if (item.select) {  
213 - uid += '${item.id},'; 216 +
  217 + if (first && widget.uidStr != null && widget.uidStr != '') {
  218 + params['uid'] = widget.uidStr;
  219 + } else {
  220 + String uid = '';
  221 + for (FilterBtnModel item in customerProvider.filterManageList) {
  222 + if (item.select) {
  223 + uid += '${item.id},';
  224 + }
214 } 225 }
215 - }  
216 - if (uid.length > 0) {  
217 - if (uid.endsWith(',')) {  
218 - uid = uid.substring(0, uid.length - 1); 226 + if (uid.length > 0) {
  227 + if (uid.endsWith(',')) {
  228 + uid = uid.substring(0, uid.length - 1);
  229 + }
  230 + params['uid'] = uid;
219 } 231 }
220 - params['uid'] = uid;  
221 } 232 }
222 233
223 if (customerProvider.controllerstime.text.trim().length > 0) { 234 if (customerProvider.controllerstime.text.trim().length > 0) {
@@ -232,6 +243,13 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -232,6 +243,13 @@ class _CustomerListPageState extends State<CustomerListPage>
232 } 243 }
233 244
234 await customerProvider.getCustomerBySeller(context, params); 245 await customerProvider.getCustomerBySeller(context, params);
  246 + // if (customerProvider.customerBySellerList.length ==
  247 + // customerProvider.selectCustomerSeller.length) {
  248 + // customerProvider.checkValue = true;
  249 + // } else {
  250 + // customerProvider.checkValue = false;
  251 + // }
  252 + // if (first || customerProvider.checkValue) {
235 if (first) { 253 if (first) {
236 customerProvider.addAll(); 254 customerProvider.addAll();
237 } 255 }
@@ -114,6 +114,8 @@ class _FestivalEditPageState extends State<FestivalEditPage> { @@ -114,6 +114,8 @@ class _FestivalEditPageState extends State<FestivalEditPage> {
114 String dayStr = ''; 114 String dayStr = '';
115 bool gongli = true; 115 bool gongli = true;
116 String content = str.substring(0, str.indexOf(':')); 116 String content = str.substring(0, str.indexOf(':'));
  117 +
  118 + str = str.substring(content.length);
117 if (str.contains('年')) { 119 if (str.contains('年')) {
118 yearStr = str.substring( 120 yearStr = str.substring(
119 str.indexOf(':') + 1, str.indexOf('年')); 121 str.indexOf(':') + 1, str.indexOf('年'));
@@ -15,6 +15,7 @@ import 'package:one_key/provider/user_model.dart'; @@ -15,6 +15,7 @@ import 'package:one_key/provider/user_model.dart';
15 import 'package:one_key/res/colors.dart'; 15 import 'package:one_key/res/colors.dart';
16 import 'package:one_key/route/navigator_util.dart'; 16 import 'package:one_key/route/navigator_util.dart';
17 import 'package:one_key/utils/dialog_util.dart'; 17 import 'package:one_key/utils/dialog_util.dart';
  18 +import 'package:one_key/utils/event_bus.dart';
18 import 'package:one_key/utils/utils.dart'; 19 import 'package:one_key/utils/utils.dart';
19 import 'package:one_key/widgets/h_empty_view.dart'; 20 import 'package:one_key/widgets/h_empty_view.dart';
20 import 'package:one_key/widgets/round_button.dart'; 21 import 'package:one_key/widgets/round_button.dart';
@@ -49,8 +50,6 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> { @@ -49,8 +50,6 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> {
49 CustomerMakingProvider customerMakingProvider; 50 CustomerMakingProvider customerMakingProvider;
50 bool needClear = true; 51 bool needClear = true;
51 String gid = ''; 52 String gid = '';
52 - String andriodPhone = '';  
53 - List<String> iosPhone = [];  
54 53
55 @override 54 @override
56 void initState() { 55 void initState() {
@@ -69,23 +68,17 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> { @@ -69,23 +68,17 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> {
69 } 68 }
70 }); 69 });
71 WidgetsBinding.instance.addPostFrameCallback((_) async { 70 WidgetsBinding.instance.addPostFrameCallback((_) async {
72 - for (CustomerBySellerSunModel item in customerMakingProvider.selectCustomerSeller) {  
73 - gid += '${item.gid},';  
74 - if (Platform.isIOS) {  
75 - iosPhone.add(item.phone);  
76 - } else {  
77 - andriodPhone += "${item.phone};";  
78 - }  
79 - }  
80 - if (gid.endsWith(',')) {  
81 - gid = gid.substring(0, gid.length - 1);  
82 - }  
83 - if (!Platform.isIOS && andriodPhone.endsWith(';')) {  
84 - andriodPhone = andriodPhone.substring(0, andriodPhone.length - 1);  
85 - }  
86 _couponNetworkData(isShowLoading: false); 71 _couponNetworkData(isShowLoading: false);
87 if (widget.fromPage == FromPage.FromPageMakeRecordDetail) { 72 if (widget.fromPage == FromPage.FromPageMakeRecordDetail) {
88 _getGuestByGid(); 73 _getGuestByGid();
  74 + } else {
  75 + for (CustomerBySellerSunModel item
  76 + in customerMakingProvider.selectCustomerSeller) {
  77 + gid += '${item.gid},';
  78 + }
  79 + if (gid.endsWith(',')) {
  80 + gid = gid.substring(0, gid.length - 1);
  81 + }
89 } 82 }
90 }); 83 });
91 } 84 }
@@ -105,13 +98,15 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> { @@ -105,13 +98,15 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> {
105 Map<String, String> params = { 98 Map<String, String> params = {
106 "gid": widget.marketingByIdSunModel.gid, 99 "gid": widget.marketingByIdSunModel.gid,
107 }; 100 };
108 - await customerProvider.getGuestByGid( 101 + await customerProvider.getSellerGuestByGid(
109 context, 102 context,
110 params, 103 params,
111 ); 104 );
112 print('''object'''); 105 print('''object''');
  106 + gid = widget.marketingByIdSunModel.gid;
113 customerMakingProvider.labels = customerProvider.labels; 107 customerMakingProvider.labels = customerProvider.labels;
114 - customerMakingProvider.selectCustomerSeller = customerProvider.selectCustomerSeller; 108 + customerMakingProvider.selectCustomerSeller =
  109 + customerProvider.selectCustomerSeller;
115 // customerMakingProvider.fromPage = widget.fromPage; 110 // customerMakingProvider.fromPage = widget.fromPage;
116 customerMakingProvider.controller.text = 111 customerMakingProvider.controller.text =
117 widget.marketingByIdSunModel.content; 112 widget.marketingByIdSunModel.content;
@@ -164,27 +159,9 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> { @@ -164,27 +159,9 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> {
164 } 159 }
165 } 160 }
166 161
167 - _createMarketing() async {  
168 - if (customerMakingProvider.controller.text.trim().length == 0) {  
169 - Utils.showToast('请输入营销内容');  
170 - return;  
171 - }  
172 - Map<String, String> params = {  
173 - "uid": Provider.of<UserModel>(context, listen: false).user.openid,  
174 - "gid": gid,  
175 - "content": customerMakingProvider.controller.text  
176 - };  
177 - if (customerMakingProvider.youhui != '选择优惠' &&  
178 - customerMakingProvider.isUse) {  
179 - params['aid'] =  
180 - '${customerProvider.couponListSelect[customerMakingProvider.couponSelectIndex].id}';  
181 - }  
182 - await customerProvider.createMarketing(context, params, showLoading: true);  
183 - _goSms();  
184 - }  
185 -  
186 /// 商家创建营销 162 /// 商家创建营销
187 _createMarketingBySeller() async { 163 _createMarketingBySeller() async {
  164 + FocusScope.of(context).requestFocus(FocusNode());
188 if (customerMakingProvider.controller.text.trim().length == 0) { 165 if (customerMakingProvider.controller.text.trim().length == 0) {
189 Utils.showToast('请输入营销内容'); 166 Utils.showToast('请输入营销内容');
190 return; 167 return;
@@ -212,43 +189,16 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> { @@ -212,43 +189,16 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> {
212 } 189 }
213 params['edate'] = customerMakingProvider.edate; 190 params['edate'] = customerMakingProvider.edate;
214 } 191 }
  192 + print(params);
215 193
216 - await customerProvider.createMarketingBySeller(context, params,  
217 - showLoading: true);  
218 - _goSms();  
219 - }  
220 -  
221 - _goSms() async {  
222 - // DialogUtil.cupertinoAlertDialog(context,  
223 - // title: '确认发送', content: '是否确定为当前所选顾客发送该优惠券', lCallback: () {  
224 - // print('取消发送');  
225 - // }, rCallback: () async {  
226 - if (Platform.isIOS) {  
227 - // List<String> phoneNumber = ['18161963378', '18729572142', '18765432345'];  
228 - String message = "test";  
229 - try {  
230 - String _result = await sendSMS(message: message, recipients: iosPhone);  
231 - print(_result);  
232 - } catch (error) {  
233 - print(error.toString()); 194 + bool success = await customerProvider
  195 + .createMarketingBySeller(context, params, showLoading: true);
  196 + if (success) {
  197 + if (widget.fromPage == FromPage.FromPageMakeRecordDetail) {
  198 + bus.emit('refresh_store_marking_records_page');
234 } 199 }
235 - } else {  
236 - print('确定发送');  
237 - // String phoneNumber = "18161963378;18729572142";  
238 - String message = "test";  
239 -  
240 - // await Sendsms.onGetPermission();  
241 -  
242 - // if (await Sendsms.hasPermission()) {  
243 - await Sendsms.onSendSMS(andriodPhone, message); 200 + Utils.showToast("下发任务成功");
244 } 201 }
245 -  
246 - // }  
247 - // SmsModel smsModel = new SmsModel();  
248 - // // String sms = await smsModel.getSmsContent(context, params);  
249 - // String phoneNumber = "";  
250 - // await Sendsms.onSendSMS(phoneNumber, '短信内容');  
251 - // });  
252 } 202 }
253 203
254 _buttonChoose(String title, ClickCallback callback) { 204 _buttonChoose(String title, ClickCallback callback) {
@@ -603,12 +553,43 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> { @@ -603,12 +553,43 @@ class _MakeMarkingPageState extends State<MakeMarkingPage> {
603 )), 553 )),
604 HEmptyView(10), 554 HEmptyView(10),
605 InkWell( 555 InkWell(
606 - onTap: () { 556 + onTap: () async {
607 needClear = false; 557 needClear = false;
608 if (widget.fromPage == 558 if (widget.fromPage ==
609 FromPage.FromPageMakeRecordDetail) { 559 FromPage.FromPageMakeRecordDetail) {
610 - NavigatorUtil.goCustomerListPage(  
611 - context, FromPage.FromPageMakeRecord); 560 + customerMakingProvider.selectCustomerSeller =
  561 + customerProvider.selectCustomerSeller;
  562 +
  563 + await NavigatorUtil.goCustomerListPage(
  564 + context, FromPage.FromPageMakeRecord, '');
  565 +
  566 + // Map temp =
  567 +
  568 + customerProvider.labels =
  569 + customerMakingProvider.labels;
  570 + customerProvider.selectCustomerSeller =
  571 + customerMakingProvider.selectCustomerSeller;
  572 + gid = '';
  573 + for (CustomerBySellerSunModel item
  574 + in customerMakingProvider
  575 + .selectCustomerSeller) {
  576 + gid += '${item.gid},';
  577 + }
  578 + if (gid.endsWith(',')) {
  579 + gid = gid.substring(0, gid.length - 1);
  580 + }
  581 +
  582 + // {
  583 + // 'labels': customerProvider.labels,
  584 + // 'selectCustomer': customerProvider.selectCustomer
  585 + // };
  586 + // customerProvider.labels = temp['labels'];
  587 + // customerProvider.selectCustomer =
  588 + // temp['selectCustomer'];
  589 + // customerMakingProvider.labels = temp['labels'];
  590 + // customerMakingProvider.selectCustomer =
  591 + // temp['selectCustomer'];
  592 + setState(() {});
612 } else { 593 } else {
613 Navigator.pop(context); 594 Navigator.pop(context);
614 } 595 }
@@ -365,6 +365,9 @@ class _MarketingRecordsDetailPageState @@ -365,6 +365,9 @@ class _MarketingRecordsDetailPageState
365 horizontal: ScreenUtil().setWidth(200)), 365 horizontal: ScreenUtil().setWidth(200)),
366 isBold: false, 366 isBold: false,
367 onPressed: () { 367 onPressed: () {
  368 + // NavigatorUtil.goMyMakeMarkingPage(context,
  369 + // selfList: widget.selfList,
  370 + // fromPage: FromPage.FromPageMakeRecordDetail);
368 NavigatorUtil.goMakeMarkingPage(context, 371 NavigatorUtil.goMakeMarkingPage(context,
369 marketingByIdSunModel: 372 marketingByIdSunModel:
370 model.marketingByIdSunModel, 373 model.marketingByIdSunModel,
@@ -74,7 +74,8 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> { @@ -74,7 +74,8 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> {
74 } 74 }
75 75
76 ///活跃客户、沉睡客户、流失客户 76 ///活跃客户、沉睡客户、流失客户
77 - Widget _percentWidget(String pnum, String btnTitle, String percent) { 77 + Widget _percentWidget(String pnum, String btnTitle, String percent,
  78 + {String uid = ''}) {
78 return Container( 79 return Container(
79 color: MyColours.color_ffffff, 80 color: MyColours.color_ffffff,
80 // height: ScreenUtil().setWidth(230), 81 // height: ScreenUtil().setWidth(230),
@@ -102,6 +103,7 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> { @@ -102,6 +103,7 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> {
102 RoundButton( 103 RoundButton(
103 onPressed: () async { 104 onPressed: () async {
104 String index = '0'; 105 String index = '0';
  106 +
105 if (btnTitle == '活跃客户') { 107 if (btnTitle == '活跃客户') {
106 index = '1'; 108 index = '1';
107 } else if (btnTitle == '沉睡客户') { 109 } else if (btnTitle == '沉睡客户') {
@@ -109,7 +111,8 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> { @@ -109,7 +111,8 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> {
109 } else if (btnTitle == '流失客户') { 111 } else if (btnTitle == '流失客户') {
110 index = '3'; 112 index = '3';
111 } 113 }
112 - NavigatorUtil.goCustomerListPage(context, FromPage.FromPageHome, 114 + NavigatorUtil.goCustomerListPage(
  115 + context, FromPage.FromPageHome, uid,
113 index: index); 116 index: index);
114 }, 117 },
115 text: btnTitle, 118 text: btnTitle,
@@ -199,7 +202,7 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> { @@ -199,7 +202,7 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> {
199 RoundButton( 202 RoundButton(
200 onPressed: () async { 203 onPressed: () async {
201 NavigatorUtil.goCustomerListPage( 204 NavigatorUtil.goCustomerListPage(
202 - context, FromPage.FromPageHome); 205 + context, FromPage.FromPageHome, '');
203 }, 206 },
204 text: '全店客户', 207 text: '全店客户',
205 fontSize: 24, 208 fontSize: 24,
@@ -300,7 +303,9 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> { @@ -300,7 +303,9 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> {
300 return _percentWidget( 303 return _percentWidget(
301 '${customerProvider.storeSunmodel.sellerUser[index - 1].count}', 304 '${customerProvider.storeSunmodel.sellerUser[index - 1].count}',
302 '${customerProvider.storeSunmodel.sellerUser[index - 1].nickName}经理', 305 '${customerProvider.storeSunmodel.sellerUser[index - 1].nickName}经理',
303 - null); 306 + null,
  307 + uid: customerProvider
  308 + .storeSunmodel.sellerUser[index - 1].uid);
304 }) 309 })
305 ], 310 ],
306 ), 311 ),
@@ -990,8 +990,13 @@ class CustomerProvider extends ChangeNotifier { @@ -990,8 +990,13 @@ class CustomerProvider extends ChangeNotifier {
990 notifyListeners(); 990 notifyListeners();
991 }); 991 });
992 if (baseResp != null && baseResp.code == Constant.status_success) { 992 if (baseResp != null && baseResp.code == Constant.status_success) {
993 - pageStateMarketingRecordMy = PageState.Success;  
994 myRecordData = MarketingByUidModel.fromJson(baseResp.responseData).data; 993 myRecordData = MarketingByUidModel.fromJson(baseResp.responseData).data;
  994 + if (myRecordData.selfList.length == 0 &&
  995 + myRecordData.sellerList.length == 0) {
  996 + pageStateMarketingRecordMy = PageState.Empty;
  997 + } else {
  998 + pageStateMarketingRecordMy = PageState.Success;
  999 + }
995 notifyListeners(); 1000 notifyListeners();
996 } else { 1001 } else {
997 if (baseResp != null) { 1002 if (baseResp != null) {
@@ -1067,6 +1072,67 @@ class CustomerProvider extends ChangeNotifier { @@ -1067,6 +1072,67 @@ class CustomerProvider extends ChangeNotifier {
1067 return storeSunmodel; 1072 return storeSunmodel;
1068 } 1073 }
1069 1074
  1075 + //商家营销中的用户列表
  1076 + getSellerGuestByGid(BuildContext context, Map<String, String> params) async {
  1077 + BaseResp<List> baseResp = await DioUtil()
  1078 + .request<List>(context, Method.get, HttpUrl.get_guest_by_gid,
  1079 + data: params, showLoading: false)
  1080 + .catchError((error) {
  1081 + print(error.toString());
  1082 + if (error is MyError) {
  1083 + switch (error.type) {
  1084 + case 1:
  1085 + pageStateListShow = PageState.ConnectivityError;
  1086 + break;
  1087 + case 2:
  1088 + pageStateListShow = PageState.ConnectivityTimeOut;
  1089 + break;
  1090 + default:
  1091 + pageStateListShow = PageState.ConnectivityError;
  1092 + break;
  1093 + }
  1094 + }
  1095 + notifyListeners();
  1096 + });
  1097 +
  1098 + if (baseResp != null && baseResp.code == Constant.status_success) {
  1099 + List<CustomerBySellerSunModel> user =
  1100 + baseResp.data.map<CustomerBySellerSunModel>((value) {
  1101 + return CustomerBySellerSunModel.fromJson(value);
  1102 + }).toList();
  1103 + if (user.length == 0) {
  1104 + pageStateListShow = PageState.Empty;
  1105 + } else {
  1106 + for (int i = 0; i < user.length; i++) {
  1107 + CustomerBySellerSunModel item = user[i];
  1108 + item.select = true;
  1109 + if (item.rname != null) {
  1110 + item.pinyin =
  1111 + PinyinHelper.getPinyin(item.rname).replaceAll(' ', '');
  1112 + }
  1113 +
  1114 + user[i] = item;
  1115 + }
  1116 + selectCustomerSeller = user; //全部客户列表信息
  1117 + List<String> tempLabel = [];
  1118 + for (CustomerBySellerSunModel item in selectCustomerSeller) {
  1119 + if (item.select && item.attr != null) {
  1120 + tempLabel.add(item.attr);
  1121 + }
  1122 + }
  1123 + tempLabel = tempLabel.toSet().toList();
  1124 + labels = Utils.listToStringEnglish(tempLabel);
  1125 + pageStateListShow = PageState.Success;
  1126 + }
  1127 + } else {
  1128 + if (baseResp != null) {
  1129 + Utils.showToast(baseResp.msg ?? "");
  1130 + }
  1131 + pageStateGuestInfo = PageState.ConnectivityTimeOut;
  1132 + }
  1133 + notifyListeners();
  1134 + }
  1135 +
1070 //全选按钮执行“全选” 1136 //全选按钮执行“全选”
1071 addAll() async { 1137 addAll() async {
1072 //把数据状态全部改成true,即选中状态 1138 //把数据状态全部改成true,即选中状态
@@ -1115,7 +1181,7 @@ class CustomerProvider extends ChangeNotifier { @@ -1115,7 +1181,7 @@ class CustomerProvider extends ChangeNotifier {
1115 addData(int index) { 1181 addData(int index) {
1116 // userHistorys[index].select = true; 1182 // userHistorys[index].select = true;
1117 selectCustomerSeller.add(customerBySellerList[index]); 1183 selectCustomerSeller.add(customerBySellerList[index]);
1118 - labelsValueMy(); 1184 + labelsValue();
1119 notifyListeners(); 1185 notifyListeners();
1120 } 1186 }
1121 1187
@@ -1124,7 +1190,7 @@ class CustomerProvider extends ChangeNotifier { @@ -1124,7 +1190,7 @@ class CustomerProvider extends ChangeNotifier {
1124 userHistorys[index].select = false; 1190 userHistorys[index].select = false;
1125 selectCustomerSeller.removeWhere( 1191 selectCustomerSeller.removeWhere(
1126 (element) => element.gid == customerBySellerList[index].gid); 1192 (element) => element.gid == customerBySellerList[index].gid);
1127 - labelsValueMy(); 1193 + labelsValue();
1128 notifyListeners(); 1194 notifyListeners();
1129 } 1195 }
1130 1196
@@ -1170,6 +1236,33 @@ class CustomerProvider extends ChangeNotifier { @@ -1170,6 +1236,33 @@ class CustomerProvider extends ChangeNotifier {
1170 pageState = PageState.Empty; 1236 pageState = PageState.Empty;
1171 } else { 1237 } else {
1172 pageState = PageState.Success; 1238 pageState = PageState.Success;
  1239 + List<String> idList = [];
  1240 + for (int i = 0; i < customerBySellerList.length; i++) {
  1241 + CustomerBySellerSunModel item = customerBySellerList[i];
  1242 + idList.add(item.gid);
  1243 + for (CustomerBySellerSunModel value in selectCustomerSeller) {
  1244 + if (value.gid == item.gid) {
  1245 + item.select = true; //原来选中的继续保持选中
  1246 + }
  1247 + }
  1248 + if (item.rname != null) {
  1249 + item.pinyin =
  1250 + PinyinHelper.getPinyin(item.rname).replaceAll(' ', '');
  1251 + }
  1252 +
  1253 + customerBySellerList[i] = item;
  1254 + }
  1255 + // 把选中的列表,剔除掉现在结果里没有的
  1256 + List<CustomerBySellerSunModel> temp = [];
  1257 + for (CustomerBySellerSunModel value in selectCustomerSeller) {
  1258 + if (idList.contains(value.gid)) {
  1259 + temp.add(value);
  1260 + }
  1261 + }
  1262 + selectCustomerSeller = temp; //把选中的列表,剔除掉现在结果里没有的
  1263 + getCheckValue();
  1264 + //对于以前有选中的数据,接口请求后,继续赋值
  1265 +
1173 for (int i = 0; i < customerBySellerList.length; i++) { 1266 for (int i = 0; i < customerBySellerList.length; i++) {
1174 CustomerBySellerSunModel item = customerBySellerList[i]; 1267 CustomerBySellerSunModel item = customerBySellerList[i];
1175 // item.pinyinFirst = ''; 1268 // item.pinyinFirst = '';
@@ -1196,34 +1289,6 @@ class CustomerProvider extends ChangeNotifier { @@ -1196,34 +1289,6 @@ class CustomerProvider extends ChangeNotifier {
1196 1289
1197 customerBySellerList[i] = item; 1290 customerBySellerList[i] = item;
1198 } 1291 }
1199 - // userHistorysShow = userHistorys; //全部客户列表信息  
1200 - // userHistorysShowHuoyue = [];  
1201 - // userHistorysShowChenshui = [];  
1202 - // userHistorysShowLiushi = [];  
1203 - // for (CustomerListSunModel item in userHistorysShow) {  
1204 - // if (item.attr == '活跃') {  
1205 - // userHistorysShowHuoyue.add(item);  
1206 - // } else if (item.attr == '沉睡') {  
1207 - // userHistorysShowChenshui.add(item);  
1208 - // } else if (item.attr == '流失') {  
1209 - // userHistorysShowLiushi.add(item);  
1210 - // }  
1211 - // }  
1212 - // if (userHistorysShowHuoyue.length > 0) {  
1213 - // pageStateHuoyue = PageState.Success;  
1214 - // } else {  
1215 - // pageStateHuoyue = PageState.Empty;  
1216 - // }  
1217 - // if (userHistorysShowChenshui.length > 0) {  
1218 - // pageStateChenshui = PageState.Success;  
1219 - // } else {  
1220 - // pageStateChenshui = PageState.Empty;  
1221 - // }  
1222 - // if (userHistorysShowLiushi.length > 0) {  
1223 - // pageStateLiushi = PageState.Success;  
1224 - // } else {  
1225 - // pageStateLiushi = PageState.Empty;  
1226 - // }  
1227 1292
1228 handleList(customerBySellerList, needRefresh: true); 1293 handleList(customerBySellerList, needRefresh: true);
1229 } 1294 }
@@ -1440,7 +1505,8 @@ class CustomerProvider extends ChangeNotifier { @@ -1440,7 +1505,8 @@ class CustomerProvider extends ChangeNotifier {
1440 } 1505 }
1441 1506
1442 // 商家创建营销 1507 // 商家创建营销
1443 - createMarketingBySeller(BuildContext context, Map<String, String> params, 1508 + Future<bool> createMarketingBySeller(
  1509 + BuildContext context, Map<String, String> params,
1444 {bool showLoading = false}) async { 1510 {bool showLoading = false}) async {
1445 BaseResp<dynamic> baseResp = await DioUtil() 1511 BaseResp<dynamic> baseResp = await DioUtil()
1446 .request<dynamic>( 1512 .request<dynamic>(
@@ -1454,13 +1520,17 @@ class CustomerProvider extends ChangeNotifier { @@ -1454,13 +1520,17 @@ class CustomerProvider extends ChangeNotifier {
1454 if (baseResp != null && baseResp.code == Constant.status_success) { 1520 if (baseResp != null && baseResp.code == Constant.status_success) {
1455 // guestReserveSunModel = 1521 // guestReserveSunModel =
1456 // GuestReserveModel.fromJson(baseResp.responseData).data; 1522 // GuestReserveModel.fromJson(baseResp.responseData).data;
1457 - notifyListeners(); 1523 + if (baseResp.data != null &&
  1524 + baseResp.data['id'] != '' &&
  1525 + baseResp.data['id'] != null) {
  1526 + return true;
  1527 + }
1458 } else { 1528 } else {
1459 if (baseResp != null) { 1529 if (baseResp != null) {
1460 Utils.showToast(baseResp.msg ?? ""); 1530 Utils.showToast(baseResp.msg ?? "");
1461 } 1531 }
1462 } 1532 }
1463 - notifyListeners(); 1533 + return false;
1464 } 1534 }
1465 1535
1466 // 商家营销列表 1536 // 商家营销列表
@@ -1488,9 +1558,13 @@ class CustomerProvider extends ChangeNotifier { @@ -1488,9 +1558,13 @@ class CustomerProvider extends ChangeNotifier {
1488 notifyListeners(); 1558 notifyListeners();
1489 }); 1559 });
1490 if (baseResp != null && baseResp.code == Constant.status_success) { 1560 if (baseResp != null && baseResp.code == Constant.status_success) {
1491 - pageStateMarketingRecord = PageState.Success;  
1492 marketingBySellerSunModel = 1561 marketingBySellerSunModel =
1493 MarketingBySellerModel.fromJson(baseResp.responseData).data; 1562 MarketingBySellerModel.fromJson(baseResp.responseData).data;
  1563 + if (marketingBySellerSunModel.length == 0) {
  1564 + pageStateMarketingRecord = PageState.Empty;
  1565 + } else {
  1566 + pageStateMarketingRecord = PageState.Success;
  1567 + }
1494 notifyListeners(); 1568 notifyListeners();
1495 } else { 1569 } else {
1496 if (baseResp != null) { 1570 if (baseResp != null) {
@@ -541,10 +541,10 @@ class NavigatorUtil { @@ -541,10 +541,10 @@ class NavigatorUtil {
541 541
542 /// 客情列表 542 /// 客情列表
543 static Future<dynamic> goCustomerListPage( 543 static Future<dynamic> goCustomerListPage(
544 - BuildContext context, FromPage fromPage, 544 + BuildContext context, FromPage fromPage, String uid,
545 {replace = false, bool needBtn = false, String index = '0'}) { 545 {replace = false, bool needBtn = false, String index = '0'}) {
546 return _navigateTo(context, 546 return _navigateTo(context,
547 - "${Routes.customer_list_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}&index=$index", 547 + "${Routes.customer_list_page}?fromPage=${FluroConvertUtils.enumToString(fromPage)}&index=$index&uid=$uid",
548 replace: replace); 548 replace: replace);
549 } 549 }
550 550
@@ -598,11 +598,12 @@ class NavigatorUtil { @@ -598,11 +598,12 @@ class NavigatorUtil {
598 static Future<dynamic> goCustomerDetailPage( 598 static Future<dynamic> goCustomerDetailPage(
599 BuildContext context, 599 BuildContext context,
600 CustomerBySellerSunModel userHistoryEntity, 600 CustomerBySellerSunModel userHistoryEntity,
601 - FromPage fromPage, { 601 + FromPage fromPage,
  602 + String nickName, {
602 replace = false, 603 replace = false,
603 }) { 604 }) {
604 return _navigateTo(context, 605 return _navigateTo(context,
605 - "${Routes.customer_detail_page}?userHistoryEntity=${FluroConvertUtils.object2string(userHistoryEntity)}&fromPage=${FluroConvertUtils.enumToString(fromPage)}", 606 + "${Routes.customer_detail_page}?userHistoryEntity=${FluroConvertUtils.object2string(userHistoryEntity)}&fromPage=${FluroConvertUtils.enumToString(fromPage)}&nickName=${Uri.encodeComponent(nickName)}",
606 replace: replace); 607 replace: replace);
607 } 608 }
608 609
@@ -689,9 +690,10 @@ class NavigatorUtil { @@ -689,9 +690,10 @@ class NavigatorUtil {
689 replace = false, 690 replace = false,
690 SelfList selfList, 691 SelfList selfList,
691 FromPage fromPage, 692 FromPage fromPage,
  693 + String homeGid = '',
692 }) { 694 }) {
693 return _navigateTo(context, 695 return _navigateTo(context,
694 - "${Routes.my_make_marketing_page}?selfList=${FluroConvertUtils.object2string(selfList)}&fromPage=${FluroConvertUtils.enumToString(fromPage)}", 696 + "${Routes.my_make_marketing_page}?selfList=${FluroConvertUtils.object2string(selfList)}&fromPage=${FluroConvertUtils.enumToString(fromPage)}&homeGid=$homeGid",
695 replace: replace); 697 replace: replace);
696 } 698 }
697 699
@@ -877,9 +877,11 @@ var customerListPageHandle = new Handler( @@ -877,9 +877,11 @@ var customerListPageHandle = new Handler(
877 print(fromPage); 877 print(fromPage);
878 String index = params["index"].first; 878 String index = params["index"].first;
879 879
  880 + String uid = params["uid"].first;
  881 +
880 return ChangeNotifierProvider<CustomerProvider>( 882 return ChangeNotifierProvider<CustomerProvider>(
881 create: (_) => CustomerProvider(), 883 create: (_) => CustomerProvider(),
882 - child: CustomerListPage(fromPage: fromPage, index: index)); 884 + child: CustomerListPage(fromPage: fromPage, index: index, uidStr: uid));
883 }); 885 });
884 886
885 ///仅供展示的客情列表 887 ///仅供展示的客情列表
@@ -1007,9 +1009,10 @@ var myMakeMarkingPageHandle = new Handler( @@ -1007,9 +1009,10 @@ var myMakeMarkingPageHandle = new Handler(
1007 child: MyMakeMarkingPage(selfList: selfList, fromPage: fromPage)); 1009 child: MyMakeMarkingPage(selfList: selfList, fromPage: fromPage));
1008 } 1010 }
1009 1011
  1012 + String homeGid = params["homeGid"].first;
1010 return ChangeNotifierProvider<CustomerProvider>( 1013 return ChangeNotifierProvider<CustomerProvider>(
1011 create: (_) => CustomerProvider(), 1014 create: (_) => CustomerProvider(),
1012 - child: MyMakeMarkingPage(fromPage: fromPage)); 1015 + child: MyMakeMarkingPage(fromPage: fromPage, homeGid: homeGid));
1013 }); 1016 });
1014 1017
1015 ///我的创建营销 ---- 完成全店营销 1018 ///我的创建营销 ---- 完成全店营销
@@ -1037,12 +1040,14 @@ var customerDetailPageHandle = new Handler( @@ -1037,12 +1040,14 @@ var customerDetailPageHandle = new Handler(
1037 FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>( 1040 FromPage fromPage = FluroConvertUtils.enumFromString<FromPage>(
1038 FromPage.values, params["fromPage"].first); 1041 FromPage.values, params["fromPage"].first);
1039 print(fromPage); 1042 print(fromPage);
  1043 +
  1044 + String nickName = params["nickName"].first;
1040 return ChangeNotifierProvider<CustomerProvider>( 1045 return ChangeNotifierProvider<CustomerProvider>(
1041 create: (_) => CustomerProvider(), 1046 create: (_) => CustomerProvider(),
1042 child: CustomerDetailPage( 1047 child: CustomerDetailPage(
1043 - userHistoryEntity: userHistoryEntity,  
1044 - fromPage: fromPage,  
1045 - )); 1048 + userHistoryEntity: userHistoryEntity,
  1049 + fromPage: fromPage,
  1050 + nickName: nickName));
1046 }); 1051 });
1047 1052
1048 ///我的客户详情 1053 ///我的客户详情
@@ -2472,6 +2472,8 @@ class DialogUtil { @@ -2472,6 +2472,8 @@ class DialogUtil {
2472 children: [ 2472 children: [
2473 InkWell( 2473 InkWell(
2474 onTap: () { 2474 onTap: () {
  2475 + FocusScope.of(context).requestFocus(
  2476 + FocusNode()); //点击空白处隐藏键盘
2475 if (gongli) { 2477 if (gongli) {
2476 return; 2478 return;
2477 } 2479 }
@@ -2521,6 +2523,8 @@ class DialogUtil { @@ -2521,6 +2523,8 @@ class DialogUtil {
2521 )), 2523 )),
2522 InkWell( 2524 InkWell(
2523 onTap: () { 2525 onTap: () {
  2526 + FocusScope.of(context)
  2527 + .requestFocus(FocusNode()); //点击空白处隐藏键盘
2524 if (!gongli) { 2528 if (!gongli) {
2525 return; 2529 return;
2526 } 2530 }
@@ -2569,6 +2573,8 @@ class DialogUtil { @@ -2569,6 +2573,8 @@ class DialogUtil {
2569 HEmptyView(30), 2573 HEmptyView(30),
2570 InkWell( 2574 InkWell(
2571 onTap: () { 2575 onTap: () {
  2576 + FocusScope.of(context).requestFocus(
  2577 + FocusNode()); //点击空白处隐藏键盘
2572 incrementCounterYear( 2578 incrementCounterYear(
2573 context, 2579 context,
2574 gongli, 2580 gongli,
@@ -2621,6 +2627,8 @@ class DialogUtil { @@ -2621,6 +2627,8 @@ class DialogUtil {
2621 HEmptyView(10), 2627 HEmptyView(10),
2622 InkWell( 2628 InkWell(
2623 onTap: () { 2629 onTap: () {
  2630 + FocusScope.of(context).requestFocus(
  2631 + FocusNode()); //点击空白处隐藏键盘
2624 incrementCounterMonth( 2632 incrementCounterMonth(
2625 context, 2633 context,
2626 gongli, 2634 gongli,
@@ -2695,6 +2703,8 @@ class DialogUtil { @@ -2695,6 +2703,8 @@ class DialogUtil {
2695 HEmptyView(10), 2703 HEmptyView(10),
2696 InkWell( 2704 InkWell(
2697 onTap: () { 2705 onTap: () {
  2706 + FocusScope.of(context).requestFocus(
  2707 + FocusNode()); //点击空白处隐藏键盘
2698 incrementCounterDay( 2708 incrementCounterDay(
2699 context, 2709 context,
2700 gongli, 2710 gongli,
@@ -145,7 +145,6 @@ class Utils { @@ -145,7 +145,6 @@ class Utils {
145 } else { 145 } else {
146 date = datestr; 146 date = datestr;
147 } 147 }
148 - return date;  
149 148
150 // if (delta < 12 * 4 * ONE_WEEK) { 149 // if (delta < 12 * 4 * ONE_WEEK) {
151 // num months = toMonths(delta); 150 // num months = toMonths(delta);
@@ -155,6 +154,7 @@ class Utils { @@ -155,6 +154,7 @@ class Utils {
155 // return (years <= 0 ? 1 : years).toInt().toString() + ONE_YEAR_AGO; 154 // return (years <= 0 ? 1 : years).toInt().toString() + ONE_YEAR_AGO;
156 // } 155 // }
157 } 156 }
  157 + return date;
158 } 158 }
159 159
160 static num toSeconds(num date) { 160 static num toSeconds(num date) {
@@ -1224,6 +1224,22 @@ class Utils { @@ -1224,6 +1224,22 @@ class Utils {
1224 return result.toString(); 1224 return result.toString();
1225 } 1225 }
1226 1226
  1227 +
  1228 + static String listToStringEnglish1(List<dynamic> list) {
  1229 + if (list == null) {
  1230 + return null;
  1231 + }
  1232 + String result;
  1233 + list.forEach((string) {
  1234 + if (result == null) {
  1235 + result = string;
  1236 + } else {
  1237 + result = '$result,$string';
  1238 + }
  1239 + });
  1240 + return result.toString();
  1241 + }
  1242 +
1227 static String listToStringEnglish(List<String> list) { 1243 static String listToStringEnglish(List<String> list) {
1228 if (list == null) { 1244 if (list == null) {
1229 return null; 1245 return null;