Commit ef8f6dff62ef8a704714c8507571f1b83effcb5f

Authored by wdn127929
1 parent 93533c26

宴会

  1 +/**
  2 + * 宴会看板
  3 + */
  4 +
  5 +import 'package:flutter/material.dart';
  6 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  7 +import 'package:one_key/res/colors.dart';
  8 +import 'package:one_key/widgets/system_app_bar.dart';
  9 +import 'package:table_calendar/table_calendar.dart';
  10 +
  11 +import '../../utils/utils.dart';
  12 +import '../../widgets/round_button.dart';
  13 +import '../../widgets/v_empty_view.dart';
  14 +import 'feast_board.item.dart';
  15 +
  16 +class FeastBoardPage extends StatefulWidget {
  17 + FeastBoardPage({Key key}) : super(key: key);
  18 +
  19 + @override
  20 + _FeastBoardPageState createState() => _FeastBoardPageState();
  21 +}
  22 +
  23 +class _FeastBoardPageState extends State<FeastBoardPage> {
  24 + CalendarController _calendarController = CalendarController();
  25 + DateTime dateTimeNow; //当前日期
  26 + bool calendarShow = true; //日历展开
  27 + @override
  28 + void initState() {
  29 + // TODO: implement initState
  30 + super.initState();
  31 + dateTimeNow = DateTime.now();
  32 + Utils.changeStatusColor(color: MyColours.color_438E93);
  33 + }
  34 +
  35 + //解析返回显示的日期
  36 + static String _parseDateDay(DateTime dateTime) {
  37 + DateTime now = DateTime.now();
  38 + if (Utils.isOneDay(dateTime, now)) {
  39 + return "今";
  40 + }
  41 + // else if (Utils.isOneDay(dateTime, now.add(Duration(days: 1)))) {
  42 + // return "明";
  43 + // } else if (Utils.isOneDay(dateTime, now.add(Duration(days: 2)))) {
  44 + // return "后";
  45 + // }
  46 + else {
  47 + return '${Utils.lunarCalendarHolidaysShow(dateTime)}';
  48 + }
  49 + }
  50 +
  51 + @override
  52 + Widget build(BuildContext context) {
  53 + return Scaffold(
  54 + backgroundColor: MyColours.color_ffffff,
  55 + appBar: SystemAppBar(
  56 + '宴会看板',
  57 + needWhite: true,
  58 + bgColor: MyColours.color_438E93,
  59 + titleColor: MyColours.color_F6F6F6,
  60 + onTap: () {
  61 + Navigator.pop(context);
  62 + },
  63 + ),
  64 + body: Column(
  65 + children: <Widget>[
  66 + Container(
  67 + decoration:
  68 + BoxDecoration(color: MyColours.color_ffffff, boxShadow: [
  69 + BoxShadow(
  70 + offset: Offset(
  71 + 0,
  72 + ScreenUtil().setWidth(8),
  73 + ),
  74 + blurRadius: ScreenUtil().setWidth(8),
  75 + color: MyColours.color_26000000)
  76 + ]),
  77 + child: Column(
  78 + children: [
  79 + TableCalendar(
  80 + // rowHeight: ScreenUtil().setWidth(100),
  81 + rowHeight: ScreenUtil().setWidth(106),
  82 + calendarController: _calendarController,
  83 + initialSelectedDay: dateTimeNow,
  84 + onDaySelected: (day, events, holidays) {
  85 + if (!Utils.isOneDay(day, dateTimeNow)) {
  86 + //不是一天
  87 + dateTimeNow = day;
  88 + }
  89 + },
  90 + // holidays: _holidays,
  91 + availableGestures: AvailableGestures.none,
  92 +
  93 + locale: "zh_CN",
  94 + initialCalendarFormat: calendarShow
  95 + ? CalendarFormat.month
  96 + : CalendarFormat.week,
  97 + headerStyle: HeaderStyle(
  98 + decoration: BoxDecoration(color: MyColours.color_ffffff),
  99 + headerPadding: EdgeInsets.symmetric(
  100 + // vertical: ScreenUtil().setWidth(24),
  101 + horizontal: ScreenUtil().setWidth(66)),
  102 + formatButtonVisible: false,
  103 + centerHeaderTitle: true,
  104 + titleTextBuilder: (dateTime, _) {
  105 + return dateTime.year.toString() +
  106 + ' ' +
  107 + "年" +
  108 + ' ' +
  109 + dateTime.month.toString() +
  110 + ' ' +
  111 + "月";
  112 + },
  113 + titleTextStyle: TextStyle(
  114 + fontWeight: FontWeight.bold,
  115 + color: MyColours.color_515151,
  116 + fontSize: ScreenUtil().setSp(44)),
  117 + leftChevronIcon: Icon(Icons.chevron_left,
  118 + color: MyColours.color_000000,
  119 + size: ScreenUtil().setWidth(48)),
  120 + rightChevronIcon: Icon(Icons.chevron_right,
  121 + color: MyColours.color_000000,
  122 + size: ScreenUtil().setWidth(48)),
  123 + ),
  124 + calendarStyle: CalendarStyle(
  125 + contentPadding:
  126 + EdgeInsets.only(bottom: ScreenUtil().setWidth(8)),
  127 + weekdayStyle: TextStyle(
  128 + color: MyColours.color_2bb5b7,
  129 + fontSize: ScreenUtil().setSp(32)),
  130 + weekendStyle: TextStyle(
  131 + color: MyColours.color_f49a5e,
  132 + fontSize: ScreenUtil().setSp(32)),
  133 + selectedColor: MyColours.color_2bb5b7,
  134 + outsideDaysVisible: false,
  135 + ),
  136 + builders: CalendarBuilders(
  137 + dowWeekdayBuilder: (context, weekday) {
  138 + return Container(
  139 + color: MyColours.color_ffffff,
  140 + alignment: Alignment.center,
  141 + // margin:
  142 + // EdgeInsets.only(bottom: ScreenUtil().setWidth(20)),
  143 + padding: EdgeInsets.symmetric(
  144 + vertical: ScreenUtil().setWidth(15)),
  145 + child: Text(
  146 + weekday,
  147 + style: TextStyle(
  148 + color: MyColours.color_999999,
  149 + fontSize: ScreenUtil().setSp(32)),
  150 + ),
  151 + );
  152 + },
  153 + dayBuilder: (context, date, _) {
  154 + return Container(
  155 + // height: ScreenUtil().setWidth(210),
  156 + decoration: BoxDecoration(
  157 + // shape: BoxShape.circle,
  158 + // color: Colors.blue,
  159 + ),
  160 + // alignment: Alignment.center,
  161 + // margin: EdgeInsets.fromLTRB(
  162 + // ScreenUtil().setWidth(12),
  163 + // ScreenUtil().setWidth(12),
  164 + // ScreenUtil().setWidth(12),
  165 + // ScreenUtil().setWidth(10)),
  166 + // padding: EdgeInsets.symmetric(
  167 + // // horizontal: ScreenUtil().setWidth(12),
  168 + // vertical: ScreenUtil().setWidth(8),
  169 + // ),
  170 + child: Column(
  171 + mainAxisAlignment: MainAxisAlignment.center,
  172 + children: [
  173 + Text(
  174 + // "${_parseDateDay(date)}",
  175 + // '${Utils.addZeroNumber(date.day)}',
  176 + '${date.day}',
  177 + style: TextStyle().copyWith(
  178 + fontSize: ScreenUtil().setSp(32),
  179 + color: MyColours.color_515151,
  180 + fontWeight: FontWeight.bold)),
  181 + VEmptyView(4),
  182 + // Text(
  183 + // // "${_parseDateDay(date)}",
  184 + // '${Utils.getLunarSpecialDate(date)}',
  185 + // style: TextStyle().copyWith(
  186 + // fontSize: ScreenUtil().setSp(22),
  187 + // color: MyColours.color_353535),
  188 + // ),
  189 + Text(
  190 + "${_parseDateDay(date)}",
  191 + style: TextStyle().copyWith(
  192 + fontSize: ScreenUtil().setSp(20),
  193 + color: MyColours.color_515151),
  194 + ),
  195 + Container(
  196 + margin: EdgeInsets.symmetric(
  197 + vertical: ScreenUtil().setWidth(4)),
  198 + width: ScreenUtil().setWidth(16),
  199 + height: ScreenUtil().setWidth(16),
  200 + decoration: BoxDecoration(
  201 + color: MyColours.color_E34D59,
  202 + borderRadius: BorderRadius.circular(
  203 + ScreenUtil().radius(8))),
  204 + )
  205 + ],
  206 + ),
  207 + );
  208 + },
  209 + selectedDayBuilder: (context, date, _) {
  210 + return Container(
  211 + // alignment: Alignment.center,
  212 + // margin: EdgeInsets.fromLTRB(
  213 + // ScreenUtil().setWidth(12),
  214 + // ScreenUtil().setWidth(12),
  215 + // ScreenUtil().setWidth(12),
  216 + // ScreenUtil().setWidth(32)),
  217 + padding: EdgeInsets.only(
  218 + bottom: ScreenUtil().setWidth(10),
  219 + left: ScreenUtil().setWidth(5),
  220 + right: ScreenUtil().setWidth(5),
  221 + top: ScreenUtil().setWidth(10)),
  222 + child: Container(
  223 + decoration: BoxDecoration(
  224 + borderRadius: BorderRadius.circular(
  225 + ScreenUtil().setWidth(10)),
  226 + color: MyColours.color_438E93),
  227 + child: Column(
  228 + mainAxisAlignment: MainAxisAlignment.center,
  229 + children: [
  230 + Text(
  231 + // "${_parseDateDay(date)}",
  232 + // '${Utils.addZeroNumber(date.day)}',
  233 + '${date.day}',
  234 + style: TextStyle().copyWith(
  235 + color: MyColours.color_F6F6F6,
  236 + fontSize: ScreenUtil().setSp(32),
  237 + fontWeight: FontWeight.bold),
  238 + ),
  239 + Text(
  240 + "${_parseDateDay(date)}",
  241 + // '${Utils.lunarCalendarHolidaysShow(date)}',
  242 + style: TextStyle().copyWith(
  243 + fontSize: ScreenUtil().setSp(22),
  244 + color: MyColours.color_F6F6F6),
  245 + ),
  246 + Container(
  247 + margin: EdgeInsets.symmetric(
  248 + vertical: ScreenUtil().setWidth(4)),
  249 + width: ScreenUtil().setWidth(16),
  250 + height: ScreenUtil().setWidth(16),
  251 + decoration: BoxDecoration(
  252 + color: MyColours.color_E34D59,
  253 + borderRadius: BorderRadius.circular(
  254 + ScreenUtil().radius(8))),
  255 + )
  256 + ],
  257 + ),
  258 + ),
  259 + );
  260 + },
  261 + todayDayBuilder: (context, date, _) {
  262 + return Container(
  263 + // alignment: Alignment.center,
  264 + // margin: EdgeInsets.fromLTRB(
  265 + // ScreenUtil().setWidth(12),
  266 + // ScreenUtil().setWidth(12),
  267 + // ScreenUtil().setWidth(12),
  268 + // ScreenUtil().setWidth(32)),
  269 + padding: EdgeInsets.only(
  270 + bottom: ScreenUtil().setWidth(10),
  271 + left: ScreenUtil().setWidth(5),
  272 + right: ScreenUtil().setWidth(5),
  273 + top: ScreenUtil().setWidth(10)),
  274 + child: Container(
  275 + decoration: BoxDecoration(
  276 + borderRadius: BorderRadius.circular(
  277 + ScreenUtil().setWidth(10)),
  278 + color: MyColours.color_2bb5b7),
  279 + child: Column(
  280 + mainAxisAlignment: MainAxisAlignment.center,
  281 + children: [
  282 + Text(
  283 + // "${_parseDateDay(date)}",
  284 + // '${Utils.addZeroNumber(date.day)}',
  285 + '${date.day}',
  286 + style: TextStyle().copyWith(
  287 + color: MyColours.color_F6F6F6,
  288 + fontSize: ScreenUtil().setSp(32),
  289 + fontWeight: FontWeight.bold),
  290 + ),
  291 + Text(
  292 + "${_parseDateDay(date)}",
  293 + // '${Utils.lunarCalendarHolidaysShow(date)}',
  294 + style: TextStyle().copyWith(
  295 + fontSize: ScreenUtil().setSp(22),
  296 + color: MyColours.color_F6F6F6),
  297 + ),
  298 + Container(
  299 + margin: EdgeInsets.symmetric(
  300 + vertical: ScreenUtil().setWidth(4)),
  301 + width: ScreenUtil().setWidth(16),
  302 + height: ScreenUtil().setWidth(16),
  303 + decoration: BoxDecoration(
  304 + color: MyColours.color_E34D59,
  305 + borderRadius: BorderRadius.circular(
  306 + ScreenUtil().radius(8))),
  307 + )
  308 + ],
  309 + ),
  310 + ),
  311 + );
  312 + // return Container(
  313 + // decoration: BoxDecoration(
  314 + // shape: BoxShape.circle,
  315 + // border: Border.all(
  316 + // color: MyColours.color_2bb5b7,
  317 + // width: ScreenUtil().setWidth(2))),
  318 + // alignment: Alignment.center,
  319 + // margin: EdgeInsets.fromLTRB(
  320 + // ScreenUtil().setWidth(12),
  321 + // ScreenUtil().setWidth(12),
  322 + // ScreenUtil().setWidth(12),
  323 + // ScreenUtil().setWidth(32)),
  324 + // padding: EdgeInsets.only(
  325 + // bottom: ScreenUtil().setWidth(8),
  326 + // left: ScreenUtil().setWidth(16),
  327 + // right: ScreenUtil().setWidth(16),
  328 + // top: ScreenUtil().setWidth(8)),
  329 + // child: Text(
  330 + // // '今',
  331 + // '${Utils.addZeroNumber(date.day)}',
  332 + // style: TextStyle().copyWith(
  333 + // fontSize: ScreenUtil().setSp(32),
  334 + // color: MyColours.color_2bb5b7),
  335 + // ),
  336 + // );
  337 + },
  338 + markersBuilder: (context, date, events, holidays) {
  339 + final children = <Widget>[];
  340 +
  341 + // if (events.isNotEmpty) {
  342 + // children.add(
  343 + // Positioned(
  344 + // right: 1,
  345 + // bottom: 1,
  346 + // child: _buildEventsMarker(date, events),
  347 + // ),
  348 + // );
  349 + // }
  350 +
  351 + // if (holidays.isNotEmpty) {
  352 + // children.add(
  353 + // Positioned(
  354 + // right: ScreenUtil().setWidth(27),
  355 + // bottom: 0,
  356 + // top: ScreenUtil().setWidth(30),
  357 + // child: buildMarker(date)),
  358 + // Align(
  359 + // alignment: Alignment.bottomCenter,
  360 + // child: buildMarker(date),
  361 + // )
  362 + // );
  363 + // }
  364 +
  365 + return [];
  366 + },
  367 + // singleMarkerBuilder: (context, dateTime, event) {
  368 + // return Container(
  369 + // width: ScreenUtil().setWidth(6),
  370 + // height: ScreenUtil().setWidth(6),
  371 + // margin:
  372 + // const EdgeInsets.symmetric(horizontal: 0.3),
  373 + // decoration: BoxDecoration(
  374 + // shape: BoxShape.circle,
  375 + // color: MyColours.color_ff0000,
  376 + // ),
  377 + // );
  378 + // },
  379 + ),
  380 + ),
  381 + VEmptyView(4),
  382 + InkWell(
  383 + onTap: () {
  384 + calendarShow = !calendarShow;
  385 +
  386 + if (calendarShow) {
  387 + _calendarController
  388 + .setCalendarFormat(CalendarFormat.month);
  389 + } else {
  390 + _calendarController
  391 + .setCalendarFormat(CalendarFormat.week);
  392 + }
  393 + setState(() {});
  394 + },
  395 + child: Image.asset(
  396 + Utils.getImgPath(calendarShow
  397 + ? 'y_chevron_up_circle'
  398 + : 'y_chevron_down_circle'),
  399 + width: ScreenUtil().setWidth(32))),
  400 + VEmptyView(32),
  401 + ],
  402 + )),
  403 + VEmptyView(48),
  404 + Expanded(
  405 + child: ListView.builder(
  406 + padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(8)),
  407 + itemBuilder: (context, index) {
  408 + return FeastBoardItem();
  409 + },
  410 + itemCount: 100,
  411 + )),
  412 + Row(
  413 + mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  414 + children: [
  415 + RoundButton(
  416 + onPressed: () async {
  417 + _calendarController.setSelectedDay(DateTime.now());
  418 + setState(() {});
  419 + },
  420 + text: '回到今天',
  421 + fontSize: 28,
  422 + isBold: false,
  423 + height: ScreenUtil().setWidth(70),
  424 + width: ScreenUtil().setWidth(220),
  425 + gradientStart: MyColours.color_2bb5b7,
  426 + gradientEnd: MyColours.color_2bb5b7,
  427 + radius: ScreenUtil().setWidth(10),
  428 + ),
  429 + RoundButton(
  430 + onPressed: () async {
  431 + Navigator.pop(context);
  432 + },
  433 + text: '取消',
  434 + fontSize: 28,
  435 + isBold: false,
  436 + textColor: MyColours.color_333333,
  437 + borderColor: Color.fromRGBO(119, 119, 119, 1),
  438 + height: ScreenUtil().setWidth(70),
  439 + width: ScreenUtil().setWidth(220),
  440 + gradientStart: Colors.transparent,
  441 + gradientEnd: Colors.transparent,
  442 + radius: ScreenUtil().setWidth(10),
  443 + )
  444 + ],
  445 + ),
  446 + ],
  447 + ),
  448 + );
  449 + }
  450 +}
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  3 +import 'package:one_key/res/colors.dart';
  4 +import 'package:one_key/widgets/MyDivider.dart';
  5 +import 'package:one_key/widgets/h_empty_view.dart';
  6 +import 'package:one_key/widgets/v_empty_view.dart';
  7 +
  8 +import '../../widgets/round_button.dart';
  9 +
  10 +class FeastBoardItem extends StatefulWidget {
  11 + FeastBoardItem({Key key}) : super(key: key);
  12 +
  13 + @override
  14 + _FeastBoardItemState createState() => _FeastBoardItemState();
  15 +}
  16 +
  17 +class _FeastBoardItemState extends State<FeastBoardItem> {
  18 + Widget numWidget(String title, bool select, {bool needMargin = true}) {
  19 + return Container(
  20 + width: ScreenUtil().setWidth(32),
  21 + height: ScreenUtil().setWidth(32),
  22 + alignment: Alignment.center,
  23 + margin: needMargin
  24 + ? EdgeInsets.only(right: ScreenUtil().setWidth(50))
  25 + : EdgeInsets.zero,
  26 + decoration: BoxDecoration(
  27 + color: select ? MyColours.color_438E93 : MyColours.color_BFC4D4,
  28 + borderRadius: BorderRadius.circular(ScreenUtil().radius(4))),
  29 + child: Text(
  30 + title,
  31 + style: TextStyle(
  32 + color: select ? MyColours.color_ffffff : MyColours.color_515151,
  33 + fontSize: ScreenUtil().setSp(16)),
  34 + ),
  35 + );
  36 + }
  37 +
  38 + Widget canduanWidget(String title) {
  39 + return Column(
  40 + children: [
  41 + VEmptyView(16),
  42 + Row(
  43 + children: [
  44 + Text(
  45 + title,
  46 + style: TextStyle(
  47 + fontSize: ScreenUtil().setSp(28),
  48 + color: MyColours.color_000000,
  49 + fontWeight: FontWeight.bold),
  50 + ),
  51 + HEmptyView(56),
  52 + RoundButton(
  53 + onPressed: () async {},
  54 + text: '刘经理 30桌',
  55 + fontSize: 20,
  56 + isBold: false,
  57 + height: ScreenUtil().setWidth(36),
  58 + width: ScreenUtil().setWidth(64 * 2),
  59 + gradientStart: MyColours.color_438E93,
  60 + gradientEnd: MyColours.color_438E93,
  61 + radius: ScreenUtil().radius(10),
  62 + textColor: MyColours.color_F6F6F6,
  63 + ),
  64 + ],
  65 + ),
  66 + VEmptyView(16),
  67 + MyDivider(
  68 + double.infinity,
  69 + ScreenUtil().setWidth(2),
  70 + color: MyColours.color_DBDBDB,
  71 + )
  72 + ],
  73 + );
  74 + }
  75 +
  76 + @override
  77 + Widget build(BuildContext context) {
  78 + return Container(
  79 + margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(40)),
  80 + padding: EdgeInsets.symmetric(
  81 + horizontal: ScreenUtil().setWidth(24),
  82 + vertical: ScreenUtil().setWidth(16)),
  83 + decoration: BoxDecoration(
  84 + borderRadius: BorderRadius.circular(ScreenUtil().radius(10)),
  85 + border: Border.all(
  86 + color: MyColours.color_438E93, width: ScreenUtil().setWidth(2))),
  87 + child: Column(
  88 + children: [
  89 + Row(
  90 + children: [
  91 + Text(
  92 + '凤凰厅',
  93 + style: TextStyle(
  94 + color: MyColours.color_438E93,
  95 + fontSize: ScreenUtil().setSp(40),
  96 + fontWeight: FontWeight.bold),
  97 + ),
  98 + Spacer(),
  99 + numWidget('空', false),
  100 + numWidget('1', true),
  101 + numWidget('空', false),
  102 + numWidget('空', false, needMargin: false),
  103 + ],
  104 + ),
  105 + VEmptyView(24),
  106 + canduanWidget('早餐'),
  107 + canduanWidget('午餐'),
  108 + canduanWidget('晚餐'),
  109 + canduanWidget('其他'),
  110 + ],
  111 + ),
  112 + );
  113 + }
  114 +}
  1 +import 'package:flutter/gestures.dart';
  2 +import 'package:flutter/material.dart';
  3 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  4 +import 'package:one_key/res/colors.dart';
  5 +import 'package:one_key/widgets/v_empty_view.dart';
  6 +
  7 +class FeastItem extends StatefulWidget {
  8 + FeastItem({Key key}) : super(key: key);
  9 +
  10 + @override
  11 + _FeastItemState createState() => _FeastItemState();
  12 +}
  13 +
  14 +class _FeastItemState extends State<FeastItem> {
  15 + List<Widget> taocanWidget(List data) {
  16 + List<Widget> list = [];
  17 + data.forEach((element) {
  18 + list.add(
  19 + RichText(
  20 + textScaleFactor: 1,
  21 + overflow: TextOverflow.ellipsis,
  22 + // textDirection: TextDirection.ltr,
  23 + // textAlign: TextAlign.left,
  24 +
  25 + text: TextSpan(
  26 + children: [
  27 + TextSpan(
  28 + text: "1299套餐:",
  29 + style: TextStyle(
  30 + color: MyColours.color_000000,
  31 + fontSize: ScreenUtil().setSp(28)),
  32 + recognizer: TapGestureRecognizer()..onTap = () {}),
  33 + TextSpan(
  34 + text: "已调菜",
  35 + style: TextStyle(
  36 + color: MyColours.color_438E93,
  37 + fontSize: ScreenUtil().setSp(28)),
  38 + //点击事件
  39 + recognizer: TapGestureRecognizer()
  40 + ..onTap = () {
  41 + print("点击了安全协议");
  42 + }),
  43 + TextSpan(
  44 + text: "保证30桌、备2桌",
  45 + style: TextStyle(
  46 + color: MyColours.color_000000,
  47 + fontSize: ScreenUtil().setSp(28)),
  48 + recognizer: TapGestureRecognizer()..onTap = () {}),
  49 + ],
  50 + )),
  51 + );
  52 + });
  53 + return list;
  54 + }
  55 +
  56 + @override
  57 + Widget build(BuildContext context) {
  58 + return Container(
  59 + margin: EdgeInsets.only(bottom: ScreenUtil().setWidth(36)),
  60 + decoration: BoxDecoration(
  61 + border: Border.all(
  62 + color: MyColours.color_f3f3f3, width: ScreenUtil().setWidth(2)),
  63 + boxShadow: [
  64 + BoxShadow(
  65 + color: MyColours.color_1F000000,
  66 + offset: Offset(0, ScreenUtil().setWidth(8)),
  67 + blurRadius: ScreenUtil().setWidth(8))
  68 + ],
  69 + borderRadius: BorderRadius.circular(ScreenUtil().radius(10))),
  70 + child: Column(
  71 + children: [
  72 + Container(
  73 + padding: EdgeInsets.symmetric(
  74 + horizontal: ScreenUtil().setWidth(16),
  75 + vertical: ScreenUtil().setWidth(8)),
  76 + decoration: BoxDecoration(
  77 + color: MyColours.color_438E93,
  78 + borderRadius: BorderRadius.only(
  79 + topLeft: Radius.circular(ScreenUtil().radius(10)),
  80 + topRight: Radius.circular(ScreenUtil().radius(10)),
  81 + ),
  82 + ),
  83 + child: Row(
  84 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  85 + children: [
  86 + Text(
  87 + '8月1日 午餐 14:00-16:00',
  88 + style: TextStyle(
  89 + fontWeight: FontWeight.bold,
  90 + color: MyColours.color_F6F6F6,
  91 + fontSize: ScreenUtil().setSp(40)),
  92 + ),
  93 + Text(
  94 + '婚宴',
  95 + style: TextStyle(
  96 + fontWeight: FontWeight.bold,
  97 + color: MyColours.color_F6F6F6,
  98 + fontSize: ScreenUtil().setSp(40)),
  99 + )
  100 + ],
  101 + )),
  102 + Container(
  103 + padding: EdgeInsets.symmetric(
  104 + horizontal: ScreenUtil().setWidth(16),
  105 + vertical: ScreenUtil().setWidth(14)),
  106 + decoration: BoxDecoration(
  107 + color: MyColours.color_ffffff,
  108 + borderRadius: BorderRadius.only(
  109 + bottomLeft: Radius.circular(ScreenUtil().radius(10)),
  110 + bottomRight: Radius.circular(ScreenUtil().radius(10)),
  111 + ),
  112 + ),
  113 + child: Column(
  114 + crossAxisAlignment: CrossAxisAlignment.start,
  115 + children: [
  116 + Text(
  117 + '桌位:凤凰厅、包间1、包间2',
  118 + style: TextStyle(
  119 + color: MyColours.color_000000,
  120 + fontSize: ScreenUtil().setSp(28)),
  121 + ),
  122 + VEmptyView(8),
  123 + Column(
  124 + children: taocanWidget(['ff', 'ff', 'ff', 'ff']),
  125 + ),
  126 + VEmptyView(36),
  127 + Row(
  128 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  129 + children: [
  130 + Text(
  131 + '方先生 订32桌 备2桌',
  132 + style: TextStyle(
  133 + fontWeight: FontWeight.bold,
  134 + color: MyColours.color_000000,
  135 + fontSize: ScreenUtil().setSp(28)),
  136 + ),
  137 + Text(
  138 + '负责人:刘经理',
  139 + style: TextStyle(
  140 + fontWeight: FontWeight.bold,
  141 + color: MyColours.color_000000,
  142 + fontSize: ScreenUtil().setSp(28)),
  143 + ),
  144 + ],
  145 + )
  146 + ],
  147 + ),
  148 + )
  149 + ],
  150 + ),
  151 + );
  152 + }
  153 +}
  1 +import 'dart:io';
  2 +
  3 +import 'package:flutter/material.dart';
  4 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  5 +import 'package:one_key/pages/feast/feast_item.dart';
  6 +import 'package:one_key/provider/feast_model.dart';
  7 +import 'package:one_key/route/navigator_util.dart';
  8 +import 'package:one_key/utils/utils.dart';
  9 +import 'package:one_key/widgets/system_app_bar.dart';
  10 +import 'package:one_key/widgets/v_empty_view.dart';
  11 +import 'package:provider/provider.dart';
  12 +
  13 +import '../../constant/state.dart';
  14 +import '../../res/colors.dart';
  15 +
  16 +import '../../widgets/page_exception.dart';
  17 +
  18 +class FeastPage extends StatefulWidget {
  19 + FeastPage({Key key}) : super(key: key);
  20 +
  21 + @override
  22 + _FeastPageState createState() => _FeastPageState();
  23 +}
  24 +
  25 +class _FeastPageState extends State<FeastPage> {
  26 + Widget upAndDown(String image, String title, {GestureTapCallback onTap}) {
  27 + return InkWell(
  28 + onTap: onTap,
  29 + child: Column(
  30 + children: [
  31 + Image.asset(Utils.getImgPath(image),
  32 + width: ScreenUtil().setWidth(36 * 2)),
  33 + VEmptyView(8),
  34 + Text(
  35 + title,
  36 + style: TextStyle(
  37 + fontSize: ScreenUtil().setSp(28),
  38 + color: MyColours.color_515151),
  39 + )
  40 + ],
  41 + ));
  42 + }
  43 +
  44 + @override
  45 + Widget build(BuildContext context) {
  46 + return Scaffold(
  47 + backgroundColor: MyColours.color_ffffff,
  48 + // appBar: SystemAppBar(''),
  49 + body: Column(
  50 + crossAxisAlignment: CrossAxisAlignment.start,
  51 + children: [
  52 + VEmptyView(112),
  53 + Row(
  54 + mainAxisAlignment: MainAxisAlignment.spaceAround,
  55 + children: [
  56 + upAndDown('y_kanban', '宴会看板', onTap: () {
  57 + NavigatorUtil.goFeastBoardPage(context);
  58 + }),
  59 + upAndDown('y_new', '新建宴会'),
  60 + Stack(clipBehavior: Clip.none, children: [
  61 + upAndDown('y_schedule', '待跟进'),
  62 + Positioned(
  63 + right: ScreenUtil().setWidth(-6),
  64 + bottom: ScreenUtil().setWidth(32),
  65 + child: Container(
  66 + alignment: Alignment.center,
  67 + decoration: BoxDecoration(
  68 + borderRadius:
  69 + BorderRadius.circular(ScreenUtil().setWidth(16)),
  70 + color: MyColours.color_E34D59),
  71 + width: ScreenUtil().setWidth(32),
  72 + height: ScreenUtil().setWidth(32),
  73 + child: Text(
  74 + '7',
  75 + style: TextStyle(
  76 + color: MyColours.color_F6F6F6,
  77 + fontWeight: FontWeight.bold,
  78 + fontSize: ScreenUtil().setSp(24)),
  79 + ),
  80 + ),
  81 + )
  82 + ]),
  83 + upAndDown('y_money', '定金管理')
  84 + ],
  85 + ),
  86 + VEmptyView(102),
  87 + Padding(
  88 + padding: EdgeInsets.only(left: ScreenUtil().setWidth(48)),
  89 + child: Text(
  90 + '30天内宴会',
  91 + style: TextStyle(
  92 + color: MyColours.color_000000,
  93 + fontSize: ScreenUtil().setSp(28)),
  94 + ),
  95 + ),
  96 + VEmptyView(26),
  97 + Expanded(child: Consumer<FeastModel>(builder: (context, model, _) {
  98 + if (model.pageState != PageState.Success) {
  99 + return ExceptionPage(
  100 + pageState: model.pageState,
  101 + callback: () {
  102 + // offset = 0;
  103 + // getMessage(showLoading: true);
  104 + },
  105 + emptyMsg: "还未创建宴会",
  106 + emptyImg: "empty_search",
  107 + showMsg: "加载中,请稍后...",
  108 + );
  109 + } else {
  110 + return ListView.builder(
  111 + padding: EdgeInsets.symmetric(
  112 + horizontal: ScreenUtil().setWidth(24)),
  113 + itemBuilder: (context, index) {
  114 + return FeastItem();
  115 + },
  116 + itemCount: 100,
  117 + );
  118 + }
  119 + }))
  120 + ],
  121 + ));
  122 + }
  123 +}
