Showing
8 changed files
with
1237 additions
and
429 deletions
assets/error_circle_red.png
0 → 100755
1.75 KB
assets/table_m_arrow_down_white.png
0 → 100755
1.06 KB
| @@ -132,11 +132,13 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | @@ -132,11 +132,13 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { | ||
| 132 | solt: widget.solt, | 132 | solt: widget.solt, |
| 133 | )), | 133 | )), |
| 134 | )) | 134 | )) |
| 135 | - ..add(ChangeNotifierProvider<BaseIndoProvider>( | ||
| 136 | - create: (_) => BaseIndoProvider(), | ||
| 137 | - child: ChangeNotifierProvider<TableManagerModel>( | ||
| 138 | - create: (_) => TableManagerModel(), child: TableManagerPage()), | ||
| 139 | - )) | 135 | + ..add(ChangeNotifierProvider<MyModel>( |
| 136 | + create: (_) => MyModel(), | ||
| 137 | + child: ChangeNotifierProvider<BaseIndoProvider>( | ||
| 138 | + create: (_) => BaseIndoProvider(), | ||
| 139 | + child: ChangeNotifierProvider<TableManagerModel>( | ||
| 140 | + create: (_) => TableManagerModel(), child: TableManagerPage()), | ||
| 141 | + ))) | ||
| 140 | ..add(ChangeNotifierProvider<MyModel>( | 142 | ..add(ChangeNotifierProvider<MyModel>( |
| 141 | create: (_) => MyModel(), | 143 | create: (_) => MyModel(), |
| 142 | child: MyPage(), | 144 | child: MyPage(), |
| @@ -73,6 +73,7 @@ class InvicationPageState extends State<InvicationPage> | @@ -73,6 +73,7 @@ class InvicationPageState extends State<InvicationPage> | ||
| 73 | String wechat = ''; | 73 | String wechat = ''; |
| 74 | String qiniuUrl = ''; | 74 | String qiniuUrl = ''; |
| 75 | List<String> couponsCan = []; //优惠券弹框数据 | 75 | List<String> couponsCan = []; //优惠券弹框数据 |
| 76 | + | ||
| 76 | 77 | ||
| 77 | final GlobalKey globalKey = GlobalKey(); | 78 | final GlobalKey globalKey = GlobalKey(); |
| 78 | String reserverPhone; //联系人保存成功后的值 | 79 | String reserverPhone; //联系人保存成功后的值 |
| @@ -7,12 +7,16 @@ import 'package:flutter/material.dart'; | @@ -7,12 +7,16 @@ import 'package:flutter/material.dart'; | ||
| 7 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 7 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 8 | import 'package:one_key/constant/state.dart'; | 8 | import 'package:one_key/constant/state.dart'; |
| 9 | import 'package:one_key/models/area.dart'; | 9 | import 'package:one_key/models/area.dart'; |
| 10 | +import 'package:one_key/models/coupon_model.dart'; | ||
| 10 | import 'package:one_key/models/guest_info_model.dart'; | 11 | import 'package:one_key/models/guest_info_model.dart'; |
| 11 | 12 | ||
| 12 | import 'package:one_key/models/reserve_info_model.dart'; | 13 | import 'package:one_key/models/reserve_info_model.dart'; |
| 14 | +import 'package:one_key/models/sms_info.dart'; | ||
| 13 | 15 | ||
| 14 | import 'package:one_key/pages/table/area_item_table.dart'; | 16 | import 'package:one_key/pages/table/area_item_table.dart'; |
| 15 | import 'package:one_key/provider/base_info_provider.dart'; | 17 | import 'package:one_key/provider/base_info_provider.dart'; |
| 18 | +import 'package:one_key/provider/coupon_provider.dart'; | ||
| 19 | +import 'package:one_key/provider/my_model.dart'; | ||
| 16 | 20 | ||
| 17 | import 'package:one_key/provider/table_manager_model.dart'; | 21 | import 'package:one_key/provider/table_manager_model.dart'; |
| 18 | import 'package:one_key/provider/user_model.dart'; | 22 | import 'package:one_key/provider/user_model.dart'; |
| @@ -26,6 +30,7 @@ import 'package:one_key/widgets/MyDivider.dart'; | @@ -26,6 +30,7 @@ import 'package:one_key/widgets/MyDivider.dart'; | ||
| 26 | 30 | ||
| 27 | import 'package:one_key/widgets/common_button_flat.dart'; | 31 | import 'package:one_key/widgets/common_button_flat.dart'; |
| 28 | import 'package:one_key/widgets/f_table_item.dart'; | 32 | import 'package:one_key/widgets/f_table_item.dart'; |
| 33 | +import 'package:one_key/widgets/gradient_button.dart'; | ||
| 29 | import 'package:one_key/widgets/h_empty_view.dart'; | 34 | import 'package:one_key/widgets/h_empty_view.dart'; |
| 30 | import 'package:one_key/widgets/page_exception.dart'; | 35 | import 'package:one_key/widgets/page_exception.dart'; |
| 31 | import 'package:one_key/widgets/round_button.dart'; | 36 | import 'package:one_key/widgets/round_button.dart'; |
| @@ -74,6 +79,15 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -74,6 +79,15 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 74 | String ddateHm = '选填'; | 79 | String ddateHm = '选填'; |
| 75 | int actualPnumIndex; | 80 | int actualPnumIndex; |
| 76 | int ddateIndex; | 81 | int ddateIndex; |
| 82 | + List<String> couponsCan = []; //优惠券弹框数据 | ||
| 83 | + String youhui = '选择优惠'; | ||
| 84 | + int couponSelectIndex = 0; | ||
| 85 | + CouponProvider couponProvider; | ||
| 86 | + bool wechatNotification = true; //默认微信通知模式 | ||
| 87 | + SmsInfoData smsInfoData; | ||
| 88 | + MyModel myModel; | ||
| 89 | + | ||
| 90 | + String showErro = ''; | ||
| 77 | 91 | ||
| 78 | // ScrollController _scrollCrl = ScrollController(); | 92 | // ScrollController _scrollCrl = ScrollController(); |
| 79 | final ItemPositionsListener itemPositionsListener = | 93 | final ItemPositionsListener itemPositionsListener = |
| @@ -93,7 +107,10 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -93,7 +107,10 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 93 | // personNumList.add('30以上'); | 107 | // personNumList.add('30以上'); |
| 94 | 108 | ||
| 95 | WidgetsBinding.instance.addPostFrameCallback((_) { | 109 | WidgetsBinding.instance.addPostFrameCallback((_) { |
| 110 | + couponProvider.sendSMS = false; | ||
| 96 | tableManagerModel.initTime(context); | 111 | tableManagerModel.initTime(context); |
| 112 | + _couponNetworkData(); | ||
| 113 | + _getSmsInfo(context); | ||
| 97 | EventBus().on("refresh_tablemanager", (arg) { | 114 | EventBus().on("refresh_tablemanager", (arg) { |
| 98 | //订座-完成预订 刷新管理桌位 | 115 | //订座-完成预订 刷新管理桌位 |
| 99 | tableManagerModel.getReserveList(context, | 116 | tableManagerModel.getReserveList(context, |
| @@ -115,6 +132,78 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -115,6 +132,78 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 115 | EventBus().off("refresh_tablePhoto"); | 132 | EventBus().off("refresh_tablePhoto"); |
| 116 | } | 133 | } |
| 117 | 134 | ||
| 135 | + ///获取短信余量 | ||
| 136 | + _getSmsInfo(context) async { | ||
| 137 | + smsInfoData = await myModel.getSmsInfo(context); | ||
| 138 | + if (myModel.smsInfo.isEmpty) { | ||
| 139 | + setState(() { | ||
| 140 | + showErro = '短信余额不足,请充值短信条数'; | ||
| 141 | + }); | ||
| 142 | + } else { | ||
| 143 | + showErro = ''; | ||
| 144 | + } | ||
| 145 | + | ||
| 146 | + // setState(() { | ||
| 147 | + // if (smsInfoData != null) { | ||
| 148 | + // smsInfo = smsInfoData?.lastNum; | ||
| 149 | + // } | ||
| 150 | + // }); | ||
| 151 | + } | ||
| 152 | + | ||
| 153 | + ///消费券 | ||
| 154 | + _couponNetworkData({bool isShowLoading = true}) async { | ||
| 155 | + couponSelectIndex = 0; | ||
| 156 | + Map<String, String> params = { | ||
| 157 | + "uid": Provider.of<UserModel>(context, listen: false).user.openid, | ||
| 158 | + 'status': '1' | ||
| 159 | + }; | ||
| 160 | + await couponProvider.getCustomerSelectActivityNew(context, params, | ||
| 161 | + isShowLoading: isShowLoading); | ||
| 162 | + //此人已经新建好券 | ||
| 163 | + if (couponProvider.couponListSelect.length > 0) { | ||
| 164 | + // couponProvider.initCouponSelect(context); | ||
| 165 | + couponsCan = []; | ||
| 166 | + List<CouponSunModel> temp = []; | ||
| 167 | + for (int i = 0; i < couponProvider.couponListSelect.length; i++) { | ||
| 168 | + if (couponProvider.couponListSelect[i].isOpenBool) { | ||
| 169 | +// 店铺优惠券 | ||
| 170 | + if (couponProvider.couponListSelect[i].isType == '1') { | ||
| 171 | + if (couponProvider.couponListSelect[i].uidList != null) { | ||
| 172 | + List<String> listuids = | ||
| 173 | + couponProvider.couponListSelect[i].uidList.split(','); | ||
| 174 | + if (listuids.contains( | ||
| 175 | + Provider.of<UserModel>(context, listen: false).user.openid)) | ||
| 176 | + couponsCan.add(couponProvider.couponListSelect[i].aname); | ||
| 177 | + temp.add(couponProvider.couponListSelect[i]); | ||
| 178 | + } | ||
| 179 | + } else { | ||
| 180 | + //我的优惠券 | ||
| 181 | + couponsCan.add(couponProvider.couponListSelect[i].aname); | ||
| 182 | + temp.add(couponProvider.couponListSelect[i]); | ||
| 183 | + } | ||
| 184 | + } | ||
| 185 | + } | ||
| 186 | + couponProvider.couponListSelect = temp; | ||
| 187 | + //获取绑定的优惠券 | ||
| 188 | + // _getActivityByRid(); | ||
| 189 | + | ||
| 190 | + // if (couponProvider.coupons.length == 0) { | ||
| 191 | + // setState(() { | ||
| 192 | + // couponHeight = 0.0; | ||
| 193 | + // }); | ||
| 194 | + // } else { | ||
| 195 | + // setState(() { | ||
| 196 | + // couponHeight = 140.0; | ||
| 197 | + // }); | ||
| 198 | + // } | ||
| 199 | + } else { | ||
| 200 | + //没有新建的优惠券 | ||
| 201 | + // setState(() { | ||
| 202 | + // couponHeight = 0.0; | ||
| 203 | + // }); | ||
| 204 | + } | ||
| 205 | + } | ||
| 206 | + | ||
| 118 | ///刷新图片显示 | 207 | ///刷新图片显示 |
| 119 | _refreshTablePhoto() async { | 208 | _refreshTablePhoto() async { |
| 120 | List temp = | 209 | List temp = |
| @@ -795,102 +884,134 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -795,102 +884,134 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 795 | width: ScreenUtil().setWidth(2), | 884 | width: ScreenUtil().setWidth(2), |
| 796 | color: MyColours.color_DBDBDB)), | 885 | color: MyColours.color_DBDBDB)), |
| 797 | child: Row( | 886 | child: Row( |
| 798 | - mainAxisAlignment: MainAxisAlignment.spaceBetween, | 887 | + // mainAxisAlignment: MainAxisAlignment.spaceAround, |
| 799 | children: [ | 888 | children: [ |
| 800 | - Row(children: [ | ||
| 801 | - Text( | ||
| 802 | - '就餐人数:', | ||
| 803 | - style: TextStyle( | ||
| 804 | - // letterSpacing: ScreenUtil().setWidth(1.8 * 2), | ||
| 805 | - color: MyColours.color_515151, | ||
| 806 | - fontSize: ScreenUtil().setSp(28)), | ||
| 807 | - ), | ||
| 808 | - InkWell( | ||
| 809 | - onTap: () { | ||
| 810 | - FocusScope.of(context) | ||
| 811 | - .requestFocus(FocusNode()); //隐藏键盘 | ||
| 812 | - DialogUtil.showSelectCusmanDialog( | ||
| 813 | - context, personNumList, (value) async { | ||
| 814 | - if (value != null) { | ||
| 815 | - actualPnumIndex = value.first; | ||
| 816 | - actualPnum = personNumList[value.first]; | ||
| 817 | - setState(() {}); | ||
| 818 | - } | ||
| 819 | - }, | ||
| 820 | - selecteds: actualPnumIndex == null | ||
| 821 | - ? [] | ||
| 822 | - : [actualPnumIndex]) | ||
| 823 | - .then((value) {}); | ||
| 824 | - }, | ||
| 825 | - child: Expanded( | ||
| 826 | - child: Text(actualPnum, | ||
| 827 | - style: TextStyle( | ||
| 828 | - fontSize: ScreenUtil().setSp(28), | ||
| 829 | - color: actualPnum == '选填' | ||
| 830 | - ? MyColours.color_999999 | ||
| 831 | - : MyColours.color_515151)), | ||
| 832 | - ), | 889 | + Expanded( |
| 890 | + child: Padding( | ||
| 891 | + padding: EdgeInsets.only( | ||
| 892 | + right: ScreenUtil().setWidth(14)), | ||
| 893 | + child: Row( | ||
| 894 | + mainAxisAlignment: | ||
| 895 | + MainAxisAlignment.spaceBetween, | ||
| 896 | + children: [ | ||
| 897 | + Text( | ||
| 898 | + '就餐人数:', | ||
| 899 | + style: TextStyle( | ||
| 900 | + // letterSpacing: ScreenUtil().setWidth(1.8 * 2), | ||
| 901 | + color: MyColours.color_515151, | ||
| 902 | + fontSize: ScreenUtil().setSp(28)), | ||
| 903 | + ), | ||
| 904 | + Expanded( | ||
| 905 | + child: InkWell( | ||
| 906 | + onTap: () { | ||
| 907 | + FocusScope.of(context) | ||
| 908 | + .requestFocus( | ||
| 909 | + FocusNode()); //隐藏键盘 | ||
| 910 | + DialogUtil.showSelectCusmanDialog( | ||
| 911 | + context, personNumList, | ||
| 912 | + (value) async { | ||
| 913 | + if (value != null) { | ||
| 914 | + actualPnumIndex = value.first; | ||
| 915 | + actualPnum = personNumList[ | ||
| 916 | + value.first]; | ||
| 917 | + setState(() {}); | ||
| 918 | + } | ||
| 919 | + }, | ||
| 920 | + selecteds: | ||
| 921 | + actualPnumIndex == | ||
| 922 | + null | ||
| 923 | + ? [] | ||
| 924 | + : [ | ||
| 925 | + actualPnumIndex | ||
| 926 | + ]) | ||
| 927 | + .then((value) {}); | ||
| 928 | + }, | ||
| 929 | + child: Container( | ||
| 930 | + alignment: Alignment.center, | ||
| 931 | + child: Text(actualPnum, | ||
| 932 | + style: TextStyle( | ||
| 933 | + fontSize: ScreenUtil() | ||
| 934 | + .setSp(28), | ||
| 935 | + color: actualPnum == | ||
| 936 | + '选填' | ||
| 937 | + ? MyColours | ||
| 938 | + .color_999999 | ||
| 939 | + : MyColours | ||
| 940 | + .color_515151))), | ||
| 941 | + ), | ||
| 833 | 942 | ||
| 834 | - // HEmptyView(6), | ||
| 835 | - // Image.asset( | ||
| 836 | - // Utils.getImgPath( | ||
| 837 | - // false ? 'c_arrow_up' : 'c_arrow_down'), | ||
| 838 | - // width: ScreenUtil().setWidth(28), | ||
| 839 | - // // height: ScreenUtil().setWidth(10), | ||
| 840 | - // ), | ||
| 841 | - ) | ||
| 842 | - ]), | 943 | + // HEmptyView(6), |
| 944 | + // Image.asset( | ||
| 945 | + // Utils.getImgPath( | ||
| 946 | + // false ? 'c_arrow_up' : 'c_arrow_down'), | ||
| 947 | + // width: ScreenUtil().setWidth(28), | ||
| 948 | + // // height: ScreenUtil().setWidth(10), | ||
| 949 | + // ), | ||
| 950 | + ), | ||
| 951 | + ]))), | ||
| 843 | MyDivider(ScreenUtil().setWidth(2), | 952 | MyDivider(ScreenUtil().setWidth(2), |
| 844 | ScreenUtil().setWidth(46), | 953 | ScreenUtil().setWidth(46), |
| 845 | color: MyColours.color_BFC4D4), | 954 | color: MyColours.color_BFC4D4), |
| 846 | - Row( | ||
| 847 | - mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
| 848 | - children: [ | ||
| 849 | - Text( | ||
| 850 | - '就餐时间:', | ||
| 851 | - style: TextStyle( | ||
| 852 | - // letterSpacing: ScreenUtil().setWidth(1.8 * 2), | ||
| 853 | - color: MyColours.color_333333, | ||
| 854 | - fontSize: ScreenUtil().setSp(26)), | ||
| 855 | - ), | ||
| 856 | - InkWell( | ||
| 857 | - onTap: () { | ||
| 858 | - FocusScope.of(context) | ||
| 859 | - .requestFocus(FocusNode()); //隐藏键盘 | ||
| 860 | - DialogUtil.showSelectCusmanDialog( | ||
| 861 | - context, tableManagerModel.dailyList, | ||
| 862 | - (value) async { | ||
| 863 | - if (value != null) { | ||
| 864 | - ddateIndex = value.first; | ||
| 865 | - ddateHm = tableManagerModel | ||
| 866 | - .dailyList[value.first]; | ||
| 867 | - setState(() {}); | ||
| 868 | - } | ||
| 869 | - }, | ||
| 870 | - selecteds: ddateIndex == null | ||
| 871 | - ? [] | ||
| 872 | - : [ddateIndex]) | ||
| 873 | - .then((value) {}); | ||
| 874 | - }, | ||
| 875 | - child: Expanded( | ||
| 876 | - child: Text(ddateHm, | ||
| 877 | - style: TextStyle( | ||
| 878 | - fontSize: ScreenUtil().setSp(28), | ||
| 879 | - color: ddateHm == '选填' | ||
| 880 | - ? MyColours.color_999999 | ||
| 881 | - : MyColours.color_515151)), | ||
| 882 | - ), | 955 | + Expanded( |
| 956 | + child: Padding( | ||
| 957 | + padding: EdgeInsets.only( | ||
| 958 | + left: ScreenUtil().setWidth(14)), | ||
| 959 | + child: Row( | ||
| 960 | + mainAxisAlignment: | ||
| 961 | + MainAxisAlignment.spaceEvenly, | ||
| 962 | + children: [ | ||
| 963 | + Text( | ||
| 964 | + '到店时间:', | ||
| 965 | + style: TextStyle( | ||
| 966 | + // letterSpacing: ScreenUtil().setWidth(1.8 * 2), | ||
| 967 | + color: MyColours.color_515151, | ||
| 968 | + fontSize: ScreenUtil().setSp(28)), | ||
| 969 | + ), | ||
| 970 | + Expanded( | ||
| 971 | + child: InkWell( | ||
| 972 | + onTap: () { | ||
| 973 | + FocusScope.of(context).requestFocus( | ||
| 974 | + FocusNode()); //隐藏键盘 | ||
| 975 | + DialogUtil.showSelectCusmanDialog( | ||
| 976 | + context, | ||
| 977 | + tableManagerModel.dailyList, | ||
| 978 | + (value) async { | ||
| 979 | + if (value != null) { | ||
| 980 | + ddateIndex = value.first; | ||
| 981 | + ddateHm = tableManagerModel | ||
| 982 | + .dailyList[value.first]; | ||
| 983 | + setState(() {}); | ||
| 984 | + } | ||
| 985 | + }, | ||
| 986 | + selecteds: | ||
| 987 | + ddateIndex == null | ||
| 988 | + ? [] | ||
| 989 | + : [ddateIndex]) | ||
| 990 | + .then((value) {}); | ||
| 991 | + }, | ||
| 992 | + child: Container( | ||
| 993 | + alignment: Alignment.center, | ||
| 994 | + child: Text(ddateHm, | ||
| 995 | + style: TextStyle( | ||
| 996 | + fontSize: ScreenUtil() | ||
| 997 | + .setSp(28), | ||
| 998 | + color: ddateHm == '选填' | ||
| 999 | + ? MyColours | ||
| 1000 | + .color_999999 | ||
| 1001 | + : MyColours | ||
| 1002 | + .color_515151))), | ||
| 1003 | + ), | ||
| 883 | 1004 | ||
| 884 | - // HEmptyView(6), | ||
| 885 | - // Image.asset( | ||
| 886 | - // Utils.getImgPath( | ||
| 887 | - // false ? 'c_arrow_up' : 'c_arrow_down'), | ||
| 888 | - // width: ScreenUtil().setWidth(28), | ||
| 889 | - // // height: ScreenUtil().setWidth(10), | ||
| 890 | - // ), | ||
| 891 | - ), | ||
| 892 | - ], | ||
| 893 | - ) | 1005 | + // HEmptyView(6), |
| 1006 | + // Image.asset( | ||
| 1007 | + // Utils.getImgPath( | ||
| 1008 | + // false ? 'c_arrow_up' : 'c_arrow_down'), | ||
| 1009 | + // width: ScreenUtil().setWidth(28), | ||
| 1010 | + // // height: ScreenUtil().setWidth(10), | ||
| 1011 | + // ), | ||
| 1012 | + ), | ||
| 1013 | + ], | ||
| 1014 | + ))) | ||
| 894 | ], | 1015 | ], |
| 895 | ), | 1016 | ), |
| 896 | ) | 1017 | ) |
| @@ -1024,6 +1145,153 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1024,6 +1145,153 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1024 | )); | 1145 | )); |
| 1025 | } | 1146 | } |
| 1026 | 1147 | ||
| 1148 | + // 客户经理转发记录 | ||
| 1149 | + _addForward(String rid) async { | ||
| 1150 | + UserModel userModel = Provider.of<UserModel>(context, listen: false); | ||
| 1151 | + Map<String, String> params = { | ||
| 1152 | + "rid": rid, | ||
| 1153 | + "sid": userModel.user.sellerid, | ||
| 1154 | + "uid": userModel.user.openid | ||
| 1155 | + }; | ||
| 1156 | + | ||
| 1157 | + bool success = await couponProvider.addForwardAsReserve(context, params); | ||
| 1158 | + if (success) { | ||
| 1159 | + print('yes'); | ||
| 1160 | + } | ||
| 1161 | + } | ||
| 1162 | + | ||
| 1163 | + _buttonChoose(String title, ClickCallback callback) { | ||
| 1164 | + return InkWell( | ||
| 1165 | + onTap: () { | ||
| 1166 | + callback(title); | ||
| 1167 | + }, | ||
| 1168 | + child: Padding( | ||
| 1169 | + padding: EdgeInsets.symmetric( | ||
| 1170 | + horizontal: ScreenUtil().setWidth(20), | ||
| 1171 | + vertical: ScreenUtil().setWidth(10)), | ||
| 1172 | + // height: ScreenUtil().setWidth(50), | ||
| 1173 | + // decoration: BoxDecoration( | ||
| 1174 | + // // border: Border.all( | ||
| 1175 | + // // width: ScreenUtil().setWidth(2), | ||
| 1176 | + // // color: MyColours.color_199095), | ||
| 1177 | + // borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))), | ||
| 1178 | + child: Row( | ||
| 1179 | + children: [ | ||
| 1180 | + Expanded( | ||
| 1181 | + child: Text( | ||
| 1182 | + title, | ||
| 1183 | + overflow: TextOverflow.ellipsis, | ||
| 1184 | + style: TextStyle( | ||
| 1185 | + color: MyColours.color_ffffff, | ||
| 1186 | + fontSize: ScreenUtil().setWidth(28)), | ||
| 1187 | + )), | ||
| 1188 | + HEmptyView(10), | ||
| 1189 | + Image.asset( | ||
| 1190 | + Utils.getImgPath('table_m_arrow_down_white'), | ||
| 1191 | + width: ScreenUtil().setWidth(40), | ||
| 1192 | + // height: ScreenUtil().setWidth(10), | ||
| 1193 | + ) | ||
| 1194 | + ], | ||
| 1195 | + ))); | ||
| 1196 | + } | ||
| 1197 | + | ||
| 1198 | + ///优惠券选择 | ||
| 1199 | + Widget _couponWidget() { | ||
| 1200 | + return Padding( | ||
| 1201 | + padding: EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(48)), | ||
| 1202 | + child: Stack( | ||
| 1203 | + children: [ | ||
| 1204 | + Container( | ||
| 1205 | + width: double.infinity, | ||
| 1206 | + child: Row( | ||
| 1207 | + children: [ | ||
| 1208 | + Expanded( | ||
| 1209 | + child: GradientButton( | ||
| 1210 | + radius: 12, | ||
| 1211 | + height: ScreenUtil().setWidth(34 * 2), | ||
| 1212 | + colors: [ | ||
| 1213 | + MyColours.color_5CA0AD, | ||
| 1214 | + MyColours.color_238389 | ||
| 1215 | + ])), | ||
| 1216 | + Expanded( | ||
| 1217 | + child: GradientButton( | ||
| 1218 | + left: false, | ||
| 1219 | + radius: 12, | ||
| 1220 | + height: ScreenUtil().setWidth(34 * 2), | ||
| 1221 | + colors: [ | ||
| 1222 | + MyColours.color_238389, | ||
| 1223 | + MyColours.color_2193B0 | ||
| 1224 | + ])) | ||
| 1225 | + ], | ||
| 1226 | + ), | ||
| 1227 | + ), | ||
| 1228 | + Row(children: [ | ||
| 1229 | + Expanded( | ||
| 1230 | + child: Container( | ||
| 1231 | + height: ScreenUtil().setWidth(70), | ||
| 1232 | + // width: ScreenUtil().setWidth(130), | ||
| 1233 | + decoration: BoxDecoration( | ||
| 1234 | + borderRadius: | ||
| 1235 | + BorderRadius.circular(ScreenUtil().setWidth(12)), | ||
| 1236 | + color: Colors.transparent), | ||
| 1237 | + child: _buttonChoose(youhui, (value) { | ||
| 1238 | + if (couponsCan == null || couponsCan.length == 0) { | ||
| 1239 | + Utils.showToast('暂无优惠券!'); | ||
| 1240 | + return; | ||
| 1241 | + } | ||
| 1242 | + FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘 | ||
| 1243 | + DialogUtil.showSelectCusmanDialog(context, couponsCan, | ||
| 1244 | + (value) { | ||
| 1245 | + if (value != null) { | ||
| 1246 | + setState(() { | ||
| 1247 | + couponSelectIndex = value.first; | ||
| 1248 | + youhui = couponsCan[couponSelectIndex]; | ||
| 1249 | + }); | ||
| 1250 | + } | ||
| 1251 | + }, | ||
| 1252 | + selecteds: couponSelectIndex == null | ||
| 1253 | + ? [] | ||
| 1254 | + : [couponSelectIndex]) | ||
| 1255 | + .then((value) {}); | ||
| 1256 | + }))), | ||
| 1257 | + // HEmptyView(40), | ||
| 1258 | + // InkWell( | ||
| 1259 | + // onTap: () async { | ||
| 1260 | + // UserModel userModel = | ||
| 1261 | + // Provider.of<UserModel>(context, listen: false); | ||
| 1262 | + // if (userModel.user.role_name == '管理员' || | ||
| 1263 | + // userModel.user.role_name == '店长') { | ||
| 1264 | + // NavigatorUtil.goCouponCreateSelectTypePage(context); | ||
| 1265 | + // } else { | ||
| 1266 | + // bool needRefresh = | ||
| 1267 | + // await NavigatorUtil.goCouponEditPage(context); | ||
| 1268 | + // print(needRefresh); | ||
| 1269 | + // if (needRefresh != null && needRefresh) { | ||
| 1270 | + // _couponNetworkData(); | ||
| 1271 | + // //刷新页面数据 | ||
| 1272 | + // // _controller.callRefresh(); | ||
| 1273 | + // // _couponNetworkData(tabController.index); | ||
| 1274 | + // } | ||
| 1275 | + // } | ||
| 1276 | + // // NavigatorUtil.goMarketingRecordsDetailPage(context); | ||
| 1277 | + // // bool needRefresh = await NavigatorUtil.goCouponEditPage(context); | ||
| 1278 | + // // print(needRefresh); | ||
| 1279 | + // // if (needRefresh != null && needRefresh) { | ||
| 1280 | + // // //刷新页面数据 | ||
| 1281 | + // // // _controller.callRefresh(); | ||
| 1282 | + // // _couponNetworkData(); | ||
| 1283 | + // // } | ||
| 1284 | + // }, | ||
| 1285 | + // child: Text('创建新优惠', | ||
| 1286 | + // style: TextStyle( | ||
| 1287 | + // decoration: TextDecoration.underline, | ||
| 1288 | + // color: MyColours.color_199095, | ||
| 1289 | + // fontSize: ScreenUtil().setSp(26)))), | ||
| 1290 | + ]) | ||
| 1291 | + ], | ||
| 1292 | + )); | ||
| 1293 | + } | ||
| 1294 | + | ||
| 1027 | ///选中的桌子widget | 1295 | ///选中的桌子widget |
| 1028 | Widget _selectTableWidget() { | 1296 | Widget _selectTableWidget() { |
| 1029 | return Container( | 1297 | return Container( |
| @@ -1045,6 +1313,7 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1045,6 +1313,7 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1045 | child: Column( | 1313 | child: Column( |
| 1046 | // mainAxisSize: MainAxisSize.min, | 1314 | // mainAxisSize: MainAxisSize.min, |
| 1047 | mainAxisAlignment: MainAxisAlignment.start, | 1315 | mainAxisAlignment: MainAxisAlignment.start, |
| 1316 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 1048 | children: [ | 1317 | children: [ |
| 1049 | Stack(alignment: Alignment.centerRight, children: [ | 1318 | Stack(alignment: Alignment.centerRight, children: [ |
| 1050 | Container( | 1319 | Container( |
| @@ -1083,7 +1352,33 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1083,7 +1352,33 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1083 | Positioned( | 1352 | Positioned( |
| 1084 | right: ScreenUtil().setWidth(40), | 1353 | right: ScreenUtil().setWidth(40), |
| 1085 | child: InkWell( | 1354 | child: InkWell( |
| 1086 | - onTap: () {}, | 1355 | + onTap: () { |
| 1356 | + nameStr = ''; | ||
| 1357 | + _baseIndoProvider.nameController.text = ''; | ||
| 1358 | + _baseIndoProvider.phoneController.text = ''; | ||
| 1359 | + sexSelectIndex = 0; | ||
| 1360 | + sexStr = '先生'; | ||
| 1361 | + actualPnum = '选填'; | ||
| 1362 | + ddateHm = '选填'; | ||
| 1363 | + actualPnumIndex = null; | ||
| 1364 | + ddateIndex = null; | ||
| 1365 | + youhui = '选择优惠'; | ||
| 1366 | + couponSelectIndex = 0; | ||
| 1367 | + tableManagerModel.selectTables = []; | ||
| 1368 | + if (showErro != '短信余额不足,请充值短信条数') { | ||
| 1369 | + showErro = ''; | ||
| 1370 | + } | ||
| 1371 | + for (t.Table item in tableManagerModel.tablesShow) { | ||
| 1372 | + item.selected = false; | ||
| 1373 | + } | ||
| 1374 | + tableManagerModel.areaTableMapShow.forEach((key, value) { | ||
| 1375 | + value.forEach((element) { | ||
| 1376 | + element.selected = false; | ||
| 1377 | + }); | ||
| 1378 | + }); | ||
| 1379 | + | ||
| 1380 | + tableManagerModel.notifyListeners(); | ||
| 1381 | + }, | ||
| 1087 | child: Text( | 1382 | child: Text( |
| 1088 | '清空', | 1383 | '清空', |
| 1089 | style: TextStyle( | 1384 | style: TextStyle( |
| @@ -1105,10 +1400,11 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1105,10 +1400,11 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1105 | return Container( | 1400 | return Container( |
| 1106 | margin: EdgeInsets.only(right: ScreenUtil().setWidth(20)), | 1401 | margin: EdgeInsets.only(right: ScreenUtil().setWidth(20)), |
| 1107 | padding: EdgeInsets.only( | 1402 | padding: EdgeInsets.only( |
| 1108 | - left: ScreenUtil().setWidth(16), | ||
| 1109 | - right: ScreenUtil().setWidth(4), | ||
| 1110 | - top: ScreenUtil().setWidth(14), | ||
| 1111 | - bottom: ScreenUtil().setWidth(14)), | 1403 | + left: ScreenUtil().setWidth(16), |
| 1404 | + // right: ScreenUtil().setWidth(4), | ||
| 1405 | + // top: ScreenUtil().setWidth(14), | ||
| 1406 | + // bottom: ScreenUtil().setWidth(14) | ||
| 1407 | + ), | ||
| 1112 | decoration: BoxDecoration( | 1408 | decoration: BoxDecoration( |
| 1113 | border: Border.all( | 1409 | border: Border.all( |
| 1114 | width: ScreenUtil().setWidth(2), | 1410 | width: ScreenUtil().setWidth(2), |
| @@ -1124,335 +1420,807 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1124,335 +1420,807 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1124 | fontSize: ScreenUtil().setSp(28)), | 1420 | fontSize: ScreenUtil().setSp(28)), |
| 1125 | ), | 1421 | ), |
| 1126 | HEmptyView(14), | 1422 | HEmptyView(14), |
| 1127 | - Image.asset(Utils.getImgPath('table_m_close'), | ||
| 1128 | - width: ScreenUtil().setWidth(32)), | 1423 | + InkWell( |
| 1424 | + onTap: () { | ||
| 1425 | + //删除已经选择的桌位 | ||
| 1426 | + tableManagerModel.selectTables | ||
| 1427 | + .removeWhere((t) => t.id == table.id); | ||
| 1428 | + | ||
| 1429 | + for (t.Table item | ||
| 1430 | + in tableManagerModel.tablesShow) { | ||
| 1431 | + if (item.id == table.id) { | ||
| 1432 | + item.selected = false; | ||
| 1433 | + } | ||
| 1434 | + } | ||
| 1435 | + for (t.Table item | ||
| 1436 | + in tableManagerModel.areaTableMapShow[ | ||
| 1437 | + tableManagerModel | ||
| 1438 | + .areas[tableManagerModel.selectNumber] | ||
| 1439 | + .name]) { | ||
| 1440 | + if (item.id == table.id) { | ||
| 1441 | + item.selected = false; | ||
| 1442 | + } | ||
| 1443 | + } | ||
| 1444 | + setState(() {}); | ||
| 1445 | + }, | ||
| 1446 | + child: Container( | ||
| 1447 | + // color: Colors.red, | ||
| 1448 | + padding: EdgeInsets.only( | ||
| 1449 | + top: ScreenUtil().setWidth(14), | ||
| 1450 | + bottom: ScreenUtil().setWidth(14), | ||
| 1451 | + left: ScreenUtil().setWidth(14), | ||
| 1452 | + right: ScreenUtil().setWidth(4)), | ||
| 1453 | + child: Image.asset( | ||
| 1454 | + Utils.getImgPath('table_m_close'), | ||
| 1455 | + width: ScreenUtil().setWidth(32)))), | ||
| 1129 | ], | 1456 | ], |
| 1130 | ), | 1457 | ), |
| 1131 | ); | 1458 | ); |
| 1132 | }), | 1459 | }), |
| 1133 | ), | 1460 | ), |
| 1134 | - _customerInfoWidget(), | ||
| 1135 | - VEmptyView(40), | ||
| 1136 | - Row( | ||
| 1137 | - crossAxisAlignment: CrossAxisAlignment.start, | ||
| 1138 | - children: [ | ||
| 1139 | - // HEmptyView(15), | ||
| 1140 | - Padding( | ||
| 1141 | - // width: ScreenUtil().setWidth(120), | ||
| 1142 | - padding: EdgeInsets.only(top: ScreenUtil().setWidth(10)), | ||
| 1143 | - child: Text( | ||
| 1144 | - '已选桌位:', | ||
| 1145 | - style: TextStyle( | ||
| 1146 | - color: MyColours.color_333333, | ||
| 1147 | - fontSize: ScreenUtil().setSp(26)), | 1461 | + !wechatNotification |
| 1462 | + ? Column(children: [ | ||
| 1463 | + _customerInfoWidget(), | ||
| 1464 | + VEmptyView(44), | ||
| 1465 | + _couponWidget(), | ||
| 1466 | + ]) | ||
| 1467 | + : SizedBox(), | ||
| 1468 | + VEmptyView(50), | ||
| 1469 | + wechatNotification | ||
| 1470 | + ? Padding( | ||
| 1471 | + padding: EdgeInsets.symmetric( | ||
| 1472 | + horizontal: ScreenUtil().setWidth(36)), | ||
| 1473 | + child: Row( | ||
| 1474 | + children: [ | ||
| 1475 | + RoundButton( | ||
| 1476 | + text: '仅占座', | ||
| 1477 | + width: ScreenUtil().setWidth(64 * 2), | ||
| 1478 | + height: ScreenUtil().setWidth(96), | ||
| 1479 | + fontSize: 24, | ||
| 1480 | + textColor: MyColours.color_515151, | ||
| 1481 | + gradientStart: MyColours.color_f3f3f3, | ||
| 1482 | + gradientEnd: MyColours.color_f3f3f3, | ||
| 1483 | + radius: ScreenUtil().setWidth(8), | ||
| 1484 | + isBold: false, | ||
| 1485 | + onPressed: () async { | ||
| 1486 | + SunReserveInfoModel _model = | ||
| 1487 | + await tableManagerModel.setReserveInfo(context, | ||
| 1488 | + needKeep: true, guest: widget.guest); | ||
| 1489 | + if (_model != null && | ||
| 1490 | + ObjectUtil.isNotEmpty(_model.row) && | ||
| 1491 | + ObjectUtil.isNotEmpty(_model.row.id)) { | ||
| 1492 | + print('成功'); | ||
| 1493 | + tableManagerModel.selectTables = []; | ||
| 1494 | + // _homeEnterModel.clearData(); | ||
| 1495 | + bus.emit("refresh_tablemanager"); //刷新当前页面 | ||
| 1496 | + bus.emit("refresh_book_list"); //刷新已预订列表 | ||
| 1497 | + //进入订座详情页面 | ||
| 1498 | + // NavigatorUtil.goNotebookDetailPage( | ||
| 1499 | + // context, | ||
| 1500 | + // _model.row.id, | ||
| 1501 | + // Provider.of<UserModel>(context, listen: false) | ||
| 1502 | + // .user | ||
| 1503 | + // .openid, | ||
| 1504 | + // ); | ||
| 1505 | + // String ddate_solt = ''; | ||
| 1506 | + // if (_model.row.isSetDdate == '1') { | ||
| 1507 | + // String createtime = | ||
| 1508 | + // _model.row.ddate.toString() + '000'; | ||
| 1509 | + // DateTime createTime = | ||
| 1510 | + // DateTime.fromMillisecondsSinceEpoch( | ||
| 1511 | + // int.parse(createtime)); | ||
| 1512 | + // ddate_solt = DateUtil.formatDate(createTime, | ||
| 1513 | + // format: DateFormats.h_m); | ||
| 1514 | + // } else { | ||
| 1515 | + // if (_model.row.ddateSolt == '1') { | ||
| 1516 | + // ddate_solt = '早餐'; | ||
| 1517 | + // } else if (_model.row.ddateSolt == '2') { | ||
| 1518 | + // ddate_solt = '午餐'; | ||
| 1519 | + // } else if (_model.row.ddateSolt == '3') { | ||
| 1520 | + // ddate_solt = '晚餐'; | ||
| 1521 | + // } | ||
| 1522 | + // } | ||
| 1523 | + // List<dynamic> tableinfo = | ||
| 1524 | + // convert.jsonDecode(_model.row.tableinfo); | ||
| 1525 | + // print(tableinfo); | ||
| 1526 | + | ||
| 1527 | + // String _nameStr = | ||
| 1528 | + // t.TableList.fromJson(tableinfo[0]).name; | ||
| 1529 | + // if (tableinfo.length > 1) { | ||
| 1530 | + // _nameStr = t.TableList.fromJson(tableinfo[0]).name + | ||
| 1531 | + // '等${tableinfo.length}桌'; | ||
| 1532 | + // } | ||
| 1533 | + // LogUtil.v(_nameStr); | ||
| 1534 | + // String _tid = ''; | ||
| 1535 | + // for (int i = 0; i < tableinfo.length; i++) { | ||
| 1536 | + // _tid += '${t.TableList.fromJson(tableinfo[i]).id},'; | ||
| 1537 | + // } | ||
| 1538 | + // if (_tid.endsWith(',')) { | ||
| 1539 | + // _tid = _tid.substring(0, _tid.length - 1); | ||
| 1540 | + // } | ||
| 1541 | + // NavigatorUtil.goInvicationPage( | ||
| 1542 | + // context, | ||
| 1543 | + // _model.row.id, | ||
| 1544 | + // _nameStr, | ||
| 1545 | + // _model.row.ddate, | ||
| 1546 | + // ddate_solt, | ||
| 1547 | + // _model.row.phone, | ||
| 1548 | + // _model.row.ddateSolt, | ||
| 1549 | + // tid: _tid, | ||
| 1550 | + // replace: false); | ||
| 1551 | + // //今天 明天 其他天 | ||
| 1552 | + // String tempTime = _homeEnterModel.ddateStr; | ||
| 1553 | + // if (_homeEnterModel.ddateStr == '') { | ||
| 1554 | + // if (currTimeIndex == 1) { | ||
| 1555 | + // tempTime = '08:00'; | ||
| 1556 | + // } else if (currTimeIndex == 2) { | ||
| 1557 | + // tempTime = '12:00'; | ||
| 1558 | + // } else if (currTimeIndex == 3) { | ||
| 1559 | + // tempTime = '18:00'; | ||
| 1560 | + // } | ||
| 1561 | + // } | ||
| 1562 | + // print(_model.row.tableinfo); | ||
| 1563 | + // _clearData(); | ||
| 1564 | + // String timeStr = dateText + ' ' + tempTime + ':00'; | ||
| 1565 | + | ||
| 1566 | + // LogUtil.v(timeStr); | ||
| 1567 | + // int ddate = DateUtil.getDateMsByTimeStr(timeStr); | ||
| 1568 | + | ||
| 1569 | + // _homeEnterModel.getNewTableList(context, '${ddate}', | ||
| 1570 | + // currTimeIndex.toString(), pnum); | ||
| 1571 | + | ||
| 1572 | + // EventBus().emit("refresh_tablemanager"); //刷新桌位 | ||
| 1573 | + } else { | ||
| 1574 | + Utils.showToast("预订失败!"); | ||
| 1575 | + } | ||
| 1576 | + }), | ||
| 1577 | + HEmptyView(22), | ||
| 1578 | + RoundButton( | ||
| 1579 | + text: '短信通知', | ||
| 1580 | + width: ScreenUtil().setWidth(64 * 2), | ||
| 1581 | + height: ScreenUtil().setWidth(96), | ||
| 1582 | + fontSize: 24, | ||
| 1583 | + textColor: MyColours.color_515151, | ||
| 1584 | + gradientStart: MyColours.color_f3f3f3, | ||
| 1585 | + gradientEnd: MyColours.color_f3f3f3, | ||
| 1586 | + radius: ScreenUtil().setWidth(8), | ||
| 1587 | + isBold: false, | ||
| 1588 | + onPressed: () { | ||
| 1589 | + setState(() { | ||
| 1590 | + wechatNotification = false; | ||
| 1591 | + }); | ||
| 1592 | + }, | ||
| 1593 | + ), | ||
| 1594 | + HEmptyView(20), | ||
| 1595 | + Expanded( | ||
| 1596 | + child: RoundButton( | ||
| 1597 | + text: '微信通知', | ||
| 1598 | + height: ScreenUtil().setWidth(96), | ||
| 1599 | + fontSize: 32, | ||
| 1600 | + gradientStart: MyColours.color_438E93, | ||
| 1601 | + gradientEnd: MyColours.color_438E93, | ||
| 1602 | + radius: ScreenUtil().setWidth(8), | ||
| 1603 | + isBold: false, | ||
| 1604 | + onPressed: () async { | ||
| 1605 | + SunReserveInfoModel _model = | ||
| 1606 | + await tableManagerModel.setReserveInfo(context, | ||
| 1607 | + needKeep: true, guest: widget.guest); | ||
| 1608 | + if (_model != null && | ||
| 1609 | + ObjectUtil.isNotEmpty(_model.row) && | ||
| 1610 | + ObjectUtil.isNotEmpty(_model.row.id)) { | ||
| 1611 | + print('成功'); | ||
| 1612 | + tableManagerModel.selectTables = []; | ||
| 1613 | + // _homeEnterModel.clearData(); | ||
| 1614 | + bus.emit("refresh_tablemanager"); //刷新当前页面 | ||
| 1615 | + bus.emit("refresh_book_list"); //刷新已预订列表 | ||
| 1616 | + | ||
| 1617 | + if (youhui != '选择优惠') { | ||
| 1618 | + Map<String, String> params = { | ||
| 1619 | + "rid": _model.row.id, | ||
| 1620 | + "aid": | ||
| 1621 | + '${couponProvider.couponListSelect[couponSelectIndex].id}' | ||
| 1622 | + }; | ||
| 1623 | + bool isSuc = await couponProvider | ||
| 1624 | + .setActivityAsReserve(context, params); | ||
| 1625 | + if (isSuc) { | ||
| 1626 | + couponProvider.hasModify = true; | ||
| 1627 | + // bus.emit("refresh_book_list"); | ||
| 1628 | + bool isSuccess = | ||
| 1629 | + await Utils.goShareInvicationToWeChat( | ||
| 1630 | + context, | ||
| 1631 | + _model.row.id, | ||
| 1632 | + Provider.of<UserModel>(context, | ||
| 1633 | + listen: false) | ||
| 1634 | + .user | ||
| 1635 | + .openid); | ||
| 1636 | + print(isSuccess); | ||
| 1637 | + if (isSuccess) { | ||
| 1638 | + _addForward(_model.row.id); | ||
| 1639 | + } | ||
| 1640 | + } | ||
| 1641 | + } else { | ||
| 1642 | + bool isSuccess = | ||
| 1643 | + await Utils.goShareInvicationToWeChat( | ||
| 1644 | + context, | ||
| 1645 | + _model.row.id, | ||
| 1646 | + Provider.of<UserModel>(context, | ||
| 1647 | + listen: false) | ||
| 1648 | + .user | ||
| 1649 | + .openid); | ||
| 1650 | + if (isSuccess) { | ||
| 1651 | + _addForward(_model.row.id); | ||
| 1652 | + } | ||
| 1653 | + } | ||
| 1654 | + } else { | ||
| 1655 | + //失败 | ||
| 1656 | + Utils.showToast("预订失败!"); | ||
| 1657 | + } | ||
| 1658 | + }, | ||
| 1659 | + )), | ||
| 1660 | + ], | ||
| 1661 | + )) | ||
| 1662 | + : Padding( | ||
| 1663 | + padding: EdgeInsets.symmetric( | ||
| 1664 | + horizontal: ScreenUtil().setWidth(36)), | ||
| 1665 | + child: Row( | ||
| 1666 | + children: [ | ||
| 1667 | + Expanded( | ||
| 1668 | + child: RoundButton( | ||
| 1669 | + text: '短信通知', | ||
| 1670 | + height: ScreenUtil().setWidth(96), | ||
| 1671 | + fontSize: 32, | ||
| 1672 | + gradientStart: MyColours.color_438E93, | ||
| 1673 | + gradientEnd: MyColours.color_438E93, | ||
| 1674 | + radius: ScreenUtil().setWidth(8), | ||
| 1675 | + isBold: false, | ||
| 1676 | + onPressed: () async { | ||
| 1677 | + if (myModel.smsInfo.isEmpty) { | ||
| 1678 | + return; | ||
| 1679 | + } | ||
| 1680 | + if ((_baseIndoProvider.phoneController.text | ||
| 1681 | + .trim() | ||
| 1682 | + .isEmpty || | ||
| 1683 | + !Utils.phoneRegExp( | ||
| 1684 | + _baseIndoProvider.phoneController.text))) { | ||
| 1685 | + setState(() { | ||
| 1686 | + showErro = '请输入正确的11位手机号码'; | ||
| 1687 | + }); | ||
| 1688 | + return; | ||
| 1689 | + } else { | ||
| 1690 | + setState(() { | ||
| 1691 | + showErro = ''; | ||
| 1692 | + }); | ||
| 1693 | + } | ||
| 1694 | + | ||
| 1695 | + // if (!couponProvider.sendSMS) { | ||
| 1696 | + /* | ||
| 1697 | + String dateSoltStr = ''; | ||
| 1698 | + if (widget.dateSolt == '1') { | ||
| 1699 | + dateSoltStr = '早餐'; | ||
| 1700 | + } else if (widget.dateSolt == '2') { | ||
| 1701 | + dateSoltStr = '午餐'; | ||
| 1702 | + } else if (widget.dateSolt == '3') { | ||
| 1703 | + dateSoltStr = '晚餐'; | ||
| 1704 | + } | ||
| 1705 | + DateTime dateTimeTemp = | ||
| 1706 | + DateTime.fromMillisecondsSinceEpoch( | ||
| 1707 | + int.parse(widget.ddate) * 1000); | ||
| 1708 | + String dateTimeStrTemp = | ||
| 1709 | + "${Utils.addZeroNumber(dateTimeTemp.month)}月${Utils.addZeroNumber(dateTimeTemp.day)}日"; | ||
| 1710 | + Map<String, String> params = { | ||
| 1711 | + "id": widget.rid, | ||
| 1712 | + "uid": Provider.of<UserModel>(context, | ||
| 1713 | + listen: false) | ||
| 1714 | + .user | ||
| 1715 | + .openid, | ||
| 1716 | + "phone": widget.phone, | ||
| 1717 | + | ||
| 1718 | + // "Strtext": user.sellername + | ||
| 1719 | + // dateTimeStrTemp + | ||
| 1720 | + // dateSoltStr + | ||
| 1721 | + // ',' + | ||
| 1722 | + // '餐厅经理' + | ||
| 1723 | + // _baseIndoProvider.baseInfoSunModel.name + | ||
| 1724 | + // '已为您安排在' + | ||
| 1725 | + // widget.tableInfo.replaceAll("\n", "") | ||
| 1726 | + }; | ||
| 1727 | + if (ObjectUtil.isNotEmpty(_baseIndoProvider | ||
| 1728 | + .baseInfoSunModel) && | ||
| 1729 | + ObjectUtil.isNotEmpty(_baseIndoProvider | ||
| 1730 | + .baseInfoSunModel.name)) { | ||
| 1731 | + params['Strtext'] = user.sellername + | ||
| 1732 | + _baseIndoProvider | ||
| 1733 | + .baseInfoSunModel.name; | ||
| 1734 | + } else { | ||
| 1735 | + params['Strtext'] = user.sellername; | ||
| 1736 | + } | ||
| 1737 | + */ | ||
| 1738 | + SunReserveInfoModel _model = | ||
| 1739 | + await tableManagerModel.setReserveInfo(context, | ||
| 1740 | + needKeep: true, guest: widget.guest); | ||
| 1741 | + if (_model != null && | ||
| 1742 | + ObjectUtil.isNotEmpty(_model.row) && | ||
| 1743 | + ObjectUtil.isNotEmpty(_model.row.id)) { | ||
| 1744 | + print('成功'); | ||
| 1745 | + tableManagerModel.selectTables = []; | ||
| 1746 | + // _homeEnterModel.clearData(); | ||
| 1747 | + bus.emit("refresh_tablemanager"); //刷新当前页面 | ||
| 1748 | + bus.emit("refresh_book_list"); //刷新已预订列表 | ||
| 1749 | + UserModel userModel = | ||
| 1750 | + Provider.of<UserModel>(context, listen: false); | ||
| 1751 | + Map<String, String> params = { | ||
| 1752 | + "rid": _model.row.id, | ||
| 1753 | + "sid": userModel.user.sellerid | ||
| 1754 | + }; | ||
| 1755 | + bool success = await couponProvider | ||
| 1756 | + .sendSMSWxSendSms(context, params); | ||
| 1757 | + print(success); | ||
| 1758 | + // if (success) { | ||
| 1759 | + // Utils.showToast('短信已经发送成功!'); | ||
| 1760 | + // } else { | ||
| 1761 | + // Utils.showToast('发送次数太频繁!'); | ||
| 1762 | + // } | ||
| 1763 | + // } else { | ||
| 1764 | + // Utils.showToast('短信已经发送成功!'); | ||
| 1765 | + // } | ||
| 1766 | + // //进入订座详情页面 | ||
| 1767 | + // NavigatorUtil.goNotebookDetailPage( | ||
| 1768 | + // context, | ||
| 1769 | + // _model.row.id, | ||
| 1770 | + // Provider.of<UserModel>(context, listen: false) | ||
| 1771 | + // .user | ||
| 1772 | + // .openid, | ||
| 1773 | + // ); | ||
| 1774 | + // String ddate_solt = ''; | ||
| 1775 | + // if (_model.row.isSetDdate == '1') { | ||
| 1776 | + // String createtime = _model.row.ddate.toString() + '000'; | ||
| 1777 | + // DateTime createTime = | ||
| 1778 | + // DateTime.fromMillisecondsSinceEpoch( | ||
| 1779 | + // int.parse(createtime)); | ||
| 1780 | + // ddate_solt = DateUtil.formatDate(createTime, | ||
| 1781 | + // format: DateFormats.h_m); | ||
| 1782 | + // } else { | ||
| 1783 | + // if (_model.row.ddateSolt == '1') { | ||
| 1784 | + // ddate_solt = '早餐'; | ||
| 1785 | + // } else if (_model.row.ddateSolt == '2') { | ||
| 1786 | + // ddate_solt = '午餐'; | ||
| 1787 | + // } else if (_model.row.ddateSolt == '3') { | ||
| 1788 | + // ddate_solt = '晚餐'; | ||
| 1789 | + // } | ||
| 1790 | + // } | ||
| 1791 | + // List<dynamic> tableinfo = | ||
| 1792 | + // convert.jsonDecode(_model.row.tableinfo); | ||
| 1793 | + // print(tableinfo); | ||
| 1794 | + | ||
| 1795 | + // // String _nameStr = | ||
| 1796 | + // // table.TableList.fromJson(tableinfo[0]).name; | ||
| 1797 | + // // if (tableinfo.length > 1) { | ||
| 1798 | + // // _nameStr = table.TableList.fromJson(tableinfo[0]).name + | ||
| 1799 | + // // '等${tableinfo.length}桌'; | ||
| 1800 | + // // } | ||
| 1801 | + // // LogUtil.v(_nameStr); | ||
| 1802 | + // // String _tid = ''; | ||
| 1803 | + // // for (int i = 0; i < tableinfo.length; i++) { | ||
| 1804 | + // // _tid += '${table.TableList.fromJson(tableinfo[i]).id},'; | ||
| 1805 | + // // } | ||
| 1806 | + // // if (_tid.endsWith(',')) { | ||
| 1807 | + // // _tid = _tid.substring(0, _tid.length - 1); | ||
| 1808 | + // // } | ||
| 1809 | + // String _nameStr = ''; | ||
| 1810 | + // String _tid = ''; | ||
| 1811 | + // for (int i = 0; i < tableinfo.length; i++) { | ||
| 1812 | + // _nameStr += | ||
| 1813 | + // '${table.TableList.fromJson(tableinfo[i]).name},'; | ||
| 1814 | + | ||
| 1815 | + // _tid += '${table.TableList.fromJson(tableinfo[i]).id},'; | ||
| 1816 | + // } | ||
| 1817 | + // if (_tid.endsWith(',')) { | ||
| 1818 | + // _tid = _tid.substring(0, _tid.length - 1); | ||
| 1819 | + // } | ||
| 1820 | + // if (_nameStr.endsWith(',')) { | ||
| 1821 | + // _nameStr = _nameStr.substring(0, _nameStr.length - 1); | ||
| 1822 | + // } | ||
| 1823 | + // NavigatorUtil.goInvicationPage( | ||
| 1824 | + // context, | ||
| 1825 | + // _model.row.id, | ||
| 1826 | + // _nameStr, | ||
| 1827 | + // _model.row.ddate, | ||
| 1828 | + // ddate_solt, | ||
| 1829 | + // _model.row.phone, | ||
| 1830 | + // _model.row.ddateSolt, | ||
| 1831 | + // _model.row.rname == null ? '' : _model.row.rname, | ||
| 1832 | + // _model.row.sex == null ? '' : _model.row.sex, | ||
| 1833 | + // tid: _tid, | ||
| 1834 | + // replace: false); | ||
| 1835 | + // // //今天 明天 其他天 | ||
| 1836 | + // // String tempTime = _homeEnterModel.ddateStr; | ||
| 1837 | + // // if (_homeEnterModel.ddateStr == '') { | ||
| 1838 | + // // if (currTimeIndex == 1) { | ||
| 1839 | + // // tempTime = '08:00'; | ||
| 1840 | + // // } else if (currTimeIndex == 2) { | ||
| 1841 | + // // tempTime = '12:00'; | ||
| 1842 | + // // } else if (currTimeIndex == 3) { | ||
| 1843 | + // // tempTime = '18:00'; | ||
| 1844 | + // // } | ||
| 1845 | + // // } | ||
| 1846 | + // // print(_model.row.tableinfo); | ||
| 1847 | + // // _clearData(); | ||
| 1848 | + // // String timeStr = dateText + ' ' + tempTime + ':00'; | ||
| 1849 | + | ||
| 1850 | + // // LogUtil.v(timeStr); | ||
| 1851 | + // // int ddate = DateUtil.getDateMsByTimeStr(timeStr); | ||
| 1852 | + | ||
| 1853 | + // // _homeEnterModel.getNewTableList(context, '${ddate}', | ||
| 1854 | + // // currTimeIndex.toString(), pnum); | ||
| 1855 | + | ||
| 1856 | + // // EventBus().emit("refresh_tablemanager"); //刷新桌位 | ||
| 1857 | + } else { | ||
| 1858 | + Utils.showToast("预订失败!"); | ||
| 1859 | + } | ||
| 1860 | + }, | ||
| 1861 | + )), | ||
| 1862 | + HEmptyView(36), | ||
| 1863 | + RoundButton( | ||
| 1864 | + text: '返回微信通知', | ||
| 1865 | + width: ScreenUtil().setWidth(182), | ||
| 1866 | + height: ScreenUtil().setWidth(96), | ||
| 1867 | + fontSize: 24, | ||
| 1868 | + textColor: MyColours.color_515151, | ||
| 1869 | + gradientStart: MyColours.color_f3f3f3, | ||
| 1870 | + gradientEnd: MyColours.color_f3f3f3, | ||
| 1871 | + radius: ScreenUtil().setWidth(8), | ||
| 1872 | + isBold: false, | ||
| 1873 | + onPressed: () { | ||
| 1874 | + setState(() { | ||
| 1875 | + wechatNotification = true; | ||
| 1876 | + }); | ||
| 1877 | + }, | ||
| 1878 | + ) | ||
| 1879 | + ], | ||
| 1148 | )), | 1880 | )), |
| 1149 | - HEmptyView(15), | ||
| 1150 | - // Expanded( | ||
| 1151 | - // child: | ||
| 1152 | - // width: ScreenUtil().screenWidth - | ||
| 1153 | - // ScreenUtil().setWidth(160), | ||
| 1154 | - // constraints: | ||
| 1155 | - // BoxConstraints(maxHeight: ScreenUtil().setWidth(140)), | ||
| 1156 | - // color: Colors.blueAccent, | ||
| 1157 | - | ||
| 1158 | - // ListView.builder( | ||
| 1159 | - // shrinkWrap: true, | ||
| 1160 | - // itemBuilder: (BuildContext context, int index) { | ||
| 1161 | - // return | ||
| 1162 | - // Scrollbar( | ||
| 1163 | - // isAlwaysShown: true, //设置滚动条常亮 | ||
| 1164 | - // controller: _scrollCrl, //必须设置一个controller | ||
| 1165 | - | ||
| 1166 | - // ///添加进度条 | ||
| 1167 | - // child: | ||
| 1168 | - // SingleChildScrollView( | ||
| 1169 | - // controller: _scrollCrl, | ||
| 1170 | - // child: | ||
| 1171 | - Container( | ||
| 1172 | - // color: Colors.red, | ||
| 1173 | - width: ScreenUtil().screenWidth - | ||
| 1174 | - ScreenUtil().setWidth(100 + 130), | ||
| 1175 | - child: Wrap( | ||
| 1176 | - spacing: ScreenUtil().setWidth(20), | ||
| 1177 | - runSpacing: ScreenUtil().setWidth(20), | ||
| 1178 | - children: _buildAlwayItems())), | ||
| 1179 | - // ) | ||
| 1180 | - // ) | ||
| 1181 | - // }, | ||
| 1182 | - // itemCount: 1, | ||
| 1183 | - // ), | ||
| 1184 | - // ) | ||
| 1185 | - ], | ||
| 1186 | - ), | ||
| 1187 | - VEmptyView(40), | ||
| 1188 | - Container( | ||
| 1189 | - // width: ScreenUtil().setWidth(100), | ||
| 1190 | - // color: Colors.red, | ||
| 1191 | - // constraints: BoxConstraints( | ||
| 1192 | - // minHeight: ScreenUtil().setWidth(500), | ||
| 1193 | - // ), | ||
| 1194 | - child: Row( | ||
| 1195 | - mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
| 1196 | - children: [ | ||
| 1197 | - InkWell( | ||
| 1198 | - onTap: () { | ||
| 1199 | - tableManagerModel.selectTables = []; | ||
| 1200 | - for (t.Table item in tableManagerModel.tablesShow) { | ||
| 1201 | - item.selected = false; | ||
| 1202 | - } | ||
| 1203 | - tableManagerModel.areaTableMapShow.forEach((key, value) { | ||
| 1204 | - value.forEach((element) { | ||
| 1205 | - element.selected = false; | ||
| 1206 | - }); | ||
| 1207 | - }); | ||
| 1208 | 1881 | ||
| 1209 | - tableManagerModel.notifyListeners(); | ||
| 1210 | - }, | ||
| 1211 | - child: Container( | ||
| 1212 | - padding: EdgeInsets.all( | ||
| 1213 | - ScreenUtil().setWidth(30), | ||
| 1214 | - ), | ||
| 1215 | - child: Text( | ||
| 1216 | - '取消重置', | ||
| 1217 | - style: TextStyle( | ||
| 1218 | - color: MyColours.color_199095, | ||
| 1219 | - fontSize: ScreenUtil().setSp(26)), | ||
| 1220 | - ), | 1882 | + // Row( |
| 1883 | + // crossAxisAlignment: CrossAxisAlignment.start, | ||
| 1884 | + // children: [ | ||
| 1885 | + // // HEmptyView(15), | ||
| 1886 | + // Padding( | ||
| 1887 | + // // width: ScreenUtil().setWidth(120), | ||
| 1888 | + // padding: EdgeInsets.only(top: ScreenUtil().setWidth(10)), | ||
| 1889 | + // child: Text( | ||
| 1890 | + // '已选桌位:', | ||
| 1891 | + // style: TextStyle( | ||
| 1892 | + // color: MyColours.color_333333, | ||
| 1893 | + // fontSize: ScreenUtil().setSp(26)), | ||
| 1894 | + // )), | ||
| 1895 | + // HEmptyView(15), | ||
| 1896 | + // // Expanded( | ||
| 1897 | + // // child: | ||
| 1898 | + // // width: ScreenUtil().screenWidth - | ||
| 1899 | + // // ScreenUtil().setWidth(160), | ||
| 1900 | + // // constraints: | ||
| 1901 | + // // BoxConstraints(maxHeight: ScreenUtil().setWidth(140)), | ||
| 1902 | + // // color: Colors.blueAccent, | ||
| 1903 | + | ||
| 1904 | + // // ListView.builder( | ||
| 1905 | + // // shrinkWrap: true, | ||
| 1906 | + // // itemBuilder: (BuildContext context, int index) { | ||
| 1907 | + // // return | ||
| 1908 | + // // Scrollbar( | ||
| 1909 | + // // isAlwaysShown: true, //设置滚动条常亮 | ||
| 1910 | + // // controller: _scrollCrl, //必须设置一个controller | ||
| 1911 | + | ||
| 1912 | + // // ///添加进度条 | ||
| 1913 | + // // child: | ||
| 1914 | + // // SingleChildScrollView( | ||
| 1915 | + // // controller: _scrollCrl, | ||
| 1916 | + // // child: | ||
| 1917 | + // Container( | ||
| 1918 | + // // color: Colors.red, | ||
| 1919 | + // width: ScreenUtil().screenWidth - | ||
| 1920 | + // ScreenUtil().setWidth(100 + 130), | ||
| 1921 | + // child: Wrap( | ||
| 1922 | + // spacing: ScreenUtil().setWidth(20), | ||
| 1923 | + // runSpacing: ScreenUtil().setWidth(20), | ||
| 1924 | + // children: _buildAlwayItems())), | ||
| 1925 | + // // ) | ||
| 1926 | + // // ) | ||
| 1927 | + // // }, | ||
| 1928 | + // // itemCount: 1, | ||
| 1929 | + // // ), | ||
| 1930 | + // // ) | ||
| 1931 | + // ], | ||
| 1932 | + // ), | ||
| 1933 | + // VEmptyView(40), | ||
| 1934 | + // Container( | ||
| 1935 | + // // width: ScreenUtil().setWidth(100), | ||
| 1936 | + // // color: Colors.red, | ||
| 1937 | + // // constraints: BoxConstraints( | ||
| 1938 | + // // minHeight: ScreenUtil().setWidth(500), | ||
| 1939 | + // // ), | ||
| 1940 | + // child: Row( | ||
| 1941 | + // mainAxisAlignment: MainAxisAlignment.spaceEvenly, | ||
| 1942 | + // children: [ | ||
| 1943 | + // InkWell( | ||
| 1944 | + // onTap: () { | ||
| 1945 | + // tableManagerModel.selectTables = []; | ||
| 1946 | + // for (t.Table item in tableManagerModel.tablesShow) { | ||
| 1947 | + // item.selected = false; | ||
| 1948 | + // } | ||
| 1949 | + // tableManagerModel.areaTableMapShow.forEach((key, value) { | ||
| 1950 | + // value.forEach((element) { | ||
| 1951 | + // element.selected = false; | ||
| 1952 | + // }); | ||
| 1953 | + // }); | ||
| 1954 | + | ||
| 1955 | + // tableManagerModel.notifyListeners(); | ||
| 1956 | + // }, | ||
| 1957 | + // child: Container( | ||
| 1958 | + // padding: EdgeInsets.all( | ||
| 1959 | + // ScreenUtil().setWidth(30), | ||
| 1960 | + // ), | ||
| 1961 | + // child: Text( | ||
| 1962 | + // '取消重置', | ||
| 1963 | + // style: TextStyle( | ||
| 1964 | + // color: MyColours.color_199095, | ||
| 1965 | + // fontSize: ScreenUtil().setSp(26)), | ||
| 1966 | + // ), | ||
| 1967 | + // ), | ||
| 1968 | + // ), | ||
| 1969 | + // RoundButton( | ||
| 1970 | + // onPressed: () async { | ||
| 1971 | + // SunReserveInfoModel _model = | ||
| 1972 | + // await tableManagerModel.setReserveInfo(context, | ||
| 1973 | + // needKeep: true, guest: widget.guest); | ||
| 1974 | + // if (_model != null && | ||
| 1975 | + // ObjectUtil.isNotEmpty(_model.row) && | ||
| 1976 | + // ObjectUtil.isNotEmpty(_model.row.id)) { | ||
| 1977 | + // print('成功'); | ||
| 1978 | + // tableManagerModel.selectTables = []; | ||
| 1979 | + // // _homeEnterModel.clearData(); | ||
| 1980 | + // bus.emit("refresh_tablemanager"); //刷新当前页面 | ||
| 1981 | + // bus.emit("refresh_book_list"); //刷新已预订列表 | ||
| 1982 | + // //进入订座详情页面 | ||
| 1983 | + // // NavigatorUtil.goNotebookDetailPage( | ||
| 1984 | + // // context, | ||
| 1985 | + // // _model.row.id, | ||
| 1986 | + // // Provider.of<UserModel>(context, listen: false) | ||
| 1987 | + // // .user | ||
| 1988 | + // // .openid, | ||
| 1989 | + // // ); | ||
| 1990 | + // // String ddate_solt = ''; | ||
| 1991 | + // // if (_model.row.isSetDdate == '1') { | ||
| 1992 | + // // String createtime = | ||
| 1993 | + // // _model.row.ddate.toString() + '000'; | ||
| 1994 | + // // DateTime createTime = | ||
| 1995 | + // // DateTime.fromMillisecondsSinceEpoch( | ||
| 1996 | + // // int.parse(createtime)); | ||
| 1997 | + // // ddate_solt = DateUtil.formatDate(createTime, | ||
| 1998 | + // // format: DateFormats.h_m); | ||
| 1999 | + // // } else { | ||
| 2000 | + // // if (_model.row.ddateSolt == '1') { | ||
| 2001 | + // // ddate_solt = '早餐'; | ||
| 2002 | + // // } else if (_model.row.ddateSolt == '2') { | ||
| 2003 | + // // ddate_solt = '午餐'; | ||
| 2004 | + // // } else if (_model.row.ddateSolt == '3') { | ||
| 2005 | + // // ddate_solt = '晚餐'; | ||
| 2006 | + // // } | ||
| 2007 | + // // } | ||
| 2008 | + // // List<dynamic> tableinfo = | ||
| 2009 | + // // convert.jsonDecode(_model.row.tableinfo); | ||
| 2010 | + // // print(tableinfo); | ||
| 2011 | + | ||
| 2012 | + // // String _nameStr = | ||
| 2013 | + // // t.TableList.fromJson(tableinfo[0]).name; | ||
| 2014 | + // // if (tableinfo.length > 1) { | ||
| 2015 | + // // _nameStr = t.TableList.fromJson(tableinfo[0]).name + | ||
| 2016 | + // // '等${tableinfo.length}桌'; | ||
| 2017 | + // // } | ||
| 2018 | + // // LogUtil.v(_nameStr); | ||
| 2019 | + // // String _tid = ''; | ||
| 2020 | + // // for (int i = 0; i < tableinfo.length; i++) { | ||
| 2021 | + // // _tid += '${t.TableList.fromJson(tableinfo[i]).id},'; | ||
| 2022 | + // // } | ||
| 2023 | + // // if (_tid.endsWith(',')) { | ||
| 2024 | + // // _tid = _tid.substring(0, _tid.length - 1); | ||
| 2025 | + // // } | ||
| 2026 | + // // NavigatorUtil.goInvicationPage( | ||
| 2027 | + // // context, | ||
| 2028 | + // // _model.row.id, | ||
| 2029 | + // // _nameStr, | ||
| 2030 | + // // _model.row.ddate, | ||
| 2031 | + // // ddate_solt, | ||
| 2032 | + // // _model.row.phone, | ||
| 2033 | + // // _model.row.ddateSolt, | ||
| 2034 | + // // tid: _tid, | ||
| 2035 | + // // replace: false); | ||
| 2036 | + // // //今天 明天 其他天 | ||
| 2037 | + // // String tempTime = _homeEnterModel.ddateStr; | ||
| 2038 | + // // if (_homeEnterModel.ddateStr == '') { | ||
| 2039 | + // // if (currTimeIndex == 1) { | ||
| 2040 | + // // tempTime = '08:00'; | ||
| 2041 | + // // } else if (currTimeIndex == 2) { | ||
| 2042 | + // // tempTime = '12:00'; | ||
| 2043 | + // // } else if (currTimeIndex == 3) { | ||
| 2044 | + // // tempTime = '18:00'; | ||
| 2045 | + // // } | ||
| 2046 | + // // } | ||
| 2047 | + // // print(_model.row.tableinfo); | ||
| 2048 | + // // _clearData(); | ||
| 2049 | + // // String timeStr = dateText + ' ' + tempTime + ':00'; | ||
| 2050 | + | ||
| 2051 | + // // LogUtil.v(timeStr); | ||
| 2052 | + // // int ddate = DateUtil.getDateMsByTimeStr(timeStr); | ||
| 2053 | + | ||
| 2054 | + // // _homeEnterModel.getNewTableList(context, '${ddate}', | ||
| 2055 | + // // currTimeIndex.toString(), pnum); | ||
| 2056 | + | ||
| 2057 | + // // EventBus().emit("refresh_tablemanager"); //刷新桌位 | ||
| 2058 | + // } else { | ||
| 2059 | + // Utils.showToast("预订失败!"); | ||
| 2060 | + // } | ||
| 2061 | + // }, | ||
| 2062 | + // text: '仅预订', | ||
| 2063 | + // fontSize: 32, | ||
| 2064 | + // isBold: false, | ||
| 2065 | + // width: ScreenUtil().setWidth(180), | ||
| 2066 | + // height: ScreenUtil().setWidth(90), | ||
| 2067 | + // padding: EdgeInsets.symmetric( | ||
| 2068 | + // horizontal: ScreenUtil().setWidth(20), | ||
| 2069 | + // vertical: ScreenUtil().setWidth(4)), | ||
| 2070 | + // textColor: MyColours.color_199095, | ||
| 2071 | + // gradientStart: MyColours.color_ffffff, | ||
| 2072 | + // gradientEnd: MyColours.color_ffffff, | ||
| 2073 | + // radius: ScreenUtil().setWidth(10), | ||
| 2074 | + // borderColor: MyColours.color_199095, | ||
| 2075 | + // ), | ||
| 2076 | + // RoundButton( | ||
| 2077 | + // onPressed: () async { | ||
| 2078 | + // SunReserveInfoModel _model = | ||
| 2079 | + // await tableManagerModel.setReserveInfo(context, | ||
| 2080 | + // needKeep: true, guest: widget.guest); | ||
| 2081 | + // if (_model != null && | ||
| 2082 | + // ObjectUtil.isNotEmpty(_model.row) && | ||
| 2083 | + // ObjectUtil.isNotEmpty(_model.row.id)) { | ||
| 2084 | + // print('成功'); | ||
| 2085 | + // tableManagerModel.selectTables = []; | ||
| 2086 | + // // _homeEnterModel.clearData(); | ||
| 2087 | + // bus.emit("refresh_tablemanager"); //刷新当前页面 | ||
| 2088 | + // bus.emit("refresh_book_list"); //刷新已预订列表 | ||
| 2089 | + // // //进入订座详情页面 | ||
| 2090 | + // // NavigatorUtil.goNotebookDetailPage( | ||
| 2091 | + // // context, | ||
| 2092 | + // // _model.row.id, | ||
| 2093 | + // // Provider.of<UserModel>(context, listen: false) | ||
| 2094 | + // // .user | ||
| 2095 | + // // .openid, | ||
| 2096 | + // // ); | ||
| 2097 | + // String ddate_solt = ''; | ||
| 2098 | + // if (_model.row.isSetDdate == '1') { | ||
| 2099 | + // String createtime = _model.row.ddate.toString() + '000'; | ||
| 2100 | + // DateTime createTime = | ||
| 2101 | + // DateTime.fromMillisecondsSinceEpoch( | ||
| 2102 | + // int.parse(createtime)); | ||
| 2103 | + // ddate_solt = DateUtil.formatDate(createTime, | ||
| 2104 | + // format: DateFormats.h_m); | ||
| 2105 | + // } else { | ||
| 2106 | + // if (_model.row.ddateSolt == '1') { | ||
| 2107 | + // ddate_solt = '早餐'; | ||
| 2108 | + // } else if (_model.row.ddateSolt == '2') { | ||
| 2109 | + // ddate_solt = '午餐'; | ||
| 2110 | + // } else if (_model.row.ddateSolt == '3') { | ||
| 2111 | + // ddate_solt = '晚餐'; | ||
| 2112 | + // } | ||
| 2113 | + // } | ||
| 2114 | + // List<dynamic> tableinfo = | ||
| 2115 | + // convert.jsonDecode(_model.row.tableinfo); | ||
| 2116 | + // print(tableinfo); | ||
| 2117 | + | ||
| 2118 | + // // String _nameStr = | ||
| 2119 | + // // table.TableList.fromJson(tableinfo[0]).name; | ||
| 2120 | + // // if (tableinfo.length > 1) { | ||
| 2121 | + // // _nameStr = table.TableList.fromJson(tableinfo[0]).name + | ||
| 2122 | + // // '等${tableinfo.length}桌'; | ||
| 2123 | + // // } | ||
| 2124 | + // // LogUtil.v(_nameStr); | ||
| 2125 | + // // String _tid = ''; | ||
| 2126 | + // // for (int i = 0; i < tableinfo.length; i++) { | ||
| 2127 | + // // _tid += '${table.TableList.fromJson(tableinfo[i]).id},'; | ||
| 2128 | + // // } | ||
| 2129 | + // // if (_tid.endsWith(',')) { | ||
| 2130 | + // // _tid = _tid.substring(0, _tid.length - 1); | ||
| 2131 | + // // } | ||
| 2132 | + // String _nameStr = ''; | ||
| 2133 | + // String _tid = ''; | ||
| 2134 | + // for (int i = 0; i < tableinfo.length; i++) { | ||
| 2135 | + // _nameStr += | ||
| 2136 | + // '${table.TableList.fromJson(tableinfo[i]).name},'; | ||
| 2137 | + | ||
| 2138 | + // _tid += '${table.TableList.fromJson(tableinfo[i]).id},'; | ||
| 2139 | + // } | ||
| 2140 | + // if (_tid.endsWith(',')) { | ||
| 2141 | + // _tid = _tid.substring(0, _tid.length - 1); | ||
| 2142 | + // } | ||
| 2143 | + // if (_nameStr.endsWith(',')) { | ||
| 2144 | + // _nameStr = _nameStr.substring(0, _nameStr.length - 1); | ||
| 2145 | + // } | ||
| 2146 | + // NavigatorUtil.goInvicationPage( | ||
| 2147 | + // context, | ||
| 2148 | + // _model.row.id, | ||
| 2149 | + // _nameStr, | ||
| 2150 | + // _model.row.ddate, | ||
| 2151 | + // ddate_solt, | ||
| 2152 | + // _model.row.phone, | ||
| 2153 | + // _model.row.ddateSolt, | ||
| 2154 | + // _model.row.rname == null ? '' : _model.row.rname, | ||
| 2155 | + // _model.row.sex == null ? '' : _model.row.sex, | ||
| 2156 | + // tid: _tid, | ||
| 2157 | + // replace: false); | ||
| 2158 | + // // //今天 明天 其他天 | ||
| 2159 | + // // String tempTime = _homeEnterModel.ddateStr; | ||
| 2160 | + // // if (_homeEnterModel.ddateStr == '') { | ||
| 2161 | + // // if (currTimeIndex == 1) { | ||
| 2162 | + // // tempTime = '08:00'; | ||
| 2163 | + // // } else if (currTimeIndex == 2) { | ||
| 2164 | + // // tempTime = '12:00'; | ||
| 2165 | + // // } else if (currTimeIndex == 3) { | ||
| 2166 | + // // tempTime = '18:00'; | ||
| 2167 | + // // } | ||
| 2168 | + // // } | ||
| 2169 | + // // print(_model.row.tableinfo); | ||
| 2170 | + // // _clearData(); | ||
| 2171 | + // // String timeStr = dateText + ' ' + tempTime + ':00'; | ||
| 2172 | + | ||
| 2173 | + // // LogUtil.v(timeStr); | ||
| 2174 | + // // int ddate = DateUtil.getDateMsByTimeStr(timeStr); | ||
| 2175 | + | ||
| 2176 | + // // _homeEnterModel.getNewTableList(context, '${ddate}', | ||
| 2177 | + // // currTimeIndex.toString(), pnum); | ||
| 2178 | + | ||
| 2179 | + // // EventBus().emit("refresh_tablemanager"); //刷新桌位 | ||
| 2180 | + // } else { | ||
| 2181 | + // Utils.showToast("预订失败!"); | ||
| 2182 | + // } | ||
| 2183 | + // }, | ||
| 2184 | + // text: '预订并通知', | ||
| 2185 | + // fontSize: 32, | ||
| 2186 | + // isBold: false, | ||
| 2187 | + // width: ScreenUtil().setWidth(220), | ||
| 2188 | + // height: ScreenUtil().setWidth(90), | ||
| 2189 | + // padding: EdgeInsets.symmetric( | ||
| 2190 | + // horizontal: ScreenUtil().setWidth(20), | ||
| 2191 | + // vertical: ScreenUtil().setWidth(4)), | ||
| 2192 | + // textColor: MyColours.color_ffffff, | ||
| 2193 | + // gradientStart: MyColours.color_199095, | ||
| 2194 | + // gradientEnd: MyColours.color_199095, | ||
| 2195 | + // radius: ScreenUtil().setWidth(10), | ||
| 2196 | + // borderColor: MyColours.color_199095, | ||
| 2197 | + // ), | ||
| 2198 | + // ], | ||
| 2199 | + // ), | ||
| 2200 | + // ), | ||
| 2201 | + wechatNotification || showErro == '' | ||
| 2202 | + ? VEmptyView(62) | ||
| 2203 | + : Container( | ||
| 2204 | + padding: EdgeInsets.only( | ||
| 2205 | + left: ScreenUtil().setWidth(36), | ||
| 2206 | + top: ScreenUtil().setWidth(12), | ||
| 2207 | + right: ScreenUtil().setWidth(36), | ||
| 2208 | + bottom: ScreenUtil().setWidth(18), | ||
| 1221 | ), | 2209 | ), |
| 1222 | - ), | ||
| 1223 | - RoundButton( | ||
| 1224 | - onPressed: () async { | ||
| 1225 | - SunReserveInfoModel _model = | ||
| 1226 | - await tableManagerModel.setReserveInfo(context, | ||
| 1227 | - needKeep: true, guest: widget.guest); | ||
| 1228 | - if (_model != null && | ||
| 1229 | - ObjectUtil.isNotEmpty(_model.row) && | ||
| 1230 | - ObjectUtil.isNotEmpty(_model.row.id)) { | ||
| 1231 | - print('成功'); | ||
| 1232 | - tableManagerModel.selectTables = []; | ||
| 1233 | - // _homeEnterModel.clearData(); | ||
| 1234 | - bus.emit("refresh_tablemanager"); //刷新当前页面 | ||
| 1235 | - bus.emit("refresh_book_list"); //刷新已预订列表 | ||
| 1236 | - //进入订座详情页面 | ||
| 1237 | - // NavigatorUtil.goNotebookDetailPage( | ||
| 1238 | - // context, | ||
| 1239 | - // _model.row.id, | ||
| 1240 | - // Provider.of<UserModel>(context, listen: false) | ||
| 1241 | - // .user | ||
| 1242 | - // .openid, | ||
| 1243 | - // ); | ||
| 1244 | - // String ddate_solt = ''; | ||
| 1245 | - // if (_model.row.isSetDdate == '1') { | ||
| 1246 | - // String createtime = | ||
| 1247 | - // _model.row.ddate.toString() + '000'; | ||
| 1248 | - // DateTime createTime = | ||
| 1249 | - // DateTime.fromMillisecondsSinceEpoch( | ||
| 1250 | - // int.parse(createtime)); | ||
| 1251 | - // ddate_solt = DateUtil.formatDate(createTime, | ||
| 1252 | - // format: DateFormats.h_m); | ||
| 1253 | - // } else { | ||
| 1254 | - // if (_model.row.ddateSolt == '1') { | ||
| 1255 | - // ddate_solt = '早餐'; | ||
| 1256 | - // } else if (_model.row.ddateSolt == '2') { | ||
| 1257 | - // ddate_solt = '午餐'; | ||
| 1258 | - // } else if (_model.row.ddateSolt == '3') { | ||
| 1259 | - // ddate_solt = '晚餐'; | ||
| 1260 | - // } | ||
| 1261 | - // } | ||
| 1262 | - // List<dynamic> tableinfo = | ||
| 1263 | - // convert.jsonDecode(_model.row.tableinfo); | ||
| 1264 | - // print(tableinfo); | ||
| 1265 | - | ||
| 1266 | - // String _nameStr = | ||
| 1267 | - // t.TableList.fromJson(tableinfo[0]).name; | ||
| 1268 | - // if (tableinfo.length > 1) { | ||
| 1269 | - // _nameStr = t.TableList.fromJson(tableinfo[0]).name + | ||
| 1270 | - // '等${tableinfo.length}桌'; | ||
| 1271 | - // } | ||
| 1272 | - // LogUtil.v(_nameStr); | ||
| 1273 | - // String _tid = ''; | ||
| 1274 | - // for (int i = 0; i < tableinfo.length; i++) { | ||
| 1275 | - // _tid += '${t.TableList.fromJson(tableinfo[i]).id},'; | ||
| 1276 | - // } | ||
| 1277 | - // if (_tid.endsWith(',')) { | ||
| 1278 | - // _tid = _tid.substring(0, _tid.length - 1); | ||
| 1279 | - // } | ||
| 1280 | - // NavigatorUtil.goInvicationPage( | ||
| 1281 | - // context, | ||
| 1282 | - // _model.row.id, | ||
| 1283 | - // _nameStr, | ||
| 1284 | - // _model.row.ddate, | ||
| 1285 | - // ddate_solt, | ||
| 1286 | - // _model.row.phone, | ||
| 1287 | - // _model.row.ddateSolt, | ||
| 1288 | - // tid: _tid, | ||
| 1289 | - // replace: false); | ||
| 1290 | - // //今天 明天 其他天 | ||
| 1291 | - // String tempTime = _homeEnterModel.ddateStr; | ||
| 1292 | - // if (_homeEnterModel.ddateStr == '') { | ||
| 1293 | - // if (currTimeIndex == 1) { | ||
| 1294 | - // tempTime = '08:00'; | ||
| 1295 | - // } else if (currTimeIndex == 2) { | ||
| 1296 | - // tempTime = '12:00'; | ||
| 1297 | - // } else if (currTimeIndex == 3) { | ||
| 1298 | - // tempTime = '18:00'; | ||
| 1299 | - // } | ||
| 1300 | - // } | ||
| 1301 | - // print(_model.row.tableinfo); | ||
| 1302 | - // _clearData(); | ||
| 1303 | - // String timeStr = dateText + ' ' + tempTime + ':00'; | ||
| 1304 | - | ||
| 1305 | - // LogUtil.v(timeStr); | ||
| 1306 | - // int ddate = DateUtil.getDateMsByTimeStr(timeStr); | ||
| 1307 | - | ||
| 1308 | - // _homeEnterModel.getNewTableList(context, '${ddate}', | ||
| 1309 | - // currTimeIndex.toString(), pnum); | ||
| 1310 | - | ||
| 1311 | - // EventBus().emit("refresh_tablemanager"); //刷新桌位 | ||
| 1312 | - } else { | ||
| 1313 | - Utils.showToast("预订失败!"); | ||
| 1314 | - } | ||
| 1315 | - }, | ||
| 1316 | - text: '仅预订', | ||
| 1317 | - fontSize: 32, | ||
| 1318 | - isBold: false, | ||
| 1319 | - width: ScreenUtil().setWidth(180), | ||
| 1320 | - height: ScreenUtil().setWidth(90), | ||
| 1321 | - padding: EdgeInsets.symmetric( | ||
| 1322 | - horizontal: ScreenUtil().setWidth(20), | ||
| 1323 | - vertical: ScreenUtil().setWidth(4)), | ||
| 1324 | - textColor: MyColours.color_199095, | ||
| 1325 | - gradientStart: MyColours.color_ffffff, | ||
| 1326 | - gradientEnd: MyColours.color_ffffff, | ||
| 1327 | - radius: ScreenUtil().setWidth(10), | ||
| 1328 | - borderColor: MyColours.color_199095, | ||
| 1329 | - ), | ||
| 1330 | - RoundButton( | ||
| 1331 | - onPressed: () async { | ||
| 1332 | - SunReserveInfoModel _model = | ||
| 1333 | - await tableManagerModel.setReserveInfo(context, | ||
| 1334 | - needKeep: true, guest: widget.guest); | ||
| 1335 | - if (_model != null && | ||
| 1336 | - ObjectUtil.isNotEmpty(_model.row) && | ||
| 1337 | - ObjectUtil.isNotEmpty(_model.row.id)) { | ||
| 1338 | - print('成功'); | ||
| 1339 | - tableManagerModel.selectTables = []; | ||
| 1340 | - // _homeEnterModel.clearData(); | ||
| 1341 | - bus.emit("refresh_tablemanager"); //刷新当前页面 | ||
| 1342 | - bus.emit("refresh_book_list"); //刷新已预订列表 | ||
| 1343 | - // //进入订座详情页面 | ||
| 1344 | - // NavigatorUtil.goNotebookDetailPage( | ||
| 1345 | - // context, | ||
| 1346 | - // _model.row.id, | ||
| 1347 | - // Provider.of<UserModel>(context, listen: false) | ||
| 1348 | - // .user | ||
| 1349 | - // .openid, | ||
| 1350 | - // ); | ||
| 1351 | - String ddate_solt = ''; | ||
| 1352 | - if (_model.row.isSetDdate == '1') { | ||
| 1353 | - String createtime = _model.row.ddate.toString() + '000'; | ||
| 1354 | - DateTime createTime = | ||
| 1355 | - DateTime.fromMillisecondsSinceEpoch( | ||
| 1356 | - int.parse(createtime)); | ||
| 1357 | - ddate_solt = DateUtil.formatDate(createTime, | ||
| 1358 | - format: DateFormats.h_m); | ||
| 1359 | - } else { | ||
| 1360 | - if (_model.row.ddateSolt == '1') { | ||
| 1361 | - ddate_solt = '早餐'; | ||
| 1362 | - } else if (_model.row.ddateSolt == '2') { | ||
| 1363 | - ddate_solt = '午餐'; | ||
| 1364 | - } else if (_model.row.ddateSolt == '3') { | ||
| 1365 | - ddate_solt = '晚餐'; | ||
| 1366 | - } | ||
| 1367 | - } | ||
| 1368 | - List<dynamic> tableinfo = | ||
| 1369 | - convert.jsonDecode(_model.row.tableinfo); | ||
| 1370 | - print(tableinfo); | ||
| 1371 | - | ||
| 1372 | - // String _nameStr = | ||
| 1373 | - // table.TableList.fromJson(tableinfo[0]).name; | ||
| 1374 | - // if (tableinfo.length > 1) { | ||
| 1375 | - // _nameStr = table.TableList.fromJson(tableinfo[0]).name + | ||
| 1376 | - // '等${tableinfo.length}桌'; | ||
| 1377 | - // } | ||
| 1378 | - // LogUtil.v(_nameStr); | ||
| 1379 | - // String _tid = ''; | ||
| 1380 | - // for (int i = 0; i < tableinfo.length; i++) { | ||
| 1381 | - // _tid += '${table.TableList.fromJson(tableinfo[i]).id},'; | ||
| 1382 | - // } | ||
| 1383 | - // if (_tid.endsWith(',')) { | ||
| 1384 | - // _tid = _tid.substring(0, _tid.length - 1); | ||
| 1385 | - // } | ||
| 1386 | - String _nameStr = ''; | ||
| 1387 | - String _tid = ''; | ||
| 1388 | - for (int i = 0; i < tableinfo.length; i++) { | ||
| 1389 | - _nameStr += | ||
| 1390 | - '${table.TableList.fromJson(tableinfo[i]).name},'; | ||
| 1391 | - | ||
| 1392 | - _tid += '${table.TableList.fromJson(tableinfo[i]).id},'; | ||
| 1393 | - } | ||
| 1394 | - if (_tid.endsWith(',')) { | ||
| 1395 | - _tid = _tid.substring(0, _tid.length - 1); | ||
| 1396 | - } | ||
| 1397 | - if (_nameStr.endsWith(',')) { | ||
| 1398 | - _nameStr = _nameStr.substring(0, _nameStr.length - 1); | ||
| 1399 | - } | ||
| 1400 | - NavigatorUtil.goInvicationPage( | ||
| 1401 | - context, | ||
| 1402 | - _model.row.id, | ||
| 1403 | - _nameStr, | ||
| 1404 | - _model.row.ddate, | ||
| 1405 | - ddate_solt, | ||
| 1406 | - _model.row.phone, | ||
| 1407 | - _model.row.ddateSolt, | ||
| 1408 | - _model.row.rname == null ? '' : _model.row.rname, | ||
| 1409 | - _model.row.sex == null ? '' : _model.row.sex, | ||
| 1410 | - tid: _tid, | ||
| 1411 | - replace: false); | ||
| 1412 | - // //今天 明天 其他天 | ||
| 1413 | - // String tempTime = _homeEnterModel.ddateStr; | ||
| 1414 | - // if (_homeEnterModel.ddateStr == '') { | ||
| 1415 | - // if (currTimeIndex == 1) { | ||
| 1416 | - // tempTime = '08:00'; | ||
| 1417 | - // } else if (currTimeIndex == 2) { | ||
| 1418 | - // tempTime = '12:00'; | ||
| 1419 | - // } else if (currTimeIndex == 3) { | ||
| 1420 | - // tempTime = '18:00'; | ||
| 1421 | - // } | ||
| 1422 | - // } | ||
| 1423 | - // print(_model.row.tableinfo); | ||
| 1424 | - // _clearData(); | ||
| 1425 | - // String timeStr = dateText + ' ' + tempTime + ':00'; | ||
| 1426 | - | ||
| 1427 | - // LogUtil.v(timeStr); | ||
| 1428 | - // int ddate = DateUtil.getDateMsByTimeStr(timeStr); | ||
| 1429 | - | ||
| 1430 | - // _homeEnterModel.getNewTableList(context, '${ddate}', | ||
| 1431 | - // currTimeIndex.toString(), pnum); | ||
| 1432 | - | ||
| 1433 | - // EventBus().emit("refresh_tablemanager"); //刷新桌位 | ||
| 1434 | - } else { | ||
| 1435 | - Utils.showToast("预订失败!"); | ||
| 1436 | - } | ||
| 1437 | - }, | ||
| 1438 | - text: '预订并通知', | ||
| 1439 | - fontSize: 32, | ||
| 1440 | - isBold: false, | ||
| 1441 | - width: ScreenUtil().setWidth(220), | ||
| 1442 | - height: ScreenUtil().setWidth(90), | ||
| 1443 | - padding: EdgeInsets.symmetric( | ||
| 1444 | - horizontal: ScreenUtil().setWidth(20), | ||
| 1445 | - vertical: ScreenUtil().setWidth(4)), | ||
| 1446 | - textColor: MyColours.color_ffffff, | ||
| 1447 | - gradientStart: MyColours.color_199095, | ||
| 1448 | - gradientEnd: MyColours.color_199095, | ||
| 1449 | - radius: ScreenUtil().setWidth(10), | ||
| 1450 | - borderColor: MyColours.color_199095, | ||
| 1451 | - ), | ||
| 1452 | - ], | ||
| 1453 | - ), | ||
| 1454 | - ), | ||
| 1455 | - VEmptyView(40), | 2210 | + child: Row( |
| 2211 | + children: [ | ||
| 2212 | + Image.asset(Utils.getImgPath('error_circle_red'), | ||
| 2213 | + width: ScreenUtil().setWidth(44)), | ||
| 2214 | + HEmptyView(16), | ||
| 2215 | + Text( | ||
| 2216 | + showErro, | ||
| 2217 | + style: TextStyle( | ||
| 2218 | + color: MyColours.color_E34D59, | ||
| 2219 | + fontSize: ScreenUtil().setSp(28)), | ||
| 2220 | + ) | ||
| 2221 | + ], | ||
| 2222 | + ), | ||
| 2223 | + ) | ||
| 1456 | ], | 2224 | ], |
| 1457 | ), | 2225 | ), |
| 1458 | ); | 2226 | ); |
| @@ -1560,6 +2328,8 @@ class TableManagerPageState extends State<TableManagerPage> { | @@ -1560,6 +2328,8 @@ class TableManagerPageState extends State<TableManagerPage> { | ||
| 1560 | Widget build(BuildContext context) { | 2328 | Widget build(BuildContext context) { |
| 1561 | tableManagerModel = Provider.of<TableManagerModel>(context, listen: true); | 2329 | tableManagerModel = Provider.of<TableManagerModel>(context, listen: true); |
| 1562 | _baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true); | 2330 | _baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true); |
| 2331 | + couponProvider = Provider.of<CouponProvider>(context, listen: true); | ||
| 2332 | + myModel = Provider.of<MyModel>(context, listen: true); | ||
| 1563 | return Scaffold( | 2333 | return Scaffold( |
| 1564 | appBar: widget.guest == null | 2334 | appBar: widget.guest == null |
| 1565 | ? null | 2335 | ? null |
| 1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
| 2 | 2 | ||
| 3 | class MyColours { | 3 | class MyColours { |
| 4 | - | ||
| 5 | - static const Color color_8EBBBE = Color(0xff8EBBBE); | 4 | + static const Color color_2193B0 = Color(0xff2193B0); |
| 5 | + static const Color color_238389 = Color(0xff238389); | ||
| 6 | + static const Color color_5CA0AD = Color(0xff5CA0AD); | ||
| 7 | + static const Color color_8EBBBE = Color(0xff8EBBBE); | ||
| 6 | static const Color color_A78E44 = Color(0xffA78E44); | 8 | static const Color color_A78E44 = Color(0xffA78E44); |
| 7 | static const Color color_260101 = Color(0xff260101); | 9 | static const Color color_260101 = Color(0xff260101); |
| 8 | static const Color color_ED7B2F = Color(0xffED7B2F); | 10 | static const Color color_ED7B2F = Color(0xffED7B2F); |
| @@ -1245,12 +1245,14 @@ var tableManagerPageHandle = new Handler( | @@ -1245,12 +1245,14 @@ var tableManagerPageHandle = new Handler( | ||
| 1245 | // UserHistoryEntity userHistoryEntity = UserHistoryEntity.fromJson(json.decode( | 1245 | // UserHistoryEntity userHistoryEntity = UserHistoryEntity.fromJson(json.decode( |
| 1246 | // FluroConvertUtils.fluroCnParamsDecode( | 1246 | // FluroConvertUtils.fluroCnParamsDecode( |
| 1247 | // params["userHistoryEntity"].first))); | 1247 | // params["userHistoryEntity"].first))); |
| 1248 | - return ChangeNotifierProvider<BaseIndoProvider>( | ||
| 1249 | - create: (_) => BaseIndoProvider(), | ||
| 1250 | - child: ChangeNotifierProvider<TableManagerModel>( | ||
| 1251 | - create: (_) => TableManagerModel(), | ||
| 1252 | - child: TableManagerPage(guest: guest)), | ||
| 1253 | - ); | 1248 | + return ChangeNotifierProvider<MyModel>( |
| 1249 | + create: (_) => MyModel(), | ||
| 1250 | + child: ChangeNotifierProvider<BaseIndoProvider>( | ||
| 1251 | + create: (_) => BaseIndoProvider(), | ||
| 1252 | + child: ChangeNotifierProvider<TableManagerModel>( | ||
| 1253 | + create: (_) => TableManagerModel(), | ||
| 1254 | + child: TableManagerPage(guest: guest)), | ||
| 1255 | + )); | ||
| 1254 | }); | 1256 | }); |
| 1255 | 1257 | ||
| 1256 | ///账号登录页面 | 1258 | ///账号登录页面 |
lib/widgets/gradient_button.dart
0 → 100644
| 1 | +import 'package:amap_map_fluttify/amap_map_fluttify.dart'; | ||
| 2 | +import 'package:flutter/material.dart'; | ||
| 3 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 4 | + | ||
| 5 | +class GradientButton extends StatelessWidget { | ||
| 6 | + final List<Color> colors; | ||
| 7 | + final double height; | ||
| 8 | + final bool left; | ||
| 9 | + final double radius; | ||
| 10 | + | ||
| 11 | + const GradientButton( | ||
| 12 | + {Key key, this.colors, this.height, this.left = true, this.radius = 0}) | ||
| 13 | + : super(key: key); | ||
| 14 | + | ||
| 15 | + @override | ||
| 16 | + Widget build(BuildContext context) { | ||
| 17 | + return // 渐变色按钮 | ||
| 18 | + Container( | ||
| 19 | + height: height, | ||
| 20 | + decoration: BoxDecoration( | ||
| 21 | + gradient: LinearGradient(colors: colors), // 渐变色 | ||
| 22 | + borderRadius: left | ||
| 23 | + ? BorderRadius.only( | ||
| 24 | + topLeft: Radius.circular(ScreenUtil().setWidth(radius)), | ||
| 25 | + bottomLeft: Radius.circular(ScreenUtil().setWidth(radius))) | ||
| 26 | + : BorderRadius.only( | ||
| 27 | + topRight: Radius.circular(ScreenUtil().setWidth(radius)), | ||
| 28 | + bottomRight: Radius.circular(ScreenUtil().setWidth(radius)))), | ||
| 29 | + ); | ||
| 30 | + } | ||
| 31 | +} |
-
Please register or login to post a comment