|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:one_key/provider/plan_dish_provider.dart';
|
|
|
|
|
|
|
|
import '../../../res/colors.dart';
|
|
|
|
import '../../../utils/screen_util.dart';
|
|
|
|
import '../../../widgets/round_button.dart';
|
|
|
|
import '../../../widgets/system_app_bar.dart';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 我的排菜新建编辑页
|
|
|
|
*/
|
|
|
|
|
|
|
|
import 'package:common_utils/common_utils.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_picker/flutter_picker.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
|
|
import 'package:fluttertoast/fluttertoast.dart';
|
|
|
|
import 'package:one_key/provider/user_model.dart';
|
|
|
|
import 'package:one_key/res/colors.dart';
|
|
|
|
import 'package:one_key/utils/dialog_util.dart';
|
|
|
|
import 'package:one_key/utils/event_bus.dart';
|
|
|
|
import 'package:one_key/route/navigator_util.dart';
|
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
|
|
import 'package:one_key/widgets/MyDivider.dart';
|
|
|
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
import 'package:one_key/widgets/round_button.dart';
|
|
|
|
import 'package:one_key/widgets/system_app_bar.dart';
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 新建排菜
|
|
|
|
*/
|
|
|
|
|
|
|
|
class PlanDishEidtPage extends StatefulWidget {
|
|
|
|
final bool isMine;
|
|
|
|
PlanDishEidtPage({Key key, this.isMine = true}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_PlanDishEidtPageState createState() => _PlanDishEidtPageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _PlanDishEidtPageState extends State<PlanDishEidtPage> {
|
|
|
|
ScrollController controller = ScrollController();
|
|
|
|
TextEditingController _dishNameEditControl = TextEditingController();
|
|
|
|
TextEditingController _dishRequireEditControl = TextEditingController();
|
|
|
|
TextEditingController _dishExplainEditControl = TextEditingController();
|
|
|
|
final heightCell = ScreenUtil().setWidth(48 * 2);
|
|
|
|
bool swichState = true; //默认启用 开关状态
|
|
|
|
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
|
|
|
|
|
|
|
|
FocusNode _nameFocusNode = FocusNode();
|
|
|
|
FocusNode _requireFocusNode = FocusNode();
|
|
|
|
bool showDateSelWidget = false;
|
|
|
|
PlanDishProvider dishProvider;
|
|
|
|
bool swichHexiao = true; //默认启用 核销状态
|
|
|
|
String uids = '';
|
|
|
|
List labelList = ['店内通用套餐', '自定义排菜单'];
|
|
|
|
int labelSelIndex = 0;
|
|
|
|
String labelShow;
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
labelShow = labelList[labelSelIndex];
|
|
|
|
_nameFocusNode.addListener(() {
|
|
|
|
if (_nameFocusNode.hasFocus) {
|
|
|
|
//有焦点
|
|
|
|
if (showDateSelWidget) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
showDateSelWidget = false;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//失去焦点
|
|
|
|
// _editingController.text = '';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
_requireFocusNode.addListener(() {
|
|
|
|
if (_requireFocusNode.hasFocus) {
|
|
|
|
//有焦点
|
|
|
|
if (showDateSelWidget) {
|
|
|
|
Navigator.pop(context);
|
|
|
|
showDateSelWidget = false;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
//失去焦点
|
|
|
|
// _editingController.text = '';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
//创建新券 客户经理创建活动
|
|
|
|
_createNewdish() async {
|
|
|
|
// FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// Map<String, String> params = {
|
|
|
|
// "uid": Provider.of<UserModel>(context, listen: false).user.openid,
|
|
|
|
// "aname": _dishNameEditControl.text.trim(),
|
|
|
|
// "desc": _dishRequireEditControl.text.trim(),
|
|
|
|
// "stime": fromDate == '点击选择'
|
|
|
|
// ? ""
|
|
|
|
// : '${DateUtil.getDateMsByTimeStr(fromDate) / 1000}',
|
|
|
|
// "etime": endDate == '点击选择'
|
|
|
|
// ? ''
|
|
|
|
// : '${DateUtil.getDateMsByTimeStr(endDate) / 1000}',
|
|
|
|
// "explain": _dishExplainEditControl.text,
|
|
|
|
// "is_open": swichState ? "1" : "0",
|
|
|
|
// "status": swichState ? "1" : "0",
|
|
|
|
// 'is_type': widget.isMine ? "2" : "1"
|
|
|
|
// };
|
|
|
|
// if (!widget.isMine) {
|
|
|
|
// params['is_examine'] = swichHexiao ? "1" : "0";
|
|
|
|
// params['uid_list'] = uids;
|
|
|
|
// }
|
|
|
|
// bool isSuccess = await dishProvider.createCustomerActivity(context, params);
|
|
|
|
// if (isSuccess) {
|
|
|
|
// //成功之后跳回前一个页面
|
|
|
|
// // bus.emit('refresh_dish_list');
|
|
|
|
// EventBus().emit('refresh_dish_invitation');
|
|
|
|
// bus.emit('refresh_dish_list_f');
|
|
|
|
|
|
|
|
// bus.emit('refresh_table_m_dish');
|
|
|
|
// Navigator.pop(context, true);
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
|
|
|
|
///输入框
|
|
|
|
Widget _textfield(String title, String hintText) {
|
|
|
|
return Container(
|
|
|
|
height: w(48),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(80),
|
|
|
|
Expanded(
|
|
|
|
child: Container(
|
|
|
|
child: TextField(
|
|
|
|
controller: title.contains('排菜名称')
|
|
|
|
? _dishNameEditControl
|
|
|
|
: _dishRequireEditControl,
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
textAlignVertical: TextAlignVertical.bottom,
|
|
|
|
maxLines: 1,
|
|
|
|
// //光标颜色
|
|
|
|
// cursorColor:
|
|
|
|
// widget.isSelect ? Colors.white : MyColours.color_199095,
|
|
|
|
//输入文本的样式
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
),
|
|
|
|
focusNode:
|
|
|
|
title.contains('排菜名称') ? _nameFocusNode : _requireFocusNode,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
hintText: hintText,
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_99515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
),
|
|
|
|
enabledBorder: new UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
),
|
|
|
|
focusedBorder: new UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
keyboardType: TextInputType.text,
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///时间选择
|
|
|
|
Widget _select(String title, String hintText, GestureTapCallback onTap) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: onTap,
|
|
|
|
child: Container(
|
|
|
|
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
// height: ScreenUtil().setWidth(40),
|
|
|
|
// color: Colors.red,
|
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(20),
|
|
|
|
Spacer(),
|
|
|
|
Text(hintText,
|
|
|
|
style: TextStyle(
|
|
|
|
color: hintText == '点击选择'
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
)),
|
|
|
|
HEmptyView(20),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('arrow_right_new'),
|
|
|
|
width: ScreenUtil().setWidth(20),
|
|
|
|
),
|
|
|
|
// HEmptyView(32),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///券说明
|
|
|
|
Widget _explain(String title, String hintText) {
|
|
|
|
return Container(
|
|
|
|
// height: ScreenUtil().setWidth(380),
|
|
|
|
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(20)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
borderRadius: BorderRadius.circular(r(5)),
|
|
|
|
border: Border.all(width: w(1), color: MyColours.color_DBDBDB)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
// Align(
|
|
|
|
// alignment: Alignment.centerLeft,
|
|
|
|
// child: Text(
|
|
|
|
// title,
|
|
|
|
// textAlign: TextAlign.left,
|
|
|
|
// style: TextStyle(
|
|
|
|
// color: Color.fromRGBO(0, 0, 0, 0.9),
|
|
|
|
// fontWeight: FontWeight.bold,
|
|
|
|
// fontSize: ScreenUtil().setSp(32)),
|
|
|
|
// )),
|
|
|
|
// VEmptyView(26),
|
|
|
|
// Container(
|
|
|
|
// height: ScreenUtil().setWidth(2),
|
|
|
|
// color: MyColours.color_E7E7E7,
|
|
|
|
// ),
|
|
|
|
TextField(
|
|
|
|
controller: _dishExplainEditControl,
|
|
|
|
// keyboardType: TextInputType.number, //键盘类型,数字键盘
|
|
|
|
maxLines: 6,
|
|
|
|
enabled: false,
|
|
|
|
// maxLength: 50,
|
|
|
|
|
|
|
|
// maxLengthEnforced: true,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_999999), //输入文本的样式
|
|
|
|
decoration: InputDecoration(
|
|
|
|
contentPadding: EdgeInsets.all(ScreenUtil().setWidth(6)),
|
|
|
|
hintText: hintText,
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
),
|
|
|
|
|
|
|
|
border: OutlineInputBorder(borderSide: BorderSide.none),
|
|
|
|
|
|
|
|
enabledBorder: new UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
),
|
|
|
|
focusedBorder: new UnderlineInputBorder(
|
|
|
|
borderSide: BorderSide.none,
|
|
|
|
),
|
|
|
|
|
|
|
|
// fillColor: MyColours.color_F9F9F9,
|
|
|
|
// // fillColor: Colors.red,
|
|
|
|
// filled: true,
|
|
|
|
// enabledBorder: OutlineInputBorder(
|
|
|
|
// //未选中时候的颜色
|
|
|
|
// borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
// borderSide: BorderSide(
|
|
|
|
// color: MyColours.color_cccccc,
|
|
|
|
// width: ScreenUtil().setWidth(2)),
|
|
|
|
// ),
|
|
|
|
// focusedBorder: OutlineInputBorder(
|
|
|
|
// //选中时外边框颜色
|
|
|
|
// borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
// borderSide: BorderSide(
|
|
|
|
// color: MyColours.app_main,
|
|
|
|
// ),
|
|
|
|
// ),
|
|
|
|
// border: OutlineInputBorder(
|
|
|
|
// borderRadius:
|
|
|
|
// BorderRadius.circular(ScreenUtil().setWidth(20)),
|
|
|
|
// borderSide: BorderSide(
|
|
|
|
// color: Colors.red, width: ScreenUtil().setWidth(2))),
|
|
|
|
),
|
|
|
|
onChanged: (value) {},
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///是否立即启用
|
|
|
|
Widget _canUse(String title, bool swich, GestureTapCallback onTap) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: onTap,
|
|
|
|
child: Container(
|
|
|
|
height: w(48),
|
|
|
|
// padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(24)),
|
|
|
|
margin: EdgeInsets.only(top: ScreenUtil().setWidth(24)),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
// height: ScreenUtil().setWidth(40),
|
|
|
|
// color: Colors.red,
|
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Image.asset(
|
|
|
|
swich
|
|
|
|
? Utils.getImgPath('swich_on')
|
|
|
|
: Utils.getImgPath('swich_off'),
|
|
|
|
width: ScreenUtil().setWidth(44 * 2),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///
|
|
|
|
Widget _item(String title, String subTitle) {
|
|
|
|
return Container(
|
|
|
|
padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(28)),
|
|
|
|
margin: EdgeInsets.only(right: ScreenUtil().setWidth(32)),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: Color.fromRGBO(0, 0, 0, 0.9),
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
HEmptyView(60),
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
subTitle,
|
|
|
|
maxLines: 20,
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
color: Color.fromRGBO(0, 0, 0, 0.4),
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
),
|
|
|
|
))
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
dishProvider = Provider.of<PlanDishProvider>(context, listen: true);
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
key: scaffoldKey,
|
|
|
|
appBar: SystemAppBar(
|
|
|
|
'排菜详情',
|
|
|
|
onTap: () {
|
|
|
|
Navigator.pop(context, false);
|
|
|
|
},
|
|
|
|
),
|
|
|
|
body: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
child: Column(children: [
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
controller: controller,
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40)),
|
|
|
|
child: Column(
|
|
|
|
children: [
|
|
|
|
VEmptyView(40),
|
|
|
|
_textfield('排菜名称 *', '点击输入排菜套餐名称'),
|
|
|
|
MyDivider(double.infinity, w(1),
|
|
|
|
color: MyColours.color_DBDBDB),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(FocusNode()); //隐藏键盘
|
|
|
|
DialogUtil.showSelectCusmanDialog(
|
|
|
|
context,
|
|
|
|
labelList.map((item) {
|
|
|
|
return item.label;
|
|
|
|
}).toList(), (value) {
|
|
|
|
if (value != null) {
|
|
|
|
setState(() {
|
|
|
|
labelSelIndex = value.first;
|
|
|
|
labelShow =
|
|
|
|
labelList[labelSelIndex].label;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
selecteds: labelSelIndex == null
|
|
|
|
? []
|
|
|
|
: [labelSelIndex])
|
|
|
|
.then((value) {});
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
height: ScreenUtil().setWidth(48 * 2),
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
top: ScreenUtil().setWidth(24)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
// color: Colors.red,
|
|
|
|
width: ScreenUtil().setWidth(150),
|
|
|
|
// height: ScreenUtil().setWidth(35),
|
|
|
|
// height: ScreenUtil().setWidth(48),
|
|
|
|
child: Text(
|
|
|
|
'排菜类型',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(32),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: Text(
|
|
|
|
labelShow,
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
HEmptyView(10),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('c_arrow_down'),
|
|
|
|
width: ScreenUtil().setWidth(24),
|
|
|
|
// height: ScreenUtil().setWidth(10),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
MyDivider(double.infinity, w(1),
|
|
|
|
color: MyColours.color_DBDBDB),
|
|
|
|
_canUse('是否启用', swichState, () {
|
|
|
|
setState(() {
|
|
|
|
swichState = !swichState;
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
MyDivider(double.infinity, w(1),
|
|
|
|
color: MyColours.color_DBDBDB),
|
|
|
|
VEmptyView(24),
|
|
|
|
Container(
|
|
|
|
height: w(48),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
// height: ScreenUtil().setWidth(40),
|
|
|
|
// color: Colors.red,
|
|
|
|
child: Text(
|
|
|
|
'就餐人数',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('plan_dish_minus'),
|
|
|
|
width: w(16),
|
|
|
|
),
|
|
|
|
HEmptyView(46),
|
|
|
|
Container(
|
|
|
|
// constraints: BoxConstraints(
|
|
|
|
// minWidth: w(34),
|
|
|
|
// ),
|
|
|
|
width: w(34),
|
|
|
|
height: w(48),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
// borderRadius:
|
|
|
|
// BorderRadius.circular(r(5)),
|
|
|
|
// border: Border.all(
|
|
|
|
// width: w(1),
|
|
|
|
// color: MyColours.color_999999)
|
|
|
|
),
|
|
|
|
// constraints: BoxConstraints(minWidth: w(20)),
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
// controller:
|
|
|
|
// focusNode: _focusNode,
|
|
|
|
// autofocus: true,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_438E93,
|
|
|
|
fontSize: font(16)),
|
|
|
|
textAlign: TextAlign.center,
|
|
|
|
// textAlignVertical: TextAlignVertical.center,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: "人数",
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(16),
|
|
|
|
),
|
|
|
|
// isCollapsed:
|
|
|
|
// true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
),
|
|
|
|
keyboardType: TextInputType.number,
|
|
|
|
textInputAction:
|
|
|
|
TextInputAction.done,
|
|
|
|
|
|
|
|
onChanged: (value) {
|
|
|
|
// setState(() {});
|
|
|
|
// _searchSellerLocation();
|
|
|
|
// customerProvider.searchData(value);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context)
|
|
|
|
.requestFocus(
|
|
|
|
FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// contantShowModel.searchData(
|
|
|
|
// contantShowModel.controller.text);
|
|
|
|
// _searchSellerLocation();
|
|
|
|
// _focusNode.unfocus();
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
HEmptyView(46),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('plan_dish_add'),
|
|
|
|
width: w(16),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
MyDivider(double.infinity, w(1),
|
|
|
|
color: MyColours.color_DBDBDB),
|
|
|
|
VEmptyView(24),
|
|
|
|
Container(
|
|
|
|
height: w(48),
|
|
|
|
child: Row(children: [
|
|
|
|
Container(
|
|
|
|
// height: ScreenUtil().setWidth(40),
|
|
|
|
// color: Colors.red,
|
|
|
|
child: Text(
|
|
|
|
'菜单总价/会员总价',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Text(
|
|
|
|
'0元/0元',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_99515151,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
])),
|
|
|
|
MyDivider(double.infinity, w(1),
|
|
|
|
color: MyColours.color_DBDBDB),
|
|
|
|
VEmptyView(24),
|
|
|
|
Container(
|
|
|
|
height: w(48),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'排菜价格',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(16),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
HEmptyView(20),
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
// controller: controller,
|
|
|
|
// focusNode: _focusNode,
|
|
|
|
// autofocus: true,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_515151,
|
|
|
|
fontSize: font(16)),
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
textAlignVertical:
|
|
|
|
TextAlignVertical.center,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: '点击输入排菜套餐价格',
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: font(16),
|
|
|
|
),
|
|
|
|
isCollapsed:
|
|
|
|
true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
|
|
|
|
border: OutlineInputBorder(
|
|
|
|
borderSide: BorderSide.none),
|
|
|
|
contentPadding: EdgeInsets.zero,
|
|
|
|
),
|
|
|
|
keyboardType:
|
|
|
|
TextInputType.numberWithOptions(),
|
|
|
|
textInputAction: TextInputAction.done,
|
|
|
|
|
|
|
|
onChanged: (value) {
|
|
|
|
// setState(() {});
|
|
|
|
// _searchSellerLocation();
|
|
|
|
// customerProvider.searchData(value);
|
|
|
|
},
|
|
|
|
onEditingComplete: () {
|
|
|
|
FocusScope.of(context).requestFocus(
|
|
|
|
FocusNode()); //点击空白处隐藏键盘
|
|
|
|
// contantShowModel.searchData(
|
|
|
|
// contantShowModel.controller.text);
|
|
|
|
// _searchSellerLocation();
|
|
|
|
// _focusNode.unfocus();
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
Text(
|
|
|
|
'元',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(16),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
MyDivider(double.infinity, w(1),
|
|
|
|
color: MyColours.color_DBDBDB),
|
|
|
|
VEmptyView(24),
|
|
|
|
_select('菜品', '编辑', () async {
|
|
|
|
// Map temp =
|
|
|
|
// await NavigatorUtil.godishToPersonnalPage(
|
|
|
|
// context, uids);
|
|
|
|
// if (temp != null && temp['object'] != null) {
|
|
|
|
// uids = temp['object'];
|
|
|
|
// }
|
|
|
|
NavigatorUtil.goPlanNewDishPage(context);
|
|
|
|
}),
|
|
|
|
_explain('券说明', '点击上面右侧的“编辑”,开始选菜吧!'),
|
|
|
|
VEmptyView(20),
|
|
|
|
],
|
|
|
|
))),
|
|
|
|
),
|
|
|
|
VEmptyView(20),
|
|
|
|
RoundButton(
|
|
|
|
onPressed: () {
|
|
|
|
// if (_dishNameEditControl.text.trim().length == 0) {
|
|
|
|
// Utils.showToast('请填写券名称');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// if (_dishRequireEditControl.text.trim().length == 0) {
|
|
|
|
// Utils.showToast('请填写券要求');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// if (fromDate == '点击选择') {
|
|
|
|
// Utils.showToast('请选择有效期起始时间');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// if (endDate == '点击选择') {
|
|
|
|
// Utils.showToast('请选择有效期结束时间');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// if (DateUtil.getDateTime(endDate)
|
|
|
|
// .compareTo(DateUtil.getDateTime(fromDate)) <
|
|
|
|
// 0) {
|
|
|
|
// Utils.showToast('有效期结束时间不能早于起始时间');
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// // ***参数***
|
|
|
|
// // _dishNameEditControl.text
|
|
|
|
// // _dishRequireEditControl.text
|
|
|
|
// // fromDate
|
|
|
|
// // endDate
|
|
|
|
// // _dishExplainEditControl.text
|
|
|
|
// // swichState
|
|
|
|
_createNewdish();
|
|
|
|
},
|
|
|
|
text: '立即创建',
|
|
|
|
fontSize: 24,
|
|
|
|
isBold: false,
|
|
|
|
height: ScreenUtil().setWidth(37 * 2),
|
|
|
|
width: ScreenUtil().setWidth(130 * 2),
|
|
|
|
radius: ScreenUtil().setWidth(22),
|
|
|
|
),
|
|
|
|
VEmptyView(32)
|
|
|
|
]))),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|