Commit 56591f9f6f53fb76f1e39544a5126ce404969fa1

Authored by wdn127929
1 parent bd18d244

占座方硕新修改

@@ -11,14 +11,14 @@ if (flutterRoot == null) { @@ -11,14 +11,14 @@ if (flutterRoot == null) {
11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 11 throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 } 12 }
13 13
14 -def flutterVersionCode = "315" 14 +def flutterVersionCode = "316"
15 if (flutterVersionCode == null) { 15 if (flutterVersionCode == null) {
16 - flutterVersionCode = '315' 16 + flutterVersionCode = '316'
17 } 17 }
18 18
19 -def flutterVersionName = "3.1.5" 19 +def flutterVersionName = "3.1.6"
20 if (flutterVersionName == null) { 20 if (flutterVersionName == null) {
21 - flutterVersionName = '3.1.5' 21 + flutterVersionName = '3.1.6'
22 } 22 }
23 23
24 apply plugin: 'com.android.application' 24 apply plugin: 'com.android.application'
  1 +import 'package:easy_contact_picker/easy_contact_picker.dart';
  2 +import 'package:flutter/material.dart';
  3 +import 'package:flutter_screenutil/screenutil.dart';
  4 +import 'package:one_key/provider/notebook_detail_model.dart';
  5 +import 'package:one_key/provider/user_model.dart';
  6 +import 'package:one_key/res/colors.dart';
  7 +import 'package:one_key/utils/dialog_util.dart';
  8 +import 'package:one_key/utils/event_bus.dart';
  9 +import 'package:one_key/utils/misc.dart';
  10 +import 'package:one_key/utils/utils.dart';
  11 +import 'package:one_key/widgets/round_button.dart';
  12 +import 'package:one_key/widgets/system_app_bar.dart';
  13 +import 'package:one_key/widgets/v_empty_view.dart';
  14 +import 'package:permission_handler/permission_handler.dart';
  15 +import 'package:provider/provider.dart';
  16 +
  17 +/**
  18 + * 填写预订联系人页面
  19 + */
  20 +class EditReserverPage extends StatefulWidget {
  21 + final String rid;
  22 + EditReserverPage(this.rid, {Key key}) : super(key: key);
  23 +
  24 + @override
  25 + _EditReserverPageState createState() => _EditReserverPageState();
  26 +}
  27 +
  28 +class _EditReserverPageState extends State<EditReserverPage> {
  29 + NotebookDetailModel detailModel;
  30 + String nameStr;
  31 + FocusNode _nameNode = FocusNode();
  32 + FocusNode _phoneNode = FocusNode();
  33 + bool showPhoneHistory = false; //显示客户历史记录
  34 + EasyContactPicker _contactPicker = EasyContactPicker();
  35 +
  36 + _openAddressBook() async {
  37 + if (!(await checkContactPermission())) {
  38 + PermissionStatus permissionStatus = await contactPermissionStatus();
  39 + if (permissionStatus == PermissionStatus.permanentlyDenied) {
  40 + //用户选择不在弹出权限提示框
  41 + print('never');
  42 + DialogUtil.openAlertDialog(
  43 + context, '未获得通讯录权限', "请在手机的权限管理里,将通讯录权限开启", '去设置', 340.0,
  44 + onTap: () {
  45 + openSetting();
  46 + Navigator.pop(context, '');
  47 + });
  48 + } else {
  49 + // 申请权限
  50 + bool canContacts = await requestContactPermission();
  51 + if (canContacts) {
  52 + _getContactData();
  53 + } else {
  54 + //拒绝通讯录权限 , 苹果拒绝权限后,不再提示权限框,进入此处
  55 + DialogUtil.openAlertDialog(
  56 + context, '未获得通讯录权限', "请在手机的权限管理里,将通讯录权限开启。", '去设置', 340.0,
  57 + onTap: () {
  58 + openSetting();
  59 + Navigator.pop(context, '');
  60 + });
  61 + }
  62 + }
  63 + } else {
  64 + _getContactData();
  65 + }
  66 + }
  67 +
  68 + _getContactData() async {
  69 + Contact contact = await _contactPicker.selectContactWithNative();
  70 + setState(() {
  71 + String fullName =
  72 + contact.fullName.replaceAll(new RegExp(r"\s+\b|\b\s"), "");
  73 + String phone =
  74 + contact.phoneNumber.replaceAll(new RegExp(r"\s+\b|\b\s"), "");
  75 + if (fullName.compareTo(phone) == 0) {
  76 + fullName = '';
  77 + } else {
  78 + fullName = contact.fullName;
  79 + }
  80 + detailModel.phoneController.text =
  81 + contact.phoneNumber.replaceAll(new RegExp(r"\s+"), "");
  82 + nameStr = fullName;
  83 + // _homeEnterModel.nameController.text = fullName + _nameSuffix();
  84 + _addNameSuffix(fullName, _nameSuffix());
  85 + });
  86 + }
  87 +
  88 + _addNameSuffix(String name, String suffix) {
  89 + if (name == detailModel.nameController.text &&
  90 + detailModel.nameController.text.endsWith(suffix)) {
  91 + return;
  92 + }
  93 + detailModel.nameController.text = name + suffix;
  94 + }
  95 +
  96 + //姓名后缀
  97 + _nameSuffix() {
  98 + for (var item in detailModel.sexList) {
  99 + if (item['select'] == true) {
  100 + return item['title'];
  101 + }
  102 + }
  103 + }
  104 +
  105 + Widget _callButton(
  106 + {GestureTapCallback onPress,
  107 + content,
  108 + hasLeftBorder = true,
  109 + isSelect = false}) {
  110 + return InkWell(
  111 + onTap: onPress,
  112 + child: Container(
  113 + width: ScreenUtil().setWidth(84),
  114 + height: ScreenUtil().setHeight(48),
  115 + decoration: BoxDecoration(
  116 + color: isSelect ? MyColours.color_199095 : MyColours.color_fefefe,
  117 + border: Border(
  118 + bottom: BorderSide(
  119 + color: MyColours.color_6AB6B9,
  120 + width: ScreenUtil().setWidth(2)),
  121 + top: BorderSide(
  122 + color: MyColours.color_6AB6B9,
  123 + width: ScreenUtil().setWidth(2)),
  124 + left: hasLeftBorder
  125 + ? BorderSide(
  126 + color: MyColours.color_6AB6B9,
  127 + width: ScreenUtil().setWidth(2))
  128 + : BorderSide.none,
  129 + right: BorderSide(
  130 + color: MyColours.color_6AB6B9,
  131 + width: ScreenUtil().setWidth(2)))),
  132 + child: Align(
  133 + alignment: Alignment.center,
  134 + child: Text(
  135 + content,
  136 + style: TextStyle(
  137 + color: isSelect ? Colors.white : MyColours.color_353535,
  138 + fontSize: ScreenUtil().setSp(28)),
  139 + ),
  140 + ),
  141 + ),
  142 + );
  143 + }
  144 +
  145 + @override
  146 + Widget build(BuildContext context) {
  147 + detailModel = Provider.of<NotebookDetailModel>(context, listen: true);
  148 + return Scaffold(
  149 + backgroundColor: MyColours.color_ffffff,
  150 + appBar: SystemAppBar(
  151 + '录入预订人信息',
  152 + onTap: () {
  153 + Navigator.pop(context);
  154 + },
  155 + ),
  156 + body: Padding(
  157 + padding:
  158 + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
  159 + child: Column(children: [
  160 + //第一行 顾客姓名
  161 +
  162 + VEmptyView(40),
  163 +
  164 + Expanded(
  165 + child: Column(
  166 + children: [
  167 + Row(
  168 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  169 + crossAxisAlignment: CrossAxisAlignment.center,
  170 + children: [
  171 + Expanded(
  172 + child: Container(
  173 + height: ScreenUtil().setWidth(60),
  174 + decoration: BoxDecoration(
  175 + border: Border(
  176 + bottom: BorderSide(
  177 + width: ScreenUtil().setWidth(2),
  178 + color: MyColours.color_efefef))),
  179 + child: TextField(
  180 + maxLines: 1,
  181 +
  182 + //输入文本的样式
  183 + style: TextStyle(
  184 + fontSize: ScreenUtil().setSp(30),
  185 + color: MyColours.color_353535),
  186 + controller: detailModel.nameController,
  187 + focusNode: _nameNode,
  188 + // textAlignVertical: TextAlignVertical.top,
  189 + decoration: InputDecoration(
  190 + hintText: "客人姓名",
  191 + hintStyle: TextStyle(
  192 + color: MyColours.color_999999,
  193 + fontSize: ScreenUtil().setSp(30),
  194 + ),
  195 + // contentPadding:
  196 + // EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
  197 + border: InputBorder.none,
  198 + ),
  199 + onChanged: (value) {
  200 + print('ggg');
  201 +
  202 + nameStr = value;
  203 + },
  204 + onEditingComplete: () {
  205 + print('fff');
  206 + _nameNode.unfocus();
  207 + // _homeEnterModel.nameController.text =
  208 + // nameStr + _nameSuffix();
  209 + _addNameSuffix(nameStr, _nameSuffix());
  210 + },
  211 + keyboardType: TextInputType.text,
  212 + ),
  213 + ),
  214 + ),
  215 + // HEmptyView(40),
  216 + Row(
  217 + children: detailModel.sexList.map((value) {
  218 + return _callButton(
  219 + onPress: () {
  220 + for (var item in detailModel.sexList) {
  221 + item['select'] = false;
  222 + if (item['title'] == value['title']) {
  223 + item['select'] = true;
  224 + // _homeEnterModel.nameController.text =
  225 + // nameStr + item['title'];
  226 + if (nameStr != null && nameStr != '') {
  227 + _addNameSuffix(nameStr, item['title']);
  228 + }
  229 + }
  230 + }
  231 + detailModel.notifyListeners();
  232 + },
  233 + content: value['title'],
  234 + hasLeftBorder: value['hasLeftBorder'],
  235 + isSelect: value['select']);
  236 + }).toList()),
  237 + ],
  238 + ),
  239 + // VEmptyView(30),
  240 + // MyDivider(double.infinity,
  241 + // ScreenUtil().setWidth(2),
  242 + // color:
  243 + // MyColours.color_efefef),
  244 + //电话
  245 + VEmptyView(20),
  246 +
  247 + Row(
  248 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  249 + crossAxisAlignment: CrossAxisAlignment.center,
  250 + children: [
  251 + Expanded(
  252 + child: Container(
  253 + height: ScreenUtil().setWidth(60),
  254 + decoration: BoxDecoration(
  255 + border: Border(
  256 + bottom: BorderSide(
  257 + width: ScreenUtil().setWidth(2),
  258 + color: MyColours.color_efefef))),
  259 + child: TextField(
  260 + maxLines: 1,
  261 + //输入文本的样式
  262 + style: TextStyle(
  263 + fontSize: ScreenUtil().setSp(30),
  264 + color: MyColours.color_353535),
  265 + controller: detailModel.phoneController,
  266 + focusNode: _phoneNode,
  267 + // textAlignVertical: TextAlignVertical.top,
  268 + decoration: InputDecoration(
  269 + hintText: "电话",
  270 + hintStyle: TextStyle(
  271 + color: MyColours.color_999999,
  272 + fontSize: ScreenUtil().setSp(30),
  273 + ),
  274 + // contentPadding:
  275 + // EdgeInsets.only(bottom: ScreenUtil().setWidth(17)),
  276 + border: InputBorder.none,
  277 + ),
  278 + onChanged: (value) {
  279 + if (value.isEmpty || value.length > 11) {
  280 + //内容为空,或 超过11位
  281 + setState(() {
  282 + detailModel.userHistorys.clear();
  283 + });
  284 + return;
  285 + }
  286 + Map<String, String> params = {
  287 + "keywords": value,
  288 + "sid": Provider.of<UserModel>(context,
  289 + listen: false)
  290 + .user
  291 + .sellerid,
  292 + };
  293 + detailModel.getUserHistorys(context, params);
  294 + },
  295 + onEditingComplete: () {
  296 + _phoneNode.unfocus();
  297 + },
  298 + onTap: () {
  299 + setState(() {
  300 + showPhoneHistory = true;
  301 + });
  302 + // Future.delayed(Duration(milliseconds: 300), () {
  303 + // _controller.jumpTo(_controller.position.maxScrollExtent);
  304 + // });
  305 + },
  306 + keyboardType: TextInputType.number,
  307 + )),
  308 + ),
  309 + InkWell(
  310 + onTap: () {
  311 + _openAddressBook();
  312 + },
  313 + child: Container(
  314 + width: ScreenUtil().setWidth(84) * 3,
  315 + height: ScreenUtil().setWidth(48),
  316 + alignment: Alignment.centerRight,
  317 + child: Text('一键录入',
  318 + style: TextStyle(
  319 + color: MyColours.color_199095,
  320 + fontSize: ScreenUtil().setSp(28),
  321 + decoration: TextDecoration.underline)),
  322 + ),
  323 + ),
  324 + ],
  325 + ),
  326 + Stack(
  327 + children: [
  328 + Container(
  329 + height: ScreenUtil().setWidth(180),
  330 + width: double.infinity,
  331 + color: MyColours.color_ffffff,
  332 + ),
  333 + Offstage(
  334 + offstage: !(showPhoneHistory &&
  335 + detailModel.userHistorys.length > 0),
  336 + child: Container(
  337 + decoration: BoxDecoration(
  338 + borderRadius: BorderRadius.circular(8),
  339 + border: Border.all(color: Colors.white),
  340 + color: MyColours.color_ffffff,
  341 + boxShadow: [
  342 + BoxShadow(
  343 + color: MyColours.color_e5e5e5,
  344 + blurRadius: ScreenUtil().setWidth(20))
  345 + ]),
  346 + width: ScreenUtil().setWidth(440),
  347 + height: detailModel.userHistorys.length > 1
  348 + ? ScreenUtil().setWidth(180)
  349 + : ScreenUtil().setWidth(104),
  350 + padding: EdgeInsets.symmetric(
  351 + horizontal: ScreenUtil().setWidth(30)),
  352 + child: Align(
  353 + alignment: Alignment.topCenter,
  354 + child: MediaQuery.removePadding(
  355 + context: context,
  356 + removeTop: true,
  357 + child: ListView.builder(
  358 + itemBuilder: (context, index) {
  359 + return GestureDetector(
  360 + onTap: () {
  361 + setState(() {
  362 + showPhoneHistory = false;
  363 + detailModel.phoneController.text =
  364 + detailModel
  365 + .userHistorys[index].phone;
  366 + // _homeEnterModel.nameController.text =
  367 + // _homeEnterModel
  368 + // .userHistorys[index].rname +
  369 + // _nameSuffix();
  370 + _addNameSuffix(
  371 + detailModel
  372 + .userHistorys[index].rname,
  373 + _nameSuffix());
  374 + nameStr = detailModel
  375 + .userHistorys[index].rname;
  376 + _phoneNode.unfocus();
  377 + detailModel.userHistorys.clear();
  378 + });
  379 + },
  380 + child: Container(
  381 + width: double.infinity,
  382 + height: ScreenUtil().setWidth(102),
  383 + decoration: BoxDecoration(
  384 + border: Border(
  385 + bottom: (index !=
  386 + (detailModel
  387 + .userHistorys
  388 + .length -
  389 + 1) &&
  390 + detailModel
  391 + .userHistorys
  392 + .length >
  393 + 1)
  394 + ? BorderSide(
  395 + color: MyColours
  396 + .color_e5e5e5,
  397 + width: ScreenUtil()
  398 + .setWidth(2))
  399 + : BorderSide.none)),
  400 + child: Row(
  401 + mainAxisAlignment:
  402 + MainAxisAlignment.spaceBetween,
  403 + children: [
  404 + Text(
  405 + detailModel
  406 + .userHistorys[index].phone,
  407 + style: TextStyle(
  408 + color:
  409 + MyColours.color_333333,
  410 + fontSize:
  411 + ScreenUtil().setSp(32)),
  412 + ),
  413 + Expanded(
  414 + child: Text(
  415 + detailModel
  416 + .userHistorys[index].rname,
  417 + style: TextStyle(
  418 + color:
  419 + MyColours.color_333333,
  420 + fontSize:
  421 + ScreenUtil().setSp(32)),
  422 + ))
  423 + ],
  424 + ),
  425 + ),
  426 + );
  427 + },
  428 + itemExtent: ScreenUtil().setWidth(104),
  429 + itemCount: detailModel.userHistorys.length,
  430 + ))),
  431 + ),
  432 + )
  433 + ],
  434 + ),
  435 + ],
  436 + )),
  437 +
  438 + Padding(
  439 + padding: EdgeInsets.only(top: ScreenUtil().setWidth(60)),
  440 + child: Row(
  441 + mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  442 + children: [
  443 + RoundButton(
  444 + text: '返回',
  445 + fontSize: 28,
  446 + isBold: false,
  447 + height: ScreenUtil().setWidth(70),
  448 + width: ScreenUtil().setWidth(180),
  449 + radius: ScreenUtil().setWidth(10),
  450 + gradientStart: MyColours.color_ffffff,
  451 + textColor: MyColours.color_333333,
  452 + borderColor: MyColours.color_199095,
  453 + gradientEnd: MyColours.color_ffffff,
  454 + onPressed: () {
  455 + setState(() {
  456 + nameStr = '';
  457 + detailModel.nameController.text = '';
  458 + detailModel.phoneController.text = '';
  459 + });
  460 + },
  461 + ),
  462 + RoundButton(
  463 + text: '保存',
  464 + fontSize: 28,
  465 + isBold: false,
  466 + height: ScreenUtil().setWidth(70),
  467 + width: ScreenUtil().setWidth(180),
  468 + radius: ScreenUtil().setWidth(10),
  469 + onPressed: () async {
  470 + if (nameStr == null || nameStr.trim().length == 0) {
  471 + Utils.showToast('请填写客人姓名');
  472 + return;
  473 + }
  474 +
  475 + if (detailModel.phoneController.text.trim().length ==
  476 + 0) {
  477 + Utils.showToast('请填写电话');
  478 + return;
  479 + }
  480 + String sex = '1';
  481 + for (var item in detailModel.sexList) {
  482 + if (item['select']) {
  483 + sex = item['code'];
  484 + }
  485 + }
  486 + bool sucess = await detailModel.upReserveInfo(
  487 + context, widget.rid,
  488 + name: nameStr,
  489 + sex: sex,
  490 + phone: detailModel.phoneController.text);
  491 + if (sucess) {
  492 + EventBus().emit("refresh_tablemanager"); //刷新桌位
  493 + bus.emit("refresh_book_list"); //刷新已预订列表
  494 + bus.emit("refresh_detail");
  495 + Navigator.pop(context);
  496 + }
  497 + },
  498 + )
  499 + ],
  500 + )),
  501 + VEmptyView(40)
  502 + ])));
  503 + }
  504 +}
