Commit 7e2263c26a5d744188c22a8430143f4d7cea0389

Authored by wdn127929
1 parent 2c64680a

人数输入

@@ -2226,38 +2226,38 @@ Future<bool> getAllCuisine(BuildContext context) async { @@ -2226,38 +2226,38 @@ Future<bool> getAllCuisine(BuildContext context) async {
2226 VEmptyView(34), 2226 VEmptyView(34),
2227 ], 2227 ],
2228 )), 2228 )),
2229 - VEmptyView(34),  
2230 - InkWell(  
2231 - onTap: () {  
2232 - NavigatorUtil.goBookTimeSettingListPage(  
2233 - context);  
2234 - },  
2235 - child: Padding(  
2236 - padding: EdgeInsets.symmetric(  
2237 - horizontal: ScreenUtil().setWidth(24)),  
2238 - child: Container(  
2239 - height: ScreenUtil().setWidth(40),  
2240 - child: Row(  
2241 - crossAxisAlignment:  
2242 - CrossAxisAlignment.center,  
2243 - mainAxisAlignment:  
2244 - MainAxisAlignment.spaceBetween,  
2245 - children: [  
2246 - Text('指定日期多时段预订设置',  
2247 - style: TextStyle(  
2248 - color: MyColours.color_999999,  
2249 - fontSize:  
2250 - ScreenUtil().setSp(28),  
2251 - )),  
2252 - Spacer(),  
2253 - Image.asset(  
2254 - Utils.getImgPath('arrow_right_new'),  
2255 - width: ScreenUtil().setWidth(16),  
2256 - height: ScreenUtil().setWidth(28),  
2257 - )  
2258 - ],  
2259 - ),  
2260 - ))), 2229 + // VEmptyView(34),
  2230 + // InkWell(
  2231 + // onTap: () {
  2232 + // NavigatorUtil.goBookTimeSettingListPage(
  2233 + // context);
  2234 + // },
  2235 + // child: Padding(
  2236 + // padding: EdgeInsets.symmetric(
  2237 + // horizontal: ScreenUtil().setWidth(24)),
  2238 + // child: Container(
  2239 + // height: ScreenUtil().setWidth(40),
  2240 + // child: Row(
  2241 + // crossAxisAlignment:
  2242 + // CrossAxisAlignment.center,
  2243 + // mainAxisAlignment:
  2244 + // MainAxisAlignment.spaceBetween,
  2245 + // children: [
  2246 + // Text('指定日期多时段预订设置',
  2247 + // style: TextStyle(
  2248 + // color: MyColours.color_999999,
  2249 + // fontSize:
  2250 + // ScreenUtil().setSp(28),
  2251 + // )),
  2252 + // Spacer(),
  2253 + // Image.asset(
  2254 + // Utils.getImgPath('arrow_right_new'),
  2255 + // width: ScreenUtil().setWidth(16),
  2256 + // height: ScreenUtil().setWidth(28),
  2257 + // )
  2258 + // ],
  2259 + // ),
  2260 + // ))),
