Commit 94216022dbfe6fa576001ef13614c9e0e1d2bc22

Authored by wdn127929
1 parent c03a4e4e

已预订列表issimple

@@ -60,7 +60,7 @@ class Notebook { @@ -60,7 +60,7 @@ class Notebook {
60 String name; 60 String name;
61 OrderInfo orderInfo; 61 OrderInfo orderInfo;
62 String nick_name; 62 String nick_name;
63 - bool issimple; 63 + bool issimple = false;
64 64
65 String orderID; 65 String orderID;
66 String orderRID; 66 String orderRID;
@@ -41,7 +41,7 @@ class NoteBookPage extends StatefulWidget { @@ -41,7 +41,7 @@ class NoteBookPage extends StatefulWidget {
41 : super(key: key); 41 : super(key: key);
42 @override 42 @override
43 State<StatefulWidget> createState() { 43 State<StatefulWidget> createState() {
44 - // TODO: implement createState 44 +// TODO: implement createState
45 return new NoteBookPageState(); 45 return new NoteBookPageState();
46 } 46 }
47 } 47 }
@@ -64,25 +64,25 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -64,25 +64,25 @@ class NoteBookPageState extends State<NoteBookPage> {
64 StartingDayOfWeek startingDayOfWeek; 64 StartingDayOfWeek startingDayOfWeek;
65 bool clearSel = false; 65 bool clearSel = false;
66 bool isall = true; 66 bool isall = true;
67 - bool isSimple = true;  
68 NoteBookModel noteBookModel; 67 NoteBookModel noteBookModel;
69 68
70 @override 69 @override
71 void initState() { 70 void initState() {
72 - // TODO: implement initState 71 +// TODO: implement initState
73 super.initState(); 72 super.initState();
74 - isSimple = App.sp.getBool("isSimple") ?? true; 73 +
75 tabIndex = widget.tabIndex; 74 tabIndex = widget.tabIndex;
76 LogUtil.v("notebook_page initState"); 75 LogUtil.v("notebook_page initState");
77 76
78 _controller = EasyRefreshController(); 77 _controller = EasyRefreshController();
79 - // _initTime(); 78 +// _initTime();
80 bus.on("refresh_book_list", (args) { 79 bus.on("refresh_book_list", (args) {
81 _getReserveList(); 80 _getReserveList();
82 }); 81 });
83 startingDayOfWeek = _initStartingDayOfWeek(); 82 startingDayOfWeek = _initStartingDayOfWeek();
84 dateTimeNow = DateTime.now(); 83 dateTimeNow = DateTime.now();
85 WidgetsBinding.instance.addPostFrameCallback((_) { 84 WidgetsBinding.instance.addPostFrameCallback((_) {
  85 + noteBookModel.isSimple = App.sp.getBool("isSimple") ?? true;
86 _initTime(); 86 _initTime();
87 setState(() {}); 87 setState(() {});
88 _getReserveList(needLoading: true, showLoading: false); 88 _getReserveList(needLoading: true, showLoading: false);
@@ -90,8 +90,6 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -90,8 +90,6 @@ class NoteBookPageState extends State<NoteBookPage> {
90 }); 90 });
91 } 91 }
92 92
93 -  
94 -  
95 /// 第一个显示今天 93 /// 第一个显示今天
96 _initStartingDayOfWeek() { 94 _initStartingDayOfWeek() {
97 switch (DateTime.now().weekday.toString()) { 95 switch (DateTime.now().weekday.toString()) {
@@ -121,28 +119,28 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -121,28 +119,28 @@ class NoteBookPageState extends State<NoteBookPage> {
121 _calendarController.dispose(); 119 _calendarController.dispose();
122 } 120 }
123 121
124 - //初始化时间 122 +//初始化时间
125 _initTime() { 123 _initTime() {
126 dateTimeNow = widget.date != null ? widget.date : DateTime.now(); 124 dateTimeNow = widget.date != null ? widget.date : DateTime.now();
127 if (widget.date != null) { 125 if (widget.date != null) {
128 _refreshPageCalendar(dateTimeNow); 126 _refreshPageCalendar(dateTimeNow);
129 } 127 }
130 - // dateText = "${dateTimeNow.year}年 " +  
131 - // Utils.addZeroNumber(dateTimeNow.month) +  
132 - // "月" +  
133 - // Utils.addZeroNumber(dateTimeNow.day) +  
134 - // "日";  
135 - // DateTime dateNow = DateTime.now(); 128 +// dateText = "${dateTimeNow.year}年 " +
  129 +// Utils.addZeroNumber(dateTimeNow.month) +
  130 +// "月" +
  131 +// Utils.addZeroNumber(dateTimeNow.day) +
  132 +// "日";
  133 +// DateTime dateNow = DateTime.now();
136 134
137 - // if (Utils.isOneDay(dateTimeNow, dateNow)) {  
138 - // dateText += " 今天";  
139 - // } else if (Utils.isOneDay(dateTimeNow, dateNow.add(Duration(days: 1)))) {  
140 - // dateText += " 明天";  
141 - // } else if (Utils.isOneDay(dateTimeNow, dateNow.add(Duration(days: 2)))) {  
142 - // dateText += " 后天";  
143 - // } else {  
144 - // dateText += " 周${Utils.formatWeekDayNum(dateTimeNow.weekday)}";  
145 - // } 135 +// if (Utils.isOneDay(dateTimeNow, dateNow)) {
  136 +// dateText += " 今天";
  137 +// } else if (Utils.isOneDay(dateTimeNow, dateNow.add(Duration(days: 1)))) {
  138 +// dateText += " 明天";
  139 +// } else if (Utils.isOneDay(dateTimeNow, dateNow.add(Duration(days: 2)))) {
  140 +// dateText += " 后天";
  141 +// } else {
  142 +// dateText += " 周${Utils.formatWeekDayNum(dateTimeNow.weekday)}";
  143 +// }
146 144
147 morning = 145 morning =
148 userModel.user.morning.isEmpty ? "00:00-00:00" : userModel.user.morning; 146 userModel.user.morning.isEmpty ? "00:00-00:00" : userModel.user.morning;
@@ -158,7 +156,7 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -158,7 +156,7 @@ class NoteBookPageState extends State<NoteBookPage> {
158 " " + 156 " " +
159 morning.split("-")[1] + 157 morning.split("-")[1] +
160 ":00"))) { 158 ":00"))) {
161 - //未过早市 159 +//未过早市
162 currTimeIndex = 1; 160 currTimeIndex = 1;
163 } else if (noon != '' && 161 } else if (noon != '' &&
164 dateTimeNow.isAfter(DateTime.parse(dateTimeNow.year.toString() + 162 dateTimeNow.isAfter(DateTime.parse(dateTimeNow.year.toString() +
@@ -177,7 +175,7 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -177,7 +175,7 @@ class NoteBookPageState extends State<NoteBookPage> {
177 " " + 175 " " +
178 noon.split("-")[1] + 176 noon.split("-")[1] +
179 ":00"))) { 177 ":00"))) {
180 - //过了早市,未过午市 178 +//过了早市,未过午市
181 currTimeIndex = 2; 179 currTimeIndex = 2;
182 } else if (night != '' && 180 } else if (night != '' &&
183 dateTimeNow.isAfter(DateTime.parse(dateTimeNow.year.toString() + 181 dateTimeNow.isAfter(DateTime.parse(dateTimeNow.year.toString() +
@@ -196,10 +194,10 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -196,10 +194,10 @@ class NoteBookPageState extends State<NoteBookPage> {
196 " " + 194 " " +
197 night.split("-")[1] + 195 night.split("-")[1] +
198 ":00"))) { 196 ":00"))) {
199 - //过了午市,未过晚市 197 +//过了午市,未过晚市
200 currTimeIndex = 3; 198 currTimeIndex = 3;
201 } else { 199 } else {
202 - //过了晚市 200 +//过了晚市
203 currTimeIndex = 3; 201 currTimeIndex = 3;
204 } 202 }
205 } else { 203 } else {
@@ -207,10 +205,8 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -207,10 +205,8 @@ class NoteBookPageState extends State<NoteBookPage> {
207 } 205 }
208 } 206 }
209 207
210 - //获取已预订列表 208 +//获取已预订列表
211 _getReserveList({bool needLoading = false, bool showLoading = true}) async { 209 _getReserveList({bool needLoading = false, bool showLoading = true}) async {
212 -  
213 -  
214 Map<String, String> params = { 210 Map<String, String> params = {
215 "sid": userModel.user.sellerid, 211 "sid": userModel.user.sellerid,
216 "rdate": _getRdate(), 212 "rdate": _getRdate(),
@@ -226,14 +222,10 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -226,14 +222,10 @@ class NoteBookPageState extends State<NoteBookPage> {
226 222
227 await noteBookModel.getReserveList(context, params, 223 await noteBookModel.getReserveList(context, params,
228 needLoading: needLoading, showLoading: showLoading); 224 needLoading: needLoading, showLoading: showLoading);
229 - _simpleState(); 225 +// _simpleState();
230 } 226 }
231 227
232 -  
233 -  
234 -  
235 -  
236 - //解析返回显示的日期 228 +//解析返回显示的日期
237 _parseDateDay(DateTime dateTime) { 229 _parseDateDay(DateTime dateTime) {
238 DateTime now = DateTime.now(); 230 DateTime now = DateTime.now();
239 if (Utils.isOneDay(dateTime, now)) { 231 if (Utils.isOneDay(dateTime, now)) {
@@ -247,9 +239,9 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -247,9 +239,9 @@ class NoteBookPageState extends State<NoteBookPage> {
247 } 239 }
248 } 240 }
249 241
250 - //获取一天开始-结束时间字符串 242 +//获取一天开始-结束时间字符串
251 String _getRdate() { 243 String _getRdate() {
252 - //一天开始时间 244 +//一天开始时间
253 double startDay = (DateTime.parse((dateTimeNow.year.toString() + 245 double startDay = (DateTime.parse((dateTimeNow.year.toString() +
254 "-" + 246 "-" +
255 Utils.addZeroNumber(dateTimeNow.month) + 247 Utils.addZeroNumber(dateTimeNow.month) +
@@ -258,7 +250,7 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -258,7 +250,7 @@ class NoteBookPageState extends State<NoteBookPage> {
258 " 00:00:00")) 250 " 00:00:00"))
259 .millisecondsSinceEpoch) / 251 .millisecondsSinceEpoch) /
260 1000; 252 1000;
261 - //一天结束时间 253 +//一天结束时间
262 double endDay = (DateTime.parse((dateTimeNow.year.toString() + 254 double endDay = (DateTime.parse((dateTimeNow.year.toString() +
263 "-" + 255 "-" +
264 Utils.addZeroNumber(dateTimeNow.month) + 256 Utils.addZeroNumber(dateTimeNow.month) +
@@ -270,7 +262,7 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -270,7 +262,7 @@ class NoteBookPageState extends State<NoteBookPage> {
270 return startDay.floor().toString() + "-" + endDay.floor().toString(); 262 return startDay.floor().toString() + "-" + endDay.floor().toString();
271 } 263 }
272 264
273 - //获取订单统计数目 265 +//获取订单统计数目
274 _reserveCountDay() async { 266 _reserveCountDay() async {
275 NoteBookModel model = Provider.of<NoteBookModel>(context, listen: false); 267 NoteBookModel model = Provider.of<NoteBookModel>(context, listen: false);
276 Map<String, String> params = { 268 Map<String, String> params = {
@@ -289,7 +281,7 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -289,7 +281,7 @@ class NoteBookPageState extends State<NoteBookPage> {
289 await model.getReserveCountDay(context, params); 281 await model.getReserveCountDay(context, params);
290 } 282 }
291 283
292 - //构建List表头 284 +//构建List表头
293 Widget _buildListTitle() { 285 Widget _buildListTitle() {
294 return Container( 286 return Container(
295 width: double.infinity, 287 width: double.infinity,
@@ -360,21 +352,21 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -360,21 +352,21 @@ class NoteBookPageState extends State<NoteBookPage> {
360 //刷新当前页面的日历显示 352 //刷新当前页面的日历显示
361 _refreshPageCalendar(DateTime day) { 353 _refreshPageCalendar(DateTime day) {
362 setState(() { 354 setState(() {
363 - // DateTime dateNow = DateTime.now();  
364 - // dateText = "${day.year}年 " +  
365 - // Utils.addZeroNumber(day.month) +  
366 - // "月" +  
367 - // Utils.addZeroNumber(day.day) +  
368 - // "日";  
369 - // if (Utils.isOneDay(day, dateNow)) {  
370 - // dateText += " 今天";  
371 - // } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 1)))) {  
372 - // dateText += " 明天";  
373 - // } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 2)))) {  
374 - // dateText += " 后天";  
375 - // } else {  
376 - // dateText += " 周${Utils.formatWeekDayNum(day.weekday)}";  
377 - // } 355 +// DateTime dateNow = DateTime.now();
  356 +// dateText = "${day.year}年 " +
  357 +// Utils.addZeroNumber(day.month) +
  358 +// "月" +
  359 +// Utils.addZeroNumber(day.day) +
  360 +// "日";
  361 +// if (Utils.isOneDay(day, dateNow)) {
  362 +// dateText += " 今天";
  363 +// } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 1)))) {
  364 +// dateText += " 明天";
  365 +// } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 2)))) {
  366 +// dateText += " 后天";
  367 +// } else {
  368 +// dateText += " 周${Utils.formatWeekDayNum(day.weekday)}";
  369 +// }
378 370
379 dateTimeNow = day; 371 dateTimeNow = day;
380 Duration days = day.difference(DateTime.now()); 372 Duration days = day.difference(DateTime.now());
@@ -391,7 +383,7 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -391,7 +383,7 @@ class NoteBookPageState extends State<NoteBookPage> {
391 }); 383 });
392 } 384 }
393 385
394 - //生成日期文本 386 +//生成日期文本
395 _createDateText(DateTime day) { 387 _createDateText(DateTime day) {
396 if (Utils.isOneDay(day, dateTimeNow)) return; //日期没变 388 if (Utils.isOneDay(day, dateTimeNow)) return; //日期没变
397 _refreshPageCalendar(day); 389 _refreshPageCalendar(day);
@@ -400,161 +392,147 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -400,161 +392,147 @@ class NoteBookPageState extends State<NoteBookPage> {
400 _reserveCountDay(); 392 _reserveCountDay();
401 } 393 }
402 394
403 - // Widget _buildTabbar() {  
404 - // Container container = Container(  
405 - // color: MyColours.color_ffffff,  
406 - // width: double.infinity,  
407 - // padding: EdgeInsets.only(  
408 - // left: ScreenUtil().setWidth(20), top: ScreenUtil().setWidth(20)),  
409 - // child: Row(  
410 - // mainAxisSize: MainAxisSize.min,  
411 - // children: <Widget>[  
412 - // Container(  
413 - // padding:  
414 - // EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)),  
415 - // child: GestureDetector(  
416 - // onTap: () {  
417 - // if (tabIndex == 0) return;  
418 - // setState(() {  
419 - // tabIndex = 0;  
420 - // _getReserveList();  
421 - // _reserveCountDay();  
422 - // });  
423 - // },  
424 - // child: Column(  
425 - // mainAxisAlignment: MainAxisAlignment.center,  
426 - // children: <Widget>[  
427 - // Text(  
428 - // "全部预订",  
429 - // style: TextStyle(  
430 - // color: tabIndex == 0  
431 - // ? MyColours.color_353535  
432 - // : MyColours.color_999999,  
433 - // fontSize: tabIndex == 0  
434 - // ? ScreenUtil().setSp(36)  
435 - // : ScreenUtil().setSp(28),  
436 - // fontWeight: tabIndex == 0  
437 - // ? FontWeight.bold  
438 - // : FontWeight.normal),  
439 - // ),  
440 - // Align(  
441 - // alignment: Alignment.bottomCenter,  
442 - // child: Container(  
443 - // height: ScreenUtil().setWidth(6),  
444 - // width: ScreenUtil().setWidth(60),  
445 - // margin: EdgeInsets.only(top: ScreenUtil().setWidth(8)),  
446 - // decoration: tabIndex == 0  
447 - // ? BoxDecoration(  
448 - // color: MyColours.color_199095,  
449 - // borderRadius: BorderRadius.circular(  
450 - // ScreenUtil().setWidth(6)))  
451 - // : BoxDecoration(  
452 - // color: MyColours.color_ffffff,  
453 - // borderRadius: BorderRadius.circular(  
454 - // ScreenUtil().setWidth(6))),  
455 - // ),  
456 - // ),  
457 - // ],  
458 - // )),  
459 - // ),  
460 - // Container(  
461 - // padding:  
462 - // EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)),  
463 - // child: GestureDetector(  
464 - // onTap: () {  
465 - // if (tabIndex == 1) return;  
466 - // setState(() {  
467 - // tabIndex = 1;  
468 - // _getReserveList();  
469 - // _reserveCountDay();  
470 - // });  
471 - // },  
472 - // child: Column(  
473 - // mainAxisAlignment: MainAxisAlignment.center,  
474 - // children: <Widget>[  
475 - // Text(  
476 - // "我录入的",  
477 - // style: TextStyle(  
478 - // color: tabIndex == 1  
479 - // ? MyColours.color_353535  
480 - // : MyColours.color_999999,  
481 - // fontSize: tabIndex == 1  
482 - // ? ScreenUtil().setSp(36)  
483 - // : ScreenUtil().setSp(28),  
484 - // fontWeight: tabIndex == 1  
485 - // ? FontWeight.bold  
486 - // : FontWeight.normal),  
487 - // ),  
488 - // Align(  
489 - // alignment: Alignment.bottomCenter,  
490 - // child: Container(  
491 - // height: ScreenUtil().setWidth(6),  
492 - // width: ScreenUtil().setWidth(60),  
493 - // margin: EdgeInsets.only(top: ScreenUtil().setWidth(8)),  
494 - // decoration: tabIndex == 1  
495 - // ? BoxDecoration(  
496 - // color: MyColours.color_199095,  
497 - // borderRadius: BorderRadius.circular(  
498 - // ScreenUtil().setWidth(6)))  
499 - // : BoxDecoration(  
500 - // color: MyColours.color_ffffff,  
501 - // borderRadius: BorderRadius.circular(  
502 - // ScreenUtil().setWidth(6))),  
503 - // ),  
504 - // ),  
505 - // ],  
506 - // )),  
507 - // ),  
508 - // Spacer(),  
509 - // GestureDetector(  
510 - // onTap: () {  
511 - // NavigatorUtil.goStatisticsPage(context);  
512 - // },  
513 - // child: Container(  
514 - // color: Colors.white,  
515 - // padding: EdgeInsets.only(  
516 - // left: ScreenUtil().setWidth(40),  
517 - // right: ScreenUtil().setWidth(40),  
518 - // bottom: ScreenUtil().setWidth(30)),  
519 - // child: Text(  
520 - // "统计列表",  
521 - // style: TextStyle(  
522 - // color: MyColours.color_199095,  
523 - // fontSize: ScreenUtil().setSp(36),  
524 - // fontWeight: FontWeight.bold),  
525 - // ))),  
526 - // ],  
527 - // ),  
528 - // );  
529 - // return container;  
530 - // }  
531 -  
532 - _simpleState() {  
533 - if (noteBookModel.notebooks.length > 0) {  
534 - if (isSimple) {  
535 - for (Notebook item in noteBookModel.notebooks) {  
536 - item.issimple = true;  
537 - }  
538 - } else {  
539 - for (Notebook item in noteBookModel.notebooks) {  
540 - item.issimple = false;  
541 - }  
542 - }  
543 - }  
544 - } 395 +// Widget _buildTabbar() {
  396 +// Container container = Container(
  397 +// color: MyColours.color_ffffff,
  398 +// width: double.infinity,
  399 +// padding: EdgeInsets.only(
  400 +// left: ScreenUtil().setWidth(20), top: ScreenUtil().setWidth(20)),
  401 +// child: Row(
  402 +// mainAxisSize: MainAxisSize.min,
  403 +// children: <Widget>[
  404 +// Container(
  405 +// padding:
  406 +// EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)),
  407 +// child: GestureDetector(
  408 +// onTap: () {
  409 +// if (tabIndex == 0) return;
  410 +// setState(() {
  411 +// tabIndex = 0;
  412 +// _getReserveList();
  413 +// _reserveCountDay();
  414 +// });
  415 +// },
  416 +// child: Column(
  417 +// mainAxisAlignment: MainAxisAlignment.center,
  418 +// children: <Widget>[
  419 +// Text(
  420 +// "全部预订",
  421 +// style: TextStyle(
  422 +// color: tabIndex == 0
  423 +// ? MyColours.color_353535
  424 +// : MyColours.color_999999,
  425 +// fontSize: tabIndex == 0
  426 +// ? ScreenUtil().setSp(36)
  427 +// : ScreenUtil().setSp(28),
  428 +// fontWeight: tabIndex == 0
  429 +// ? FontWeight.bold
  430 +// : FontWeight.normal),
  431 +// ),
  432 +// Align(
  433 +// alignment: Alignment.bottomCenter,
  434 +// child: Container(
  435 +// height: ScreenUtil().setWidth(6),
  436 +// width: ScreenUtil().setWidth(60),
  437 +// margin: EdgeInsets.only(top: ScreenUtil().setWidth(8)),
  438 +// decoration: tabIndex == 0
  439 +// ? BoxDecoration(
  440 +// color: MyColours.color_199095,
  441 +// borderRadius: BorderRadius.circular(
  442 +// ScreenUtil().setWidth(6)))
  443 +// : BoxDecoration(
  444 +// color: MyColours.color_ffffff,
  445 +// borderRadius: BorderRadius.circular(
  446 +// ScreenUtil().setWidth(6))),
  447 +// ),
  448 +// ),
  449 +// ],
  450 +// )),
  451 +// ),
  452 +// Container(
  453 +// padding:
  454 +// EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)),
  455 +// child: GestureDetector(
  456 +// onTap: () {
  457 +// if (tabIndex == 1) return;
  458 +// setState(() {
  459 +// tabIndex = 1;
  460 +// _getReserveList();
  461 +// _reserveCountDay();
  462 +// });
  463 +// },
  464 +// child: Column(
  465 +// mainAxisAlignment: MainAxisAlignment.center,
  466 +// children: <Widget>[
  467 +// Text(
  468 +// "我录入的",
  469 +// style: TextStyle(
  470 +// color: tabIndex == 1
  471 +// ? MyColours.color_353535
  472 +// : MyColours.color_999999,
  473 +// fontSize: tabIndex == 1
  474 +// ? ScreenUtil().setSp(36)
  475 +// : ScreenUtil().setSp(28),
  476 +// fontWeight: tabIndex == 1
  477 +// ? FontWeight.bold
  478 +// : FontWeight.normal),
  479 +// ),
  480 +// Align(
  481 +// alignment: Alignment.bottomCenter,
  482 +// child: Container(
  483 +// height: ScreenUtil().setWidth(6),
  484 +// width: ScreenUtil().setWidth(60),
  485 +// margin: EdgeInsets.only(top: ScreenUtil().setWidth(8)),
  486 +// decoration: tabIndex == 1
  487 +// ? BoxDecoration(
  488 +// color: MyColours.color_199095,
  489 +// borderRadius: BorderRadius.circular(
  490 +// ScreenUtil().setWidth(6)))
  491 +// : BoxDecoration(
  492 +// color: MyColours.color_ffffff,
  493 +// borderRadius: BorderRadius.circular(
  494 +// ScreenUtil().setWidth(6))),
  495 +// ),
  496 +// ),
  497 +// ],
  498 +// )),
  499 +// ),
  500 +// Spacer(),
  501 +// GestureDetector(
  502 +// onTap: () {
  503 +// NavigatorUtil.goStatisticsPage(context);
  504 +// },
  505 +// child: Container(
  506 +// color: Colors.white,
  507 +// padding: EdgeInsets.only(
  508 +// left: ScreenUtil().setWidth(40),
  509 +// right: ScreenUtil().setWidth(40),
  510 +// bottom: ScreenUtil().setWidth(30)),
  511 +// child: Text(
  512 +// "统计列表",
  513 +// style: TextStyle(
  514 +// color: MyColours.color_199095,
  515 +// fontSize: ScreenUtil().setSp(36),
  516 +// fontWeight: FontWeight.bold),
  517 +// ))),
  518 +// ],
  519 +// ),
  520 +// );
  521 +// return container;
  522 +// }
545 523
546 - //获取全选按钮的状态 true or false 524 +//获取全选按钮的状态 true or false
547 getCheckValue() { 525 getCheckValue() {
548 bool temp = noteBookModel.notebooks.any((value) { 526 bool temp = noteBookModel.notebooks.any((value) {
549 return value.issimple == false; 527 return value.issimple == false;
550 }); 528 });
551 if (temp == true) { 529 if (temp == true) {
552 - isSimple = false; 530 + noteBookModel.isSimple = false;
553 } else { 531 } else {
554 - isSimple = true; 532 + noteBookModel.isSimple = true;
555 } 533 }
556 setState(() {}); 534 setState(() {});
557 - App.sp.setBool("isSimple", isSimple); 535 + App.sp.setBool("isSimple", noteBookModel.isSimple);
558 } 536 }
559 537
560 ///单个item切换模式 538 ///单个item切换模式
@@ -565,7 +543,7 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -565,7 +543,7 @@ class NoteBookPageState extends State<NoteBookPage> {
565 543
566 @override 544 @override
567 Widget build(BuildContext context) { 545 Widget build(BuildContext context) {
568 - // TODO: implement build 546 +// TODO: implement build
569 userModel = Provider.of<UserModel>(context, listen: false); 547 userModel = Provider.of<UserModel>(context, listen: false);
570 noteBookModel = Provider.of<NoteBookModel>(context, listen: true); 548 noteBookModel = Provider.of<NoteBookModel>(context, listen: true);
571 int sum = 3; 549 int sum = 3;
@@ -603,10 +581,10 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -603,10 +581,10 @@ class NoteBookPageState extends State<NoteBookPage> {
603 headerVisible: false, 581 headerVisible: false,
604 startingDayOfWeek: startingDayOfWeek, 582 startingDayOfWeek: startingDayOfWeek,
605 startDay: DateTime.now(), 583 startDay: DateTime.now(),
606 - // endDay: DateTime.now().add(Duration(days: 5)), 584 +// endDay: DateTime.now().add(Duration(days: 5)),
607 onDaySelected: (day, _, holidays) { 585 onDaySelected: (day, _, holidays) {
608 if (!Utils.isOneDay(day, dateTimeNow)) { 586 if (!Utils.isOneDay(day, dateTimeNow)) {
609 - //不是一天 587 +//不是一天
610 dateTimeNow = day; 588 dateTimeNow = day;
611 clearSel = false; 589 clearSel = false;
612 setState(() { 590 setState(() {
@@ -640,17 +618,17 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -640,17 +618,17 @@ class NoteBookPageState extends State<NoteBookPage> {
640 titleTextBuilder: (dateTime, _) { 618 titleTextBuilder: (dateTime, _) {
641 return ''; 619 return '';
642 }, 620 },
643 - // titleTextStyle: TextStyle(  
644 - // color: MyColours.font_color_333333,  
645 - // fontSize: ScreenUtil().setSp(32)),  
646 - // leftChevronIcon: Image(  
647 - // image: AssetImage(  
648 - // Utils.getImgPath('left_arrow')),  
649 - // alignment: Alignment.center,  
650 - // ),  
651 - // rightChevronIcon: const Icon(  
652 - // Icons.keyboard_arrow_right,  
653 - // color: MyColours.font_color_333333), 621 +// titleTextStyle: TextStyle(
  622 +// color: MyColours.font_color_333333,
  623 +// fontSize: ScreenUtil().setSp(32)),
  624 +// leftChevronIcon: Image(
  625 +// image: AssetImage(
  626 +// Utils.getImgPath('left_arrow')),
  627 +// alignment: Alignment.center,
  628 +// ),
  629 +// rightChevronIcon: const Icon(
  630 +// Icons.keyboard_arrow_right,
  631 +// color: MyColours.font_color_333333),
654 ), 632 ),
655 builders: CalendarBuilders( 633 builders: CalendarBuilders(
656 dayBuilder: (context, dateTime, events) { 634 dayBuilder: (context, dateTime, events) {
@@ -822,7 +800,7 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -822,7 +800,7 @@ class NoteBookPageState extends State<NoteBookPage> {
822 ], 800 ],
823 begin: Alignment.topCenter, 801 begin: Alignment.topCenter,
824 end: Alignment.bottomCenter), 802 end: Alignment.bottomCenter),
825 -// border: Border.all(color: MyColours.color_FFB116) 803 +// border: Border.all(color: MyColours.color_FFB116)
826 ), 804 ),
827 alignment: Alignment.center, 805 alignment: Alignment.center,
828 margin: EdgeInsets.all( 806 margin: EdgeInsets.all(
@@ -841,25 +819,25 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -841,25 +819,25 @@ class NoteBookPageState extends State<NoteBookPage> {
841 ) 819 )
842 ]); 820 ]);
843 }, 821 },
844 - // todayDayBuilder: (context, date, _) {  
845 - // return Container(  
846 - // decoration: BoxDecoration(  
847 - // shape: BoxShape.circle,  
848 - // border: Border.all(  
849 - // color: MyColours.color_24A4A8, width: 1)),  
850 - // alignment: Alignment.center,  
851 - // margin: const EdgeInsets.all(6.0),  
852 - // padding: const EdgeInsets.only(  
853 - // bottom: 4.0, left: 8.0, right: 8.0, top: 4.0),  
854 - // child: Text(  
855 - // '今',  
856 - // style: TextStyle().copyWith(  
857 - // fontSize: ScreenUtil().setSp(32),  
858 - // color: MyColours.color_438E93,  
859 - // fontWeight: FontWeight.bold),  
860 - // ),  
861 - // );  
862 - // }, 822 +// todayDayBuilder: (context, date, _) {
  823 +// return Container(
  824 +// decoration: BoxDecoration(
  825 +// shape: BoxShape.circle,
  826 +// border: Border.all(
  827 +// color: MyColours.color_24A4A8, width: 1)),
  828 +// alignment: Alignment.center,
  829 +// margin: const EdgeInsets.all(6.0),
  830 +// padding: const EdgeInsets.only(
  831 +// bottom: 4.0, left: 8.0, right: 8.0, top: 4.0),
  832 +// child: Text(
  833 +// '今',
  834 +// style: TextStyle().copyWith(
  835 +// fontSize: ScreenUtil().setSp(32),
  836 +// color: MyColours.color_438E93,
  837 +// fontWeight: FontWeight.bold),
  838 +// ),
  839 +// );
  840 +// },
863 singleMarkerBuilder: 841 singleMarkerBuilder:
864 (context, dateTime, event) { 842 (context, dateTime, event) {
865 return Container( 843 return Container(
@@ -929,8 +907,8 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -929,8 +907,8 @@ class NoteBookPageState extends State<NoteBookPage> {
929 ScreenUtil().setWidth(20), 907 ScreenUtil().setWidth(20),
930 )), 908 )),
931 child: Row( 909 child: Row(
932 - // mainAxisAlignment: MainAxisAlignment.spaceEvenly,  
933 - // crossAxisAlignment: CrossAxisAlignment.center, 910 +// mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  911 +// crossAxisAlignment: CrossAxisAlignment.center,
934 children: <Widget>[ 912 children: <Widget>[
935 Offstage( 913 Offstage(
936 offstage: 914 offstage:
@@ -1067,10 +1045,10 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -1067,10 +1045,10 @@ class NoteBookPageState extends State<NoteBookPage> {
1067 InkWell( 1045 InkWell(
1068 onTap: () { 1046 onTap: () {
1069 setState(() { 1047 setState(() {
1070 - isSimple = !isSimple; 1048 + noteBookModel.isSimple = !noteBookModel.isSimple;
1071 }); 1049 });
1072 - _simpleState();  
1073 - App.sp.setBool("isSimple", isSimple); 1050 + noteBookModel.simpleState();
  1051 + App.sp.setBool("isSimple", noteBookModel.isSimple);
1074 }, 1052 },
1075 child: Column( 1053 child: Column(
1076 children: [ 1054 children: [
@@ -1083,8 +1061,9 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -1083,8 +1061,9 @@ class NoteBookPageState extends State<NoteBookPage> {
1083 ), 1061 ),
1084 VEmptyView(16), 1062 VEmptyView(16),
1085 Image.asset( 1063 Image.asset(
1086 - Utils.getImgPath(  
1087 - isSimple ? 'f_swich_on' : 'f_swich_off'), 1064 + Utils.getImgPath(noteBookModel.isSimple
  1065 + ? 'f_swich_on'
  1066 + : 'f_swich_off'),
1088 width: ScreenUtil().setWidth(24 * 2)) 1067 width: ScreenUtil().setWidth(24 * 2))
1089 ], 1068 ],
1090 )), 1069 )),
@@ -1131,7 +1110,7 @@ class NoteBookPageState extends State<NoteBookPage> { @@ -1131,7 +1110,7 @@ class NoteBookPageState extends State<NoteBookPage> {
1131 }), 1110 }),
1132 ); 1111 );
1133 }, childCount: model.notebooks.length), 1112 }, childCount: model.notebooks.length),
1134 - // itemExtent: ScreenUtil().setWidth(112), 1113 +// itemExtent: ScreenUtil().setWidth(112),
1135 ) 1114 )
1136 ], 1115 ],
1137 onRefresh: () async { 1116 onRefresh: () async {
@@ -21,12 +21,14 @@ class NoteBookModel extends ChangeNotifier { @@ -21,12 +21,14 @@ class NoteBookModel extends ChangeNotifier {
21 String totalnight = ""; //一天统计 21 String totalnight = ""; //一天统计
22 22
23 PageState pageState = PageState.Loading; 23 PageState pageState = PageState.Loading;
  24 + bool isSimple = true;
24 25
25 //获取已预订订单 26 //获取已预订订单
26 Future<List<Notebook>> getReserveList( 27 Future<List<Notebook>> getReserveList(
27 BuildContext context, Map<String, String> params, 28 BuildContext context, Map<String, String> params,
28 {bool needLoading = false, bool showLoading = true}) async { 29 {bool needLoading = false, bool showLoading = true}) async {
29 if (needLoading) { 30 if (needLoading) {
  31 + // notebooks = [];
30 pageState = PageState.Loading; 32 pageState = PageState.Loading;
31 showLoading = false; 33 showLoading = false;
32 notifyListeners(); 34 notifyListeners();
@@ -108,7 +110,18 @@ class NoteBookModel extends ChangeNotifier { @@ -108,7 +110,18 @@ class NoteBookModel extends ChangeNotifier {
108 110
109 // tableManagerModel.tableOuterList //桌子 111 // tableManagerModel.tableOuterList //桌子
110 // tableManagerModel.areaSunModelList //区域 112 // tableManagerModel.areaSunModelList //区域
111 - 113 + // simpleState();
  114 + if (notebooks.length > 0) {
  115 + if (isSimple) {
  116 + for (Notebook item in notebooks) {
  117 + item.issimple = true;
  118 + }
  119 + } else {
  120 + for (Notebook item in notebooks) {
  121 + item.issimple = false;
  122 + }
  123 + }
  124 + }
112 pageState = PageState.Success; 125 pageState = PageState.Success;
113 } 126 }
114 } else { 127 } else {
@@ -119,6 +132,20 @@ class NoteBookModel extends ChangeNotifier { @@ -119,6 +132,20 @@ class NoteBookModel extends ChangeNotifier {
119 return notebooks; 132 return notebooks;
120 } 133 }
121 134
  135 + simpleState() {
  136 + if (notebooks.length > 0) {
  137 + if (isSimple) {
  138 + for (Notebook item in notebooks) {
  139 + item.issimple = true;
  140 + }
  141 + } else {
  142 + for (Notebook item in notebooks) {
  143 + item.issimple = false;
  144 + }
  145 + }
  146 + }
  147 + }
  148 +
122 //获取订单统计数目 149 //获取订单统计数目
123 getReserveCountDay(BuildContext context, Map<String, String> params) async { 150 getReserveCountDay(BuildContext context, Map<String, String> params) async {
124 BaseResp<Map<String, dynamic>> baseResp = await DioUtil() 151 BaseResp<Map<String, dynamic>> baseResp = await DioUtil()