@@ -37,6 +37,9 @@ import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; @@ -37,6 +37,9 @@ import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
37 import 'package:flutter_app_badger/flutter_app_badger.dart'; 37 import 'package:flutter_app_badger/flutter_app_badger.dart';
38 import 'package:one_key/models/message.dart'; 38 import 'package:one_key/models/message.dart';
39 39
  40 +import '../../provider/feast_model.dart';
  41 +import '../feast/feast_page.dart';
  42 +
40 class HomePage extends StatefulWidget { 43 class HomePage extends StatefulWidget {
41 final int initialIndex; //初始tab 44 final int initialIndex; //初始tab
42 45
@@ -141,6 +144,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -141,6 +144,10 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
141 child: ChangeNotifierProvider<TableManagerModel>( 144 child: ChangeNotifierProvider<TableManagerModel>(
142 create: (_) => TableManagerModel(), child: TableManagerPage()), 145 create: (_) => TableManagerModel(), child: TableManagerPage()),
143 ))) 146 )))
  147 + ..add(
  148 + ChangeNotifierProvider<FeastModel>(
  149 + create: (_) => FeastModel(), child: FeastPage()),
  150 + )
144 ..add(ChangeNotifierProvider<MyModel>( 151 ..add(ChangeNotifierProvider<MyModel>(
145 create: (_) => MyModel(), 152 create: (_) => MyModel(),
146 child: MyPage(), 153 child: MyPage(),
@@ -883,6 +890,19 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -883,6 +890,19 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
883 ), 890 ),
884 BottomNavigationBarItem( 891 BottomNavigationBarItem(
885 icon: Image( 892 icon: Image(
  893 + image: AssetImage("assets/y_feast_un.png"),
  894 + width: ScreenUtil().setWidth(48),
  895 + height: ScreenUtil().setWidth(48),
  896 + ),
  897 + activeIcon: Image(
  898 + image: AssetImage("assets/y_feast_sel.png"),
  899 + width: ScreenUtil().setWidth(48),
  900 + height: ScreenUtil().setWidth(48),
  901 + ),
  902 + label: "宴会",
  903 + ),
  904 + BottomNavigationBarItem(
  905 + icon: Image(
886 image: AssetImage("assets/my_default.png"), 906 image: AssetImage("assets/my_default.png"),
887 width: ScreenUtil().setWidth(48), 907 width: ScreenUtil().setWidth(48),
888 height: ScreenUtil().setWidth(48), 908 height: ScreenUtil().setWidth(48),
@@ -909,7 +929,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -909,7 +929,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
909 _currIndex = index; 929 _currIndex = index;
910 _pageController.jumpToPage(index); 930 _pageController.jumpToPage(index);
911 }); 931 });
912 - if (_currIndex == 3) { 932 + if (_currIndex == 4) {
913 Utils.changeStatusColor(color: MyColours.color_199095); 933 Utils.changeStatusColor(color: MyColours.color_199095);
914 } else { 934 } else {
915 Utils.changeStatusColor(color: Colors.white); 935 Utils.changeStatusColor(color: Colors.white);
  1 +import 'package:flutter/material.dart';
  2 +import 'package:one_key/constant/state.dart';
  3 +
  4 +class FeastModel extends ChangeNotifier {
  5 + PageState pageState = PageState.Success;
  6 +}
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 2
3 class MyColours { 3 class MyColours {
  4 + static const Color color_F6F6F6 = Color(0xffF6F6F6);
4 static const Color color_E6000000 = Color(0xE6000000); 5 static const Color color_E6000000 = Color(0xE6000000);
5 static const Color color_99000000 = Color(0x99000000); 6 static const Color color_99000000 = Color(0x99000000);
6 static const Color color_E5000000 = Color(0xE5000000); 7 static const Color color_E5000000 = Color(0xE5000000);
@@ -56,6 +57,8 @@ class MyColours { @@ -56,6 +57,8 @@ class MyColours {
56 static const Color color_131313 = Color(0xff131313); 57 static const Color color_131313 = Color(0xff131313);
57 static const Color color_2e000000 = Color(0x2e000000); 58 static const Color color_2e000000 = Color(0x2e000000);
58 static const Color color_14000000 = Color(0x14000000); 59 static const Color color_14000000 = Color(0x14000000);
  60 + static const Color color_1F000000 = Color(0x1F000000);
  61 +
59 static const Color color_bfbfbf = Color(0xffBFBFBF); 62 static const Color color_bfbfbf = Color(0xffBFBFBF);
60 static const Color color_828282 = Color(0xff828282); 63 static const Color color_828282 = Color(0xff828282);
61 static const Color color_a8e2e4 = Color(0xffA8E2E4); 64 static const Color color_a8e2e4 = Color(0xffA8E2E4);
@@ -841,4 +841,10 @@ class NavigatorUtil { @@ -841,4 +841,10 @@ class NavigatorUtil {
841 "${Routes.coupon_to_personnel_page}?uids=$uids&onlyShow=$onlyShow", 841 "${Routes.coupon_to_personnel_page}?uids=$uids&onlyShow=$onlyShow",
842 replace: replace); 842 replace: replace);
843 } 843 }
  844 +
  845 + ///宴会----宴会看板
  846 + static Future<dynamic> goFeastBoardPage(BuildContext context,
  847 + {replace = false, bool onlyShow = false}) {
  848 + return _navigateTo(context, "${Routes.feast_board_page}", replace: replace);
  849 + }
844 } 850 }
@@ -141,6 +141,9 @@ import 'package:one_key/utils/fluro_convert_utils.dart'; @@ -141,6 +141,9 @@ import 'package:one_key/utils/fluro_convert_utils.dart';
141 import 'package:one_key/utils/utils.dart'; 141 import 'package:one_key/utils/utils.dart';
142 import 'package:provider/provider.dart'; 142 import 'package:provider/provider.dart';
143 143
  144 +import '../pages/feast/feast_board.dart';
  145 +import '../provider/feast_model.dart';
  146 +
144 // 登录页 147 // 登录页
145 var loginHandler = new Handler( 148 var loginHandler = new Handler(
146 handlerFunc: (BuildContext context, Map<String, List<Object>> params) { 149 handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
@@ -322,8 +325,7 @@ var handleInvicationHandler = new Handler( @@ -322,8 +325,7 @@ var handleInvicationHandler = new Handler(
322 return ChangeNotifierProvider<RemarkManagerModel>( 325 return ChangeNotifierProvider<RemarkManagerModel>(
323 create: (_) => RemarkManagerModel(), 326 create: (_) => RemarkManagerModel(),
324 child: ChangeNotifierProvider<BaseIndoProvider>( 327 child: ChangeNotifierProvider<BaseIndoProvider>(
325 - create: (_) => BaseIndoProvider(),  
326 - child: InvicationPage(rid))); 328 + create: (_) => BaseIndoProvider(), child: InvicationPage(rid)));
327 }); 329 });
328 330
329 // 发短信 331 // 发短信
@@ -1317,3 +1319,13 @@ var couponToPersonnelPageHandle = new Handler( @@ -1317,3 +1319,13 @@ var couponToPersonnelPageHandle = new Handler(
1317 create: (_) => PersonnelProvider(), 1319 create: (_) => PersonnelProvider(),
1318 child: CouponToPersonnalPage(uids: uids, onlyShow: onlyShow)); 1320 child: CouponToPersonnalPage(uids: uids, onlyShow: onlyShow));
1319 }); 1321 });
  1322 +
  1323 +///宴会----宴会看板
  1324 +var feastBoardPageHandle = new Handler(
  1325 + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  1326 + // String uids = params["uids"].first;
  1327 +
  1328 + // bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first);
  1329 + return ChangeNotifierProvider<FeastModel>(
  1330 + create: (_) => FeastModel(), child: FeastBoardPage());
  1331 +});
