|
...
|
...
|
@@ -697,6 +697,328 @@ class DialogUtil { |
|
|
|
String swichtitle = '是否可调菜',
|
|
|
|
String content = '',
|
|
|
|
String per = '',
|
|
|
|
String numStr = '',
|
|
|
|
bool can = true,
|
|
|
|
}) async {
|
|
|
|
TextEditingController nameC = TextEditingController();
|
|
|
|
TextEditingController perC = TextEditingController();
|
|
|
|
TextEditingController numC = TextEditingController();
|
|
|
|
nameC.text = content;
|
|
|
|
perC.text = per;
|
|
|
|
numC.text = numStr;
|
|
|
|
// bool isRed = content != '' ? false : true;
|
|
|
|
final action = await showDialog(
|
|
|
|
context: context,
|
|
|
|
barrierDismissible: false,
|
|
|
|
builder: (BuildContext context) {
|
|
|
|
return StatefulBuilder(builder: (context, state) {
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
body: Center(
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(50)),
|
|
|
|
height: ScreenUtil().setWidth(421 * 2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(16))),
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
child: Card(
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
borderRadius: BorderRadius.all(
|
|
|
|
Radius.circular(ScreenUtil().setWidth(10)))), //设置圆角
|
|
|
|
child: Container(
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
VEmptyView(64),
|
|
|
|
Container(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text(title,
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_E5000000)),
|
|
|
|
),
|
|
|
|
VEmptyView(32),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(16)),
|
|
|
|
child: Row(children: [
|
|
|
|
Text(
|
|
|
|
nametitle,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_000000),
|
|
|
|
),
|
|
|
|
HEmptyView(24),
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(48 * 2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(8))),
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: w(12)),
|
|
|
|
child: TextField(
|
|
|
|
controller: nameC,
|
|
|
|
maxLines: 1,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
decoration: InputDecoration(
|
|
|
|
contentPadding: EdgeInsets.only(
|
|
|
|
bottom: ScreenUtil()
|
|
|
|
.setWidth(40)), //设置文字内容与边框距离
|
|
|
|
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none),
|
|
|
|
hintText: '请输入',
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_66000000,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context).requestFocus(
|
|
|
|
FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
),
|
|
|
|
))
|
|
|
|
])),
|
|
|
|
VEmptyView(32),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(16)),
|
|
|
|
child: Row(children: [
|
|
|
|
Text(
|
|
|
|
'菜品数量',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_000000),
|
|
|
|
),
|
|
|
|
HEmptyView(24),
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(48 * 2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(8))),
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: w(12)),
|
|
|
|
child: TextField(
|
|
|
|
controller: numC,
|
|
|
|
maxLines: 1,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
decoration: InputDecoration(
|
|
|
|
contentPadding: EdgeInsets.only(
|
|
|
|
bottom: ScreenUtil()
|
|
|
|
.setWidth(40)), //设置文字内容与边框距离
|
|
|
|
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none),
|
|
|
|
hintText: '请输入',
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_66000000,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context).requestFocus(
|
|
|
|
FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
),
|
|
|
|
))
|
|
|
|
])),
|
|
|
|
VEmptyView(32),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(16)),
|
|
|
|
child: Row(children: [
|
|
|
|
Text(
|
|
|
|
pricetitle,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_000000),
|
|
|
|
),
|
|
|
|
HEmptyView(24),
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(48 * 2),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_f3f3f3,
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(8))),
|
|
|
|
padding:
|
|
|
|
EdgeInsets.symmetric(horizontal: w(12)),
|
|
|
|
child: TextField(
|
|
|
|
controller: perC,
|
|
|
|
maxLines: 1,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
decoration: InputDecoration(
|
|
|
|
contentPadding: EdgeInsets.only(
|
|
|
|
bottom: ScreenUtil()
|
|
|
|
.setWidth(40)), //设置文字内容与边框距离
|
|
|
|
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none),
|
|
|
|
hintText: '请输入',
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_66000000,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context).requestFocus(
|
|
|
|
FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
keyboardType: title == '新建套餐'
|
|
|
|
? TextInputType.numberWithOptions()
|
|
|
|
: TextInputType.text,
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
title == '新建套餐'
|
|
|
|
? Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(12)),
|
|
|
|
child: Text('元',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(16),
|
|
|
|
color: MyColours.color_000000)))
|
|
|
|
: SizedBox()
|
|
|
|
])),
|
|
|
|
VEmptyView(32),
|
|
|
|
Container(
|
|
|
|
height: w(48),
|
|
|
|
padding: EdgeInsets.only(left: w(16)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border(
|
|
|
|
bottom: BorderSide(
|
|
|
|
width: h(0.5),
|
|
|
|
color: MyColours.color_E7E7E7))),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
width: w(81),
|
|
|
|
height: w(48),
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
child: Text(
|
|
|
|
swichtitle,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_E6000000),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
state(() {
|
|
|
|
can = !can;
|
|
|
|
});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
left: w(16), right: w(16)),
|
|
|
|
child: Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
can ? 'swich_on' : 'swich_off'),
|
|
|
|
width: w(44),
|
|
|
|
))),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(64),
|
|
|
|
MyDivider(double.infinity, ScreenUtil().setWidth(2),
|
|
|
|
color: MyColours.color_f3f3f3),
|
|
|
|
Row(
|
|
|
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
RoundButton(
|
|
|
|
text: '取消',
|
|
|
|
width: (ScreenUtil().screenWidth -
|
|
|
|
ScreenUtil().setWidth(62) * 2) /
|
|
|
|
2,
|
|
|
|
height: ScreenUtil().setWidth(112),
|
|
|
|
// radius: ScreenUtil().setWidth(10),
|
|
|
|
gradientStart: Colors.transparent,
|
|
|
|
gradientEnd: Colors.transparent,
|
|
|
|
textColor: MyColours.color_E6000000,
|
|
|
|
isBold: false,
|
|
|
|
fontSize: 32,
|
|
|
|
onPressed: () {
|
|
|
|
Navigator.pop(context);
|
|
|
|
}),
|
|
|
|
MyDivider(ScreenUtil().setWidth(2),
|
|
|
|
ScreenUtil().setWidth(112),
|
|
|
|
color: MyColours.color_f3f3f3),
|
|
|
|
RoundButton(
|
|
|
|
text: '确定',
|
|
|
|
width: (ScreenUtil().screenWidth -
|
|
|
|
ScreenUtil().setWidth(62) * 2) /
|
|
|
|
2,
|
|
|
|
height: ScreenUtil().setWidth(112),
|
|
|
|
// radius: ScreenUtil().setWidth(10),
|
|
|
|
gradientStart: Colors.transparent,
|
|
|
|
gradientEnd: Colors.transparent,
|
|
|
|
textColor: MyColours.color_438E93,
|
|
|
|
fontSize: 32,
|
|
|
|
onPressed: () {
|
|
|
|
if (nameC.text.trim() == '') {
|
|
|
|
Utils.showToast('请输入${nametitle}!');
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (numC.text.trim() == '') {
|
|
|
|
Utils.showToast('请输入菜品数量!');
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (perC.text.trim() == '') {
|
|
|
|
Utils.showToast('请输入${pricetitle}!');
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
onTap({
|
|
|
|
'name': nameC.text,
|
|
|
|
'per': perC.text,
|
|
|
|
'num':numC.text,
|
|
|
|
'can': can ? '1' : '0'
|
|
|
|
});
|
|
|
|
Navigator.pop(context, {
|
|
|
|
'name': nameC.text,
|
|
|
|
'per': perC.text,
|
|
|
|
'can': can
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
));
|
|
|
|
});
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
//宴会---添加菜品
|
|
|
|
static Future feastSetmealEditDialog(
|
|
|
|
BuildContext context, {
|
|
|
|
CustomCallBackMap onTap,
|
|
|
|
String title = '菜品信息',
|
|
|
|
String nametitle = '菜品名称',
|
|
|
|
String pricetitle = '菜品规格',
|
|
|
|
String swichtitle = '是否可调菜',
|
|
|
|
String content = '',
|
|
|
|
String per = '',
|
|
|
|
bool can = true,
|
|
|
|
}) async {
|
|
|
|
TextEditingController nameC = TextEditingController();
|
...
|
...
|
|