This diff could not be displayed because it is too large.
@@ -826,7 +826,7 @@ class InvicationPageState extends State<InvicationPage> { @@ -826,7 +826,7 @@ class InvicationPageState extends State<InvicationPage> {
826 ScreenUtil().setWidth(40)), 826 ScreenUtil().setWidth(40)),
827 child: Column(children: [ 827 child: Column(children: [
828 RoundButton( 828 RoundButton(
829 - text: '通知客户', 829 + text: '微信通知',
830 width: double.infinity, 830 width: double.infinity,
831 height: ScreenUtil().setWidth(84), 831 height: ScreenUtil().setWidth(84),
832 gradientStart: MyColours.color_199095, 832 gradientStart: MyColours.color_199095,
@@ -27,79 +27,85 @@ class AreaItemTableState extends State<AreaItemTable> { @@ -27,79 +27,85 @@ class AreaItemTableState extends State<AreaItemTable> {
27 Area area = widget.area; 27 Area area = widget.area;
28 bool isSelected = area.name == widget.currentArea; 28 bool isSelected = area.name == widget.currentArea;
29 return GestureDetector( 29 return GestureDetector(
30 - onTap: () {  
31 - if (widget.selectCallback != null) {  
32 - widget.selectCallback(widget.area);  
33 - }  
34 - },  
35 - child: Stack(  
36 - overflow: Overflow.visible,  
37 - alignment: Alignment.topLeft,  
38 - children: <Widget>[  
39 - Container(  
40 - width: ScreenUtil().setWidth(104 * 2),  
41 - height: ScreenUtil().setWidth(80),  
42 - margin: EdgeInsets.only(  
43 - right: ScreenUtil().setWidth(20),  
44 - top: ScreenUtil().setWidth(20),  
45 - ),  
46 - padding: EdgeInsets.symmetric(  
47 - horizontal: ScreenUtil().setWidth(20),  
48 - vertical: ScreenUtil().setWidth(10)),  
49 - alignment: Alignment.center,  
50 - decoration: BoxDecoration(  
51 - // borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),  
52 - color: isSelected  
53 - ? MyColours.color_199095  
54 - : MyColours.color_ffffff,  
55 - border: Border.all(  
56 - color: MyColours.color_E0E0E0,  
57 - width: ScreenUtil().setWidth(2))),  
58 - child: Text(  
59 - area.name,  
60 - overflow: TextOverflow.ellipsis,  
61 - style: TextStyle(  
62 - color: isSelected  
63 - ? MyColours.color_ffffff  
64 - : MyColours.color_333333,  
65 - fontSize: ScreenUtil().setSp(28),  
66 - decoration: TextDecoration.none,  
67 - fontWeight: FontWeight.normal),  
68 - ),  
69 - ),  
70 - !widget.showBadge  
71 - ? SizedBox()  
72 - : area.count == -1  
73 - ? Container()  
74 - : Positioned(  
75 - right: ScreenUtil().setWidth(12),  
76 - top: ScreenUtil().setWidth(6),  
77 - child: Container(  
78 - padding: EdgeInsets.symmetric(  
79 - vertical: ScreenUtil().setWidth(6),  
80 - horizontal: ScreenUtil().setWidth(4)),  
81 - // width: ScreenUtil().setWidth(78),  
82 - // height: ScreenUtil().setWidth(30),  
83 - alignment: Alignment.center,  
84 - decoration: BoxDecoration(  
85 - color: area.count <= 0  
86 - ? MyColours.color_999999  
87 - : MyColours.color_199095,  
88 - // borderRadius: BorderRadius.only(  
89 - // topLeft: Radius.circular(ScreenUtil().setWidth(10)),  
90 - // topRight: Radius.circular(ScreenUtil().setWidth(15)),  
91 - // bottomRight:  
92 - // Radius.circular(ScreenUtil().setWidth(15)))  
93 - ),  
94 - child: Text(area.count <= 0 ? "满座" : "${area.count}",  
95 - style: TextStyle(  
96 - color: MyColours.color_ffffff,  
97 - fontSize: ScreenUtil().setSp(26),  
98 - decoration: TextDecoration.none,  
99 - fontWeight: FontWeight.normal)),  
100 - ),  
101 - ),  
102 - ],  
103 - )); 30 + onTap: () {
  31 + if (widget.selectCallback != null) {
  32 + widget.selectCallback(widget.area);
  33 + }
  34 + },
  35 + child:
  36 + // Stack(
  37 + // overflow: Overflow.visible,
  38 + // alignment: Alignment.topLeft,
  39 + // children: <Widget>[
  40 + Container(
  41 + // width: ScreenUtil().setWidth(104 * 2),
  42 + // height: ScreenUtil().setWidth(10),
  43 + margin: EdgeInsets.only(
  44 + right: ScreenUtil().setWidth(15),
  45 + top: ScreenUtil().setWidth(20),
  46 + ),
  47 + padding: EdgeInsets.symmetric(
  48 + horizontal: ScreenUtil().setWidth(14),
  49 + // vertical: ScreenUtil().setWidth(4)
  50 + ),
  51 + alignment: Alignment.center,
  52 + decoration: BoxDecoration(
  53 + // borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
  54 + color: isSelected
  55 + ? MyColours.color_199095
  56 + : widget.showBadge && area.count != -1 && area.count <= 0
  57 + ? Color.fromRGBO(154, 154, 154, 1)
  58 + : MyColours.color_ffffff,
  59 + border: Border.all(
  60 + color: MyColours.color_E0E0E0,
  61 + width: ScreenUtil().setWidth(2))),
  62 + child: Text(
  63 + area.name,
  64 + overflow: TextOverflow.ellipsis,
  65 + style: TextStyle(
  66 + color: isSelected ||
  67 + (widget.showBadge && area.count != -1 && area.count <= 0)
  68 + ? MyColours.color_ffffff
  69 + : MyColours.color_333333,
  70 + fontSize: ScreenUtil().setSp(24),
  71 + decoration: TextDecoration.none,
  72 + fontWeight: FontWeight.normal),
  73 + ),
  74 + ),
  75 + // !widget.showBadge
  76 + // ? SizedBox()
  77 + // : area.count == -1
  78 + // ? Container()
  79 + // : Positioned(
  80 + // right: ScreenUtil().setWidth(12),
  81 + // top: ScreenUtil().setWidth(6),
  82 + // child: Container(
  83 + // padding: EdgeInsets.symmetric(
  84 + // vertical: ScreenUtil().setWidth(6),
  85 + // horizontal: ScreenUtil().setWidth(4)),
  86 + // // width: ScreenUtil().setWidth(78),
  87 + // // height: ScreenUtil().setWidth(30),
  88 + // alignment: Alignment.center,
  89 + // decoration: BoxDecoration(
  90 + // color: area.count <= 0
  91 + // ? MyColours.color_999999
  92 + // : MyColours.color_199095,
  93 + // // borderRadius: BorderRadius.only(
  94 + // // topLeft: Radius.circular(ScreenUtil().setWidth(10)),
  95 + // // topRight: Radius.circular(ScreenUtil().setWidth(15)),
  96 + // // bottomRight:
  97 + // // Radius.circular(ScreenUtil().setWidth(15)))
  98 + // ),
  99 + // child: Text(area.count <= 0 ? "满座" : "${area.count}",
  100 + // style: TextStyle(
  101 + // color: MyColours.color_ffffff,
  102 + // fontSize: ScreenUtil().setSp(26),
  103 + // decoration: TextDecoration.none,
  104 + // fontWeight: FontWeight.normal)),
  105 + // ),
  106 + // ),
  107 + // ],
  108 + // )
  109 + );
104 } 110 }
105 } 111 }
@@ -32,6 +32,7 @@ import 'package:one_key/widgets/v_empty_view.dart'; @@ -32,6 +32,7 @@ import 'package:one_key/widgets/v_empty_view.dart';
32 import 'package:provider/provider.dart'; 32 import 'package:provider/provider.dart';
33 import 'dart:convert' as convert; 33 import 'dart:convert' as convert;
34 import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; 34 import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
  35 +import 'package:one_key/models/table_list.dart' as table;
35 36
36 const scrollDuration = Duration(microseconds: 500); 37 const scrollDuration = Duration(microseconds: 500);
37 38
@@ -55,7 +56,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -55,7 +56,7 @@ class TableManagerPageState extends State<TableManagerPage> {
55 List<String> personNumList = []; 56 List<String> personNumList = [];
56 bool isSelected = true; //全部按钮 57 bool isSelected = true; //全部按钮
57 58
58 - ScrollController _scrollCrl = ScrollController(); 59 + // ScrollController _scrollCrl = ScrollController();
59 final ItemPositionsListener itemPositionsListener = 60 final ItemPositionsListener itemPositionsListener =
60 ItemPositionsListener.create(); 61 ItemPositionsListener.create();
61 62
@@ -264,10 +265,10 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -264,10 +265,10 @@ class TableManagerPageState extends State<TableManagerPage> {
264 tableManagerModel.selectTables 265 tableManagerModel.selectTables
265 .removeWhere((t) => t.id == table.id); 266 .removeWhere((t) => t.id == table.id);
266 } 267 }
267 - if (tableManagerModel.selectTables.length > 1) {  
268 - _scrollCrl.position  
269 - .didUpdateScrollPositionBy(0); //这里触发更新滚动条  
270 - } 268 + // if (tableManagerModel.selectTables.length > 1) {
  269 + // _scrollCrl.position
  270 + // .didUpdateScrollPositionBy(0); //这里触发更新滚动条
  271 + // }
271 }); 272 });
272 } 273 }
273 // DialogUtil.showTableManagerDialog(context, table).then((value) { 274 // DialogUtil.showTableManagerDialog(context, table).then((value) {
@@ -349,268 +350,455 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -349,268 +350,455 @@ class TableManagerPageState extends State<TableManagerPage> {
349 350
350 ///选中的桌子widget 351 ///选中的桌子widget
351 Widget _selectTableWidget() { 352 Widget _selectTableWidget() {
352 - return Expanded(  
353 - flex: 1,  
354 - child: Container(  
355 - // constraints: BoxConstraints(minHeight: ScreenUtil().setWidth(600)),  
356 - // height: ScreenUtil().setWidth(400),  
357 - width: double.infinity,  
358 - padding: EdgeInsets.only(  
359 - left: ScreenUtil().setWidth(40),  
360 - right: ScreenUtil().setWidth(40),  
361 - top: ScreenUtil().setWidth(30)),  
362 - decoration: BoxDecoration(  
363 - color: MyColours.color_ffffff,  
364 - boxShadow: [  
365 - BoxShadow(  
366 - color: MyColours.color_333333,  
367 - blurRadius: ScreenUtil().setWidth(14))  
368 - ],  
369 - borderRadius: BorderRadius.only(  
370 - topLeft: Radius.circular(ScreenUtil().setWidth(30)),  
371 - topRight: Radius.circular(ScreenUtil().setWidth(30)),  
372 - )),  
373 - child: Row(  
374 - // mainAxisSize: MainAxisSize.min, 353 + return Container(
  354 + // constraints: BoxConstraints(maxHeight: ScreenUtil().setWidth(760)),
  355 + // height: ScreenUtil().setWidth(400),
  356 + width: double.infinity,
  357 + padding: EdgeInsets.only(
  358 + left: ScreenUtil().setWidth(40),
  359 + right: ScreenUtil().setWidth(40),
  360 + top: ScreenUtil().setWidth(15)),
  361 + decoration: BoxDecoration(
  362 + color: MyColours.color_ffffff,
  363 + boxShadow: [
  364 + BoxShadow(
  365 + color: MyColours.color_333333,
  366 + blurRadius: ScreenUtil().setWidth(14))
  367 + ],
  368 + borderRadius: BorderRadius.only(
  369 + topLeft: Radius.circular(ScreenUtil().setWidth(30)),
  370 + topRight: Radius.circular(ScreenUtil().setWidth(30)),
  371 + )),
  372 + child: Column(
  373 + // mainAxisSize: MainAxisSize.min,
  374 + mainAxisAlignment: MainAxisAlignment.start,
  375 + children: [
  376 + Row(
  377 + crossAxisAlignment: CrossAxisAlignment.start,
375 children: [ 378 children: [
376 Column( 379 Column(
  380 + mainAxisAlignment: MainAxisAlignment.start,
377 crossAxisAlignment: CrossAxisAlignment.start, 381 crossAxisAlignment: CrossAxisAlignment.start,
378 children: [ 382 children: [
379 Text( 383 Text(
380 tableManagerModel.selectDateStr, 384 tableManagerModel.selectDateStr,
381 style: TextStyle( 385 style: TextStyle(
382 color: MyColours.color_333333, 386 color: MyColours.color_333333,
383 - fontSize: ScreenUtil().setSp(28)), 387 + fontSize: ScreenUtil().setSp(45),
  388 + fontWeight: FontWeight.bold),
384 ), 389 ),
385 - VEmptyView(15),  
386 Text( 390 Text(
387 - '已选桌位:', 391 + tableManagerModel.selectWeekAndLunarCalendar,
388 style: TextStyle( 392 style: TextStyle(
389 color: MyColours.color_333333, 393 color: MyColours.color_333333,
390 - fontSize: ScreenUtil().setSp(26)), 394 + fontSize: ScreenUtil().setSp(30)),
391 ), 395 ),
392 - VEmptyView(15),  
393 - Expanded(  
394 - child: Container(  
395 - width: ScreenUtil.screenWidthDp -  
396 - ScreenUtil().setWidth(100 + 180),  
397 - // height: ScreenUtil().setWidth(200),  
398 - // color: Colors.blueAccent,  
399 - child:  
400 - // ListView.builder(  
401 - // shrinkWrap: true,  
402 - // itemBuilder: (BuildContext context, int index) {  
403 - // return  
404 - Scrollbar(  
405 - isAlwaysShown: true, //设置滚动条常亮  
406 - controller: _scrollCrl, //必须设置一个controller  
407 -  
408 - ///添加进度条  
409 - child: SingleChildScrollView(  
410 - controller: _scrollCrl,  
411 - child: Container(  
412 - width: ScreenUtil.screenWidthDp -  
413 - ScreenUtil().setWidth(100 + 180),  
414 - child: Wrap(  
415 - spacing: ScreenUtil().setWidth(20),  
416 - runSpacing:  
417 - ScreenUtil().setWidth(20),  
418 - children: _buildAlwayItems())),  
419 - ))  
420 - // },  
421 - // itemCount: 1,  
422 - // ),  
423 - ))  
424 ], 396 ],
425 ), 397 ),
426 - HEmptyView(20), 398 + Spacer(),
  399 + Padding(
  400 + padding: EdgeInsets.only(
  401 + top: ScreenUtil().setWidth(6),
  402 + ),
  403 + child: Text(
  404 + tableManagerModel.doltStr,
  405 + style: TextStyle(
  406 + color: MyColours.color_333333,
  407 + fontSize: ScreenUtil().setSp(48),
  408 + fontWeight: FontWeight.bold),
  409 + ),
  410 + ),
  411 + ],
  412 + ),
  413 + VEmptyView(40),
  414 + Row(
  415 + crossAxisAlignment: CrossAxisAlignment.start,
  416 + children: [
  417 + // HEmptyView(15),
  418 + Padding(
  419 + // width: ScreenUtil().setWidth(120),
  420 + padding: EdgeInsets.only(top: ScreenUtil().setWidth(10)),
  421 + child: Text(
  422 + '已选桌位:',
  423 + style: TextStyle(
  424 + color: MyColours.color_333333,
  425 + fontSize: ScreenUtil().setSp(26)),
  426 + )),
  427 + HEmptyView(15),
  428 + // Expanded(
  429 + // child:
  430 + // width: ScreenUtil.screenWidthDp -
  431 + // ScreenUtil().setWidth(160),
  432 + // constraints:
  433 + // BoxConstraints(maxHeight: ScreenUtil().setWidth(140)),
  434 + // color: Colors.blueAccent,
  435 +
  436 + // ListView.builder(
  437 + // shrinkWrap: true,
  438 + // itemBuilder: (BuildContext context, int index) {
  439 + // return
  440 + // Scrollbar(
  441 + // isAlwaysShown: true, //设置滚动条常亮
  442 + // controller: _scrollCrl, //必须设置一个controller
  443 +
  444 + // ///添加进度条
  445 + // child:
  446 + // SingleChildScrollView(
  447 + // controller: _scrollCrl,
  448 + // child:
427 Container( 449 Container(
428 - // width: ScreenUtil().setWidth(100),  
429 - // color: Colors.red,  
430 - constraints: BoxConstraints(  
431 - minHeight: ScreenUtil().setWidth(500), 450 + // color: Colors.red,
  451 + width: ScreenUtil.screenWidthDp -
  452 + ScreenUtil().setWidth(100 + 130),
  453 + child: Wrap(
  454 + spacing: ScreenUtil().setWidth(20),
  455 + runSpacing: ScreenUtil().setWidth(20),
  456 + children: _buildAlwayItems())),
  457 + // )
  458 + // )
  459 + // },
  460 + // itemCount: 1,
  461 + // ),
  462 + // )
  463 + ],
  464 + ),
  465 + VEmptyView(40),
  466 + Container(
  467 + // width: ScreenUtil().setWidth(100),
  468 + // color: Colors.red,
  469 + // constraints: BoxConstraints(
  470 + // minHeight: ScreenUtil().setWidth(500),
  471 + // ),
  472 + child: Row(
  473 + mainAxisAlignment: MainAxisAlignment.spaceEvenly,
  474 + children: [
  475 + InkWell(
  476 + onTap: () {
  477 + tableManagerModel.selectTables = [];
  478 + for (t.Table item in tableManagerModel.tablesShow) {
  479 + item.selected = false;
  480 + }
  481 + tableManagerModel.areaTableMapShow.forEach((key, value) {
  482 + value.forEach((element) {
  483 + element.selected = false;
  484 + });
  485 + });
  486 +
  487 + tableManagerModel.notifyListeners();
  488 + },
  489 + child: Container(
  490 + padding: EdgeInsets.all(
  491 + ScreenUtil().setWidth(30),
  492 + ),
  493 + child: Text(
  494 + '取消重置',
  495 + style: TextStyle(
  496 + color: MyColours.color_199095,
  497 + fontSize: ScreenUtil().setSp(26)),
  498 + ),
  499 + ),
432 ), 500 ),
433 - child: Column(  
434 - children: [  
435 - RoundButton(  
436 - onPressed: () async {  
437 - SunReserveInfoModel _model = await tableManagerModel  
438 - .setReserveInfo(context, needKeep: true);  
439 - if (_model != null &&  
440 - ObjectUtil.isNotEmpty(_model.row) &&  
441 - ObjectUtil.isNotEmpty(_model.row.id)) {  
442 - print('成功');  
443 - tableManagerModel.selectTables = [];  
444 - // _homeEnterModel.clearData();  
445 - bus.emit("refresh_tablemanager"); //刷新当前页面  
446 - bus.emit("refresh_book_list"); //刷新已预订列表  
447 - //进入订座详情页面  
448 - NavigatorUtil.goNotebookDetailPage(  
449 - context,  
450 - _model.row.id,  
451 - Provider.of<UserModel>(context, listen: false)  
452 - .user  
453 - .openid,  
454 - );  
455 - // String ddate_solt = '';  
456 - // if (_model.row.isSetDdate == '1') {  
457 - // String createtime =  
458 - // _model.row.ddate.toString() + '000';  
459 - // DateTime createTime =  
460 - // DateTime.fromMillisecondsSinceEpoch(  
461 - // int.parse(createtime));  
462 - // ddate_solt = DateUtil.formatDate(createTime,  
463 - // format: DateFormats.h_m);  
464 - // } else {  
465 - // if (_model.row.ddateSolt == '1') {  
466 - // ddate_solt = '早餐';  
467 - // } else if (_model.row.ddateSolt == '2') {  
468 - // ddate_solt = '午餐';  
469 - // } else if (_model.row.ddateSolt == '3') {  
470 - // ddate_solt = '晚餐';  
471 - // }  
472 - // }  
473 - // List<dynamic> tableinfo =  
474 - // convert.jsonDecode(_model.row.tableinfo);  
475 - // print(tableinfo); 501 + RoundButton(
  502 + onPressed: () async {
  503 + SunReserveInfoModel _model = await tableManagerModel
  504 + .setReserveInfo(context, needKeep: true);
  505 + if (_model != null &&
  506 + ObjectUtil.isNotEmpty(_model.row) &&
  507 + ObjectUtil.isNotEmpty(_model.row.id)) {
  508 + print('成功');
  509 + tableManagerModel.selectTables = [];
  510 + // _homeEnterModel.clearData();
  511 + bus.emit("refresh_tablemanager"); //刷新当前页面
  512 + bus.emit("refresh_book_list"); //刷新已预订列表
  513 + //进入订座详情页面
  514 + NavigatorUtil.goNotebookDetailPage(
  515 + context,
  516 + _model.row.id,
  517 + Provider.of<UserModel>(context, listen: false)
  518 + .user
  519 + .openid,
  520 + );
  521 + // String ddate_solt = '';
  522 + // if (_model.row.isSetDdate == '1') {
  523 + // String createtime =
  524 + // _model.row.ddate.toString() + '000';
  525 + // DateTime createTime =
  526 + // DateTime.fromMillisecondsSinceEpoch(
  527 + // int.parse(createtime));
  528 + // ddate_solt = DateUtil.formatDate(createTime,
  529 + // format: DateFormats.h_m);
  530 + // } else {
  531 + // if (_model.row.ddateSolt == '1') {
  532 + // ddate_solt = '早餐';
  533 + // } else if (_model.row.ddateSolt == '2') {
  534 + // ddate_solt = '午餐';
  535 + // } else if (_model.row.ddateSolt == '3') {
  536 + // ddate_solt = '晚餐';
  537 + // }
  538 + // }
  539 + // List<dynamic> tableinfo =
  540 + // convert.jsonDecode(_model.row.tableinfo);
  541 + // print(tableinfo);
476 542
477 - // String _nameStr =  
478 - // t.TableList.fromJson(tableinfo[0]).name;  
479 - // if (tableinfo.length > 1) {  
480 - // _nameStr = t.TableList.fromJson(tableinfo[0]).name +  
481 - // '等${tableinfo.length}桌';  
482 - // }  
483 - // LogUtil.v(_nameStr);  
484 - // String _tid = '';  
485 - // for (int i = 0; i < tableinfo.length; i++) {  
486 - // _tid += '${t.TableList.fromJson(tableinfo[i]).id},';  
487 - // }  
488 - // if (_tid.endsWith(',')) {  
489 - // _tid = _tid.substring(0, _tid.length - 1);  
490 - // }  
491 - // NavigatorUtil.goInvicationPage(  
492 - // context,  
493 - // _model.row.id,  
494 - // _nameStr,  
495 - // _model.row.ddate,  
496 - // ddate_solt,  
497 - // _model.row.phone,  
498 - // _model.row.ddateSolt,  
499 - // tid: _tid,  
500 - // replace: false);  
501 - // //今天 明天 其他天  
502 - // String tempTime = _homeEnterModel.ddateStr;  
503 - // if (_homeEnterModel.ddateStr == '') {  
504 - // if (currTimeIndex == 1) {  
505 - // tempTime = '08:00';  
506 - // } else if (currTimeIndex == 2) {  
507 - // tempTime = '12:00';  
508 - // } else if (currTimeIndex == 3) {  
509 - // tempTime = '18:00';  
510 - // }  
511 - // }  
512 - // print(_model.row.tableinfo);  
513 - // _clearData();  
514 - // String timeStr = dateText + ' ' + tempTime + ':00'; 543 + // String _nameStr =
  544 + // t.TableList.fromJson(tableinfo[0]).name;
  545 + // if (tableinfo.length > 1) {
  546 + // _nameStr = t.TableList.fromJson(tableinfo[0]).name +
  547 + // '等${tableinfo.length}桌';
  548 + // }
  549 + // LogUtil.v(_nameStr);
  550 + // String _tid = '';
  551 + // for (int i = 0; i < tableinfo.length; i++) {
  552 + // _tid += '${t.TableList.fromJson(tableinfo[i]).id},';
  553 + // }
  554 + // if (_tid.endsWith(',')) {
  555 + // _tid = _tid.substring(0, _tid.length - 1);
  556 + // }
  557 + // NavigatorUtil.goInvicationPage(
  558 + // context,
  559 + // _model.row.id,
  560 + // _nameStr,
  561 + // _model.row.ddate,
  562 + // ddate_solt,
  563 + // _model.row.phone,
  564 + // _model.row.ddateSolt,
  565 + // tid: _tid,
  566 + // replace: false);
  567 + // //今天 明天 其他天
  568 + // String tempTime = _homeEnterModel.ddateStr;
  569 + // if (_homeEnterModel.ddateStr == '') {
  570 + // if (currTimeIndex == 1) {
  571 + // tempTime = '08:00';
  572 + // } else if (currTimeIndex == 2) {
  573 + // tempTime = '12:00';
  574 + // } else if (currTimeIndex == 3) {
  575 + // tempTime = '18:00';
  576 + // }
  577 + // }
  578 + // print(_model.row.tableinfo);
  579 + // _clearData();
  580 + // String timeStr = dateText + ' ' + tempTime + ':00';
515 581
516 - // LogUtil.v(timeStr);  
517 - // int ddate = DateUtil.getDateMsByTimeStr(timeStr); 582 + // LogUtil.v(timeStr);
  583 + // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
518 584
519 - // _homeEnterModel.getNewTableList(context, '${ddate}',  
520 - // currTimeIndex.toString(), pnum); 585 + // _homeEnterModel.getNewTableList(context, '${ddate}',
  586 + // currTimeIndex.toString(), pnum);
521 587
522 - // EventBus().emit("refresh_tablemanager"); //刷新桌位  
523 - } else {  
524 - Utils.showToast("预订失败!");  
525 - }  
526 - },  
527 - text: '预订',  
528 - fontSize: 48,  
529 - isBold: true,  
530 - width: ScreenUtil().setWidth(180),  
531 - height: ScreenUtil().setWidth(140),  
532 - padding: EdgeInsets.symmetric(  
533 - horizontal: ScreenUtil().setWidth(20),  
534 - vertical: ScreenUtil().setWidth(4)),  
535 - textColor: MyColours.color_ffffff,  
536 - gradientStart: MyColours.color_199095,  
537 - gradientEnd: MyColours.color_199095,  
538 - radius: ScreenUtil().setWidth(10),  
539 - borderColor: MyColours.color_199095,  
540 - ),  
541 - InkWell(  
542 - onTap: () {  
543 - tableManagerModel.selectTables = [];  
544 - for (t.Table item in tableManagerModel.tablesShow) {  
545 - item.selected = false; 588 + // EventBus().emit("refresh_tablemanager"); //刷新桌位
  589 + } else {
  590 + Utils.showToast("预订失败!");
  591 + }
  592 + },
  593 + text: '仅预订',
  594 + fontSize: 32,
  595 + isBold: false,
  596 + width: ScreenUtil().setWidth(180),
  597 + height: ScreenUtil().setWidth(90),
  598 + padding: EdgeInsets.symmetric(
  599 + horizontal: ScreenUtil().setWidth(20),
  600 + vertical: ScreenUtil().setWidth(4)),
  601 + textColor: MyColours.color_199095,
  602 + gradientStart: MyColours.color_ffffff,
  603 + gradientEnd: MyColours.color_ffffff,
  604 + radius: ScreenUtil().setWidth(10),
  605 + borderColor: MyColours.color_199095,
  606 + ),
  607 + RoundButton(
  608 + onPressed: () async {
  609 + SunReserveInfoModel _model = await tableManagerModel
  610 + .setReserveInfo(context, needKeep: true);
  611 + if (_model != null &&
  612 + ObjectUtil.isNotEmpty(_model.row) &&
  613 + ObjectUtil.isNotEmpty(_model.row.id)) {
  614 + print('成功');
  615 + tableManagerModel.selectTables = [];
  616 + // _homeEnterModel.clearData();
  617 + bus.emit("refresh_tablemanager"); //刷新当前页面
  618 + bus.emit("refresh_book_list"); //刷新已预订列表
  619 + // //进入订座详情页面
  620 + // NavigatorUtil.goNotebookDetailPage(
  621 + // context,
  622 + // _model.row.id,
  623 + // Provider.of<UserModel>(context, listen: false)
  624 + // .user
  625 + // .openid,
  626 + // );
  627 + String ddate_solt = '';
  628 + if (_model.row.isSetDdate == '1') {
  629 + String createtime = _model.row.ddate.toString() + '000';
  630 + DateTime createTime =
  631 + DateTime.fromMillisecondsSinceEpoch(
  632 + int.parse(createtime));
  633 + ddate_solt = DateUtil.formatDate(createTime,
  634 + format: DateFormats.h_m);
  635 + } else {
  636 + if (_model.row.ddateSolt == '1') {
  637 + ddate_solt = '早餐';
  638 + } else if (_model.row.ddateSolt == '2') {
  639 + ddate_solt = '午餐';
  640 + } else if (_model.row.ddateSolt == '3') {
  641 + ddate_solt = '晚餐';
546 } 642 }
547 - tableManagerModel.areaTableMapShow  
548 - .forEach((key, value) {  
549 - value.forEach((element) {  
550 - element.selected = false;  
551 - });  
552 - }); 643 + }
  644 + List<dynamic> tableinfo =
  645 + convert.jsonDecode(_model.row.tableinfo);
  646 + print(tableinfo);
553 647
554 - tableManagerModel.notifyListeners();  
555 - },  
556 - child: Padding(  
557 - padding: EdgeInsets.only(  
558 - left: ScreenUtil().setWidth(30),  
559 - right: ScreenUtil().setWidth(30),  
560 - top: ScreenUtil().setWidth(15)),  
561 - child: Text(  
562 - '取消重置',  
563 - style: TextStyle(  
564 - color: MyColours.color_199095,  
565 - fontSize: ScreenUtil().setSp(26)),  
566 - ),  
567 - ),  
568 - ),  
569 - ], 648 + String _nameStr =
  649 + table.TableList.fromJson(tableinfo[0]).name;
  650 + if (tableinfo.length > 1) {
  651 + _nameStr = table.TableList.fromJson(tableinfo[0]).name +
  652 + '等${tableinfo.length}桌';
  653 + }
  654 + LogUtil.v(_nameStr);
  655 + String _tid = '';
  656 + for (int i = 0; i < tableinfo.length; i++) {
  657 + _tid += '${table.TableList.fromJson(tableinfo[i]).id},';
  658 + }
  659 + if (_tid.endsWith(',')) {
  660 + _tid = _tid.substring(0, _tid.length - 1);
  661 + }
  662 + NavigatorUtil.goInvicationPage(
  663 + context,
  664 + _model.row.id,
  665 + _nameStr,
  666 + _model.row.ddate,
  667 + ddate_solt,
  668 + _model.row.phone,
  669 + _model.row.ddateSolt,
  670 + tid: _tid,
  671 + replace: false);
  672 + // //今天 明天 其他天
  673 + // String tempTime = _homeEnterModel.ddateStr;
  674 + // if (_homeEnterModel.ddateStr == '') {
  675 + // if (currTimeIndex == 1) {
  676 + // tempTime = '08:00';
  677 + // } else if (currTimeIndex == 2) {
  678 + // tempTime = '12:00';
  679 + // } else if (currTimeIndex == 3) {
  680 + // tempTime = '18:00';
  681 + // }
  682 + // }
  683 + // print(_model.row.tableinfo);
  684 + // _clearData();
  685 + // String timeStr = dateText + ' ' + tempTime + ':00';
  686 +
  687 + // LogUtil.v(timeStr);
  688 + // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
  689 +
  690 + // _homeEnterModel.getNewTableList(context, '${ddate}',
  691 + // currTimeIndex.toString(), pnum);
  692 +
  693 + // EventBus().emit("refresh_tablemanager"); //刷新桌位
  694 + } else {
  695 + Utils.showToast("预订失败!");
  696 + }
  697 + },
  698 + text: '预订并通知',
  699 + fontSize: 32,
  700 + isBold: false,
  701 + width: ScreenUtil().setWidth(220),
  702 + height: ScreenUtil().setWidth(90),
  703 + padding: EdgeInsets.symmetric(
  704 + horizontal: ScreenUtil().setWidth(20),
  705 + vertical: ScreenUtil().setWidth(4)),
  706 + textColor: MyColours.color_ffffff,
  707 + gradientStart: MyColours.color_199095,
  708 + gradientEnd: MyColours.color_199095,
  709 + radius: ScreenUtil().setWidth(10),
  710 + borderColor: MyColours.color_199095,
570 ), 711 ),
571 - )  
572 - ], 712 + ],
  713 + ),
573 ), 714 ),
574 - )); 715 + VEmptyView(40),
  716 + ],
  717 + ),
  718 + );
575 } 719 }
576 720
577 //构建常用备注 721 //构建常用备注
578 List<Widget> _buildAlwayItems() { 722 List<Widget> _buildAlwayItems() {
579 List<Widget> tables = []; 723 List<Widget> tables = [];
580 - for (t.Table table in tableManagerModel.selectTables) {  
581 - tables.add(Container( 724 + if (tableManagerModel.selectTables.length < 6) {
  725 + for (t.Table table in tableManagerModel.selectTables) {
  726 + tables.add(Container(
  727 + padding: EdgeInsets.symmetric(
  728 + horizontal: ScreenUtil().setWidth(10),
  729 + vertical: ScreenUtil().setWidth(6)),
  730 + decoration: BoxDecoration(
  731 + color: MyColours.color_199095,
  732 + // border: Border.all(
  733 + // color: MyColours.color_E0E0E0,
  734 + // width: ScreenUtil().setWidth(2)),
  735 + borderRadius:
  736 + BorderRadius.circular(ScreenUtil().setWidth(10))),
  737 + child: Text(
  738 + table.name,
  739 + style: TextStyle(
  740 + fontSize: ScreenUtil().setSp(36),
  741 + color: MyColours.color_ffffff,
  742 + fontWeight: FontWeight.bold),
  743 + ))
  744 + // RoundButton(
  745 + // onPressed: () async {},
  746 + // text: table.name,
  747 + // fontSize: 26,
  748 + // isBold: false,
  749 + // padding: EdgeInsets.symmetric(
  750 + // horizontal: ScreenUtil().setWidth(20),
  751 + // vertical: ScreenUtil().setWidth(4)),
  752 + // height: ScreenUtil().setWidth(48),
  753 + // textColor: MyColours.color_333333,
  754 + // gradientStart: MyColours.color_ffffff,
  755 + // gradientEnd: MyColours.color_ffffff,
  756 + // radius: ScreenUtil().setWidth(10),
  757 + // borderColor: MyColours.color_E0E0E0,
  758 + // )
  759 + );
  760 + }
  761 + } else {
  762 + for (int i = 0; i < 6; i++) {
  763 + if (i == 5) {
  764 + tables.add(Container(
  765 + padding: EdgeInsets.only(
  766 + left: ScreenUtil().setWidth(10),
  767 + right: ScreenUtil().setWidth(10),
  768 + top: ScreenUtil().setWidth(10)),
  769 + decoration: BoxDecoration(
  770 + color: MyColours.color_ffffff,
  771 + // border: Border.all(
  772 + // color: MyColours.color_E0E0E0,
  773 + // width: ScreenUtil().setWidth(2)),
  774 + borderRadius:
  775 + BorderRadius.circular(ScreenUtil().setWidth(10))),
  776 + child: Text(
  777 + '等${tableManagerModel.selectTables.length}个桌位',
  778 + style: TextStyle(
  779 + fontSize: ScreenUtil().setSp(26),
  780 + color: MyColours.color_199095,
  781 + ),
  782 + )));
  783 + return tables;
  784 + } else {
  785 + tables.add(Container(
582 padding: EdgeInsets.symmetric( 786 padding: EdgeInsets.symmetric(
583 - horizontal: ScreenUtil().setWidth(20),  
584 - vertical: ScreenUtil().setWidth(4)), 787 + horizontal: ScreenUtil().setWidth(10),
  788 + vertical: ScreenUtil().setWidth(6)),
585 decoration: BoxDecoration( 789 decoration: BoxDecoration(
586 - border: Border.all(  
587 - color: MyColours.color_E0E0E0,  
588 - width: ScreenUtil().setWidth(2)), 790 + color: MyColours.color_199095,
589 borderRadius: 791 borderRadius:
590 BorderRadius.circular(ScreenUtil().setWidth(10))), 792 BorderRadius.circular(ScreenUtil().setWidth(10))),
591 child: Text( 793 child: Text(
592 - table.name, 794 + tableManagerModel.selectTables[i].name,
593 style: TextStyle( 795 style: TextStyle(
594 - fontSize: ScreenUtil().setSp(26),  
595 - color: MyColours.color_333333, 796 + fontSize: ScreenUtil().setSp(36),
  797 + color: MyColours.color_ffffff,
596 fontWeight: FontWeight.bold), 798 fontWeight: FontWeight.bold),
597 - ))  
598 - // RoundButton(  
599 - // onPressed: () async {},  
600 - // text: table.name,  
601 - // fontSize: 26,  
602 - // isBold: false,  
603 - // padding: EdgeInsets.symmetric(  
604 - // horizontal: ScreenUtil().setWidth(20),  
605 - // vertical: ScreenUtil().setWidth(4)),  
606 - // height: ScreenUtil().setWidth(48),  
607 - // textColor: MyColours.color_333333,  
608 - // gradientStart: MyColours.color_ffffff,  
609 - // gradientEnd: MyColours.color_ffffff,  
610 - // radius: ScreenUtil().setWidth(10),  
611 - // borderColor: MyColours.color_E0E0E0,  
612 - // )  
613 - ); 799 + )));
  800 + }
  801 + }
614 } 802 }
615 803
616 return tables; 804 return tables;
@@ -618,10 +806,12 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -618,10 +806,12 @@ class TableManagerPageState extends State<TableManagerPage> {
618 806
619 ///早餐、午餐、晚餐点击方法 807 ///早餐、午餐、晚餐点击方法
620 _clickMorAndNoonAndNig() async { 808 _clickMorAndNoonAndNig() async {
621 - tableManagerModel.selectDateStr = tableManagerModel.returnDayDateWeekStr(  
622 - tableManagerModel.dateTimeSelect, tableManagerModel.currTimeIndex);  
623 -  
624 - await tableManagerModel.getReserveList(context, needLoading: true); 809 + tableManagerModel.selectDateStr =
  810 + tableManagerModel.returnDayDateStr(tableManagerModel.dateTimeSelect);
  811 + tableManagerModel.selectWeekAndLunarCalendar = tableManagerModel
  812 + .returnWeekAndLunarCalendar(tableManagerModel.dateTimeSelect);
  813 + await tableManagerModel.getReserveList(context,
  814 + needLoading: true, showMsg: true);
625 } 815 }
626 816
627 @override 817 @override
@@ -629,8 +819,9 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -629,8 +819,9 @@ class TableManagerPageState extends State<TableManagerPage> {
629 tableManagerModel = Provider.of<TableManagerModel>(context, listen: true); 819 tableManagerModel = Provider.of<TableManagerModel>(context, listen: true);
630 return Scaffold( 820 return Scaffold(
631 backgroundColor: MyColours.color_ffffff, 821 backgroundColor: MyColours.color_ffffff,
632 - appBar: SystemAppBar("桌位", showLeading: false),  
633 - body: Consumer<TableManagerModel>( 822 + body: SafeArea(child:
  823 + // appBar: SystemAppBar("桌位", showLeading: false),
  824 + Consumer<TableManagerModel>(
634 builder: (context, model, child) { 825 builder: (context, model, child) {
635 int sum = 3; 826 int sum = 3;
636 int hide = 0; 827 int hide = 0;
@@ -647,6 +838,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -647,6 +838,7 @@ class TableManagerPageState extends State<TableManagerPage> {
647 btnNum = sum - hide; 838 btnNum = sum - hide;
648 return Column( 839 return Column(
649 children: <Widget>[ 840 children: <Widget>[
  841 + VEmptyView(40),
650 Container( 842 Container(
651 color: MyColours.color_ffffff, 843 color: MyColours.color_ffffff,
652 padding: EdgeInsets.symmetric( 844 padding: EdgeInsets.symmetric(
@@ -658,9 +850,11 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -658,9 +850,11 @@ class TableManagerPageState extends State<TableManagerPage> {
658 onTap: () { 850 onTap: () {
659 DialogUtil.showCalendarDialog( 851 DialogUtil.showCalendarDialog(
660 context, tableManagerModel.dateTime) 852 context, tableManagerModel.dateTime)
661 - .then((day) { 853 + .then((day) async {
662 if (day != null) { 854 if (day != null) {
663 tableManagerModel.createDateText(context, day); 855 tableManagerModel.createDateText(context, day);
  856 + await tableManagerModel.getReserveList(context,
  857 + needLoading: true, showMsg: true);
664 } 858 }
665 }); 859 });
666 }, 860 },
@@ -684,7 +878,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -684,7 +878,7 @@ class TableManagerPageState extends State<TableManagerPage> {
684 color: MyColours.color_ffffff, 878 color: MyColours.color_ffffff,
685 fontSize: ScreenUtil().setSp(28)), 879 fontSize: ScreenUtil().setSp(28)),
686 )), 880 )),
687 - HEmptyView(10), 881 + // HEmptyView(10),
688 Image.asset( 882 Image.asset(
689 Utils.getImgPath('f_arrow_right'), 883 Utils.getImgPath('f_arrow_right'),
690 width: ScreenUtil().setWidth(25), 884 width: ScreenUtil().setWidth(25),
@@ -704,9 +898,9 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -704,9 +898,9 @@ class TableManagerPageState extends State<TableManagerPage> {
704 width: btnNum == 3 && 898 width: btnNum == 3 &&
705 (tableManagerModel.currTimeIndex == 3 || 899 (tableManagerModel.currTimeIndex == 3 ||
706 tableManagerModel.currTimeIndex == 1) 900 tableManagerModel.currTimeIndex == 1)
707 - ? ScreenUtil().setWidth(206) + 901 + ? ScreenUtil().setWidth(300) +
708 ScreenUtil().setWidth(4) 902 ScreenUtil().setWidth(4)
709 - : ScreenUtil().setWidth(206), 903 + : ScreenUtil().setWidth(300),
710 height: ScreenUtil().setWidth(74), 904 height: ScreenUtil().setWidth(74),
711 decoration: BoxDecoration( 905 decoration: BoxDecoration(
712 color: Color.fromRGBO(232, 232, 232, 1), 906 color: Color.fromRGBO(232, 232, 232, 1),
@@ -734,7 +928,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -734,7 +928,7 @@ class TableManagerPageState extends State<TableManagerPage> {
734 "00:00-00:00" 928 "00:00-00:00"
735 ? true 929 ? true
736 : false, 930 : false,
737 - width: ScreenUtil().setWidth(206) / btnNum, 931 + width: ScreenUtil().setWidth(300) / btnNum,
738 onPress: () { 932 onPress: () {
739 if (tableManagerModel.currTimeIndex == 1) 933 if (tableManagerModel.currTimeIndex == 1)
740 return; 934 return;
@@ -763,7 +957,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -763,7 +957,7 @@ class TableManagerPageState extends State<TableManagerPage> {
763 ? 1 957 ? 1
764 : 0, 958 : 0,
765 fontSize: 28, 959 fontSize: 28,
766 - width: ScreenUtil().setWidth(206) / btnNum, 960 + width: ScreenUtil().setWidth(300) / btnNum,
767 left: 961 left:
768 tableManagerModel.morning == "00:00-00:00" 962 tableManagerModel.morning == "00:00-00:00"
769 ? true 963 ? true
@@ -804,7 +998,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -804,7 +998,7 @@ class TableManagerPageState extends State<TableManagerPage> {
804 ? 1 998 ? 1
805 : 0, 999 : 0,
806 fontSize: 28, 1000 fontSize: 28,
807 - width: ScreenUtil().setWidth(206) / btnNum, 1001 + width: ScreenUtil().setWidth(300) / btnNum,
808 onPress: () { 1002 onPress: () {
809 if (tableManagerModel.currTimeIndex == 3) 1003 if (tableManagerModel.currTimeIndex == 3)
810 return; 1004 return;
@@ -822,7 +1016,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -822,7 +1016,7 @@ class TableManagerPageState extends State<TableManagerPage> {
822 ], 1016 ],
823 ), 1017 ),
824 ), 1018 ),
825 - VEmptyView(30), 1019 + VEmptyView(10),
826 1020
827 model.pageState != PageState.Success 1021 model.pageState != PageState.Success
828 ? Expanded( 1022 ? Expanded(
@@ -845,9 +1039,9 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -845,9 +1039,9 @@ class TableManagerPageState extends State<TableManagerPage> {
845 children: [ 1039 children: [
846 Container( 1040 Container(
847 color: MyColours.color_ffffff, 1041 color: MyColours.color_ffffff,
848 - height: ScreenUtil().setWidth(92), 1042 + height: ScreenUtil().setWidth(82),
849 margin: EdgeInsets.only( 1043 margin: EdgeInsets.only(
850 - bottom: ScreenUtil().setWidth(30)), 1044 + bottom: ScreenUtil().setWidth(24)),
851 child: Row( 1045 child: Row(
852 children: [ 1046 children: [
853 HEmptyView(20), 1047 HEmptyView(20),
@@ -907,8 +1101,8 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -907,8 +1101,8 @@ class TableManagerPageState extends State<TableManagerPage> {
907 DottedBorder( 1101 DottedBorder(
908 dashPattern: [5, 5, 5, 5], 1102 dashPattern: [5, 5, 5, 5],
909 borderType: BorderType.RRect, 1103 borderType: BorderType.RRect,
910 - radius: Radius.circular(  
911 - ScreenUtil().setWidth(10)), 1104 + // radius: Radius.circular(
  1105 + // ScreenUtil().setWidth(10)),
912 // padding: EdgeInsets.all(ScreenUtil().setWidth(70)), 1106 // padding: EdgeInsets.all(ScreenUtil().setWidth(70)),
913 color: MyColours.color_199095, 1107 color: MyColours.color_199095,
914 strokeWidth: 1108 strokeWidth:
@@ -922,7 +1116,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -922,7 +1116,7 @@ class TableManagerPageState extends State<TableManagerPage> {
922 height: ScreenUtil() 1116 height: ScreenUtil()
923 .setWidth(25 * 2), 1117 .setWidth(25 * 2),
924 width: ScreenUtil() 1118 width: ScreenUtil()
925 - .setWidth(104 * 2), 1119 + .setWidth(70 * 2),
926 child: Column( 1120 child: Column(
927 mainAxisAlignment: 1121 mainAxisAlignment:
928 MainAxisAlignment 1122 MainAxisAlignment
@@ -959,12 +1153,12 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -959,12 +1153,12 @@ class TableManagerPageState extends State<TableManagerPage> {
959 height: ScreenUtil().setWidth(80), 1153 height: ScreenUtil().setWidth(80),
960 margin: EdgeInsets.only( 1154 margin: EdgeInsets.only(
961 right: 1155 right:
962 - ScreenUtil().setWidth(20), 1156 + ScreenUtil().setWidth(15),
963 top: ScreenUtil().setWidth(20), 1157 top: ScreenUtil().setWidth(20),
964 ), 1158 ),
965 padding: EdgeInsets.symmetric( 1159 padding: EdgeInsets.symmetric(
966 horizontal: 1160 horizontal:
967 - ScreenUtil().setWidth(20), 1161 + ScreenUtil().setWidth(14),
968 vertical: ScreenUtil() 1162 vertical: ScreenUtil()
969 .setWidth(10)), 1163 .setWidth(10)),
970 alignment: Alignment.center, 1164 alignment: Alignment.center,
@@ -987,7 +1181,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -987,7 +1181,7 @@ class TableManagerPageState extends State<TableManagerPage> {
987 : MyColours 1181 : MyColours
988 .color_333333, 1182 .color_333333,
989 fontSize: 1183 fontSize:
990 - ScreenUtil().setSp(28), 1184 + ScreenUtil().setSp(24),
991 decoration: 1185 decoration:
992 TextDecoration.none, 1186 TextDecoration.none,
993 fontWeight: 1187 fontWeight:
@@ -1055,7 +1249,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -1055,7 +1249,7 @@ class TableManagerPageState extends State<TableManagerPage> {
1055 'f_swich_on') 1249 'f_swich_on')
1056 : Utils.getImgPath( 1250 : Utils.getImgPath(
1057 'f_swich_off'), 1251 'f_swich_off'),
1058 - width: ScreenUtil().setWidth(90), 1252 + width: ScreenUtil().setWidth(60),
1059 // height: ScreenUtil().setWidth(82), 1253 // height: ScreenUtil().setWidth(82),
1060 ), 1254 ),
1061 HEmptyView(20), 1255 HEmptyView(20),
@@ -1063,7 +1257,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -1063,7 +1257,7 @@ class TableManagerPageState extends State<TableManagerPage> {
1063 '仅看\n空座', 1257 '仅看\n空座',
1064 style: TextStyle( 1258 style: TextStyle(
1065 fontSize: 1259 fontSize:
1066 - ScreenUtil().setSp(28), 1260 + ScreenUtil().setSp(23),
1067 color: MyColours.color_333333, 1261 color: MyColours.color_333333,
1068 ), 1262 ),
1069 ), 1263 ),
@@ -1075,7 +1269,7 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -1075,7 +1269,7 @@ class TableManagerPageState extends State<TableManagerPage> {
1075 ), 1269 ),
1076 ), 1270 ),
1077 Expanded( 1271 Expanded(
1078 - flex: 2, 1272 + // flex: 2,
1079 child: Container( 1273 child: Container(
1080 constraints: BoxConstraints( 1274 constraints: BoxConstraints(
1081 minHeight: ScreenUtil().setWidth(100)), 1275 minHeight: ScreenUtil().setWidth(100)),
@@ -1137,6 +1331,6 @@ class TableManagerPageState extends State<TableManagerPage> { @@ -1137,6 +1331,6 @@ class TableManagerPageState extends State<TableManagerPage> {
1137 ], 1331 ],
1138 ); 1332 );
1139 }, 1333 },
1140 - )); 1334 + )));
1141 } 1335 }
1142 } 1336 }
@@ -58,7 +58,8 @@ class TableManagerModel with ChangeNotifier { @@ -58,7 +58,8 @@ class TableManagerModel with ChangeNotifier {
58 Map dailyMap = {}; // 早市对应半点钟,午市对应半点钟、晚市对应半点钟 58 Map dailyMap = {}; // 早市对应半点钟,午市对应半点钟、晚市对应半点钟
59 bool swichState = false; //仅看空座 59 bool swichState = false; //仅看空座
60 String selectDateStr = ''; 60 String selectDateStr = '';
61 - 61 + String selectWeekAndLunarCalendar = '';
  62 + String doltStr = '';
62 DateTime dateTimeSelect; 63 DateTime dateTimeSelect;
63 int selectNumber; 64 int selectNumber;
64 65
@@ -131,7 +132,8 @@ class TableManagerModel with ChangeNotifier { @@ -131,7 +132,8 @@ class TableManagerModel with ChangeNotifier {
131 //过了晚市 132 //过了晚市
132 currTimeIndex = 3; 133 currTimeIndex = 3;
133 } 134 }
134 - selectDateStr = returnDayDateWeekStr(dateTime, currTimeIndex); 135 + selectDateStr = returnDayDateStr(dateTime);
  136 + selectWeekAndLunarCalendar = returnWeekAndLunarCalendar(dateTime);
135 List temp = await getTableList(context); 137 List temp = await getTableList(context);
136 if (temp.length > 0) { 138 if (temp.length > 0) {
137 getReserveList(context); 139 getReserveList(context);
@@ -697,28 +699,59 @@ class TableManagerModel with ChangeNotifier { @@ -697,28 +699,59 @@ class TableManagerModel with ChangeNotifier {
697 if (Utils.isOneDay(day, dateTime)) return; //日期没变 699 if (Utils.isOneDay(day, dateTime)) return; //日期没变
698 dateTimeSelect = day; 700 dateTimeSelect = day;
699 dateText = _returnDate(day); 701 dateText = _returnDate(day);
700 - selectDateStr = returnDayDateWeekStr(day, currTimeIndex); 702 + selectDateStr = returnDayDateStr(day);
  703 + selectWeekAndLunarCalendar = returnWeekAndLunarCalendar(day);
701 dateTime = day; 704 dateTime = day;
702 getReserveList(context, needLoading: true); 705 getReserveList(context, needLoading: true);
703 } 706 }
704 707
705 _returnDate(DateTime day) { 708 _returnDate(DateTime day) {
706 - String time = Utils.lunarCalendarHolidays(day); 709 + // String time = Utils.lunarCalendarHolidays(day);
707 String date = _returnDayDateWeek(day); 710 String date = _returnDayDateWeek(day);
708 - date += ' ${time}'; 711 + // date += ' ${time}';
709 return date; 712 return date;
710 } 713 }
711 714
712 - String returnDayDateWeekStr(DateTime day, int index) {  
713 - String date = _returnDayDateWeek(day); 715 + _getDoltStr() {
  716 + if (currTimeIndex == 1) {
  717 + doltStr = '早餐';
  718 + } else if (currTimeIndex == 2) {
  719 + doltStr = '午餐';
  720 + } else if (currTimeIndex == 3) {
  721 + doltStr = '晚餐';
  722 + }
  723 + }
  724 +
  725 + // String returnDayDateWeekStr(DateTime day, int index) {
  726 + // String date = _returnDayDate(day);
  727 +
  728 + // // if (index == 1) {
  729 + // // date += ' 早餐';
  730 + // // } else if (index == 2) {
  731 + // // date += ' 午餐';
  732 + // // } else if (index == 3) {
  733 + // // date += ' 晚餐';
  734 + // // }
  735 + // return date;
  736 + // }
  737 +
  738 + String returnDayDateStr(DateTime day) {
  739 + String date = '';
  740 + DateTime dateNow = DateTime.now();
  741 + String ymd = "${day.year}-" +
  742 + Utils.addZeroNumber(day.month) +
  743 + "-" +
  744 + Utils.addZeroNumber(day.day);
714 745
715 - if (index == 1) {  
716 - date += ' 早餐';  
717 - } else if (index == 2) {  
718 - date += ' 午餐';  
719 - } else if (index == 3) {  
720 - date += ' 晚餐'; 746 + if (Utils.isOneDay(day, dateNow)) {
  747 + date += "今天 ";
  748 + } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 1)))) {
  749 + date += "明天 ";
  750 + } else if (Utils.isOneDay(day, dateNow.add(Duration(days: 2)))) {
  751 + date += "后天 ";
721 } 752 }
  753 + date += ymd;
  754 + // date += " 星期${Utils.formatWeekDayNum(day.weekday)}";
722 return date; 755 return date;
723 } 756 }
724 757
@@ -742,6 +775,13 @@ class TableManagerModel with ChangeNotifier { @@ -742,6 +775,13 @@ class TableManagerModel with ChangeNotifier {
742 return date; 775 return date;
743 } 776 }
744 777
  778 + String returnWeekAndLunarCalendar(DateTime day) {
  779 + String date = "星期${Utils.formatWeekDayNum(day.weekday)} 农历 ";
  780 + date += Utils.lunarCalendarHolidays(day);
  781 + _getDoltStr();
  782 + return date;
  783 + }
  784 +
745 //获取桌位数据 785 //获取桌位数据
746 Future<dynamic> setSwitchStatus( 786 Future<dynamic> setSwitchStatus(
747 BuildContext context, Map<String, String> params) async { 787 BuildContext context, Map<String, String> params) async {
@@ -501,4 +501,11 @@ class NavigatorUtil { @@ -501,4 +501,11 @@ class NavigatorUtil {
501 context, "${Routes.personnel_password_edit_page}?idstr=${idstr}", 501 context, "${Routes.personnel_password_edit_page}?idstr=${idstr}",
502 replace: replace); 502 replace: replace);
503 } 503 }
  504 +
  505 + /// 填写预订联系人页面
  506 + static Future<dynamic> goEditReserverPage(BuildContext context,String rid,
  507 + {replace = false }) {
  508 + return _navigateTo(context, "${Routes.edit_reserver_page}?rid=${rid}",
  509 + replace: replace);
  510 + }
504 } 511 }
@@ -26,6 +26,7 @@ import 'package:one_key/pages/create_store/enter_store_position.dart'; @@ -26,6 +26,7 @@ import 'package:one_key/pages/create_store/enter_store_position.dart';
26 import 'package:one_key/pages/create_store/enter_store_time.dart'; 26 import 'package:one_key/pages/create_store/enter_store_time.dart';
27 import 'package:one_key/pages/create_store/map_choice_point.dart'; 27 import 'package:one_key/pages/create_store/map_choice_point.dart';
28 import 'package:one_key/pages/create_store/play_video.dart'; 28 import 'package:one_key/pages/create_store/play_video.dart';
  29 +import 'package:one_key/pages/detail/edit_reserver_page.dart';
29 import 'package:one_key/pages/detail/notebook_detail_change_page.dart'; 30 import 'package:one_key/pages/detail/notebook_detail_change_page.dart';
30 import 'package:one_key/pages/detail/notebook_detail_change_page_f.dart'; 31 import 'package:one_key/pages/detail/notebook_detail_change_page_f.dart';
31 import 'package:one_key/pages/detail/select_tables_f_page.dart'; 32 import 'package:one_key/pages/detail/select_tables_f_page.dart';
@@ -129,6 +130,23 @@ var reserveDetailHandler = new Handler( @@ -129,6 +130,23 @@ var reserveDetailHandler = new Handler(
129 )))); 130 ))));
130 }); 131 });
131 132
  133 +// 填写预订人信息
  134 +var editReserverPageHandle = new Handler(
  135 + handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
  136 + String rid = params['rid'].first;
  137 + // String mid = params['mid'].first;
  138 + // String uid = params['uid'].first;
  139 + // bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first);
  140 + return ChangeNotifierProvider<NotebookDetailModel>(
  141 + create: (_) => NotebookDetailModel(),
  142 + child: EditReserverPage(
  143 + rid,
  144 + // mid: mid,
  145 + // uid: uid,
  146 + // fromNotify: fromNotify,
  147 + ));
  148 +});
  149 +
132 // 跳转到处理在线预订 150 // 跳转到处理在线预订
133 var handleOnlineHandler = new Handler( 151 var handleOnlineHandler = new Handler(
134 handlerFunc: (BuildContext context, Map<String, List<Object>> params) { 152 handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
@@ -66,6 +66,8 @@ class Routes { @@ -66,6 +66,8 @@ class Routes {
66 "/personnel_password_edit_page"; //密码修改页 66 "/personnel_password_edit_page"; //密码修改页
67 static String change_detail_f = "/change_detail_f"; //变更预订_方硕新修改页面 67 static String change_detail_f = "/change_detail_f"; //变更预订_方硕新修改页面
68 static String photo_manager_page = "/photo_manager_page"; //照片管理 68 static String photo_manager_page = "/photo_manager_page"; //照片管理
  69 + static String edit_reserver_page = "/edit_reserver_page"; //填写预订联系人
  70 +
69 71
70 static void configureRoutes(FluroRouter router) { 72 static void configureRoutes(FluroRouter router) {
71 router.notFoundHandler = new Handler( 73 router.notFoundHandler = new Handler(
@@ -140,5 +142,8 @@ class Routes { @@ -140,5 +142,8 @@ class Routes {
140 handler: personnelPasswordEditPageHandle); 142 handler: personnelPasswordEditPageHandle);
141 router.define(change_detail_f, handler: noteBookChangeFPageHandle); 143 router.define(change_detail_f, handler: noteBookChangeFPageHandle);
142 router.define(photo_manager_page, handler: photoManagerPageHandle); 144 router.define(photo_manager_page, handler: photoManagerPageHandle);
  145 +router.define(edit_reserver_page, handler: editReserverPageHandle);
  146 +
  147 +
143 } 148 }
144 } 149 }
@@ -63,25 +63,25 @@ class Utils { @@ -63,25 +63,25 @@ class Utils {
63 "1223": "过小年", 63 "1223": "过小年",
64 "0100": "除夕" 64 "0100": "除夕"
65 }; 65 };
66 - Map<String, String> holiday2 = {  
67 - "0101": '元旦',  
68 - "0214": "情人节",  
69 - "0308": "妇女节",  
70 - "0501": "劳动节",  
71 - "0504": "青年节",  
72 - "0601": "国际儿童节",  
73 - "0801": "八一建军节",  
74 - "0910": "教师节",  
75 - "1001": "国庆节",  
76 - "1224": "平安夜",  
77 - "1225": "圣诞节",  
78 - }; 66 + // Map<String, String> holiday2 = {
  67 + // "0101": '元旦',
  68 + // "0214": "情人节",
  69 + // "0308": "妇女节",
  70 + // "0501": "劳动节",
  71 + // "0504": "青年节",
  72 + // "0601": "国际儿童节",
  73 + // "0801": "八一建军节",
  74 + // "0910": "教师节",
  75 + // "1001": "国庆节",
  76 + // "1224": "平安夜",
  77 + // "1225": "圣诞节",
  78 + // };
79 if (holiday1.containsKey(keyLunar)) { 79 if (holiday1.containsKey(keyLunar)) {
80 return holiday1[keyLunar]; 80 return holiday1[keyLunar];
81 } 81 }
82 - if (holiday2.containsKey(keySolar)) {  
83 - return holiday2[keySolar];  
84 - } 82 + // if (holiday2.containsKey(keySolar)) {
  83 + // return holiday2[keySolar];
  84 + // }
85 return lunarCalendarUtils(day); 85 return lunarCalendarUtils(day);
86 } 86 }
87 87