|
|
|
// import 'package:common_utils/common_utils.dart';
|
|
|
|
// import 'package:dio/dio.dart';
|
|
|
|
// import 'package:flutter/material.dart';
|
|
|
|
// import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
|
|
// import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
// import 'package:one_key/constant/state.dart';
|
|
|
|
// import 'package:one_key/pages/notebook/notebook_item_widget.dart';
|
|
|
|
// import 'package:one_key/provider/notebook_model.dart';
|
|
|
|
// import 'package:one_key/provider/update_model.dart';
|
|
|
|
// import 'package:one_key/provider/user_model.dart';
|
|
|
|
// import 'package:one_key/res/colors.dart';
|
|
|
|
// import 'package:one_key/route/navigator_util.dart';
|
|
|
|
// import 'package:one_key/utils/dialog_util.dart';
|
|
|
|
// import 'package:one_key/utils/event_bus.dart';
|
|
|
|
// import 'package:one_key/utils/utils.dart';
|
|
|
|
// import 'package:one_key/widgets/MyDivider.dart';
|
|
|
|
// import 'package:one_key/widgets/app_bar.dart';
|
|
|
|
// import 'package:one_key/widgets/common_button.dart';
|
|
|
|
// import 'package:one_key/widgets/page_error.dart';
|
|
|
|
// import 'package:one_key/widgets/page_exception.dart';
|
|
|
|
// import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
// class NoteBookPage extends StatefulWidget {
|
|
|
|
// final int tabIndex;
|
|
|
|
|
|
|
|
// final DateTime date;
|
|
|
|
// final String solt;
|
|
|
|
|
|
|
|
// const NoteBookPage({Key key, this.tabIndex = 0, this.date, this.solt})
|
|
|
|
// : super(key: key);
|
|
|
|
// @override
|
|
|
|
// State<StatefulWidget> createState() {
|
|
|
|
// // TODO: implement createState
|
|
|
|
// return new NoteBookPageState();
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
// class NoteBookPageState extends State<NoteBookPage> {
|
|
|
|
// EasyRefreshController _controller;
|
|
|
|
|
|
|
|
// String dateText = ""; //当前显示日期时间
|
|
|
|
// int currTimeIndex = 1; //当前选中时间段
|
|
|
|
// String morning; //早市时间段
|
|
|
|
// String noon; //午市时间段
|
|
|
|
// String night; //晚市时间段
|
|
|
|
|
|
|
|
// DateTime dateTimeNow; //当前日期
|
|
|
|
|
|
|
|
// UserModel userModel;
|
|
|
|
|
|
|
|
// int tabIndex = 0; //当前选中的tab 标签
|
|
|
|
|
|
|
|
// @override
|
|
|
|
// void initState() {
|
|
|
|
// // TODO: implement initState
|
|
|
|
// super.initState();
|
|
|
|
// tabIndex = widget.tabIndex;
|
|
|
|
// LogUtil.v("notebook_page initState");
|
|
|
|
|
|
|
|
// _controller = EasyRefreshController();
|
|
|
|
// // _initTime();
|
|
|
|
// bus.on("refresh_book_list", (args) {
|
|
|
|
// _getReserveList();
|
|
|
|
// });
|
|
|
|
|
|
|
|
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
// _initTime();
|
|
|
|
// setState(() {});
|
|
|
|
// _getReserveList();
|
|
|
|
// _reserveCountDay();
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
|
|
|
|
// @override
|
|
|
|
// void dispose() {
|
|
|
|
// super.dispose();
|
|
|
|
// bus.off("refresh_book_list");
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //初始化时间
|
|
|
|
// _initTime() {
|
|
|
|
// dateTimeNow = widget.date != null ? widget.date : DateTime.now();
|
|
|
|
// dateText = "${dateTimeNow.year}年 " +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.month) +
|
|
|
|
// "月" +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.day) +
|
|
|
|
// "日";
|
|
|
|
// DateTime dateNow = DateTime.now();
|
|
|
|
|
|
|
|
// if (Utils.isOneDay(dateTimeNow, dateNow)) {
|
|
|
|
// dateText += " 今天";
|
|
|
|
// } else if (Utils.isOneDay(dateTimeNow, dateNow.add(Duration(days: 1)))) {
|
|
|
|
// dateText += " 明天";
|
|
|
|
// } else if (Utils.isOneDay(dateTimeNow, dateNow.add(Duration(days: 2)))) {
|
|
|
|
// dateText += " 后天";
|
|
|
|
// } else {
|
|
|
|
// dateText += " 周${Utils.formatWeekDayNum(dateTimeNow.weekday)}";
|
|
|
|
// }
|
|
|
|
|
|
|
|
// morning =
|
|
|
|
// userModel.user.morning.isEmpty ? "00:00-00:00" : userModel.user.morning;
|
|
|
|
// noon = userModel.user.noon.isEmpty ? "00:00-00:00" : userModel.user.noon;
|
|
|
|
// night = userModel.user.night.isEmpty ? "00:00-00:00" : userModel.user.night;
|
|
|
|
// if (widget.solt == null || widget.solt == "null") {
|
|
|
|
// if (morning != '' &&
|
|
|
|
// dateTimeNow.isBefore(DateTime.parse(dateTimeNow.year.toString() +
|
|
|
|
// "-" +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.month) +
|
|
|
|
// "-" +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.day) +
|
|
|
|
// " " +
|
|
|
|
// morning.split("-")[1] +
|
|
|
|
// ":00"))) {
|
|
|
|
// //未过早市
|
|
|
|
// currTimeIndex = 1;
|
|
|
|
// } else if (noon != '' &&
|
|
|
|
// dateTimeNow.isAfter(DateTime.parse(dateTimeNow.year.toString() +
|
|
|
|
// "-" +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.month) +
|
|
|
|
// "-" +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.day) +
|
|
|
|
// " " +
|
|
|
|
// morning.split("-")[1] +
|
|
|
|
// ":00")) &&
|
|
|
|
// dateTimeNow.isBefore(DateTime.parse(dateTimeNow.year.toString() +
|
|
|
|
// "-" +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.month) +
|
|
|
|
// "-" +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.day) +
|
|
|
|
// " " +
|
|
|
|
// noon.split("-")[1] +
|
|
|
|
// ":00"))) {
|
|
|
|
// //过了早市,未过午市
|
|
|
|
// currTimeIndex = 2;
|
|
|
|
// } else if (night != '' &&
|
|
|
|
// dateTimeNow.isAfter(DateTime.parse(dateTimeNow.year.toString() +
|
|
|
|
// "-" +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.month) +
|
|
|
|
// "-" +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.day) +
|
|
|
|
// " " +
|
|
|
|
// noon.split("-")[1] +
|
|
|
|
// ":00")) &&
|
|
|
|
// dateTimeNow.isBefore(DateTime.parse(dateTimeNow.year.toString() +
|
|
|
|
// "-" +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.month) +
|
|
|
|
// "-" +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.day) +
|
|
|
|
// " " +
|
|
|
|
// night.split("-")[1] +
|
|
|
|
// ":00"))) {
|
|
|
|
// //过了午市,未过晚市
|
|
|
|
// currTimeIndex = 3;
|
|
|
|
// } else {
|
|
|
|
// //过了晚市
|
|
|
|
// currTimeIndex = 3;
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// currTimeIndex = int.parse(widget.solt);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //获取已预订列表
|
|
|
|
// _getReserveList() {
|
|
|
|
// NoteBookModel model = Provider.of<NoteBookModel>(context, listen: false);
|
|
|
|
// Map<String, String> params = {
|
|
|
|
// "sid": userModel.user.sellerid,
|
|
|
|
// "rdate": _getRdate(),
|
|
|
|
// "ddate_solt": currTimeIndex.toString(),
|
|
|
|
// "y": "200",
|
|
|
|
// "x": "1",
|
|
|
|
// "keywords": "",
|
|
|
|
// "sort": "1"
|
|
|
|
// };
|
|
|
|
// if (tabIndex == 1) {
|
|
|
|
// params["account"] = userModel.user.account;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// model.getReserveList(context, params);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //获取一天开始-结束时间字符串
|
|
|
|
// String _getRdate() {
|
|
|
|
// //一天开始时间
|
|
|
|
// double startDay = (DateTime.parse((dateTimeNow.year.toString() +
|
|
|
|
// "-" +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.month) +
|
|
|
|
// "-" +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.day) +
|
|
|
|
// " 00:00:00"))
|
|
|
|
// .millisecondsSinceEpoch) /
|
|
|
|
// 1000;
|
|
|
|
// //一天结束时间
|
|
|
|
// double endDay = (DateTime.parse((dateTimeNow.year.toString() +
|
|
|
|
// "-" +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.month) +
|
|
|
|
// "-" +
|
|
|
|
// Utils.addZeroNumber(dateTimeNow.day) +
|
|
|
|
// " 23:59:59"))
|
|
|
|
// .millisecondsSinceEpoch) /
|
|
|
|
// 1000;
|
|
|
|
// return startDay.floor().toString() + "-" + endDay.floor().toString();
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //获取订单统计数目
|
|
|
|
// _reserveCountDay() {
|
|
|
|
// NoteBookModel model = Provider.of<NoteBookModel>(context, listen: false);
|
|
|
|
// Map<String, String> params = {
|
|
|
|
// "sid": userModel.user.sellerid,
|
|
|
|
// "day": dateTimeNow.year.toString() +
|
|
|
|
// (dateTimeNow.month < 10
|
|
|
|
// ? "0" + dateTimeNow.month.toString()
|
|
|
|
// : dateTimeNow.month.toString()) +
|
|
|
|
// (dateTimeNow.day < 10
|
|
|
|
// ? "0" + dateTimeNow.day.toString()
|
|
|
|
// : dateTimeNow.day.toString())
|
|
|
|
// };
|
|
|
|
// if (tabIndex == 1) {
|
|
|
|
// params["account"] = userModel.user.account;
|
|
|
|
// }
|
|
|
|
// model.getReserveCountDay(context, params);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //构建List表头
|
|
|
|
// Widget _buildListTitle() {
|
|
|
|
// return Container(
|
|
|
|
// width: double.infinity,
|
|
|
|
// height: ScreenUtil().setHeight(75),
|
|
|
|
// color: MyColours.color_ffffff,
|
|
|
|
// child: Row(
|
|
|
|
// children: <Widget>[
|
|
|
|
// Container(
|
|
|
|
// width: ScreenUtil().setWidth(171),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// child: Text(
|
|
|
|
// "桌号",
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_353535,
|
|
|
|
// fontSize: ScreenUtil().setSp(28)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// MyDivider(
|
|
|
|
// ScreenUtil().setWidth(1),
|
|
|
|
// ScreenUtil().setHeight(65),
|
|
|
|
// color: MyColours.color_ededed,
|
|
|
|
// ),
|
|
|
|
// Container(
|
|
|
|
// width: ScreenUtil().setWidth(230),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// child: Text(
|
|
|
|
// "用户姓名",
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_353535,
|
|
|
|
// fontSize: ScreenUtil().setSp(28)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// MyDivider(
|
|
|
|
// ScreenUtil().setWidth(1),
|
|
|
|
// ScreenUtil().setHeight(90),
|
|
|
|
// color: MyColours.color_ededed,
|
|
|
|
// ),
|
|
|
|
// Container(
|
|
|
|
// width: ScreenUtil().setWidth(159),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// child: Text(
|
|
|
|
// "时间",
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_353535,
|
|
|
|
// fontSize: ScreenUtil().setSp(28)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// MyDivider(
|
|
|
|
// ScreenUtil().setWidth(1),
|
|
|
|
// ScreenUtil().setHeight(90),
|
|
|
|
// color: MyColours.color_ededed,
|
|
|
|
// ),
|
|
|
|
// Container(
|
|
|
|
// width: ScreenUtil().setWidth(184),
|
|
|
|
// alignment: Alignment.center,
|
|
|
|
// child: Text(
|
|
|
|
// "操作",
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_353535,
|
|
|
|
// fontSize: ScreenUtil().setSp(28)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
|
|
|
|
// //生成日期文本
|
|
|
|
// _createDateText(DateTime day) {
|
|
|
|
// if (Utils.isOneDay(day, dateTimeNow)) return; //日期没变
|
|
|
|
// setState(() {
|
|
|
|
// DateTime dateNow = DateTime.now();
|
|
|
|
// dateText = "${day.year}年 " +
|
|
|
|
// Utils.addZeroNumber(day.month) +
|
|
|
|
// "月" +
|
|
|
|
// Utils.addZeroNumber(day.day) +
|
|
|
|
// "日";
|
|
|
|
// if (Utils.isOneDay(day, dateNow)) {
|
|
|
|
// dateText += " 今天";
|
|
|
|
// } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 1)))) {
|
|
|
|
// dateText += " 明天";
|
|
|
|
// } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 2)))) {
|
|
|
|
// dateText += " 后天";
|
|
|
|
// } else {
|
|
|
|
// dateText += " 周${Utils.formatWeekDayNum(day.weekday)}";
|
|
|
|
// }
|
|
|
|
// dateTimeNow = day;
|
|
|
|
// });
|
|
|
|
// _getReserveList();
|
|
|
|
// _reserveCountDay();
|
|
|
|
// }
|
|
|
|
|
|
|
|
// Widget _buildTabbar() {
|
|
|
|
// Container container = Container(
|
|
|
|
// color: MyColours.color_ffffff,
|
|
|
|
// width: double.infinity,
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// left: ScreenUtil().setWidth(20), top: ScreenUtil().setWidth(20)),
|
|
|
|
// child: Row(
|
|
|
|
// mainAxisSize: MainAxisSize.min,
|
|
|
|
// children: <Widget>[
|
|
|
|
// Container(
|
|
|
|
// padding:
|
|
|
|
// EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)),
|
|
|
|
// child: GestureDetector(
|
|
|
|
// onTap: () {
|
|
|
|
// if (tabIndex == 0) return;
|
|
|
|
// setState(() {
|
|
|
|
// tabIndex = 0;
|
|
|
|
// _getReserveList();
|
|
|
|
// _reserveCountDay();
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: Column(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
// children: <Widget>[
|
|
|
|
// Text(
|
|
|
|
// "全部预订",
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: tabIndex == 0
|
|
|
|
// ? MyColours.color_353535
|
|
|
|
// : MyColours.color_999999,
|
|
|
|
// fontSize: tabIndex == 0
|
|
|
|
// ? ScreenUtil().setSp(36)
|
|
|
|
// : ScreenUtil().setSp(28),
|
|
|
|
// fontWeight: tabIndex == 0
|
|
|
|
// ? FontWeight.bold
|
|
|
|
// : FontWeight.normal),
|
|
|
|
// ),
|
|
|
|
// Align(
|
|
|
|
// alignment: Alignment.bottomCenter,
|
|
|
|
// child: Container(
|
|
|
|
// height: ScreenUtil().setWidth(6),
|
|
|
|
// width: ScreenUtil().setWidth(60),
|
|
|
|
// margin: EdgeInsets.only(top: ScreenUtil().setWidth(8)),
|
|
|
|
// decoration: tabIndex == 0
|
|
|
|
// ? BoxDecoration(
|
|
|
|
// color: MyColours.color_199095,
|
|
|
|
// borderRadius: BorderRadius.circular(
|
|
|
|
// ScreenUtil().setWidth(6)))
|
|
|
|
// : BoxDecoration(
|
|
|
|
// color: MyColours.color_ffffff,
|
|
|
|
// borderRadius: BorderRadius.circular(
|
|
|
|
// ScreenUtil().setWidth(6))),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ],
|
|
|
|
// )),
|
|
|
|
// ),
|
|
|
|
// Container(
|
|
|
|
// padding:
|
|
|
|
// EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)),
|
|
|
|
// child: GestureDetector(
|
|
|
|
// onTap: () {
|
|
|
|
// if (tabIndex == 1) return;
|
|
|
|
// setState(() {
|
|
|
|
// tabIndex = 1;
|
|
|
|
// _getReserveList();
|
|
|
|
// _reserveCountDay();
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: Column(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
// children: <Widget>[
|
|
|
|
// Text(
|
|
|
|
// "我录入的",
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: tabIndex == 1
|
|
|
|
// ? MyColours.color_353535
|
|
|
|
// : MyColours.color_999999,
|
|
|
|
// fontSize: tabIndex == 1
|
|
|
|
// ? ScreenUtil().setSp(36)
|
|
|
|
// : ScreenUtil().setSp(28),
|
|
|
|
// fontWeight: tabIndex == 1
|
|
|
|
// ? FontWeight.bold
|
|
|
|
// : FontWeight.normal),
|
|
|
|
// ),
|
|
|
|
// Align(
|
|
|
|
// alignment: Alignment.bottomCenter,
|
|
|
|
// child: Container(
|
|
|
|
// height: ScreenUtil().setWidth(6),
|
|
|
|
// width: ScreenUtil().setWidth(60),
|
|
|
|
// margin: EdgeInsets.only(top: ScreenUtil().setWidth(8)),
|
|
|
|
// decoration: tabIndex == 1
|
|
|
|
// ? BoxDecoration(
|
|
|
|
// color: MyColours.color_199095,
|
|
|
|
// borderRadius: BorderRadius.circular(
|
|
|
|
// ScreenUtil().setWidth(6)))
|
|
|
|
// : BoxDecoration(
|
|
|
|
// color: MyColours.color_ffffff,
|
|
|
|
// borderRadius: BorderRadius.circular(
|
|
|
|
// ScreenUtil().setWidth(6))),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ],
|
|
|
|
// )),
|
|
|
|
// ),
|
|
|
|
// Spacer(),
|
|
|
|
// GestureDetector(
|
|
|
|
// onTap: () {
|
|
|
|
// NavigatorUtil.goStatisticsPage(context);
|
|
|
|
// },
|
|
|
|
// child: Container(
|
|
|
|
// color: Colors.white,
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// left: ScreenUtil().setWidth(40),
|
|
|
|
// right: ScreenUtil().setWidth(40),
|
|
|
|
// bottom: ScreenUtil().setWidth(30)),
|
|
|
|
// child: Text(
|
|
|
|
// "统计列表",
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_199095,
|
|
|
|
// fontSize: ScreenUtil().setSp(36),
|
|
|
|
// fontWeight: FontWeight.bold),
|
|
|
|
// ))),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// );
|
|
|
|
// return container;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// @override
|
|
|
|
// Widget build(BuildContext context) {
|
|
|
|
// // TODO: implement build
|
|
|
|
// userModel = Provider.of<UserModel>(context, listen: false);
|
|
|
|
// return Container(
|
|
|
|
// width: double.infinity,
|
|
|
|
// height: double.infinity,
|
|
|
|
// color: MyColours.color_f5f5f5,
|
|
|
|
// child: Column(
|
|
|
|
// children: <Widget>[
|
|
|
|
// _buildTabbar(),
|
|
|
|
// Container(
|
|
|
|
// color: MyColours.color_ffffff,
|
|
|
|
// width: double.infinity,
|
|
|
|
// padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(16)),
|
|
|
|
// child: Row(
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
// children: <Widget>[
|
|
|
|
// Expanded(
|
|
|
|
// child: Center(
|
|
|
|
// child: GestureDetector(
|
|
|
|
// onTap: () {
|
|
|
|
// DialogUtil.showCalendarDialog(context, dateTimeNow)
|
|
|
|
// .then((day) {
|
|
|
|
// if (day != null) {
|
|
|
|
// _createDateText(day);
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// child: Container(
|
|
|
|
// child: Text(
|
|
|
|
// dateText,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_199095,
|
|
|
|
// fontSize: ScreenUtil().setSp(34)),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// MyDivider(
|
|
|
|
// ScreenUtil().setWidth(2),
|
|
|
|
// ScreenUtil().setHeight(68),
|
|
|
|
// color: MyColours.color_E0E0E0,
|
|
|
|
// ),
|
|
|
|
// Expanded(
|
|
|
|
// child: Padding(
|
|
|
|
// padding: EdgeInsets.symmetric(
|
|
|
|
// horizontal: ScreenUtil().setWidth(30)),
|
|
|
|
// child: Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
// children: <Widget>[
|
|
|
|
// Offstage(
|
|
|
|
// offstage: morning == "00:00-00:00" ? true : false,
|
|
|
|
// child: Padding(
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// right: ScreenUtil().setWidth(18)),
|
|
|
|
// child: CommonButton(
|
|
|
|
// content: "早市",
|
|
|
|
// state: currTimeIndex == 1 ? 1 : 0,
|
|
|
|
// width: 92,
|
|
|
|
// height: 48,
|
|
|
|
// fontSize: 32,
|
|
|
|
// onPress: () {
|
|
|
|
// if (currTimeIndex == 1) return;
|
|
|
|
// setState(() {
|
|
|
|
// currTimeIndex = 1;
|
|
|
|
// });
|
|
|
|
// _getReserveList();
|
|
|
|
// },
|
|
|
|
// ))),
|
|
|
|
// Offstage(
|
|
|
|
// offstage: noon == "00:00-00:00" ? true : false,
|
|
|
|
// child: Padding(
|
|
|
|
// padding: EdgeInsets.only(
|
|
|
|
// right: ScreenUtil().setWidth(18)),
|
|
|
|
// child: CommonButton(
|
|
|
|
// content: "午市",
|
|
|
|
// state: currTimeIndex == 2 ? 1 : 0,
|
|
|
|
// width: 92,
|
|
|
|
// height: 48,
|
|
|
|
// fontSize: 32,
|
|
|
|
// onPress: () {
|
|
|
|
// if (currTimeIndex == 2) return;
|
|
|
|
// setState(() {
|
|
|
|
// currTimeIndex = 2;
|
|
|
|
// });
|
|
|
|
// _getReserveList();
|
|
|
|
// },
|
|
|
|
// ))),
|
|
|
|
// Offstage(
|
|
|
|
// offstage: night == "00:00-00:00" ? true : false,
|
|
|
|
// child: Container(
|
|
|
|
// // padding: EdgeInsets.symmetric(
|
|
|
|
// // horizontal: ScreenUtil().setWidth(10)),
|
|
|
|
// child: CommonButton(
|
|
|
|
// content: "晚市",
|
|
|
|
// state: currTimeIndex == 3 ? 1 : 0,
|
|
|
|
// width: 92,
|
|
|
|
// height: 48,
|
|
|
|
// fontSize: 32,
|
|
|
|
// onPress: () {
|
|
|
|
// if (currTimeIndex == 3) return;
|
|
|
|
// setState(() {
|
|
|
|
// currTimeIndex = 3;
|
|
|
|
// });
|
|
|
|
// _getReserveList();
|
|
|
|
// },
|
|
|
|
// )),
|
|
|
|
// ),
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// )
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// Selector<NoteBookModel, String>(
|
|
|
|
// selector: (context, model) => model.total,
|
|
|
|
// builder: (context, total, child) {
|
|
|
|
// return Container(
|
|
|
|
// width: double.infinity,
|
|
|
|
// alignment: Alignment.centerLeft,
|
|
|
|
// padding: EdgeInsets.only(left: ScreenUtil().setWidth(38)),
|
|
|
|
// height: ScreenUtil().setHeight(72),
|
|
|
|
// color: MyColours.color_f5f5f5,
|
|
|
|
// child: Text(
|
|
|
|
// total,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: MyColours.color_353535,
|
|
|
|
// fontSize: ScreenUtil().setSp(26)),
|
|
|
|
// ),
|
|
|
|
// );
|
|
|
|
// },
|
|
|
|
// ),
|
|
|
|
// _buildListTitle(),
|
|
|
|
// Expanded(child: Consumer<NoteBookModel>(
|
|
|
|
// builder: (context, model, _) {
|
|
|
|
// if (model.pageState != PageState.Success) {
|
|
|
|
// return ExceptionPage(
|
|
|
|
// pageState: model.pageState,
|
|
|
|
// callback: () {
|
|
|
|
// _getReserveList();
|
|
|
|
// _reserveCountDay();
|
|
|
|
// },
|
|
|
|
// emptyMsg: "暂时没有预订哦",
|
|
|
|
// emptyImg: "empty_search",
|
|
|
|
// showMsg: "加载中,请稍后...",
|
|
|
|
// );
|
|
|
|
// } else {
|
|
|
|
// return EasyRefresh.custom(
|
|
|
|
// controller: _controller,
|
|
|
|
// slivers: [
|
|
|
|
// SliverList(
|
|
|
|
// delegate: SliverChildBuilderDelegate(
|
|
|
|
// (BuildContext context, int index) {
|
|
|
|
// return NoteBookItem(model.notebooks[index], index);
|
|
|
|
// }, childCount: model.notebooks.length),
|
|
|
|
// // itemExtent: ScreenUtil().setWidth(112),
|
|
|
|
// )
|
|
|
|
// ],
|
|
|
|
// onRefresh: () async {
|
|
|
|
// _getReserveList();
|
|
|
|
// },
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
// },
|
|
|
|
// ))
|
|
|
|
// ],
|
|
|
|
// ),
|
|
|
|
// );
|
|
|
|
// }
|
|
|
|
// } |
...
|
...
|
|