feast_followup_page.dart
38.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/get_banquet_be_follow_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
import '../../constant/state.dart';
import '../../provider/feast_model.dart';
import '../../provider/user_model.dart';
import '../../route/navigator_util.dart';
import '../../utils/event_bus.dart';
import '../../utils/screen_util.dart';
import '../../utils/utils.dart';
import '../../widgets/MyDivider.dart';
import '../../widgets/loading.dart';
import '../../widgets/page_exception.dart';
import '../../widgets/round_button.dart';
import '../../widgets/system_app_bar.dart';
class FeastFollowUpPage extends StatefulWidget {
FeastFollowUpPage({Key key}) : super(key: key);
@override
_FeastFollowUpPageState createState() => _FeastFollowUpPageState();
}
class _FeastFollowUpPageState extends State<FeastFollowUpPage> {
FeastModel feastModel;
DateTime dateTimeStart;
DateTime dateTimeEnd;
String start = '不限';
String end = '不限';
bool isFeastTime = true; //ture 为宴会时间 false 为创建时间
@override
void initState() {
super.initState();
dateTimeStart = DateTime.now();
// start = createDateText(context, dateTimeStart);
dateTimeEnd = DateTime.now();
// end = createDateText(context, dateTimeEnd);
Utils.changeStatusColor(color: MyColours.color_438E93);
WidgetsBinding.instance.addPostFrameCallback((_) {
_getBanquetBeFollow();
});
}
@override
void dispose() {
super.dispose();
Utils.changeStatusColor(color: MyColours.color_ffffff);
}
/// 根据时间范围查询待跟进订单
_getBanquetBeFollow() async {
Map<String, String> pramas = {
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
'type': isFeastTime ? '2' : '1'
}; //
if (start != '不限') {
pramas['rdate'] = _getRdate(dateTimeStart);
}
if (end != '不限') {
pramas['edate'] = _getEdate(dateTimeEnd);
}
bool success = await feastModel.getBanquetBeFollow(context, pramas);
if (success) {
// _uploadImageProvider.feastRemarkContractImageList = [];
// feastModel.banquetDetail.contractInfo.contractImages.forEach((element) {
// UploadImgModel uploadImgModel = UploadImgModel();
// uploadImgModel.process = 1;
// uploadImgModel.qiniuUrl = element.url;
// _uploadImageProvider.feastRemarkContractImageList.add(uploadImgModel);
// });
// setState(() {});
}
}
/// 设置丢单原因
_setBanquetLost(String lost, GetBanquetBeFollowSunModel data) async {
Map<String, String> pramas = {'rid': data.id, 'lost': lost}; //
bool success = await feastModel.setBanquetLost(context, pramas);
if (success) {
// _uploadImageProvider.feastRemarkContractImageList = [];
// feastModel.banquetDetail.contractInfo.contractImages.forEach((element) {
// UploadImgModel uploadImgModel = UploadImgModel();
// uploadImgModel.process = 1;
// uploadImgModel.qiniuUrl = element.url;
// _uploadImageProvider.feastRemarkContractImageList.add(uploadImgModel);
// });
// setState(() {});
_getBanquetBeFollow(); //刷新当前页面
bus.emit('feast_home_page'); //编辑之后刷新宴会首页
}
}
//获取一天开始时间字符串
String _getRdate(DateTime date) {
// String ymd = DateUtil.formatDate(date, format: DateFormats.y_mo_d);
String timeStrStart = '';
//一天开始时间
double startDay;
timeStrStart = date.year.toString() +
"-" +
Utils.addZeroNumber(date.month) +
"-" +
Utils.addZeroNumber(date.day) +
" 00:00:00";
startDay = (DateTime.parse(timeStrStart).millisecondsSinceEpoch) / 1000;
return startDay.floor().toString();
}
//获取一天结束时间字符串
String _getEdate(DateTime date) {
// String ymd = DateUtil.formatDate(date, format: DateFormats.y_mo_d);
String timeStrEnd = '';
//一天结束时间
double endDay;
timeStrEnd = date.year.toString() +
"-" +
Utils.addZeroNumber(date.month) +
"-" +
Utils.addZeroNumber(date.day) +
" 23:59:59";
endDay = (DateTime.parse(timeStrEnd).millisecondsSinceEpoch) / 1000;
return endDay.floor().toString();
}
//生成日期文本
createDateText(BuildContext context, DateTime day) {
// if (Utils.isOneDay(day, dateTime)) return; //日期没变
String ymd = "${day.year}-" +
Utils.addZeroNumber(day.month) +
"-" +
Utils.addZeroNumber(day.day);
// ymd += " (周${Utils.formatWeekDayNum(day.weekday)} ";
// ymd += Utils.lunarCalendarHolidays(day);
// ymd += ')';
return ymd;
}
Widget buildFeastTypeHeader() {
return Container(
width: double.infinity,
height: h(88),
// decoration: BoxDecoration(
// color: MyColours.color_F8F9FD,
// border: Border(
// bottom: BorderSide(width: w(1), color: MyColours.color_DBDBDB))),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
InkWell(
onTap: () {
if (!isFeastTime) {
return;
}
setState(() {
isFeastTime = !isFeastTime;
});
},
child: Row(
children: [
Image.asset(
Utils.getImgPath(
!isFeastTime ? 'base_radio_sel' : 'base_radio_un'),
width: w(24),
),
HEmptyView(8),
Text(
'创建时间',
style: TextStyle(
fontSize: font(14),
color: !isFeastTime
? MyColours.color_438E93
: MyColours.color_999999),
)
],
),
),
HEmptyView(16),
InkWell(
onTap: () {
if (isFeastTime) {
return;
}
setState(() {
isFeastTime = !isFeastTime;
});
},
child: Row(
children: [
Image.asset(
Utils.getImgPath(
isFeastTime ? 'base_radio_sel' : 'base_radio_un'),
width: w(24),
),
HEmptyView(8),
Text(
'宴会时间',
style: TextStyle(
fontSize: font(14),
color: isFeastTime
? MyColours.color_438E93
: MyColours.color_999999),
)
],
),
),
Spacer(),
RoundButton(
onPressed: () async {
_getBanquetBeFollow();
},
text: '搜索',
fontSize: 28,
isBold: false,
height: h(28),
width: w(36),
// margin: EdgeInsets.only(top: w(18), bottom: w(4)),
textColor: MyColours.color_F6F6F6,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
borderColor: MyColours.color_438E93,
radius: r(4),
),
],
),
VEmptyView(20),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
// FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
DialogUtil.showCalendarDialog(context, dateTimeStart)
.then((day) async {
if (day != null) {
dateTimeStart = day;
start = createDateText(context, day);
setState(() {});
}
});
},
child: Row(
children: [
Text(
start,
style: TextStyle(
fontSize: font(18),
color: start == '不限'
? MyColours.color_999999
: MyColours.color_515151),
),
HEmptyView(8),
Image.asset(
Utils.getImgPath('f_arrow_down'),
width: w(24),
)
],
)),
Text(
'至',
style: TextStyle(
fontSize: font(20), color: MyColours.color_515151),
),
InkWell(
onTap: () {
// FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
DialogUtil.showCalendarDialog(context, dateTimeEnd)
.then((day) async {
if (day != null) {
dateTimeEnd = day;
end = createDateText(context, day);
setState(() {});
}
});
},
child: Row(
children: [
Text(
end,
style: TextStyle(
fontSize: font(18),
color: end == '不限'
? MyColours.color_999999
: MyColours.color_515151),
),
HEmptyView(8),
Image.asset(
Utils.getImgPath('f_arrow_down'),
width: w(24),
),
],
))
],
)
],
),
);
}
Widget buildFeastTypeItem(GetBanquetBeFollowSunModel data) {
return Container(
margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(36)),
decoration: BoxDecoration(
border: Border.all(
color: MyColours.color_f3f3f3, width: ScreenUtil().setWidth(2)),
boxShadow: [
BoxShadow(
color: MyColours.color_1F000000,
offset: Offset(0, ScreenUtil().setWidth(8)),
blurRadius: ScreenUtil().setWidth(8))
],
borderRadius: BorderRadius.circular(ScreenUtil().radius(10))),
child: Column(
children: [
Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(16),
vertical: ScreenUtil().setWidth(8)),
decoration: BoxDecoration(
color: MyColours.color_438E93,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(ScreenUtil().radius(10)),
topRight: Radius.circular(ScreenUtil().radius(10)),
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'${data.ddateStr}',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_F6F6F6,
fontSize: ScreenUtil().setSp(40)),
),
Text(
'${data.className}',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_F6F6F6,
fontSize: ScreenUtil().setSp(40)),
)
],
)),
Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(16),
vertical: ScreenUtil().setWidth(14)),
decoration: BoxDecoration(
color: MyColours.color_ffffff,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(ScreenUtil().radius(10)),
bottomRight: Radius.circular(ScreenUtil().radius(10)),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Wrap(
children: [
Text(
data.isTids == 1 ? '[已选桌]' : '[未选桌]',
style: TextStyle(
color: data.isTids == 1
? MyColours.color_00A870
: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
),
Text(
data.isSetmeal == 1 ? ' [已选套餐]' : ' [未选套餐]',
style: TextStyle(
color: data.isSetmeal == 1
? MyColours.color_00A870
: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
),
Text(
data.isDeposit == 1
? ' [定金${data.depositPrice}]'
: ' [未交定金]',
style: TextStyle(
color: data.isDeposit == 1
? MyColours.color_00A870
: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
),
Text(
data.isWarrant == 1 ? ' [已担保]' : ' [未担保]',
style: TextStyle(
color: data.isWarrant == 1
? MyColours.color_00A870
: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
),
Text(
data.isContractFinalPrice == 1 ? ' [已签约]' : ' [未签约]',
style: TextStyle(
color: data.isContractFinalPrice == 1
? MyColours.color_00A870
: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(28)),
),
],
),
VEmptyView(20),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'${data.rname} 跟单经理:${data.nickName ?? data.account}',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_000000,
fontSize: ScreenUtil().setSp(28)),
),
RoundButton(
onPressed: () async {
_showCancelWidget(context, data);
},
text: '丢单',
fontSize: 28,
isBold: false,
height: h(28),
width: w(44),
// margin: EdgeInsets.only(top: w(18), bottom: w(4)),
textColor: MyColours.color_F6F6F6,
gradientStart: MyColours.color_E34D59,
gradientEnd: MyColours.color_E34D59,
borderColor: MyColours.color_E34D59,
radius: r(4),
),
],
)
],
),
)
],
),
);
}
///取消预订弹框
_showCancelWidget(context, GetBanquetBeFollowSunModel data) {
ScrollController _scrollController = ScrollController();
TextEditingController _cancelController = TextEditingController();
FocusNode _cancelNode = FocusNode();
List cancelReasonList = [
{'title': '已选择其他酒店', 'select': false},
{'title': '不接受增值服务', 'select': false},
{'title': '场地无法满足客户', 'select': false},
{'title': '内部失误,跟单失败', 'select': false},
{'title': '其他原因', 'select': false},
];
showGeneralDialog(
context: context,
barrierDismissible: false,
barrierLabel:
MaterialLocalizations.of(context).modalBarrierDismissLabel,
transitionDuration: const Duration(milliseconds: 150),
barrierColor: Color.fromRGBO(0, 0, 0, 0.25),
pageBuilder: (BuildContext context, Animation animation,
Animation secondaryAnimation) {
return Scaffold(
backgroundColor: Color.fromRGBO(0, 0, 0, 0.25),
body: StatefulBuilder(builder: (context, state) {
// _cancelState = state;
return GestureDetector(
behavior: HitTestBehavior.opaque,
// onTap: () {
// Navigator.of(context).pop();
// },
child: Center(
child: Container(
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(28 * 2)),
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.circular(ScreenUtil().setWidth(10)),
),
height: ScreenUtil().setWidth(355 * 2 + 20),
child: Column(
// mainAxisSize: MainAxisSize.min,
children: [
// Stack(
// children: [
VEmptyView(48),
Container(
height: ScreenUtil().setWidth(48),
child: Text(
'请选择丢单原因',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontWeight: FontWeight.bold,
decoration: TextDecoration.none,
color: Color.fromRGBO(0, 0, 0, 0.9)),
),
),
// Positioned(
// top: ScreenUtil().setWidth(8),
// right: ScreenUtil().setWidth(0),
// child: GestureDetector(
// onTap: () {
// _initCancel();
// Navigator.of(context).pop();
// },
// child: Container(
// padding: EdgeInsets.only(left: 20),
// child: Image.asset(
// 'assets/close.png',
// width: ScreenUtil().setWidth(32),
// height: ScreenUtil().setWidth(32),
// ),
// )))
// ],
// ),
VEmptyView(40),
Container(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(32)),
child: Column(
// mainAxisSize: MainAxisSize.min,
children: cancelReasonList.map((value) {
return value['title'] == '其他原因'
? SizedBox()
: GestureDetector(
onTap: () {
for (var item
in cancelReasonList) {
item['select'] = false;
// isShowTF = false;
// paddingBottom =
// ScreenUtil().screenHeight.ceil() -
// 138 -
// 340;
if (item['title'] ==
value['title']) {
item['select'] = true;
// if (item['title'] == '其他原因') {
// // isShowTF = true;
// // paddingBottom = 130;
// // paddingBottom =
// // ScreenUtil().screenHeight.ceil() -
// // 138 -
// // 340 -
// // 46;
// }
}
}
state(() {});
},
child: Container(
height: ScreenUtil().setWidth(48),
margin: EdgeInsets.only(
bottom: ScreenUtil()
.setWidth(40)),
child: Row(
children: [
Image.asset(
value['select']
? 'assets/select.png'
: 'assets/unselect.png',
width: ScreenUtil()
.setWidth(42)),
HEmptyView(20),
Container(
child: Text(
value['title'],
style: TextStyle(
fontSize:
ScreenUtil()
.setSp(
32),
fontWeight:
FontWeight
.normal,
decoration:
TextDecoration
.none,
color: MyColours
.color_333333)))
],
),
),
);
}).toList(),
)),
Material(
child: Container(
color: Colors.white,
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(32)),
height: ScreenUtil().setWidth(42 * 2),
child: Row(children: [
InkWell(
onTap: () {
for (var item in cancelReasonList) {
item['select'] = false;
}
cancelReasonList[4]['select'] =
true;
state(() {});
},
child: Padding(
padding: EdgeInsets.only(
right: ScreenUtil()
.setWidth(20)),
child: Image.asset(
cancelReasonList[4]['select']
? 'assets/select.png'
: 'assets/unselect.png',
width: ScreenUtil()
.setWidth(44)))),
Expanded(
child: Container(
decoration: BoxDecoration(
color: Color.fromRGBO(
240, 240, 240, 1),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(8))),
// height: ScreenUtil().setWidth(42 * 2),
padding: EdgeInsets.symmetric(
horizontal:
ScreenUtil().setWidth(16)),
child: TextField(
maxLines: 1,
controller: _cancelController,
focusNode: _cancelNode,
style: TextStyle(
textBaseline:
TextBaseline.alphabetic),
textAlignVertical:
TextAlignVertical.center,
decoration: InputDecoration(
contentPadding: EdgeInsets.zero,
hintText: "其他",
// focusColor: Color.fromRGBO(0, 0, 0, 0.4),
hintStyle: TextStyle(
color:
Color.fromRGBO(0, 0, 0, 0.4),
fontSize: ScreenUtil().setSp(32),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Colors.transparent)),
border: OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Colors.transparent)),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Colors.transparent)),
),
// border: InputBorder.none,
onChanged: (_) {
setState(() {});
},
onEditingComplete: () {
print('fff');
_cancelNode.unfocus();
},
// keyboardType: TextInputType.numberWithOptions(decimal: true),
),
))
]))),
VEmptyView(40),
MyDivider(double.infinity, ScreenUtil().setWidth(2),
color: MyColours.color_f3f3f3),
Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
children: [
RoundButton(
text: '取消',
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_E6000000,
isBold: false,
fontSize: 32,
onPressed: () {
Navigator.pop(context);
}),
MyDivider(ScreenUtil().setWidth(2),
ScreenUtil().setWidth(112),
color: MyColours.color_f3f3f3),
RoundButton(
text: '确定丢单',
width: (ScreenUtil().screenWidth -
ScreenUtil().setWidth(62) * 2) /
2,
height: ScreenUtil().setWidth(112),
// radius: ScreenUtil().setWidth(10),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: MyColours.color_E34D59,
fontSize: 32,
isBold: true,
onPressed: () {
String desc = '';
for (var value in cancelReasonList) {
if (value['select'] == true) {
desc = value['title'];
if (value['title'] == '其他原因') {
desc =
_cancelController.text.trim();
if (desc.isEmpty) {
Utils.showToast("请填写原因");
return;
}
}
}
}
if (desc == '') {
Utils.showToast('请选择原因');
return;
}
Navigator.of(context).pop();
Loading.showLoading(context);
_setBanquetLost(desc, data);
}),
])
],
),
),
));
}));
});
}
Widget _callButton(
{GestureTapCallback onPress,
content,
hasLeftBorder = true,
isSelect = false}) {
return InkWell(
onTap: onPress,
child: Container(
height: h(48),
decoration: BoxDecoration(
color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff,
border: Border(
bottom: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
top: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
left: hasLeftBorder
? BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2))
: BorderSide.none,
right: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)))),
child: Align(
alignment: Alignment.center,
child: Text(
content,
style: TextStyle(
color:
isSelect ? MyColours.color_F6F6F6 : MyColours.color_438E93,
fontSize: ScreenUtil().setSp(36)),
),
),
),
);
}
@override
Widget build(BuildContext context) {
feastModel = Provider.of<FeastModel>(context);
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'待跟进宴会',
needWhite: true,
bgColor: MyColours.color_438E93,
titleColor: MyColours.color_ffffff,
onTap: () {
Navigator.pop(context);
},
),
body: Column(
children: [
Expanded(
child: NestedScrollView(
// controller: _scrollViewController,
headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
pinned: true,
floating: false,
leading: null,
backgroundColor: MyColours.color_ffffff,
// expandedHeight: ScreenUtil().setWidth(128 * 2),
automaticallyImplyLeading: false,
toolbarHeight: ScreenUtil().setWidth(88 * 2),
title: buildFeastTypeHeader(),
// flexibleSpace: FlexibleSpaceBar(
// collapseMode: CollapseMode.pin,
// title: buildFeastTypeHeader())
)
];
}, body: Consumer<FeastModel>(builder: (context, model, _) {
if (model.pageStateFollowUp != PageState.Success) {
return ExceptionPage(
pageState: model.pageStateFollowUp,
callback: () {
// _getWine();
_getBanquetBeFollow();
},
emptyMsg: "暂时没有待跟进宴会哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
} else {
return ListView.builder(
// itemCount: feastModel.beFollowData.length,
itemCount: feastModel.beFollowData.length,
padding:
EdgeInsets.only(left: w(12), top: w(19), right: w(12)),
itemBuilder: (BuildContext context, int index) {
GetBanquetBeFollowSunModel data =
feastModel.beFollowData[index];
return InkWell(
onTap: () {
//点击进入宴会详情
NavigatorUtil.goFeastDetailPage(context, data.id,needChange: false);
},
child: buildFeastTypeItem(data));
// '剑南春52度500ml', '1150元/份 不可议价'
});
}
}))),
Row(
children: [
Expanded(
child: _callButton(
onPress: () {
dateTimeStart = DateTime.now();
start = createDateText(context, dateTimeStart);
dateTimeEnd = DateTime.now();
end = createDateText(context, dateTimeEnd);
setState(() {});
},
content: '回到今天',
hasLeftBorder: true,
isSelect: false)),
Expanded(
child: _callButton(
onPress: () {
NavigatorUtil.goFeastCreatePage(context,
isCreate: true);
},
content: '创建宴会',
hasLeftBorder: true,
isSelect: true))
],
)
],
));
}
}