Commit a574b1fa3dabee733fce7892305447a09ad6c440

Authored by wdn127929
1 parent 31765f5a

0、1、2、3、7提醒

@@ -54,8 +54,9 @@ class SellerVersionSunModel { @@ -54,8 +54,9 @@ class SellerVersionSunModel {
54 vtype = json['vtype']; 54 vtype = json['vtype'];
55 vname = json['vname']; 55 vname = json['vname'];
56 rdate = json['rdate']; 56 rdate = json['rdate'];
57 - edate = '1694830573';  
58 - // edate = json['edate']; 57 + // edate = '1695437146';
  58 + // edate = json['vid'] == '4' ? '1695005146' : '1695437146';
  59 + edate = json['edate'];
59 cdate = json['cdate']; 60 cdate = json['cdate'];
60 } 61 }
61 62
@@ -104,7 +104,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -104,7 +104,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
104 104
105 CollectStoreProvider collectStoreProvider; 105 CollectStoreProvider collectStoreProvider;
106 106
107 - Map dataSp = Map(); 107 + Map<String, dynamic> dataSp = Map();
108 108
109 //实现监听 109 //实现监听
110 Future<dynamic> platformCallHandler(MethodCall call) async { 110 Future<dynamic> platformCallHandler(MethodCall call) async {
@@ -284,13 +284,23 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -284,13 +284,23 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
284 //店铺过期日期 284 //店铺过期日期
285 List<SellerVersionSunModel> showData = []; 285 List<SellerVersionSunModel> showData = [];
286 // App.sp.remove('sellerEdateModule'); 286 // App.sp.remove('sellerEdateModule');
  287 + if (App.sp.containsKey('sellerEdateModule')) {
  288 + dataSp = json.decode(App.sp.getString('sellerEdateModule'));
  289 + }
287 290
288 collectStoreProvider.sellerVersionList.forEach((element) { 291 collectStoreProvider.sellerVersionList.forEach((element) {
289 _edateSellerModuleShow(showData, element, dataSp); 292 _edateSellerModuleShow(showData, element, dataSp);
290 }); 293 });
291 print(showData); 294 print(showData);
292 print(dataSp); 295 print(dataSp);
293 - App.sp.setString("sellerEdateModule", json.encode(dataSp)); 296 + if (dataSp.length > 0) {
  297 + App.sp.setString("sellerEdateModule", json.encode(dataSp));
  298 + // var data = json.decode(App.sp.getString('sellerEdateModule'));
  299 + // var str = App.sp.getString('sellerEdateModule');
  300 + // print(str);
  301 + // print(data);
  302 + }
  303 +
294 if (showData != null && showData.length > 0) { 304 if (showData != null && showData.length > 0) {
295 DialogUtil.showSellerVersionEdateDialog(context, showData, (object) {}); 305 DialogUtil.showSellerVersionEdateDialog(context, showData, (object) {});
296 } 306 }
@@ -355,14 +365,18 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -355,14 +365,18 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
355 } 365 }
356 366
357 _setSpSellerModule(String day, SellerVersionSunModel sellerVersionSunModel) { 367 _setSpSellerModule(String day, SellerVersionSunModel sellerVersionSunModel) {
358 - Map data = Map(); 368 + Map<String, dynamic> data = Map();
359 List days = []; 369 List days = [];
360 370
361 - //已经存进去过数据  
362 - if (App.sp.containsKey('sellerEdateModule')) {  
363 - data = json.decode(App.sp.getString('sellerEdateModule')) ?? {};  
364 - days = data[sellerVersionSunModel.vid] ?? []; 371 + if (dataSp.containsKey(sellerVersionSunModel.vid)) {
  372 + days = dataSp[sellerVersionSunModel.vid];
365 } 373 }
  374 +
  375 + //已经存进去过数据
  376 + // if (App.sp.containsKey('sellerEdateModule')) {
  377 + // data = json.decode(App.sp.getString('sellerEdateModule'));
  378 + // days = data[sellerVersionSunModel.vid] ?? [];
  379 + // }
366 days.add(day); 380 days.add(day);
367 print(data); 381 print(data);
368 382
@@ -390,8 +404,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -390,8 +404,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
390 //已经存进去过数据 404 //已经存进去过数据
391 if (App.sp.containsKey('sellerEdateModule')) { 405 if (App.sp.containsKey('sellerEdateModule')) {
392 Map data = {}; 406 Map data = {};
393 - data = json.decode(App.sp.getString('sellerEdateModule')) ?? {}; 407 + data = json.decode(App.sp.getString('sellerEdateModule'));
394 data.removeWhere((key, value) => key == sellerVersionSunModel.vid); 408 data.removeWhere((key, value) => key == sellerVersionSunModel.vid);
  409 +
  410 + dataSp.removeWhere((key, value) => key == sellerVersionSunModel.vid);
395 if (data != null && data.length == 0) { 411 if (data != null && data.length == 0) {
396 App.sp.remove("sellerEdateModule"); 412 App.sp.remove("sellerEdateModule");
397 } else { 413 } else {
@@ -400,8 +416,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -400,8 +416,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
400 } 416 }
401 } 417 }
402 418
403 - _edateSellerModuleShow(List<SellerVersionSunModel> showData,  
404 - SellerVersionSunModel sellerVersionSunModel, Map dataSp) async { 419 + _edateSellerModuleShow(
  420 + List<SellerVersionSunModel> showData,
  421 + SellerVersionSunModel sellerVersionSunModel,
  422 + Map<String, dynamic> dataSp) async {
405 //店铺过期提醒 423 //店铺过期提醒
406 // 计算时间差 424 // 计算时间差
407 //店铺过期日期 425 //店铺过期日期
@@ -419,18 +437,18 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -419,18 +437,18 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
419 if (App.sp.containsKey('sellerEdateModule')) { 437 if (App.sp.containsKey('sellerEdateModule')) {
420 //已经存进去过数据 438 //已经存进去过数据
421 439
422 - Map data = json.decode(App.sp.getString('sellerEdateModule')) ?? {}; 440 + Map data = json.decode(App.sp.getString('sellerEdateModule'));
423 List days = data[sellerVersionSunModel.vid] ?? []; 441 List days = data[sellerVersionSunModel.vid] ?? [];
424 if (!days.contains('7')) { 442 if (!days.contains('7')) {
425 //7天没有提醒过 443 //7天没有提醒过
426 showData.add(sellerVersionSunModel); //7天已经提醒过了 444 showData.add(sellerVersionSunModel); //7天已经提醒过了
427 445
428 - _setSpSellerModule('7', sellerVersionSunModel); 446 + dataSp.addAll(_setSpSellerModule('7', sellerVersionSunModel));
429 } 447 }
430 } else { 448 } else {
431 //7天没有提醒过 449 //7天没有提醒过
432 showData.add(sellerVersionSunModel); //7天已经提醒过了 450 showData.add(sellerVersionSunModel); //7天已经提醒过了
433 - _setSpSellerModule('7', sellerVersionSunModel); 451 + dataSp.addAll(_setSpSellerModule('7', sellerVersionSunModel));
434 } 452 }
435 453
436 // _showSellerAlert('7', edate); 454 // _showSellerAlert('7', edate);
@@ -441,17 +459,17 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -441,17 +459,17 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
441 if (App.sp.containsKey('sellerEdateModule')) { 459 if (App.sp.containsKey('sellerEdateModule')) {
442 //已经存进去过数据 460 //已经存进去过数据
443 461
444 - Map data = json.decode(App.sp.getString('sellerEdateModule')) ?? {}; 462 + Map data = json.decode(App.sp.getString('sellerEdateModule'));
445 List days = data[sellerVersionSunModel.vid] ?? []; 463 List days = data[sellerVersionSunModel.vid] ?? [];
446 if (!days.contains('3')) { 464 if (!days.contains('3')) {
447 //3天没有提醒过 465 //3天没有提醒过
448 showData.add(sellerVersionSunModel); //3天已经提醒过了 466 showData.add(sellerVersionSunModel); //3天已经提醒过了
449 - _setSpSellerModule('3', sellerVersionSunModel); 467 + dataSp.addAll(_setSpSellerModule('3', sellerVersionSunModel));
450 } 468 }
451 } else { 469 } else {
452 //3天没有提醒过 470 //3天没有提醒过
453 showData.add(sellerVersionSunModel); //3天已经提醒过了 471 showData.add(sellerVersionSunModel); //3天已经提醒过了
454 - _setSpSellerModule('3', sellerVersionSunModel); 472 + dataSp.addAll(_setSpSellerModule('3', sellerVersionSunModel));
455 } 473 }
456 } else if (difference == 2) { 474 } else if (difference == 2) {
457 //过期差2天,提醒一次 475 //过期差2天,提醒一次
@@ -459,18 +477,18 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -459,18 +477,18 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
459 if (App.sp.containsKey('sellerEdateModule')) { 477 if (App.sp.containsKey('sellerEdateModule')) {
460 //已经存进去过数据 478 //已经存进去过数据
461 479
462 - Map data = json.decode(App.sp.getString('sellerEdateModule')) ?? {}; 480 + Map data = json.decode(App.sp.getString('sellerEdateModule'));
463 List days = data[sellerVersionSunModel.vid] ?? []; 481 List days = data[sellerVersionSunModel.vid] ?? [];
464 if (!days.contains('2')) { 482 if (!days.contains('2')) {
465 //2天没有提醒过 483 //2天没有提醒过
466 showData.add(sellerVersionSunModel); //2天已经提醒过了 484 showData.add(sellerVersionSunModel); //2天已经提醒过了
467 // _showSellerAlert('2', edate); 485 // _showSellerAlert('2', edate);
468 - _setSpSellerModule('2', sellerVersionSunModel); 486 + dataSp.addAll(_setSpSellerModule('2', sellerVersionSunModel));
469 } 487 }
470 } else { 488 } else {
471 //2天没有提醒过 489 //2天没有提醒过
472 showData.add(sellerVersionSunModel); //3天已经提醒过了 490 showData.add(sellerVersionSunModel); //3天已经提醒过了
473 - _setSpSellerModule('2', sellerVersionSunModel); 491 + dataSp.addAll(_setSpSellerModule('2', sellerVersionSunModel));
474 } 492 }
475 } else if (difference == 1) { 493 } else if (difference == 1) {
476 //过期差1天,提醒一次 494 //过期差1天,提醒一次
@@ -478,19 +496,19 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -478,19 +496,19 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
478 if (App.sp.containsKey('sellerEdateModule')) { 496 if (App.sp.containsKey('sellerEdateModule')) {
479 //已经存进去过数据 497 //已经存进去过数据
480 498
481 - Map data = json.decode(App.sp.getString('sellerEdateModule')) ?? {}; 499 + Map data = json.decode(App.sp.getString('sellerEdateModule'));
482 List days = data[sellerVersionSunModel.vid] ?? []; 500 List days = data[sellerVersionSunModel.vid] ?? [];
483 if (!days.contains('1')) { 501 if (!days.contains('1')) {
484 //1天没有提醒过 502 //1天没有提醒过
485 showData.add(sellerVersionSunModel); //1天已经提醒过了 503 showData.add(sellerVersionSunModel); //1天已经提醒过了
486 // _showSellerAlert('1', edate); 504 // _showSellerAlert('1', edate);
487 - _setSpSellerModule('1', sellerVersionSunModel); 505 + dataSp.addAll(_setSpSellerModule('1', sellerVersionSunModel));
488 } 506 }
489 } else { 507 } else {
490 //1天没有提醒过 508 //1天没有提醒过
491 showData.add(sellerVersionSunModel); //1天已经提醒过了 509 showData.add(sellerVersionSunModel); //1天已经提醒过了
492 // _showSellerAlert('1', edate); 510 // _showSellerAlert('1', edate);
493 - _setSpSellerModule('1', sellerVersionSunModel); 511 + dataSp.addAll(_setSpSellerModule('1', sellerVersionSunModel));
494 } 512 }
495 } else if (difference == 0 && differenceSeconds > 0) { 513 } else if (difference == 0 && differenceSeconds > 0) {
496 //剩余不足一天 514 //剩余不足一天
@@ -498,7 +516,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -498,7 +516,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
498 if (App.sp.containsKey('sellerEdateModule')) { 516 if (App.sp.containsKey('sellerEdateModule')) {
499 //已经存进去过数据 517 //已经存进去过数据
500 518
501 - Map data = json.decode(App.sp.getString('sellerEdateModule')) ?? {}; 519 + Map data = json.decode(App.sp.getString('sellerEdateModule'));
502 List days = data[sellerVersionSunModel.vid] ?? []; 520 List days = data[sellerVersionSunModel.vid] ?? [];
503 if (!days.contains('0')) { 521 if (!days.contains('0')) {
504 //0天没有提醒过 522 //0天没有提醒过
@@ -301,6 +301,8 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> { @@ -301,6 +301,8 @@ class _CollectStoreInfoPageState extends State<CollectStoreInfoPage> {
301 'pro_code': proCode, 301 'pro_code': proCode,
302 'city_code': cityCode, 302 'city_code': cityCode,
303 'dis_code': disCode, 303 'dis_code': disCode,
  304 + 'lat': lat.toString(),
  305 + 'long': lng.toString()
304 }; 306 };
305 bool success = await collectStoreProvider.setSellerCollect( 307 bool success = await collectStoreProvider.setSellerCollect(
306 context, params); 308 context, params);
@@ -61,6 +61,7 @@ class DialogUtil { @@ -61,6 +61,7 @@ class DialogUtil {
61 List<SellerVersionSunModel> showData, CustomCallBack callback, 61 List<SellerVersionSunModel> showData, CustomCallBack callback,
62 {GestureTapCallback onTapLeft, GestureTapCallback onTapRight}) { 62 {GestureTapCallback onTapLeft, GestureTapCallback onTapRight}) {
63 List<String> names = showData.map((e) => e.vname).toList(); 63 List<String> names = showData.map((e) => e.vname).toList();
  64 + ScrollController controller = ScrollController();
64 return showDialog( 65 return showDialog(
65 context: context, 66 context: context,
66 barrierDismissible: true, 67 barrierDismissible: true,
@@ -70,7 +71,7 @@ class DialogUtil { @@ -70,7 +71,7 @@ class DialogUtil {
70 return Material( 71 return Material(
71 color: Colors.transparent, 72 color: Colors.transparent,
72 child: Container( 73 child: Container(
73 - width: double.infinity, 74 + // width: double.infinity,
74 margin: EdgeInsets.symmetric(horizontal: w(37)), 75 margin: EdgeInsets.symmetric(horizontal: w(37)),
75 decoration: BoxDecoration( 76 decoration: BoxDecoration(
76 color: MyColours.color_ffffff, 77 color: MyColours.color_ffffff,
@@ -83,85 +84,99 @@ class DialogUtil { @@ -83,85 +84,99 @@ class DialogUtil {
83 children: <Widget>[ 84 children: <Widget>[
84 Padding( 85 Padding(
85 padding: EdgeInsets.symmetric(horizontal: w(10)), 86 padding: EdgeInsets.symmetric(horizontal: w(10)),
86 - child: Column(  
87 - crossAxisAlignment: CrossAxisAlignment.start,  
88 - children: [  
89 - VEmptyView(50),  
90 - Container(  
91 - child: Text('您的:',  
92 - style: TextStyle(  
93 - color: MyColours.color_515151,  
94 - fontSize: font(14)))),  
95 - VEmptyView(60),  
96 - ListView.builder(  
97 - itemCount: showData.length,  
98 - shrinkWrap: true,  
99 - itemBuilder:  
100 - (BuildContext context, int index) {  
101 - SellerVersionSunModel  
102 - sellerVersionSunModel =  
103 - showData[index];  
104 - return Column(  
105 - crossAxisAlignment:  
106 - CrossAxisAlignment.start,  
107 - children: [  
108 - Container(  
109 - child: Text(  
110 - '${sellerVersionSunModel.vname}功能即将在:',  
111 - style: TextStyle(  
112 - color: MyColours  
113 - .color_515151,  
114 - fontSize:  
115 - font(14)))),  
116 - VEmptyView(10),  
117 - Container(  
118 - child: Text(  
119 - DateUtil.formatDate(  
120 - DateTime.fromMillisecondsSinceEpoch(  
121 - int.parse(sellerVersionSunModel  
122 - .edate) *  
123 - 1000),  
124 - format:  
125 - DateFormats.full,  
126 - ),  
127 - style: TextStyle(  
128 - color: MyColours  
129 - .color_E34D59,  
130 - fontSize:  
131 - font(14)))),  
132 - ]);  
133 - }),  
134 - Container(  
135 - child: Text('您可以:',  
136 - style: TextStyle(  
137 - color: MyColours.color_515151,  
138 - fontSize: font(14)))),  
139 - VEmptyView(60),  
140 - Container(  
141 - child: Text('点击“前往续费” ',  
142 - style: TextStyle(  
143 - color: MyColours.color_515151,  
144 - fontSize: font(14)))),  
145 - VEmptyView(20),  
146 - Container(  
147 - child: Text('或者',  
148 - style: TextStyle(  
149 - color: MyColours.color_515151,  
150 - fontSize: font(14)))),  
151 - VEmptyView(20),  
152 - Container(  
153 - child: Text('联系您的服务商续费 ${names.toString()}功能;',  
154 - style: TextStyle(  
155 - color: MyColours.color_515151,  
156 - fontSize: font(14)))),  
157 - VEmptyView(60),  
158 - Container(  
159 - child: Text('*您可以通过开通超能版获得全部软件功能。',  
160 - style: TextStyle(  
161 - color: MyColours.color_515151,  
162 - fontSize: font(14)))),  
163 - VEmptyView(50),  
164 - ])), 87 + child: SingleChildScrollView(
  88 + controller: controller,
  89 + child: Column(
  90 + crossAxisAlignment:
  91 + CrossAxisAlignment.start,
  92 + children: [
  93 + VEmptyView(50),
  94 + Container(
  95 + child: Text('您的:',
  96 + style: TextStyle(
  97 + color:
  98 + MyColours.color_515151,
  99 + fontSize: font(14)))),
  100 + VEmptyView(50),
  101 + ListView.builder(
  102 + itemCount: showData.length,
  103 + shrinkWrap: true,
  104 + controller: controller,
  105 + itemBuilder: (BuildContext context,
  106 + int index) {
  107 + SellerVersionSunModel
  108 + sellerVersionSunModel =
  109 + showData[index];
  110 + return Column(
  111 + crossAxisAlignment:
  112 + CrossAxisAlignment.start,
  113 + children: [
  114 + Container(
  115 + child: Text(
  116 + '${sellerVersionSunModel.vname}功能即将在:',
  117 + style: TextStyle(
  118 + color: MyColours
  119 + .color_515151,
  120 + fontSize:
  121 + font(14)))),
  122 + VEmptyView(5),
  123 + Container(
  124 + child: Text(
  125 + DateUtil.formatDate(
  126 + DateTime.fromMillisecondsSinceEpoch(
  127 + int.parse(sellerVersionSunModel
  128 + .edate) *
  129 + 1000),
  130 + format:
  131 + DateFormats
  132 + .full,
  133 + ),
  134 + style: TextStyle(
  135 + color: MyColours
  136 + .color_E34D59,
  137 + fontSize:
  138 + font(14)))),
  139 + VEmptyView(20),
  140 + ]);
  141 + }),
  142 + VEmptyView(20),
  143 + Container(
  144 + child: Text('您可以:',
  145 + style: TextStyle(
  146 + color:
  147 + MyColours.color_515151,
  148 + fontSize: font(14)))),
  149 + VEmptyView(60),
  150 + Container(
  151 + child: Text('点击“前往续费” ',
  152 + style: TextStyle(
  153 + color:
  154 + MyColours.color_515151,
  155 + fontSize: font(14)))),
  156 + VEmptyView(20),
  157 + Container(
  158 + child: Text('或者',
  159 + style: TextStyle(
  160 + color:
  161 + MyColours.color_515151,
  162 + fontSize: font(14)))),
  163 + VEmptyView(20),
  164 + Container(
  165 + child: Text(
  166 + '联系您的服务商续费 ${names.toString()}功能;',
  167 + style: TextStyle(
  168 + color:
  169 + MyColours.color_515151,
  170 + fontSize: font(14)))),
  171 + VEmptyView(60),
  172 + Container(
  173 + child: Text('*您可以通过开通超能版获得全部软件功能。',
  174 + style: TextStyle(
  175 + color:
  176 + MyColours.color_515151,
  177 + fontSize: font(14)))),
  178 + VEmptyView(50),
  179 + ]))),
165 MyDivider(double.infinity, w(1), 180 MyDivider(double.infinity, w(1),
166 color: MyColours.color_DBDBDB), 181 color: MyColours.color_DBDBDB),
167 Row( 182 Row(
@@ -190,7 +205,7 @@ class DialogUtil { @@ -190,7 +205,7 @@ class DialogUtil {
190 Expanded( 205 Expanded(
191 flex: 1, 206 flex: 1,
192 child: RoundButton( 207 child: RoundButton(
193 - text: '前往开通', 208 + text: '前往续费',
194 // width: (ScreenUtil().screenWidth - 209 // width: (ScreenUtil().screenWidth -
195 // ScreenUtil().setWidth(62) * 2) / 210 // ScreenUtil().setWidth(62) * 2) /
196 // 2, 211 // 2,