@@ -115,6 +115,9 @@ class Routes { @@ -115,6 +115,9 @@ class Routes {
115 "/coupon_create_select_type_page"; //选择优惠券类型 115 "/coupon_create_select_type_page"; //选择优惠券类型
116 static String coupon_to_personnel_page = 116 static String coupon_to_personnel_page =
117 "/coupon_to_personnel_page"; //优惠券----可发放员工 117 "/coupon_to_personnel_page"; //优惠券----可发放员工
  118 +static String feast_board_page =
  119 + "/FeastBoardPage"; //宴会----宴会看板
  120 +
118 121
119 static void configureRoutes(FluroRouter router) { 122 static void configureRoutes(FluroRouter router) {
120 router.notFoundHandler = new Handler( 123 router.notFoundHandler = new Handler(
@@ -233,5 +236,9 @@ class Routes { @@ -233,5 +236,9 @@ class Routes {
233 handler: couponCreateSelectTypePageHandle); 236 handler: couponCreateSelectTypePageHandle);
234 router.define(coupon_to_personnel_page, 237 router.define(coupon_to_personnel_page,
235 handler: couponToPersonnelPageHandle); 238 handler: couponToPersonnelPageHandle);
  239 +router.define(feast_board_page,
  240 + handler: feastBoardPageHandle);
  241 +
  242 +
236 } 243 }
237 } 244 }