|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.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/system_app_bar.dart';
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
|
|
|
|
import '../../../res/colors.dart';
|
|
|
|
import '../../../utils/screen_util.dart';
|
|
|
|
import '../../../widgets/round_button.dart';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 订座详情---预点菜入口
|
|
|
|
*/
|
|
|
|
|
|
|
|
class OrderAdvanceHomePage extends StatefulWidget {
|
|
|
|
OrderAdvanceHomePage({Key key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
_OrderAdvanceHomePageState createState() => _OrderAdvanceHomePageState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> {
|
|
|
|
TextEditingController noFoodController = TextEditingController();
|
|
|
|
TextEditingController likeController = TextEditingController();
|
|
|
|
|
|
|
|
TextEditingController serviceController = TextEditingController();
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
|
|
|
|
Widget _selectItem(String title, bool select, String hintText,
|
|
|
|
TextEditingController controller) {
|
|
|
|
return Row(
|
|
|
|
children: [
|
|
|
|
HEmptyView(86),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
select ? 'plan_dish_select' : 'plan_dish_unselect'),
|
|
|
|
width: w(20)),
|
|
|
|
HEmptyView(10),
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
style: TextStyle(fontSize: font(16), color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
HEmptyView(20),
|
|
|
|
select
|
|
|
|
? Expanded(
|
|
|
|
child: TextField(
|
|
|
|
maxLines: 1,
|
|
|
|
controller: controller,
|
|
|
|
// focusNode: _focusNode,
|
|
|
|
// autofocus: true,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_438E93, fontSize: font(14)),
|
|
|
|
textAlign: TextAlign.right,
|
|
|
|
textAlignVertical: TextAlignVertical.center,
|
|
|
|
decoration: InputDecoration(
|
|
|
|
hintText: hintText,
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_438E93,
|
|
|
|
fontSize: font(14),
|
|
|
|
),
|
|
|
|
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();
|
|
|
|
},
|
|
|
|
))
|
|
|
|
: SizedBox(),
|
|
|
|
select
|
|
|
|
? Text(
|
|
|
|
'元',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(16), color: MyColours.color_515151),
|
|
|
|
)
|
|
|
|
: SizedBox(),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
///忌口和喜好
|
|
|
|
Widget _textMulLine(
|
|
|
|
String title, String hintText, TextEditingController controller) {
|
|
|
|
return Container(
|
|
|
|
// height: ScreenUtil().setWidth(380),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
title,
|
|
|
|
textAlign: TextAlign.left,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_333333,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
),
|
|
|
|
HEmptyView(54),
|
|
|
|
Expanded(
|
|
|
|
child: TextField(
|
|
|
|
controller: controller,
|
|
|
|
// keyboardType: TextInputType.number, //键盘类型,数字键盘
|
|
|
|
maxLines: 2,
|
|
|
|
// maxLength: 50,
|
|
|
|
|
|
|
|
// maxLengthEnforced: true,
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
color: title == '喜好'
|
|
|
|
? MyColours.color_438E93
|
|
|
|
: title == '忌口'
|
|
|
|
? MyColours.color_E34D59
|
|
|
|
: MyColours.color_333333), //输入文本的样式
|
|
|
|
decoration: InputDecoration(
|
|
|
|
contentPadding:
|
|
|
|
EdgeInsets.symmetric(horizontal: w(11), vertical: w(8)),
|
|
|
|
hintText: hintText,
|
|
|
|
hintStyle: TextStyle(
|
|
|
|
color: MyColours.color_999999,
|
|
|
|
fontSize: ScreenUtil().setSp(28),
|
|
|
|
),
|
|
|
|
// 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 _cancelAndChangeBtn(GestureTapCallback onTap, String title,
|
|
|
|
{Color bgColor = MyColours.color_ffffff,
|
|
|
|
double width,
|
|
|
|
Color fontColor = MyColours.color_199095}) {
|
|
|
|
return InkWell(
|
|
|
|
onTap: onTap,
|
|
|
|
child: Container(
|
|
|
|
width: width,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: bgColor,
|
|
|
|
border: Border.all(
|
|
|
|
color: Colors.transparent, width: ScreenUtil().setWidth(2)),
|
|
|
|
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
),
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text(title,
|
|
|
|
style: TextStyle(
|
|
|
|
color: fontColor,
|
|
|
|
fontSize: title == '查看排菜单'
|
|
|
|
? ScreenUtil().setSp(32)
|
|
|
|
: ScreenUtil().setSp(36))),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return KeyboardDismissOnTap(
|
|
|
|
// dismissOnCapturedTaps: true,
|
|
|
|
child: Scaffold(
|
|
|
|
appBar: SystemAppBar('预点菜'),
|
|
|
|
backgroundColor: MyColours.color_ffffff,
|
|
|
|
body: Column(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: SingleChildScrollView(
|
|
|
|
// controller: controller,
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(horizontal: w(20)),
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
height: w(48),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'就餐时段',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(16),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Text(
|
|
|
|
'2022-11-08 午餐',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(16),
|
|
|
|
color: MyColours.color_99515151),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(1),
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
height: w(48),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'就餐人数',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(16),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
Spacer(),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('plan_dish_minus'),
|
|
|
|
width: w(16),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
width: w(50),
|
|
|
|
// 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();
|
|
|
|
},
|
|
|
|
)),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('plan_dish_add'),
|
|
|
|
width: w(16),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(24),
|
|
|
|
Text(
|
|
|
|
'用餐标准',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(16), color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
VEmptyView(48),
|
|
|
|
_selectItem('预计人均', false, '点击这里输入预计人均金额', null),
|
|
|
|
VEmptyView(30),
|
|
|
|
_selectItem('预计总价', true, '点击这里输入预计总金额', null),
|
|
|
|
VEmptyView(46),
|
|
|
|
MyDivider(
|
|
|
|
double.infinity,
|
|
|
|
w(1),
|
|
|
|
color: MyColours.color_DBDBDB,
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
padding: EdgeInsets.symmetric(vertical: w(10)),
|
|
|
|
child: Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
'客户偏好参考',
|
|
|
|
style: TextStyle(
|
|
|
|
fontSize: font(16),
|
|
|
|
color: MyColours.color_515151),
|
|
|
|
),
|
|
|
|
Image.asset(
|
|
|
|
Utils.getImgPath('merge_arrow'),
|
|
|
|
width: w(20),
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(32),
|
|
|
|
_textMulLine('喜好', '点这里输入客户喜好的东西,请用逗号隔开。', likeController),
|
|
|
|
VEmptyView(20),
|
|
|
|
_textMulLine('忌口', '点这里输入客户忌口的东西,请用逗号隔开。', noFoodController),
|
|
|
|
VEmptyView(20),
|
|
|
|
_textMulLine('服务', '点这里输入客户需要的服务,如安静的包间、远离厕所等,请用逗号隔开。', serviceController),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Column(children: [
|
|
|
|
Container(
|
|
|
|
// width: double.infinity,
|
|
|
|
height: ScreenUtil().setWidth(84),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
),
|
|
|
|
margin: EdgeInsets.symmetric(
|
|
|
|
vertical: ScreenUtil().setHeight(20),
|
|
|
|
horizontal: ScreenUtil().setHeight(40)),
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
flex: 1,
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// NavigatorUtil
|
|
|
|
// .goOrderAdvanceHomePage(
|
|
|
|
// context,
|
|
|
|
// );
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
margin:
|
|
|
|
EdgeInsets.only(right: ScreenUtil().setWidth(20)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
border: Border.all(
|
|
|
|
width: w(1), color: MyColours.color_438E93),
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(10)),
|
|
|
|
),
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text('客户自己点',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_438E93,
|
|
|
|
fontSize: ScreenUtil().setSp(32))),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Expanded(
|
|
|
|
flex: 2,
|
|
|
|
child: InkWell(
|
|
|
|
onTap: () {
|
|
|
|
// NavigatorUtil
|
|
|
|
// .goInvicationPage(
|
|
|
|
// context,
|
|
|
|
// detailEntity.id,
|
|
|
|
// );
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_199095,
|
|
|
|
borderRadius: BorderRadius.circular(
|
|
|
|
ScreenUtil().setWidth(10)),
|
|
|
|
),
|
|
|
|
child: Align(
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text('经理排菜',
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize: ScreenUtil().setSp(36))),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setWidth(84),
|
|
|
|
margin:
|
|
|
|
EdgeInsets.symmetric(horizontal: ScreenUtil().setHeight(40)),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
color:
|
|
|
|
true ? MyColours.color_999999 : MyColours.color_199095,
|
|
|
|
width: ScreenUtil().setWidth(2)),
|
|
|
|
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
|
|
|
|
),
|
|
|
|
// child: Text('fff'),
|
|
|
|
child: Material(
|
|
|
|
color: Colors.transparent,
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
Expanded(
|
|
|
|
child: _cancelAndChangeBtn(() {}, '查看排菜单',
|
|
|
|
fontColor: true
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_199095)),
|
|
|
|
MyDivider(
|
|
|
|
ScreenUtil().setWidth(2),
|
|
|
|
ScreenUtil().setWidth(50),
|
|
|
|
color: true
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_199095,
|
|
|
|
),
|
|
|
|
Expanded(
|
|
|
|
child: _cancelAndChangeBtn(() {
|
|
|
|
// if (userModel.user.role_name != '管理员' &&
|
|
|
|
// userModel.user.role_name != '店长' &&
|
|
|
|
// widget.uid != "null" &&
|
|
|
|
// widget.uid !=
|
|
|
|
// userModel.user.openid) {
|
|
|
|
// } else {
|
|
|
|
// _showCancelWidget(context);
|
|
|
|
// }
|
|
|
|
}, '分享排菜单',
|
|
|
|
fontColor: true
|
|
|
|
? MyColours.color_999999
|
|
|
|
: MyColours.color_199095)),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
),
|
|
|
|
VEmptyView(ScreenUtil().setWidth(60))
|
|
|
|
])
|
|
|
|
],
|
|
|
|
),
|
|
|
|
));
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|