Commit 7e2263c26a5d744188c22a8430143f4d7cea0389

Authored by wdn127929
1 parent 2c64680a

人数输入

... ... @@ -2226,38 +2226,38 @@ Future<bool> getAllCuisine(BuildContext context) async {
VEmptyView(34),
],
)),
VEmptyView(34),
InkWell(
onTap: () {
NavigatorUtil.goBookTimeSettingListPage(
context);
},
child: Padding(
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(24)),
child: Container(
height: ScreenUtil().setWidth(40),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Text('指定日期多时段预订设置',
style: TextStyle(
color: MyColours.color_999999,
fontSize:
ScreenUtil().setSp(28),
)),
Spacer(),
Image.asset(
Utils.getImgPath('arrow_right_new'),
width: ScreenUtil().setWidth(16),
height: ScreenUtil().setWidth(28),
)
],
),
))),
// VEmptyView(34),
// InkWell(
// onTap: () {
// NavigatorUtil.goBookTimeSettingListPage(
// context);
// },
// child: Padding(
// padding: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(24)),
// child: Container(
// height: ScreenUtil().setWidth(40),
// child: Row(
// crossAxisAlignment:
// CrossAxisAlignment.center,
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: [
// Text('指定日期多时段预订设置',
// style: TextStyle(
// color: MyColours.color_999999,
// fontSize:
// ScreenUtil().setSp(28),
// )),
// Spacer(),
// Image.asset(
// Utils.getImgPath('arrow_right_new'),
// width: ScreenUtil().setWidth(16),
// height: ScreenUtil().setWidth(28),
// )
// ],
// ),
// ))),
VEmptyView(96),
Text('接单时间',
style: TextStyle(
... ...
... ... @@ -265,7 +265,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> {
//添加桌位弹框
await DialogUtil.openMyTableManageCreateTableDialog(
context, tableTypeS, personNumList,
context, tableTypeS,
onTap: (Map<String, String?> value) async {
print(value);
// 'areaname':
... ... @@ -439,7 +439,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> {
});
}
await DialogUtil.openMyTableManageModifyTableDialog(
context, tableTypeS, personNumList,
context, tableTypeS,
name: table.name!,
tidStr: table.tidStr,
pnumMin: table.table_pnum ?? '',
... ...
... ... @@ -4620,7 +4620,7 @@ class DialogUtil {
}
static Future openMyTableManageCreateTableDialog(
BuildContext context, List<String?> baojianList, List<String> pnum,
BuildContext context, List<String?> baojianList,
{CustomCallBackMap? onTap}) async {
TextEditingController controller = TextEditingController();
... ... @@ -4628,10 +4628,10 @@ class DialogUtil {
_norNumController.text = '10';
FocusNode _norNumFocusNode = FocusNode();
bool showBaojian = true;
bool showPnumMin = true;
bool showPnumMax = true;
String pnumMin = '';
String pnumMax = '';
// bool showPnumMin = true;
// bool showPnumMax = true;
// String pnumMin = '';
// String pnumMax = '';
int currentBaojianIndex =
baojianList.indexWhere((element) => element == '包间') == -1
? 0
... ... @@ -4654,6 +4654,11 @@ class DialogUtil {
// }
// });
TextEditingController controllerMax = TextEditingController();
// controllerMax.text = pnumMax;
TextEditingController controllerMin = TextEditingController();
// controllerMin.text = pnumMin;
final action = await showDialog(
context: context,
barrierDismissible: false,
... ... @@ -4833,8 +4838,8 @@ class DialogUtil {
InkWell(
onTap: () {
state(() {
showPnumMax = true;
showPnumMin = true;
// showPnumMax = true;
// showPnumMin = true;
showBaojian = !showBaojian;
});
},
... ... @@ -4898,18 +4903,84 @@ class DialogUtil {
// Stack(
// overflow: Overflow.visible,
// children: [
btnChooseTableManagePnum(
pnumMin,
'min',
ScreenUtil().setWidth(54 * 2),
(value) {
state(() {
showBaojian = true;
showPnumMax = true;
showPnumMin = !showPnumMin;
});
}),
HEmptyView(40),
Container(
width: w(80),
// margin: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(44)),
height: w(30),
alignment: Alignment.center,
decoration: BoxDecoration(
color: MyColours.color_f3f3f3,
borderRadius:
BorderRadius.circular(
ScreenUtil()
.setWidth(10))),
child: TextField(
controller: controllerMin,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
textAlign: TextAlign.center,
style: TextStyle(
fontSize:
ScreenUtil().setSp(32),
color:
MyColours.color_515151),
inputFormatters: [
FilteringTextInputFormatter
.digitsOnly
],
decoration: InputDecoration(
isCollapsed: true,
contentPadding: EdgeInsets
.zero, //设置文字内容与边框距离
// enabledBorder: UnderlineInputBorder(
// borderSide: BorderSide(
// color: MyColours.color_efefef),
// ),
// focusedBorder: UnderlineInputBorder(
// borderSide: BorderSide(
// color: MyColours.color_efefef,
// width: ScreenUtil().setWidth(2)),
// ),
// prefixText: '*',
// prefixStyle: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// color: MyColours.color_E95750),
border: OutlineInputBorder(
borderSide:
BorderSide.none),
hintText: '输入最小',
hintStyle: TextStyle(
color: MyColours.color_BFC4D4,
fontSize:
ScreenUtil().setSp(32),
),
),
onChanged: (value) {
state(() {});
},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(
FocusNode()); //点击空白处隐藏键盘
},
keyboardType:
TextInputType.number,
),
),
// btnChooseTableManagePnum(pnumMin, 'min',
// ScreenUtil().setWidth(54 * 2), (value) {
// state(() {
// showBaojian = true;
// showPnumMax = true;
// showPnumMin = !showPnumMin;
// });
// }),
HEmptyView(20),
Text(
'至',
style: TextStyle(
... ... @@ -4917,18 +4988,75 @@ class DialogUtil {
ScreenUtil().setSp(32),
color: MyColours.color_000000),
),
HEmptyView(40),
btnChooseTableManagePnum(
pnumMax,
'max',
ScreenUtil().setWidth(54 * 2),
(value) {
state(() {
showBaojian = true;
showPnumMin = true;
showPnumMax = !showPnumMax;
});
}),
HEmptyView(20),
Container(
width: w(80),
height: w(30),
alignment: Alignment.center,
decoration: BoxDecoration(
color: MyColours.color_f3f3f3,
borderRadius:
BorderRadius.circular(
ScreenUtil()
.setWidth(10))),
child: TextField(
controller: controllerMax,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
textAlign: TextAlign.center,
style: TextStyle(
fontSize:
ScreenUtil().setSp(32),
color:
MyColours.color_515151),
inputFormatters: [
FilteringTextInputFormatter
.digitsOnly
],
decoration: InputDecoration(
isCollapsed: true,
contentPadding: EdgeInsets
.zero, //设置文字内容与边框距离
// enabledBorder: UnderlineInputBorder(
// borderSide: BorderSide(
// color: MyColours.color_efefef),
// ),
// focusedBorder: UnderlineInputBorder(
// borderSide: BorderSide(
// color: MyColours.color_efefef,
// width: ScreenUtil().setWidth(2)),
// ),
// prefixText: '*',
// prefixStyle: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// color: MyColours.color_E95750),
border: OutlineInputBorder(
borderSide:
BorderSide.none),
hintText: '输入最大',
hintStyle: TextStyle(
color: MyColours.color_BFC4D4,
fontSize:
ScreenUtil().setSp(32),
),
),
onChanged: (value) {
state(() {});
},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(
FocusNode()); //点击空白处隐藏键盘
},
keyboardType:
TextInputType.number,
),
),
HEmptyView(32),
],
),
... ... @@ -5012,13 +5140,61 @@ class DialogUtil {
// pnumMin
//最高人数
// pnumMax
if (!mulCreate) {
if (controllerMax.text
.trim()
.length ==
0 ||
controllerMin.text
.trim()
.length ==
0) {
Utils.showToast('请输入人数!');
return;
}
if (controllerMax.text
.trim()
.length >
0 &&
controllerMin.text
.trim()
.length >
0) {
if (int.parse(controllerMin.text
.trim()) >
int.parse(controllerMax.text
.trim())) {
Utils.showToast(
'最大人数不能小于最小人数!');
return;
}
if (int.parse(controllerMin.text
.trim()) ==
0) {
Utils.showToast('最小人数不能为0!');
return;
}
if (int.parse(controllerMax.text
.trim()) ==
0) {
Utils.showToast('最大人数不能为0!');
return;
}
if (int.parse(controllerMax.text
.trim()) >
999) {
Utils.showToast('最大人数不能超过999!');
return;
}
}
}
onTap!({
'bjtype': baojianList[
currentBaojianIndex],
'name': controller.text,
'pnumMin': pnumMin,
'pnumMax': pnumMax,
'pnumMin': controllerMin.text,
'pnumMax': controllerMax.text,
'mulcreate': mulCreate.toString(),
'tablenum': _norNumController.text
});
... ... @@ -5044,30 +5220,30 @@ class DialogUtil {
});
}),
)),
Positioned(
left: ScreenUtil().setWidth(190 * 2),
top: ScreenUtil().setWidth(242 * 2),
child: Offstage(
offstage: showPnumMin,
child: selectWidgetTableManage(pnum, (index) {
state(() {
showPnumMin = !showPnumMin;
pnumMin = pnum[index as int];
});
}),
)),
Positioned(
right: ScreenUtil().setWidth(0),
top: ScreenUtil().setWidth(242 * 2),
child: Offstage(
offstage: showPnumMax,
child: selectWidgetTableManage(pnum, (index) {
state(() {
showPnumMax = !showPnumMax;
pnumMax = pnum[index as int];
});
}),
)),
// Positioned(
// left: ScreenUtil().setWidth(190 * 2),
// top: ScreenUtil().setWidth(242 * 2),
// child: Offstage(
// offstage: showPnumMin,
// child: selectWidgetTableManage(pnum, (index) {
// state(() {
// showPnumMin = !showPnumMin;
// pnumMin = pnum[index as int];
// });
// }),
// )),
// Positioned(
// right: ScreenUtil().setWidth(0),
// top: ScreenUtil().setWidth(242 * 2),
// child: Offstage(
// offstage: showPnumMax,
// child: selectWidgetTableManage(pnum, (index) {
// state(() {
// showPnumMax = !showPnumMax;
// pnumMax = pnum[index as int];
// });
// }),
// )),
],
));
}));
... ... @@ -5075,7 +5251,7 @@ class DialogUtil {
}
static Future openMyTableManageModifyTableDialog(
BuildContext context, List<String?> baojianList, List<String> pnum,
BuildContext context, List<String?> baojianList,
{required String name,
String? tidStr,
String pnumMin = '',
... ... @@ -5094,7 +5270,15 @@ class DialogUtil {
print(table.lockTname);
TextEditingController controller = TextEditingController();
controller.text = name;
TextEditingController controllerMin = TextEditingController();
controllerMin.text = pnumMin;
TextEditingController controllerMax = TextEditingController();
controllerMax.text = pnumMax;
// TextEditingController _norNumController = TextEditingController();
// _norNumController.text = '10';
// FocusNode _norNumFocusNode = FocusNode();
... ... @@ -5325,30 +5509,150 @@ class DialogUtil {
// Stack(
// overflow: Overflow.visible,
// children: [
btnChooseTableManagePnum(pnumMin, 'min',
ScreenUtil().setWidth(54 * 2), (value) {
state(() {
showBaojian = true;
showPnumMax = true;
showPnumMin = !showPnumMin;
});
}),
HEmptyView(40),
Container(
width: w(80),
// margin: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(44)),
height: w(30),
alignment: Alignment.center,
decoration: BoxDecoration(
color: MyColours.color_f3f3f3,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10))),
child: TextField(
controller: controllerMin,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
textAlign: TextAlign.center,
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_515151),
inputFormatters: [
FilteringTextInputFormatter.digitsOnly
],
decoration: InputDecoration(
isCollapsed: true,
contentPadding:
EdgeInsets.zero, //设置文字内容与边框距离
// enabledBorder: UnderlineInputBorder(
// borderSide: BorderSide(
// color: MyColours.color_efefef),
// ),
// focusedBorder: UnderlineInputBorder(
// borderSide: BorderSide(
// color: MyColours.color_efefef,
// width: ScreenUtil().setWidth(2)),
// ),
// prefixText: '*',
// prefixStyle: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// color: MyColours.color_E95750),
border: OutlineInputBorder(
borderSide: BorderSide.none),
hintText: '输入最小',
hintStyle: TextStyle(
color: MyColours.color_BFC4D4,
fontSize: ScreenUtil().setSp(32),
),
),
onChanged: (value) {
state(() {});
},
onEditingComplete: () {
FocusScope.of(context).requestFocus(
FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.number,
),
),
// btnChooseTableManagePnum(pnumMin, 'min',
// ScreenUtil().setWidth(54 * 2), (value) {
// state(() {
// showBaojian = true;
// showPnumMax = true;
// showPnumMin = !showPnumMin;
// });
// }),
HEmptyView(20),
Text(
'至',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_000000),
),
HEmptyView(40),
btnChooseTableManagePnum(pnumMax, 'max',
ScreenUtil().setWidth(54 * 2), (value) {
state(() {
showBaojian = true;
showPnumMin = true;
showPnumMax = !showPnumMax;
});
}),
HEmptyView(20),
Container(
width: w(80),
height: w(30),
alignment: Alignment.center,
decoration: BoxDecoration(
color: MyColours.color_f3f3f3,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10))),
child: TextField(
controller: controllerMax,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
textAlign: TextAlign.center,
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_515151),
inputFormatters: [
FilteringTextInputFormatter.digitsOnly
],
decoration: InputDecoration(
isCollapsed: true,
contentPadding:
EdgeInsets.zero, //设置文字内容与边框距离
// enabledBorder: UnderlineInputBorder(
// borderSide: BorderSide(
// color: MyColours.color_efefef),
// ),
// focusedBorder: UnderlineInputBorder(
// borderSide: BorderSide(
// color: MyColours.color_efefef,
// width: ScreenUtil().setWidth(2)),
// ),
// prefixText: '*',
// prefixStyle: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// color: MyColours.color_E95750),
border: OutlineInputBorder(
borderSide: BorderSide.none),
hintText: '输入最大',
hintStyle: TextStyle(
color: MyColours.color_BFC4D4,
fontSize: ScreenUtil().setSp(32),
),
),
onChanged: (value) {
state(() {});
},
onEditingComplete: () {
FocusScope.of(context).requestFocus(
FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.number,
),
),
// btnChooseTableManagePnum(pnumMax, 'max',
// ScreenUtil().setWidth(54 * 2), (value) {
// state(() {
// showBaojian = true;
// showPnumMin = true;
// showPnumMax = !showPnumMax;
// });
// }),
HEmptyView(32),
],
),
... ... @@ -5724,6 +6028,36 @@ class DialogUtil {
Utils.showToast('请输入桌位名称!');
return;
}
if (controllerMax.text.trim().length >
0 &&
controllerMin.text.trim().length >
0) {
if (int.parse(
controllerMin.text.trim()) >
int.parse(
controllerMax.text.trim())) {
Utils.showToast('最大人数不能小于最小人数!');
return;
}
if (int.parse(
controllerMin.text.trim()) ==
0) {
Utils.showToast('最小人数不能为0!');
return;
}
if (int.parse(
controllerMax.text.trim()) ==
0) {
Utils.showToast('最大人数不能为0!');
return;
}
if (int.parse(
controllerMax.text.trim()) >
999) {
Utils.showToast('最大人数不能超过999!');
return;
}
}
if (isLock != '1' && isMerge == '1') {
//合并桌位的时候,开关打开的情况下,必须选择至少一个桌位
if (selectTables.length == 0) {
... ... @@ -5742,8 +6076,8 @@ class DialogUtil {
'bjtype':
baojianList[currentBaojianIndex],
'name': controller.text,
'pnumMin': pnumMin,
'pnumMax': pnumMax,
'pnumMin': controllerMin.text.trim(),
'pnumMax': controllerMax.text.trim(),
'isMerge': isMerge,
'tids': tids,
'rid': rid
... ... @@ -5758,34 +6092,34 @@ class DialogUtil {
),
),
)),
Positioned(
left: ScreenUtil().setWidth(400),
top: ScreenUtil().setWidth(208 * 2),
child: Offstage(
offstage: showPnumMin,
child: Material(
color: Colors.transparent,
child: selectWidgetTableManage(pnum, (index) {
state(() {
showPnumMin = !showPnumMin;
pnumMin = pnum[index as int];
});
}),
))),
Positioned(
right: ScreenUtil().setWidth(0),
top: ScreenUtil().setWidth(208 * 2),
child: Material(
color: Colors.transparent,
child: Offstage(
offstage: showPnumMax,
child: selectWidgetTableManage(pnum, (index) {
state(() {
showPnumMax = !showPnumMax;
pnumMax = pnum[index as int];
});
}),
))),
// Positioned(
// left: ScreenUtil().setWidth(400),
// top: ScreenUtil().setWidth(208 * 2),
// child: Offstage(
// offstage: showPnumMin,
// child: Material(
// color: Colors.transparent,
// child: selectWidgetTableManage(pnum, (index) {
// state(() {
// showPnumMin = !showPnumMin;
// pnumMin = pnum[index as int];
// });
// }),
// ))),
// Positioned(
// right: ScreenUtil().setWidth(0),
// top: ScreenUtil().setWidth(208 * 2),
// child: Material(
// color: Colors.transparent,
// child: Offstage(
// offstage: showPnumMax,
// child: selectWidgetTableManage(pnum, (index) {
// state(() {
// showPnumMax = !showPnumMax;
// pnumMax = pnum[index as int];
// });
// }),
// ))),
Positioned(
right: ScreenUtil().setWidth(0),
top: ScreenUtil().setWidth(162 * 2),
... ... @@ -5813,8 +6147,14 @@ class DialogUtil {
String pnumMax = '',
CustomCallBackMap? onTap,
}) async {
bool showPnumMin = true;
bool showPnumMax = true;
// bool showPnumMin = true;
// bool showPnumMax = true;
TextEditingController controllerMin = TextEditingController();
controllerMin.text = pnumMin;
TextEditingController controllerMax = TextEditingController();
controllerMax.text = pnumMax;
final action = await showDialog(
context: context,
... ... @@ -5875,28 +6215,141 @@ class DialogUtil {
// Stack(
// overflow: Overflow.visible,
// children: [
btnChooseTableManagePnum(pnumMin, 'min',
ScreenUtil().setWidth(54 * 2), (value) {
state(() {
showPnumMax = true;
showPnumMin = !showPnumMin;
});
}),
HEmptyView(40),
Container(
width: w(80),
// margin: EdgeInsets.symmetric(
// horizontal: ScreenUtil().setWidth(44)),
height: w(30),
alignment: Alignment.center,
decoration: BoxDecoration(
color: MyColours.color_f3f3f3,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10))),
child: TextField(
controller: controllerMin,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
textAlign: TextAlign.center,
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_515151),
inputFormatters: [
FilteringTextInputFormatter.digitsOnly
],
decoration: InputDecoration(
isCollapsed: true,
contentPadding:
EdgeInsets.zero, //设置文字内容与边框距离
// enabledBorder: UnderlineInputBorder(
// borderSide: BorderSide(
// color: MyColours.color_efefef),
// ),
// focusedBorder: UnderlineInputBorder(
// borderSide: BorderSide(
// color: MyColours.color_efefef,
// width: ScreenUtil().setWidth(2)),
// ),
// prefixText: '*',
// prefixStyle: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// color: MyColours.color_E95750),
border: OutlineInputBorder(
borderSide: BorderSide.none),
hintText: '输入最小',
hintStyle: TextStyle(
color: MyColours.color_BFC4D4,
fontSize: ScreenUtil().setSp(32),
),
),
onChanged: (value) {
state(() {});
},
onEditingComplete: () {
FocusScope.of(context).requestFocus(
FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.number,
),
),
// btnChooseTableManagePnum(pnumMin, 'min',
// ScreenUtil().setWidth(54 * 2), (value) {
// state(() {
// showBaojian = true;
// showPnumMax = true;
// showPnumMin = !showPnumMin;
// });
// }),
HEmptyView(20),
Text(
'至',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_000000),
),
HEmptyView(40),
btnChooseTableManagePnum(pnumMax, 'max',
ScreenUtil().setWidth(54 * 2), (value) {
state(() {
showPnumMin = true;
showPnumMax = !showPnumMax;
});
}),
HEmptyView(20),
Container(
width: w(80),
height: w(30),
alignment: Alignment.center,
decoration: BoxDecoration(
color: MyColours.color_f3f3f3,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(10))),
child: TextField(
controller: controllerMax,
maxLines: 1,
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
textAlign: TextAlign.center,
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_515151),
inputFormatters: [
FilteringTextInputFormatter.digitsOnly
],
decoration: InputDecoration(
isCollapsed: true,
contentPadding:
EdgeInsets.zero, //设置文字内容与边框距离
// enabledBorder: UnderlineInputBorder(
// borderSide: BorderSide(
// color: MyColours.color_efefef),
// ),
// focusedBorder: UnderlineInputBorder(
// borderSide: BorderSide(
// color: MyColours.color_efefef,
// width: ScreenUtil().setWidth(2)),
// ),
// prefixText: '*',
// prefixStyle: TextStyle(
// fontSize: ScreenUtil().setSp(32),
// color: MyColours.color_E95750),
border: OutlineInputBorder(
borderSide: BorderSide.none),
hintText: '输入最大',
hintStyle: TextStyle(
color: MyColours.color_BFC4D4,
fontSize: ScreenUtil().setSp(32),
),
),
onChanged: (value) {
state(() {});
},
onEditingComplete: () {
FocusScope.of(context).requestFocus(
FocusNode()); //点击空白处隐藏键盘
},
keyboardType: TextInputType.number,
),
),
HEmptyView(32),
],
),
... ... @@ -5937,15 +6390,53 @@ class DialogUtil {
radius: ScreenUtil().setWidth(0),
gradientStart: Colors.transparent,
gradientEnd: Colors.transparent,
textColor: pnumMax == '' || pnumMin == ''
? MyColours.color_999999
: MyColours.color_438E93,
textColor:
controllerMax.text.trim().length == 0 ||
controllerMin.text
.trim()
.length ==
0
? MyColours.color_999999
: MyColours.color_438E93,
fontSize: 34,
onPressed: () {
if (pnumMax == '' && pnumMin == '') {
Utils.showToast('请选择人数!');
if (controllerMax.text.trim().length ==
0 ||
controllerMin.text.trim().length ==
0) {
Utils.showToast('请输入人数!');
return;
}
if (controllerMax.text.trim().length >
0 &&
controllerMin.text.trim().length >
0) {
if (int.parse(
controllerMin.text.trim()) >
int.parse(
controllerMax.text.trim())) {
Utils.showToast('最大人数不能小于最小人数!');
return;
}
if (int.parse(
controllerMin.text.trim()) ==
0) {
Utils.showToast('最小人数不能为0!');
return;
}
if (int.parse(
controllerMax.text.trim()) ==
0) {
Utils.showToast('最大人数不能为0!');
return;
}
if (int.parse(
controllerMax.text.trim()) >
999) {
Utils.showToast('最大人数不能超过999!');
return;
}
}
// 当前选中区域
// areas[currentAreaIndex]
//最低人数
... ... @@ -5954,8 +6445,8 @@ class DialogUtil {
// pnumMax
onTap!({
'pnumMin': pnumMin,
'pnumMax': pnumMax,
'pnumMin': controllerMin.text,
'pnumMax': controllerMax.text,
});
if (Navigator.canPop(context)) {
Navigator.pop(context);
... ... @@ -5966,34 +6457,34 @@ class DialogUtil {
),
),
),
Positioned(
left: ScreenUtil().setWidth(378),
top: ScreenUtil().setWidth(114 * 2),
child: Offstage(
offstage: showPnumMin,
child: Material(
color: Colors.transparent,
child: selectWidgetTableManage(pnum, (index) {
state(() {
showPnumMin = !showPnumMin;
pnumMin = pnum[index as int];
});
}),
))),
Positioned(
right: ScreenUtil().setWidth(0),
top: ScreenUtil().setWidth(114 * 2),
child: Material(
color: Colors.transparent,
child: Offstage(
offstage: showPnumMax,
child: selectWidgetTableManage(pnum, (index) {
state(() {
showPnumMax = !showPnumMax;
pnumMax = pnum[index as int];
});
}),
))),
// Positioned(
// left: ScreenUtil().setWidth(378),
// top: ScreenUtil().setWidth(114 * 2),
// child: Offstage(
// offstage: showPnumMin,
// child: Material(
// color: Colors.transparent,
// child: selectWidgetTableManage(pnum, (index) {
// state(() {
// showPnumMin = !showPnumMin;
// pnumMin = pnum[index as int];
// });
// }),
// ))),
// Positioned(
// right: ScreenUtil().setWidth(0),
// top: ScreenUtil().setWidth(114 * 2),
// child: Material(
// color: Colors.transparent,
// child: Offstage(
// offstage: showPnumMax,
// child: selectWidgetTableManage(pnum, (index) {
// state(() {
// showPnumMax = !showPnumMax;
// pnumMax = pnum[index as int];
// });
// }),
// ))),
]);
})));
});
... ...