2261 VEmptyView(96), 2261 VEmptyView(96),
2262 Text('接单时间', 2262 Text('接单时间',
2263 style: TextStyle( 2263 style: TextStyle(
@@ -265,7 +265,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { @@ -265,7 +265,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> {
265 265
266 //添加桌位弹框 266 //添加桌位弹框
267 await DialogUtil.openMyTableManageCreateTableDialog( 267 await DialogUtil.openMyTableManageCreateTableDialog(
268 - context, tableTypeS, personNumList, 268 + context, tableTypeS,
269 onTap: (Map<String, String?> value) async { 269 onTap: (Map<String, String?> value) async {
270 print(value); 270 print(value);
271 // 'areaname': 271 // 'areaname':
@@ -439,7 +439,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { @@ -439,7 +439,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> {
439 }); 439 });
440 } 440 }
441 await DialogUtil.openMyTableManageModifyTableDialog( 441 await DialogUtil.openMyTableManageModifyTableDialog(
442 - context, tableTypeS, personNumList, 442 + context, tableTypeS,
443 name: table.name!, 443 name: table.name!,
444 tidStr: table.tidStr, 444 tidStr: table.tidStr,
445 pnumMin: table.table_pnum ?? '', 445 pnumMin: table.table_pnum ?? '',
@@ -4620,7 +4620,7 @@ class DialogUtil { @@ -4620,7 +4620,7 @@ class DialogUtil {
4620 } 4620 }
4621 4621
4622 static Future openMyTableManageCreateTableDialog( 4622 static Future openMyTableManageCreateTableDialog(
4623 - BuildContext context, List<String?> baojianList, List<String> pnum, 4623 + BuildContext context, List<String?> baojianList,
4624 {CustomCallBackMap? onTap}) async { 4624 {CustomCallBackMap? onTap}) async {
4625 TextEditingController controller = TextEditingController(); 4625 TextEditingController controller = TextEditingController();
4626 4626
@@ -4628,10 +4628,10 @@ class DialogUtil { @@ -4628,10 +4628,10 @@ class DialogUtil {
4628 _norNumController.text = '10'; 4628 _norNumController.text = '10';
4629 FocusNode _norNumFocusNode = FocusNode(); 4629 FocusNode _norNumFocusNode = FocusNode();
4630 bool showBaojian = true; 4630 bool showBaojian = true;
4631 - bool showPnumMin = true;  
4632 - bool showPnumMax = true;  
4633 - String pnumMin = '';  
4634 - String pnumMax = ''; 4631 + // bool showPnumMin = true;
  4632 + // bool showPnumMax = true;
  4633 + // String pnumMin = '';
  4634 + // String pnumMax = '';
4635 int currentBaojianIndex = 4635 int currentBaojianIndex =
4636 baojianList.indexWhere((element) => element == '包间') == -1 4636 baojianList.indexWhere((element) => element == '包间') == -1
4637 ? 0 4637 ? 0
@@ -4654,6 +4654,11 @@ class DialogUtil { @@ -4654,6 +4654,11 @@ class DialogUtil {
4654 // } 4654 // }
4655 // }); 4655 // });
4656 4656
  4657 + TextEditingController controllerMax = TextEditingController();
  4658 +
  4659 + // controllerMax.text = pnumMax;
  4660 + TextEditingController controllerMin = TextEditingController();
  4661 + // controllerMin.text = pnumMin;
4657 final action = await showDialog( 4662 final action = await showDialog(
4658 context: context, 4663 context: context,
4659 barrierDismissible: false, 4664 barrierDismissible: false,
@@ -4833,8 +4838,8 @@ class DialogUtil { @@ -4833,8 +4838,8 @@ class DialogUtil {
4833 InkWell( 4838 InkWell(
4834 onTap: () { 4839 onTap: () {
4835 state(() { 4840 state(() {
4836 - showPnumMax = true;  
4837 - showPnumMin = true; 4841 + // showPnumMax = true;
  4842 + // showPnumMin = true;
4838 showBaojian = !showBaojian; 4843 showBaojian = !showBaojian;
4839 }); 4844 });
4840 }, 4845 },
@@ -4898,18 +4903,84 @@ class DialogUtil { @@ -4898,18 +4903,84 @@ class DialogUtil {
4898 // Stack( 4903 // Stack(
4899 // overflow: Overflow.visible, 4904 // overflow: Overflow.visible,
4900 // children: [ 4905 // children: [
4901 - btnChooseTableManagePnum(  
4902 - pnumMin,  
4903 - 'min',  
4904 - ScreenUtil().setWidth(54 * 2),  
4905 - (value) {  
4906 - state(() {  
4907 - showBaojian = true;  
4908 - showPnumMax = true;  
4909 - showPnumMin = !showPnumMin;  
4910 - });  
4911 - }),  
4912 - HEmptyView(40), 4906 + Container(
  4907 + width: w(80),
  4908 + // margin: EdgeInsets.symmetric(
  4909 + // horizontal: ScreenUtil().setWidth(44)),
  4910 + height: w(30),
  4911 + alignment: Alignment.center,
  4912 + decoration: BoxDecoration(
  4913 + color: MyColours.color_f3f3f3,
  4914 + borderRadius:
  4915 + BorderRadius.circular(
  4916 + ScreenUtil()
  4917 + .setWidth(10))),
  4918 + child: TextField(
  4919 + controller: controllerMin,
  4920 + maxLines: 1,
  4921 + // //光标颜色
  4922 + // cursorColor:
  4923 + // widget.isSelect ? Colors.white : MyColours.color_199095,
  4924 + //输入文本的样式
  4925 + textAlign: TextAlign.center,
  4926 + style: TextStyle(
  4927 + fontSize:
  4928 + ScreenUtil().setSp(32),
  4929 + color:
  4930 + MyColours.color_515151),
  4931 + inputFormatters: [
  4932 + FilteringTextInputFormatter
  4933 + .digitsOnly
  4934 + ],
  4935 + decoration: InputDecoration(
  4936 + isCollapsed: true,
  4937 + contentPadding: EdgeInsets
  4938 + .zero, //设置文字内容与边框距离
  4939 + // enabledBorder: UnderlineInputBorder(
  4940 + // borderSide: BorderSide(
  4941 + // color: MyColours.color_efefef),
  4942 + // ),
  4943 + // focusedBorder: UnderlineInputBorder(
  4944 + // borderSide: BorderSide(
  4945 + // color: MyColours.color_efefef,
  4946 + // width: ScreenUtil().setWidth(2)),
  4947 + // ),
  4948 + // prefixText: '*',
  4949 + // prefixStyle: TextStyle(
  4950 + // fontSize: ScreenUtil().setSp(32),
  4951 + // color: MyColours.color_E95750),
  4952 + border: OutlineInputBorder(
  4953 + borderSide:
  4954 + BorderSide.none),
  4955 + hintText: '输入最小',
  4956 + hintStyle: TextStyle(
  4957 + color: MyColours.color_BFC4D4,
  4958 + fontSize:
  4959 + ScreenUtil().setSp(32),
  4960 + ),
  4961 + ),
  4962 + onChanged: (value) {
  4963 + state(() {});
  4964 + },
  4965 + onEditingComplete: () {
  4966 + FocusScope.of(context)
  4967 + .requestFocus(
  4968 + FocusNode()); //点击空白处隐藏键盘
  4969 + },
  4970 + keyboardType:
  4971 + TextInputType.number,
  4972 + ),
  4973 + ),
  4974 +
  4975 + // btnChooseTableManagePnum(pnumMin, 'min',
  4976 + // ScreenUtil().setWidth(54 * 2), (value) {
  4977 + // state(() {
  4978 + // showBaojian = true;
  4979 + // showPnumMax = true;
  4980 + // showPnumMin = !showPnumMin;
  4981 + // });
  4982 + // }),
  4983 + HEmptyView(20),
4913 Text( 4984 Text(
4914 '至', 4985 '至',
4915 style: TextStyle( 4986 style: TextStyle(
@@ -4917,18 +4988,75 @@ class DialogUtil { @@ -4917,18 +4988,75 @@ class DialogUtil {
4917 ScreenUtil().setSp(32), 4988 ScreenUtil().setSp(32),
4918 color: MyColours.color_000000), 4989 color: MyColours.color_000000),
4919 ), 4990 ),
4920 - HEmptyView(40),  
4921 - btnChooseTableManagePnum(  
4922 - pnumMax,  
4923 - 'max',  
4924 - ScreenUtil().setWidth(54 * 2),  
4925 - (value) {  
4926 - state(() {  
4927 - showBaojian = true;  
4928 - showPnumMin = true;  
4929 - showPnumMax = !showPnumMax;  
4930 - });  
4931 - }), 4991 + HEmptyView(20),
  4992 +
  4993 + Container(
  4994 + width: w(80),
  4995 + height: w(30),
  4996 + alignment: Alignment.center,
  4997 + decoration: BoxDecoration(
  4998 + color: MyColours.color_f3f3f3,
  4999 + borderRadius:
  5000 + BorderRadius.circular(
  5001 + ScreenUtil()
  5002 + .setWidth(10))),
  5003 + child: TextField(
  5004 + controller: controllerMax,
  5005 + maxLines: 1,
  5006 + // //光标颜色
  5007 + // cursorColor:
  5008 + // widget.isSelect ? Colors.white : MyColours.color_199095,
  5009 + //输入文本的样式
  5010 + textAlign: TextAlign.center,
  5011 + style: TextStyle(
  5012 + fontSize:
  5013 + ScreenUtil().setSp(32),
  5014 + color:
  5015 + MyColours.color_515151),
  5016 + inputFormatters: [
  5017 + FilteringTextInputFormatter
  5018 + .digitsOnly
  5019 + ],
  5020 + decoration: InputDecoration(
  5021 + isCollapsed: true,
  5022 + contentPadding: EdgeInsets
  5023 + .zero, //设置文字内容与边框距离
  5024 +
  5025 + // enabledBorder: UnderlineInputBorder(
  5026 + // borderSide: BorderSide(
  5027 + // color: MyColours.color_efefef),
  5028 + // ),
  5029 + // focusedBorder: UnderlineInputBorder(
  5030 + // borderSide: BorderSide(
  5031 + // color: MyColours.color_efefef,
  5032 + // width: ScreenUtil().setWidth(2)),
  5033 + // ),
  5034 + // prefixText: '*',
  5035 + // prefixStyle: TextStyle(
  5036 + // fontSize: ScreenUtil().setSp(32),
  5037 + // color: MyColours.color_E95750),
  5038 + border: OutlineInputBorder(
  5039 + borderSide:
  5040 + BorderSide.none),
  5041 + hintText: '输入最大',
  5042 + hintStyle: TextStyle(
  5043 + color: MyColours.color_BFC4D4,
  5044 + fontSize:
  5045 + ScreenUtil().setSp(32),
  5046 + ),
  5047 + ),
  5048 + onChanged: (value) {
  5049 + state(() {});
  5050 + },
  5051 + onEditingComplete: () {
  5052 + FocusScope.of(context)
  5053 + .requestFocus(
  5054 + FocusNode()); //点击空白处隐藏键盘
  5055 + },
  5056 + keyboardType:
  5057 + TextInputType.number,
  5058 + ),
  5059 + ),
4932 HEmptyView(32), 5060 HEmptyView(32),
4933 ], 5061 ],
4934 ), 5062 ),
@@ -5012,13 +5140,61 @@ class DialogUtil { @@ -5012,13 +5140,61 @@ class DialogUtil {
5012 // pnumMin 5140 // pnumMin
5013 //最高人数 5141 //最高人数
5014 // pnumMax 5142 // pnumMax
  5143 + if (!mulCreate) {
  5144 + if (controllerMax.text
  5145 + .trim()
  5146 + .length ==
  5147 + 0 ||
  5148 + controllerMin.text
  5149 + .trim()
  5150 + .length ==
  5151 + 0) {
  5152 + Utils.showToast('请输入人数!');
  5153 + return;
  5154 + }
  5155 + if (controllerMax.text
  5156 + .trim()
  5157 + .length >
  5158 + 0 &&
  5159 + controllerMin.text
  5160 + .trim()
  5161 + .length >
  5162 + 0) {
  5163 + if (int.parse(controllerMin.text
  5164 + .trim()) >
  5165 + int.parse(controllerMax.text
  5166 + .trim())) {
  5167 + Utils.showToast(
  5168 + '最大人数不能小于最小人数!');
  5169 + return;
  5170 + }
  5171 + if (int.parse(controllerMin.text
  5172 + .trim()) ==
  5173 + 0) {
  5174 + Utils.showToast('最小人数不能为0!');
  5175 + return;
  5176 + }
  5177 + if (int.parse(controllerMax.text
  5178 + .trim()) ==
  5179 + 0) {
  5180 + Utils.showToast('最大人数不能为0!');
  5181 + return;
  5182 + }
  5183 + if (int.parse(controllerMax.text
  5184 + .trim()) >
  5185 + 999) {
  5186 + Utils.showToast('最大人数不能超过999!');
  5187 + return;
  5188 + }
  5189 + }
  5190 + }
5015 5191
5016 onTap!({ 5192 onTap!({
5017 'bjtype': baojianList[ 5193 'bjtype': baojianList[
5018 currentBaojianIndex], 5194 currentBaojianIndex],
5019 'name': controller.text, 5195 'name': controller.text,
5020 - 'pnumMin': pnumMin,  
5021 - 'pnumMax': pnumMax, 5196 + 'pnumMin': controllerMin.text,
  5197 + 'pnumMax': controllerMax.text,
5022 'mulcreate': mulCreate.toString(), 5198 'mulcreate': mulCreate.toString(),
5023 'tablenum': _norNumController.text 5199 'tablenum': _norNumController.text
5024 }); 5200 });
@@ -5044,30 +5220,30 @@ class DialogUtil { @@ -5044,30 +5220,30 @@ class DialogUtil {
5044 }); 5220 });
5045 }), 5221 }),
5046 )), 5222 )),
5047 - Positioned(  
5048 - left: ScreenUtil().setWidth(190 * 2),  
5049 - top: ScreenUtil().setWidth(242 * 2),  
5050 - child: Offstage(  
5051 - offstage: showPnumMin,  
5052 - child: selectWidgetTableManage(pnum, (index) {  
5053 - state(() {  
5054 - showPnumMin = !showPnumMin;  
5055 - pnumMin = pnum[index as int];  
5056 - });  
5057 - }),  
5058 - )),  
5059 - Positioned(  
5060 - right: ScreenUtil().setWidth(0),  
5061 - top: ScreenUtil().setWidth(242 * 2),  
5062 - child: Offstage(  
5063 - offstage: showPnumMax,  
5064 - child: selectWidgetTableManage(pnum, (index) {  
5065 - state(() {  
5066 - showPnumMax = !showPnumMax;  
5067 - pnumMax = pnum[index as int];  
5068 - });  
5069 - }),  
5070 - )), 5223 + // Positioned(
  5224 + // left: ScreenUtil().setWidth(190 * 2),
  5225 + // top: ScreenUtil().setWidth(242 * 2),
  5226 + // child: Offstage(
  5227 + // offstage: showPnumMin,
  5228 + // child: selectWidgetTableManage(pnum, (index) {
  5229 + // state(() {
  5230 + // showPnumMin = !showPnumMin;
  5231 + // pnumMin = pnum[index as int];
  5232 + // });
  5233 + // }),
  5234 + // )),
  5235 + // Positioned(
  5236 + // right: ScreenUtil().setWidth(0),
  5237 + // top: ScreenUtil().setWidth(242 * 2),
  5238 + // child: Offstage(
  5239 + // offstage: showPnumMax,
  5240 + // child: selectWidgetTableManage(pnum, (index) {
  5241 + // state(() {
  5242 + // showPnumMax = !showPnumMax;
  5243 + // pnumMax = pnum[index as int];
  5244 + // });
  5245 + // }),
  5246 + // )),
5071 ], 5247 ],
5072 )); 5248 ));
5073 })); 5249 }));
@@ -5075,7 +5251,7 @@ class DialogUtil { @@ -5075,7 +5251,7 @@ class DialogUtil {
5075 } 5251 }
5076 5252
5077 static Future openMyTableManageModifyTableDialog( 5253 static Future openMyTableManageModifyTableDialog(
5078 - BuildContext context, List<String?> baojianList, List<String> pnum, 5254 + BuildContext context, List<String?> baojianList,
5079 {required String name, 5255 {required String name,
5080 String? tidStr, 5256 String? tidStr,
5081 String pnumMin = '', 5257 String pnumMin = '',
@@ -5094,7 +5270,15 @@ class DialogUtil { @@ -5094,7 +5270,15 @@ class DialogUtil {
5094 print(table.lockTname); 5270 print(table.lockTname);
5095 5271
5096 TextEditingController controller = TextEditingController(); 5272 TextEditingController controller = TextEditingController();
  5273 +
5097 controller.text = name; 5274 controller.text = name;
  5275 +
  5276 + TextEditingController controllerMin = TextEditingController();
  5277 + controllerMin.text = pnumMin;
  5278 +
  5279 + TextEditingController controllerMax = TextEditingController();
  5280 + controllerMax.text = pnumMax;
  5281 +
5098 // TextEditingController _norNumController = TextEditingController(); 5282 // TextEditingController _norNumController = TextEditingController();
5099 // _norNumController.text = '10'; 5283 // _norNumController.text = '10';
5100 // FocusNode _norNumFocusNode = FocusNode(); 5284 // FocusNode _norNumFocusNode = FocusNode();
@@ -5325,30 +5509,150 @@ class DialogUtil { @@ -5325,30 +5509,150 @@ class DialogUtil {
5325 // Stack( 5509 // Stack(
5326 // overflow: Overflow.visible, 5510 // overflow: Overflow.visible,
5327 // children: [ 5511 // children: [
5328 - btnChooseTableManagePnum(pnumMin, 'min',  
5329 - ScreenUtil().setWidth(54 * 2), (value) {  
5330 - state(() {  
5331 - showBaojian = true;  
5332 - showPnumMax = true;  
5333 - showPnumMin = !showPnumMin;  
5334 - });  
5335 - }),  
5336 - HEmptyView(40), 5512 +
  5513 + Container(
  5514 + width: w(80),
  5515 + // margin: EdgeInsets.symmetric(
  5516 + // horizontal: ScreenUtil().setWidth(44)),
  5517 + height: w(30),
  5518 + alignment: Alignment.center,
  5519 + decoration: BoxDecoration(
  5520 + color: MyColours.color_f3f3f3,
  5521 + borderRadius: BorderRadius.circular(
  5522 + ScreenUtil().setWidth(10))),
  5523 + child: TextField(
  5524 + controller: controllerMin,
  5525 + maxLines: 1,
  5526 + // //光标颜色
  5527 + // cursorColor:
  5528 + // widget.isSelect ? Colors.white : MyColours.color_199095,
  5529 + //输入文本的样式
  5530 + textAlign: TextAlign.center,
  5531 + style: TextStyle(
  5532 + fontSize: ScreenUtil().setSp(32),
  5533 + color: MyColours.color_515151),
  5534 + inputFormatters: [
  5535 + FilteringTextInputFormatter.digitsOnly
  5536 + ],
  5537 + decoration: InputDecoration(
  5538 + isCollapsed: true,
  5539 + contentPadding:
  5540 + EdgeInsets.zero, //设置文字内容与边框距离
  5541 + // enabledBorder: UnderlineInputBorder(
  5542 + // borderSide: BorderSide(
  5543 + // color: MyColours.color_efefef),
  5544 + // ),
  5545 + // focusedBorder: UnderlineInputBorder(
  5546 + // borderSide: BorderSide(
  5547 + // color: MyColours.color_efefef,
  5548 + // width: ScreenUtil().setWidth(2)),
  5549 + // ),
  5550 + // prefixText: '*',
  5551 + // prefixStyle: TextStyle(
  5552 + // fontSize: ScreenUtil().setSp(32),
  5553 + // color: MyColours.color_E95750),
  5554 + border: OutlineInputBorder(
  5555 + borderSide: BorderSide.none),
  5556 + hintText: '输入最小',
  5557 + hintStyle: TextStyle(
  5558 + color: MyColours.color_BFC4D4,
  5559 + fontSize: ScreenUtil().setSp(32),
  5560 + ),
  5561 + ),
  5562 + onChanged: (value) {
  5563 + state(() {});
  5564 + },
  5565 + onEditingComplete: () {
  5566 + FocusScope.of(context).requestFocus(
  5567 + FocusNode()); //点击空白处隐藏键盘
  5568 + },
  5569 + keyboardType: TextInputType.number,
  5570 + ),
  5571 + ),
  5572 +
  5573 + // btnChooseTableManagePnum(pnumMin, 'min',
  5574 + // ScreenUtil().setWidth(54 * 2), (value) {
  5575 + // state(() {
  5576 + // showBaojian = true;
  5577 + // showPnumMax = true;
  5578 + // showPnumMin = !showPnumMin;
  5579 + // });
  5580 + // }),
  5581 + HEmptyView(20),
5337 Text( 5582 Text(
5338 '至', 5583 '至',
5339 style: TextStyle( 5584 style: TextStyle(
5340 fontSize: ScreenUtil().setSp(32), 5585 fontSize: ScreenUtil().setSp(32),
5341 color: MyColours.color_000000), 5586 color: MyColours.color_000000),
5342 ), 5587 ),
5343 - HEmptyView(40),  
5344 - btnChooseTableManagePnum(pnumMax, 'max',  
5345 - ScreenUtil().setWidth(54 * 2), (value) {  
5346 - state(() {  
5347 - showBaojian = true;  
5348 - showPnumMin = true;  
5349 - showPnumMax = !showPnumMax;  
5350 - });  
5351 - }), 5588 + HEmptyView(20),
  5589 +
  5590 + Container(
  5591 + width: w(80),
  5592 + height: w(30),
  5593 + alignment: Alignment.center,
  5594 + decoration: BoxDecoration(
  5595 + color: MyColours.color_f3f3f3,
  5596 + borderRadius: BorderRadius.circular(
  5597 + ScreenUtil().setWidth(10))),
  5598 + child: TextField(
  5599 + controller: controllerMax,
  5600 + maxLines: 1,
  5601 + // //光标颜色
  5602 + // cursorColor:
  5603 + // widget.isSelect ? Colors.white : MyColours.color_199095,
  5604 + //输入文本的样式
  5605 + textAlign: TextAlign.center,
  5606 + style: TextStyle(
  5607 + fontSize: ScreenUtil().setSp(32),
  5608 + color: MyColours.color_515151),
  5609 + inputFormatters: [
  5610 + FilteringTextInputFormatter.digitsOnly
  5611 + ],
  5612 + decoration: InputDecoration(
  5613 + isCollapsed: true,
  5614 + contentPadding:
  5615 + EdgeInsets.zero, //设置文字内容与边框距离
  5616 +
  5617 + // enabledBorder: UnderlineInputBorder(
  5618 + // borderSide: BorderSide(
  5619 + // color: MyColours.color_efefef),
  5620 + // ),
  5621 + // focusedBorder: UnderlineInputBorder(
  5622 + // borderSide: BorderSide(
  5623 + // color: MyColours.color_efefef,
  5624 + // width: ScreenUtil().setWidth(2)),
  5625 + // ),
  5626 + // prefixText: '*',
  5627 + // prefixStyle: TextStyle(
  5628 + // fontSize: ScreenUtil().setSp(32),
  5629 + // color: MyColours.color_E95750),
  5630 + border: OutlineInputBorder(
  5631 + borderSide: BorderSide.none),
  5632 + hintText: '输入最大',
  5633 + hintStyle: TextStyle(
  5634 + color: MyColours.color_BFC4D4,
  5635 + fontSize: ScreenUtil().setSp(32),
  5636 + ),
  5637 + ),
  5638 + onChanged: (value) {
  5639 + state(() {});
  5640 + },
  5641 + onEditingComplete: () {
  5642 + FocusScope.of(context).requestFocus(
  5643 + FocusNode()); //点击空白处隐藏键盘
  5644 + },
  5645 + keyboardType: TextInputType.number,
  5646 + ),
  5647 + ),
  5648 + // btnChooseTableManagePnum(pnumMax, 'max',
  5649 + // ScreenUtil().setWidth(54 * 2), (value) {
  5650 + // state(() {
  5651 + // showBaojian = true;
  5652 + // showPnumMin = true;
  5653 + // showPnumMax = !showPnumMax;
  5654 + // });
  5655 + // }),
5352 HEmptyView(32), 5656 HEmptyView(32),
5353 ], 5657 ],
5354 ), 5658 ),
@@ -5724,6 +6028,36 @@ class DialogUtil { @@ -5724,6 +6028,36 @@ class DialogUtil {
5724 Utils.showToast('请输入桌位名称!'); 6028 Utils.showToast('请输入桌位名称!');
5725 return; 6029 return;
5726 } 6030 }
  6031 + if (controllerMax.text.trim().length >
  6032 + 0 &&
  6033 + controllerMin.text.trim().length >
  6034 + 0) {
  6035 + if (int.parse(
  6036 + controllerMin.text.trim()) >
  6037 + int.parse(
  6038 + controllerMax.text.trim())) {
  6039 + Utils.showToast('最大人数不能小于最小人数!');
  6040 + return;
  6041 + }
  6042 + if (int.parse(
  6043 + controllerMin.text.trim()) ==
  6044 + 0) {
  6045 + Utils.showToast('最小人数不能为0!');
  6046 + return;
  6047 + }
  6048 + if (int.parse(
  6049 + controllerMax.text.trim()) ==
  6050 + 0) {
  6051 + Utils.showToast('最大人数不能为0!');
  6052 + return;
  6053 + }
  6054 + if (int.parse(
  6055 + controllerMax.text.trim()) >
  6056 + 999) {
  6057 + Utils.showToast('最大人数不能超过999!');
  6058 + return;
  6059 + }
  6060 + }
5727 if (isLock != '1' && isMerge == '1') { 6061 if (isLock != '1' && isMerge == '1') {
5728 //合并桌位的时候,开关打开的情况下,必须选择至少一个桌位 6062 //合并桌位的时候,开关打开的情况下,必须选择至少一个桌位
5729 if (selectTables.length == 0) { 6063 if (selectTables.length == 0) {
@@ -5742,8 +6076,8 @@ class DialogUtil { @@ -5742,8 +6076,8 @@ class DialogUtil {
5742 'bjtype': 6076 'bjtype':
5743 baojianList[currentBaojianIndex], 6077 baojianList[currentBaojianIndex],
5744 'name': controller.text, 6078 'name': controller.text,
5745 - 'pnumMin': pnumMin,  
5746 - 'pnumMax': pnumMax, 6079 + 'pnumMin': controllerMin.text.trim(),
  6080 + 'pnumMax': controllerMax.text.trim(),
5747 'isMerge': isMerge, 6081 'isMerge': isMerge,
5748 'tids': tids, 6082 'tids': tids,
5749 'rid': rid 6083 'rid': rid
@@ -5758,34 +6092,34 @@ class DialogUtil { @@ -5758,34 +6092,34 @@ class DialogUtil {
5758 ), 6092 ),
5759 ), 6093 ),
5760 )), 6094 )),
5761 - Positioned(  
5762 - left: ScreenUtil().setWidth(400),  
5763 - top: ScreenUtil().setWidth(208 * 2),  
5764 - child: Offstage(  
5765 - offstage: showPnumMin,  
5766 - child: Material(  
5767 - color: Colors.transparent,  
5768 - child: selectWidgetTableManage(pnum, (index) {  
5769 - state(() {  
5770 - showPnumMin = !showPnumMin;  
5771 - pnumMin = pnum[index as int];  
5772 - });  
5773 - }),  
5774 - ))),  
5775 - Positioned(  
5776 - right: ScreenUtil().setWidth(0),  
5777 - top: ScreenUtil().setWidth(208 * 2),  
5778 - child: Material(  
5779 - color: Colors.transparent,  
5780 - child: Offstage(  
5781 - offstage: showPnumMax,  
5782 - child: selectWidgetTableManage(pnum, (index) {  
5783 - state(() {  
5784 - showPnumMax = !showPnumMax;  
5785 - pnumMax = pnum[index as int];  
5786 - });  
5787 - }),  
5788 - ))), 6095 + // Positioned(
  6096 + // left: ScreenUtil().setWidth(400),
  6097 + // top: ScreenUtil().setWidth(208 * 2),
  6098 + // child: Offstage(
  6099 + // offstage: showPnumMin,
  6100 + // child: Material(
  6101 + // color: Colors.transparent,
  6102 + // child: selectWidgetTableManage(pnum, (index) {
  6103 + // state(() {
  6104 + // showPnumMin = !showPnumMin;
  6105 + // pnumMin = pnum[index as int];
  6106 + // });
  6107 + // }),
  6108 + // ))),
  6109 + // Positioned(
  6110 + // right: ScreenUtil().setWidth(0),
  6111 + // top: ScreenUtil().setWidth(208 * 2),
  6112 + // child: Material(
  6113 + // color: Colors.transparent,
  6114 + // child: Offstage(
  6115 + // offstage: showPnumMax,
  6116 + // child: selectWidgetTableManage(pnum, (index) {
  6117 + // state(() {
  6118 + // showPnumMax = !showPnumMax;
  6119 + // pnumMax = pnum[index as int];
  6120 + // });
  6121 + // }),
  6122 + // ))),
5789 Positioned( 6123 Positioned(
5790 right: ScreenUtil().setWidth(0), 6124 right: ScreenUtil().setWidth(0),
5791 top: ScreenUtil().setWidth(162 * 2), 6125 top: ScreenUtil().setWidth(162 * 2),
@@ -5813,8 +6147,14 @@ class DialogUtil { @@ -5813,8 +6147,14 @@ class DialogUtil {
5813 String pnumMax = '', 6147 String pnumMax = '',
5814 CustomCallBackMap? onTap, 6148 CustomCallBackMap? onTap,
5815 }) async { 6149 }) async {
5816 - bool showPnumMin = true;  
5817 - bool showPnumMax = true; 6150 + // bool showPnumMin = true;
  6151 + // bool showPnumMax = true;
  6152 +
  6153 + TextEditingController controllerMin = TextEditingController();
  6154 + controllerMin.text = pnumMin;
  6155 +
  6156 + TextEditingController controllerMax = TextEditingController();
  6157 + controllerMax.text = pnumMax;
5818 6158
5819 final action = await showDialog( 6159 final action = await showDialog(
5820 context: context, 6160 context: context,
@@ -5875,28 +6215,141 @@ class DialogUtil { @@ -5875,28 +6215,141 @@ class DialogUtil {
5875 // Stack( 6215 // Stack(
5876 // overflow: Overflow.visible, 6216 // overflow: Overflow.visible,
5877 // children: [ 6217 // children: [
5878 - btnChooseTableManagePnum(pnumMin, 'min',  
5879 - ScreenUtil().setWidth(54 * 2), (value) {  
5880 - state(() {  
5881 - showPnumMax = true;  
5882 - showPnumMin = !showPnumMin;  
5883 - });  
5884 - }),  
5885 - HEmptyView(40), 6218 + Container(
  6219 + width: w(80),
  6220 + // margin: EdgeInsets.symmetric(
  6221 + // horizontal: ScreenUtil().setWidth(44)),
  6222 + height: w(30),
  6223 + alignment: Alignment.center,
  6224 + decoration: BoxDecoration(
  6225 + color: MyColours.color_f3f3f3,
  6226 + borderRadius: BorderRadius.circular(
  6227 + ScreenUtil().setWidth(10))),
  6228 + child: TextField(
  6229 + controller: controllerMin,
  6230 + maxLines: 1,
  6231 + // //光标颜色
  6232 + // cursorColor:
  6233 + // widget.isSelect ? Colors.white : MyColours.color_199095,
  6234 + //输入文本的样式
  6235 + textAlign: TextAlign.center,
  6236 + style: TextStyle(
  6237 + fontSize: ScreenUtil().setSp(32),
  6238 + color: MyColours.color_515151),
  6239 + inputFormatters: [
  6240 + FilteringTextInputFormatter.digitsOnly
  6241 + ],
  6242 + decoration: InputDecoration(
  6243 + isCollapsed: true,
  6244 + contentPadding:
  6245 + EdgeInsets.zero, //设置文字内容与边框距离
  6246 + // enabledBorder: UnderlineInputBorder(
  6247 + // borderSide: BorderSide(
  6248 + // color: MyColours.color_efefef),
  6249 + // ),
  6250 + // focusedBorder: UnderlineInputBorder(
  6251 + // borderSide: BorderSide(
  6252 + // color: MyColours.color_efefef,
  6253 + // width: ScreenUtil().setWidth(2)),
  6254 + // ),
  6255 + // prefixText: '*',
  6256 + // prefixStyle: TextStyle(
  6257 + // fontSize: ScreenUtil().setSp(32),
  6258 + // color: MyColours.color_E95750),
  6259 + border: OutlineInputBorder(
  6260 + borderSide: BorderSide.none),
  6261 + hintText: '输入最小',
  6262 + hintStyle: TextStyle(
  6263 + color: MyColours.color_BFC4D4,
  6264 + fontSize: ScreenUtil().setSp(32),
  6265 + ),
  6266 + ),
  6267 + onChanged: (value) {
  6268 + state(() {});
  6269 + },
  6270 + onEditingComplete: () {
  6271 + FocusScope.of(context).requestFocus(
  6272 + FocusNode()); //点击空白处隐藏键盘
  6273 + },
  6274 + keyboardType: TextInputType.number,
  6275 + ),
  6276 + ),
  6277 +
  6278 + // btnChooseTableManagePnum(pnumMin, 'min',
  6279 + // ScreenUtil().setWidth(54 * 2), (value) {
  6280 + // state(() {
  6281 + // showBaojian = true;
  6282 + // showPnumMax = true;
  6283 + // showPnumMin = !showPnumMin;
  6284 + // });
  6285 + // }),
  6286 + HEmptyView(20),
5886 Text( 6287 Text(
5887 '至', 6288 '至',
5888 style: TextStyle( 6289 style: TextStyle(
5889 fontSize: ScreenUtil().setSp(32), 6290 fontSize: ScreenUtil().setSp(32),
5890 color: MyColours.color_000000), 6291 color: MyColours.color_000000),
5891 ), 6292 ),
5892 - HEmptyView(40),  
5893 - btnChooseTableManagePnum(pnumMax, 'max',  
5894 - ScreenUtil().setWidth(54 * 2), (value) {  
5895 - state(() {  
5896 - showPnumMin = true;  
5897 - showPnumMax = !showPnumMax;  
5898 - });  
5899 - }), 6293 + HEmptyView(20),
  6294 +
  6295 + Container(
  6296 + width: w(80),
  6297 + height: w(30),
  6298 + alignment: Alignment.center,
  6299 + decoration: BoxDecoration(
  6300 + color: MyColours.color_f3f3f3,
  6301 + borderRadius: BorderRadius.circular(
  6302 + ScreenUtil().setWidth(10))),
  6303 + child: TextField(
  6304 + controller: controllerMax,
  6305 + maxLines: 1,
  6306 + // //光标颜色
  6307 + // cursorColor:
  6308 + // widget.isSelect ? Colors.white : MyColours.color_199095,
  6309 + //输入文本的样式
  6310 + textAlign: TextAlign.center,
  6311 + style: TextStyle(
  6312 + fontSize: ScreenUtil().setSp(32),
  6313 + color: MyColours.color_515151),
  6314 + inputFormatters: [
  6315 + FilteringTextInputFormatter.digitsOnly
  6316 + ],
  6317 + decoration: InputDecoration(
  6318 + isCollapsed: true,
  6319 + contentPadding:
  6320 + EdgeInsets.zero, //设置文字内容与边框距离
  6321 +
  6322 + // enabledBorder: UnderlineInputBorder(
  6323 + // borderSide: BorderSide(
  6324 + // color: MyColours.color_efefef),
  6325 + // ),
  6326 + // focusedBorder: UnderlineInputBorder(
  6327 + // borderSide: BorderSide(
  6328 + // color: MyColours.color_efefef,
  6329 + // width: ScreenUtil().setWidth(2)),
  6330 + // ),
  6331 + // prefixText: '*',
  6332 + // prefixStyle: TextStyle(
  6333 + // fontSize: ScreenUtil().setSp(32),
  6334 + // color: MyColours.color_E95750),
  6335 + border: OutlineInputBorder(
  6336 + borderSide: BorderSide.none),
  6337 + hintText: '输入最大',
  6338 + hintStyle: TextStyle(
  6339 + color: MyColours.color_BFC4D4,
  6340 + fontSize: ScreenUtil().setSp(32),
  6341 + ),
  6342 + ),
  6343 + onChanged: (value) {
  6344 + state(() {});
  6345 + },
  6346 + onEditingComplete: () {
  6347 + FocusScope.of(context).requestFocus(
  6348 + FocusNode()); //点击空白处隐藏键盘
  6349 + },
  6350 + keyboardType: TextInputType.number,
  6351 + ),
  6352 + ),
5900 HEmptyView(32), 6353 HEmptyView(32),
5901 ], 6354 ],
5902 ), 6355 ),
@@ -5937,15 +6390,53 @@ class DialogUtil { @@ -5937,15 +6390,53 @@ class DialogUtil {
5937 radius: ScreenUtil().setWidth(0), 6390 radius: ScreenUtil().setWidth(0),
5938 gradientStart: Colors.transparent, 6391 gradientStart: Colors.transparent,
5939 gradientEnd: Colors.transparent, 6392 gradientEnd: Colors.transparent,
5940 - textColor: pnumMax == '' || pnumMin == ''  
5941 - ? MyColours.color_999999  
5942 - : MyColours.color_438E93, 6393 + textColor:
  6394 + controllerMax.text.trim().length == 0 ||
  6395 + controllerMin.text
  6396 + .trim()
  6397 + .length ==
  6398 + 0
  6399 + ? MyColours.color_999999
  6400 + : MyColours.color_438E93,
5943 fontSize: 34, 6401 fontSize: 34,
5944 onPressed: () { 6402 onPressed: () {
5945 - if (pnumMax == '' && pnumMin == '') {  
5946 - Utils.showToast('请选择人数!'); 6403 + if (controllerMax.text.trim().length ==
  6404 + 0 ||
  6405 + controllerMin.text.trim().length ==
  6406 + 0) {
  6407 + Utils.showToast('请输入人数!');
5947 return; 6408 return;
5948 } 6409 }
  6410 + if (controllerMax.text.trim().length >
  6411 + 0 &&
  6412 + controllerMin.text.trim().length >
  6413 + 0) {
  6414 + if (int.parse(
  6415 + controllerMin.text.trim()) >
  6416 + int.parse(
  6417 + controllerMax.text.trim())) {
  6418 + Utils.showToast('最大人数不能小于最小人数!');
  6419 + return;
  6420 + }
  6421 + if (int.parse(
  6422 + controllerMin.text.trim()) ==
  6423 + 0) {
  6424 + Utils.showToast('最小人数不能为0!');
  6425 + return;
  6426 + }
  6427 + if (int.parse(
  6428 + controllerMax.text.trim()) ==
  6429 + 0) {
  6430 + Utils.showToast('最大人数不能为0!');
  6431 + return;
  6432 + }
  6433 + if (int.parse(
  6434 + controllerMax.text.trim()) >
  6435 + 999) {
  6436 + Utils.showToast('最大人数不能超过999!');
  6437 + return;
  6438 + }
  6439 + }
5949 // 当前选中区域 6440 // 当前选中区域
5950 // areas[currentAreaIndex] 6441 // areas[currentAreaIndex]
5951 //最低人数 6442 //最低人数
@@ -5954,8 +6445,8 @@ class DialogUtil { @@ -5954,8 +6445,8 @@ class DialogUtil {
5954 // pnumMax 6445 // pnumMax
5955 6446
5956 onTap!({ 6447 onTap!({
5957 - 'pnumMin': pnumMin,  
5958 - 'pnumMax': pnumMax, 6448 + 'pnumMin': controllerMin.text,
  6449 + 'pnumMax': controllerMax.text,
5959 }); 6450 });
5960 if (Navigator.canPop(context)) { 6451 if (Navigator.canPop(context)) {
5961 Navigator.pop(context); 6452 Navigator.pop(context);
@@ -5966,34 +6457,34 @@ class DialogUtil { @@ -5966,34 +6457,34 @@ class DialogUtil {
5966 ), 6457 ),
5967 ), 6458 ),
5968 ), 6459 ),
5969 - Positioned(  
5970 - left: ScreenUtil().setWidth(378),  
5971 - top: ScreenUtil().setWidth(114 * 2),  
5972 - child: Offstage(  
5973 - offstage: showPnumMin,  
5974 - child: Material(  
5975 - color: Colors.transparent,  
5976 - child: selectWidgetTableManage(pnum, (index) {  
5977 - state(() {  
5978 - showPnumMin = !showPnumMin;  
5979 - pnumMin = pnum[index as int];  
5980 - });  
5981 - }),  
5982 - ))),  
5983 - Positioned(  
5984 - right: ScreenUtil().setWidth(0),  
5985 - top: ScreenUtil().setWidth(114 * 2),  
5986 - child: Material(  
5987 - color: Colors.transparent,  
5988 - child: Offstage(  
5989 - offstage: showPnumMax,  
5990 - child: selectWidgetTableManage(pnum, (index) {  
5991 - state(() {  
5992 - showPnumMax = !showPnumMax;  
5993 - pnumMax = pnum[index as int];  
5994 - });  
5995 - }),  
5996 - ))), 6460 + // Positioned(
  6461 + // left: ScreenUtil().setWidth(378),
  6462 + // top: ScreenUtil().setWidth(114 * 2),
  6463 + // child: Offstage(
  6464 + // offstage: showPnumMin,
  6465 + // child: Material(
  6466 + // color: Colors.transparent,
  6467 + // child: selectWidgetTableManage(pnum, (index) {
  6468 + // state(() {
  6469 + // showPnumMin = !showPnumMin;
  6470 + // pnumMin = pnum[index as int];
  6471 + // });
  6472 + // }),
  6473 + // ))),
  6474 + // Positioned(
  6475 + // right: ScreenUtil().setWidth(0),
  6476 + // top: ScreenUtil().setWidth(114 * 2),
  6477 + // child: Material(
  6478 + // color: Colors.transparent,
  6479 + // child: Offstage(
  6480 + // offstage: showPnumMax,
  6481 + // child: selectWidgetTableManage(pnum, (index) {
  6482 + // state(() {
  6483 + // showPnumMax = !showPnumMax;
  6484 + // pnumMax = pnum[index as int];
  6485 + // });
  6486 + // }),
  6487 + // ))),
5997 ]); 6488 ]);
5998 }))); 6489 })));
5999 }); 6490 });