Commit 01a2f7af04fa355bf767707ff2443d57ccf7c70e

Authored by wdn127929
1 parent b9da4fe3

宴会设置UI

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../../res/colors.dart';
import '../../../route/navigator_util.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/system_app_bar.dart';
/**
*
* 定金设置
*/
class FeastDepositManagePage extends StatefulWidget {
FeastDepositManagePage({Key key}) : super(key: key);
@override
_FeastDepositManagePageState createState() => _FeastDepositManagePageState();
}
class _FeastDepositManagePageState extends State<FeastDepositManagePage> {
bool canrReturn = true; //是否可退
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_438E93);
}
Widget feastManegeItem(String title, {GestureTapCallback onTap}) {
return InkWell(
onTap: onTap,
child: Container(
height: h(48),
margin: EdgeInsets.only(top: w(12)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: w(0.5), color: MyColours.color_E7E7E7))),
child: Row(
children: [
Text(
title,
style: TextStyle(
fontSize: font(16), color: MyColours.color_E5000000),
),
Spacer(),
Text(
'修改/添加',
style: TextStyle(
fontSize: font(16), color: MyColours.color_66000000),
),
HEmptyView(22),
Image.asset(
"assets/arrow_right_new.png",
width: ScreenUtil().setWidth(9 * 2),
height: ScreenUtil().setWidth(16 * 2),
),
HEmptyView(48),
],
),
));
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'定金设置',
needWhite: true,
bgColor: MyColours.color_438E93,
titleColor: MyColours.color_F6F6F6,
onTap: () {
Navigator.pop(context);
},
),
body: Padding(
padding: EdgeInsets.only(left: w(16)),
child: Column(
children: [
feastManegeItem('定金类型', onTap: () {
NavigatorUtil.goFeastDepositTypePage(context);
}),
Container(
height: w(48),
margin: EdgeInsets.only(top: w(12)),
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(
'是否议价',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_E5000000),
),
),
Spacer(),
InkWell(
onTap: () {
setState(() {
canrReturn = !canrReturn;
});
},
child: Container(
padding:
EdgeInsets.only(left: w(16), right: w(16)),
child: Image.asset(
Utils.getImgPath(
canrReturn ? 'swich_on' : 'swich_off'),
width: w(44),
))),
],
),
),
],
)));
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import '../../../res/colors.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/system_app_bar.dart';
/**
* 定金类型
*/
class FeastDepositTypePage extends StatefulWidget {
FeastDepositTypePage({Key key}) : super(key: key);
@override
_FeastDepositTypePageState createState() => _FeastDepositTypePageState();
}
class _FeastDepositTypePageState extends State<FeastDepositTypePage> {
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_438E93);
}
Widget buildFeastTypeHeader() {
return RoundButton(
onPressed: () async {
DialogUtil.textfeildAlertDialog(context,
title: '输入类型名称',
hintText: '请输入',
text: '',
lenghtLimit: false,
toast: '请输入类型名称', rCallback: (name) {
// _addCookbookClass(name, showLoading: true);
});
},
text: '添加一项',
fontSize: 32,
isBold: false,
height: h(32),
width: w(80),
margin: EdgeInsets.only(top: w(18), bottom: w(4)),
textColor: MyColours.color_438E93,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
radius: r(6),
);
}
Widget buildFeastTypeItem(String title) {
return Container(
height: h(48),
margin: EdgeInsets.only(top: w(12)),
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))),
child: Row(
children: [
Text(
title,
style:
TextStyle(fontSize: font(16), color: MyColours.color_E6000000),
),
Spacer(),
InkWell(
onTap: () {
DialogUtil.textfeildAlertDialog(context,
title: '输入类型名称',
hintText: '请输入',
text: '原来的内容',
lenghtLimit: true,
toast: '请输入类型名称', rCallback: (name) {
// _addCookbookClass(name, showLoading: true);
});
},
child: Text(
'修改',
style: TextStyle(
decoration: TextDecoration.underline,
fontSize: font(16),
color: MyColours.color_438E93),
)),
HEmptyView(32),
InkWell(
onTap: () {
//已经传到服务器,弹提醒窗口,是否删除
//修改之前有内容,则弹框
DialogUtil.cupertinoAlertDialogFeast(context,
rTitle: '删除',
title: "是否确认删除",
content: "酒水定金", lCallback: () {
print("取消");
}, rCallback: () {
print("确定");
// widget.deleteCallback(index);
});
},
child: Image.asset(
Utils.getImgPath(true ? 'f_delete_red_un' : 'f_delete_red'),
width: w(32),
height: w(32),
)),
HEmptyView(32),
],
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'定金类型',
needWhite: true,
bgColor: MyColours.color_438E93,
titleColor: MyColours.color_F6F6F6,
onTap: () {
Navigator.pop(context);
},
),
body: NestedScrollView(
// controller: _scrollViewController,
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
pinned: true,
floating: false,
leading: null,
backgroundColor: MyColours.color_ffffff,
expandedHeight: ScreenUtil().setWidth(56 * 2),
automaticallyImplyLeading: false,
title: buildFeastTypeHeader(),
// flexibleSpace: FlexibleSpaceBar(
// collapseMode: CollapseMode.pin,
// title: buildFeastTypeHeader())
)
];
},
body: ListView.builder(
itemCount: 100,
padding: EdgeInsets.only(left: w(16)),
itemBuilder: (BuildContext context, int index) {
return buildFeastTypeItem('酒水定金');
}),
),
);
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import '../../../res/colors.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/system_app_bar.dart';
/**
* 菜品
*/
class FeastDishPage extends StatefulWidget {
FeastDishPage({Key key}) : super(key: key);
@override
_FeastDishPageState createState() => _FeastDishPageState();
}
class _FeastDishPageState extends State<FeastDishPage> {
ScrollController controller = ScrollController();
TextEditingController typeNameC = TextEditingController(); //分类名称
FocusNode typeF = FocusNode();
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_438E93);
}
Widget buildFeastTypeHeader() {
return RoundButton(
onPressed: () async {
NavigatorUtil.goFeastSetmealManageEditPage(context);
},
text: '添加一项',
fontSize: 32,
isBold: false,
height: h(32),
width: w(80),
margin: EdgeInsets.only(top: w(18), bottom: w(4)),
textColor: MyColours.color_438E93,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
radius: r(6),
);
}
Widget buildFeastTypeItem() {
return Container(
margin: EdgeInsets.only(bottom: w(12)),
child: Row(
children: [
Container(
width: w(120),
child: Text(
'鱼香肉丝',
style: TextStyle(
fontSize: font(16), color: MyColours.color_E6000000),
)),
HEmptyView(16),
Container(
width: w(36),
child: Text(
'份',
style: TextStyle(
fontSize: font(16), color: MyColours.color_515151),
)),
HEmptyView(16),
Container(
width: w(80),
child: Text(
'可调菜/不可调菜',
style: TextStyle(
fontSize: font(16),
color:
true ? MyColours.color_00A870 : MyColours.color_E34D59),
)),
Spacer(),
InkWell(
onTap: () {
FocusScope.of(context).requestFocus(FocusNode());
DialogUtil.feastDishEditDialog(context, onTap: (Map map) {
String per = map['per'];
String name = map['name'];
String can = map['can'];
print(can);
});
},
child: Text(
'修改',
style: TextStyle(
decoration: TextDecoration.underline,
fontSize: font(16),
color: MyColours.color_438E93),
)),
HEmptyView(24),
InkWell(
onTap: () {
//已经传到服务器,弹提醒窗口,是否删除
//修改之前有内容,则弹框
DialogUtil.cupertinoAlertDialogFeast(context,
rTitle: '删除',
title: "是否确认删除",
content: "鱼香肉丝", lCallback: () {
print("取消");
}, rCallback: () {
print("确定");
// widget.deleteCallback(index);
});
},
child: Image.asset(
Utils.getImgPath(true ? 'f_delete_red_un' : 'f_delete_red'),
width: w(24),
height: w(24),
)),
HEmptyView(24),
],
),
);
}
Widget _textfield(
String title,
String hintText,
TextEditingController editingController,
FocusNode focusNode,
String subTitle,
{TextInputType inputType = TextInputType.number}) {
return Container(
height: w(48),
margin: EdgeInsets.only(top: w(12)),
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.center,
child: Text(
title,
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_E5000000),
),
),
HEmptyView(32),
Expanded(
child: Container(
// height: ScreenUtil().setHeight(120),
height: w(48),
padding: EdgeInsets.only(top: w(4)),
child: TextField(
controller: editingController,
// textAlign: TextAlign.right,
// textAlignVertical: TextAlignVertical.bottom,
maxLines: 1,
inputFormatters: [],
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_515151),
focusNode: focusNode,
decoration: InputDecoration(
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: hintText,
hintStyle: TextStyle(
color: hintText == '请输入'
? MyColours.color_999999
: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32),
),
contentPadding: EdgeInsets.zero,
),
onChanged: (value) {
typeNameC.text = value;
setState(() {});
},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: inputType,
)),
),
HEmptyView(24)
// Spacer(),
// Container(
// padding: EdgeInsets.only(left: w(16), right: w(12)),
// child: Text(
// subTitle,
// style: TextStyle(
// color: MyColours.color_000000,
// fontSize: ScreenUtil().setSp(32)),
// ),
// ),
],
),
);
}
Widget _callButton(
{GestureTapCallback onPress,
content,
hasLeftBorder = true,
isSelect = false}) {
return InkWell(
onTap: onPress,
child: Container(
height: h(48),
decoration: BoxDecoration(
color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff,
border: Border(
bottom: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
top: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
left: hasLeftBorder
? BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2))
: BorderSide.none,
right: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)))),
child: Align(
alignment: Alignment.center,
child: Text(
content,
style: TextStyle(
color:
isSelect ? MyColours.color_F6F6F6 : MyColours.color_438E93,
fontSize: ScreenUtil().setSp(36)),
),
),
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
typeNameC.text,
needWhite: true,
bgColor: MyColours.color_438E93,
titleColor: MyColours.color_F6F6F6,
onTap: () {
Navigator.pop(context);
},
),
body: Column(
children: [
Expanded(
child: SingleChildScrollView(
controller: controller,
child: Padding(
padding: EdgeInsets.only(left: w(16)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_textfield('分类名称', '热菜', typeNameC, typeF, ''),
buildFeastTypeHeader(),
VEmptyView(54),
ListView.builder(
itemCount: 100,
shrinkWrap: true,
controller: controller,
itemBuilder: (BuildContext context, int index) {
return buildFeastTypeItem();
}),
],
)),
)),
Row(
children: [
Expanded(
child: _callButton(
onPress: () {
Navigator.pop(context);
},
content: '返回',
hasLeftBorder: true,
isSelect: false)),
Expanded(
child: _callButton(
onPress: () {},
content: '保存',
hasLeftBorder: true,
isSelect: true))
],
)
],
));
}
}
... ...
... ... @@ -35,7 +35,7 @@ class _FeastManageHomePageState extends State<FeastManageHomePage> {
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(width: w(1), color: MyColours.color_E7E7E7))),
BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))),
child: Row(
children: [
Text(
... ... @@ -85,10 +85,18 @@ class _FeastManageHomePageState extends State<FeastManageHomePage> {
feastManegeItem('宴会员工', onTap: () {
NavigatorUtil.goFeastPersonalPage(context);
}),
feastManegeItem('套餐管理'),
feastManegeItem('酒水管理'),
feastManegeItem('其他配置管理'),
feastManegeItem('定金设置'),
feastManegeItem('套餐管理', onTap: () {
NavigatorUtil.goFeastSetmealManagePage(context);
}),
feastManegeItem('酒水管理', onTap: () {
NavigatorUtil.goFeastWineManagePage(context);
}),
feastManegeItem('其他配置管理', onTap: () {
NavigatorUtil.goFeastOthersetManagePage(context);
}),
feastManegeItem('定金设置', onTap: () {
NavigatorUtil.goFeastDepositManagePage(context);
}),
],
),
),
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import '../../../res/colors.dart';
import '../../../route/navigator_util.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/system_app_bar.dart';
/**
* 其他配置添加
*/
class FeastOthersetManageEditPage extends StatefulWidget {
final isCreate;
FeastOthersetManageEditPage({
Key key,
this.isCreate = true,
}) : super(key: key);
@override
_FeastOthersetManageEditPageState createState() =>
_FeastOthersetManageEditPageState();
}
class _FeastOthersetManageEditPageState extends State<FeastOthersetManageEditPage> {
TextEditingController othersetNameC = TextEditingController(); //其他配置名称
FocusNode othersetF = FocusNode();
TextEditingController othersetPriceC = TextEditingController(); //其他配置价格
FocusNode othersetPriceF = FocusNode();
TextEditingController othersetPerC = TextEditingController(); //其他配置规格
FocusNode othersetPerF = FocusNode();
bool canBargaining = true; //是否议价
ScrollController controller = ScrollController();
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_438E93);
}
///请输入
///输入框
Widget _textfield(
String title,
String hintText,
TextEditingController editingController,
FocusNode focusNode,
String subTitle,
{TextInputType inputType = TextInputType.number}) {
return Container(
height: w(48),
margin: EdgeInsets.only(top: w(12)),
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.center,
child: Text(
title,
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_E5000000),
),
),
HEmptyView(32),
Expanded(
child: Container(
// height: ScreenUtil().setHeight(120),
height: w(48),
padding: EdgeInsets.only(top: w(4)),
child: TextField(
controller: editingController,
// textAlign: TextAlign.right,
// textAlignVertical: TextAlignVertical.bottom,
maxLines: 1,
inputFormatters: [],
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_515151),
focusNode: focusNode,
decoration: InputDecoration(
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: hintText,
hintStyle: TextStyle(
color: hintText == '请输入'
? MyColours.color_999999
: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32),
),
contentPadding: EdgeInsets.zero,
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: inputType,
)),
),
Container(
padding: EdgeInsets.only(left: w(16), right: w(12)),
child: Text(
subTitle,
style: TextStyle(
color: MyColours.color_000000,
fontSize: ScreenUtil().setSp(32)),
),
),
],
),
);
}
Widget _callButton(
{GestureTapCallback onPress,
content,
hasLeftBorder = true,
isSelect = false}) {
return InkWell(
onTap: onPress,
child: Container(
height: h(48),
decoration: BoxDecoration(
color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff,
border: Border(
bottom: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
top: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
left: hasLeftBorder
? BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2))
: BorderSide.none,
right: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)))),
child: Align(
alignment: Alignment.center,
child: Text(
content,
style: TextStyle(
color:
isSelect ? MyColours.color_F6F6F6 : MyColours.color_438E93,
fontSize: ScreenUtil().setSp(36)),
),
),
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
widget.isCreate ? '添加其他配置' : othersetNameC.text,
needWhite: true,
bgColor: MyColours.color_438E93,
titleColor: MyColours.color_F6F6F6,
onTap: () {
Navigator.pop(context);
},
),
body: Column(
children: [
Expanded(
child: Padding(
padding: EdgeInsets.only(
left: w(16),
),
child: SingleChildScrollView(
controller: controller,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_textfield(
'配置名称', '剑南春52度500ml', othersetNameC, othersetF, ''),
_textfield(
'配置单价', '1299', othersetPriceC, othersetPriceF, '元'),
_textfield('配置规格', '份', othersetPerC, othersetPerF, ''),
Container(
height: w(48),
margin: EdgeInsets.only(top: w(12)),
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.center,
child: Text(
'是否议价',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_E5000000),
),
),
Spacer(),
InkWell(
onTap: () {
setState(() {
canBargaining = !canBargaining;
});
},
child: Container(
padding: EdgeInsets.only(
left: w(16), right: w(16)),
child: Image.asset(
Utils.getImgPath(canBargaining
? 'swich_on'
: 'swich_off'),
width: w(44),
))),
],
),
),
],
)))),
Row(
children: [
Expanded(
child: _callButton(
onPress: () {
Navigator.pop(context);
},
content: '返回',
hasLeftBorder: true,
isSelect: false)),
Expanded(
child: _callButton(
onPress: () {},
content: '保存',
hasLeftBorder: true,
isSelect: true))
],
)
],
));
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import '../../../res/colors.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/system_app_bar.dart';
/**
* 其他配置管理
*/
class FeastOthersetManagePage extends StatefulWidget {
FeastOthersetManagePage({Key key}) : super(key: key);
@override
_FeastOthersetManagePageState createState() =>
_FeastOthersetManagePageState();
}
class _FeastOthersetManagePageState extends State<FeastOthersetManagePage> {
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_438E93);
}
Widget buildFeastTypeHeader() {
return RoundButton(
onPressed: () async {
NavigatorUtil.goFeastOthersetManageEditPage(context);
},
text: '添加一项',
fontSize: 32,
isBold: false,
height: h(32),
width: w(80),
margin: EdgeInsets.only(top: w(18), bottom: w(4)),
textColor: MyColours.color_438E93,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
radius: r(6),
);
}
Widget buildFeastTypeItem(String title, String subTitle) {
return Container(
height: h(48),
margin: EdgeInsets.only(top: w(12)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))),
child: Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontSize: font(16), color: MyColours.color_E6000000),
),
VEmptyView(12),
Text(
subTitle,
style: TextStyle(
fontSize: font(12), color: MyColours.color_999999),
)
],
),
Spacer(),
InkWell(
onTap: () {
NavigatorUtil.goFeastOthersetManageEditPage(context);
},
child: Text(
'修改',
style: TextStyle(
decoration: TextDecoration.underline,
fontSize: font(16),
color: MyColours.color_438E93),
)),
HEmptyView(32),
InkWell(
onTap: () {
//已经传到服务器,弹提醒窗口,是否删除
//修改之前有内容,则弹框
DialogUtil.cupertinoAlertDialogFeast(context,
rTitle: '删除',
title: "是否确认删除",
content: "LED大屏", lCallback: () {
print("取消");
}, rCallback: () {
print("确定");
// widget.deleteCallback(index);
});
},
child: Image.asset(
Utils.getImgPath(true ? 'f_delete_red_un' : 'f_delete_red'),
width: w(32),
height: w(32),
)),
HEmptyView(32),
],
),
);
}
Widget _callButton(
{GestureTapCallback onPress,
content,
hasLeftBorder = true,
isSelect = false}) {
return InkWell(
onTap: onPress,
child: Container(
height: h(48),
decoration: BoxDecoration(
color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff,
border: Border(
bottom: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
top: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
left: hasLeftBorder
? BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2))
: BorderSide.none,
right: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)))),
child: Align(
alignment: Alignment.center,
child: Text(
content,
style: TextStyle(
color:
isSelect ? MyColours.color_F6F6F6 : MyColours.color_438E93,
fontSize: ScreenUtil().setSp(36)),
),
),
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'其他配置管理',
needWhite: true,
bgColor: MyColours.color_438E93,
titleColor: MyColours.color_F6F6F6,
onTap: () {
Navigator.pop(context);
},
),
body: Column(
children: [
Expanded(
child: NestedScrollView(
// controller: _scrollViewController,
headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
pinned: true,
floating: false,
leading: null,
backgroundColor: MyColours.color_ffffff,
expandedHeight: ScreenUtil().setWidth(56 * 2),
automaticallyImplyLeading: false,
title: buildFeastTypeHeader(),
// flexibleSpace: FlexibleSpaceBar(
// collapseMode: CollapseMode.pin,
// title: buildFeastTypeHeader())
)
];
},
body: ListView.builder(
itemCount: 100,
padding: EdgeInsets.only(left: w(16)),
itemBuilder: (BuildContext context, int index) {
return buildFeastTypeItem('LED大屏', '1100元/次 不可议价');
}),
)),
Row(
children: [
Expanded(
child: _callButton(
onPress: () {
Navigator.pop(context);
},
content: '返回',
hasLeftBorder: true,
isSelect: false)),
Expanded(
child: _callButton(
onPress: () {},
content: '保存',
hasLeftBorder: true,
isSelect: true))
],
)
],
),
);
}
}
... ...
... ... @@ -84,7 +84,7 @@ class _FeastPersonalPageState extends State<FeastPersonalPage> {
padding: EdgeInsets.only(left: w(32)),
child: MyDivider(
double.infinity,
w(1),
w(0.5),
color: MyColours.color_E7E7E7,
))
],
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import '../../../res/colors.dart';
import '../../../route/navigator_util.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/system_app_bar.dart';
/**
* 套餐添加
*/
class FeastSetmealManageEditPage extends StatefulWidget {
final isCreate;
FeastSetmealManageEditPage({
Key key,
this.isCreate = true,
}) : super(key: key);
@override
_FeastSetmealManageEditPageState createState() =>
_FeastSetmealManageEditPageState();
}
class _FeastSetmealManageEditPageState
extends State<FeastSetmealManageEditPage> {
TextEditingController mealNameC = TextEditingController(); //套餐名称
FocusNode mealF = FocusNode();
TextEditingController mealPriceC = TextEditingController(); //套餐价格
FocusNode mealPriceF = FocusNode();
bool canBargaining = true; //是否议价
ScrollController controller = ScrollController();
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_438E93);
}
///请输入
///输入框
Widget _textfield(
String title,
String hintText,
TextEditingController editingController,
FocusNode focusNode,
String subTitle,
{TextInputType inputType = TextInputType.number}) {
return Container(
height: w(48),
margin: EdgeInsets.only(top: w(12)),
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.center,
child: Text(
title,
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_E5000000),
),
),
HEmptyView(32),
Expanded(
child: Container(
// height: ScreenUtil().setHeight(120),
height: w(48),
padding: EdgeInsets.only(top: w(4)),
child: TextField(
controller: editingController,
// textAlign: TextAlign.right,
// textAlignVertical: TextAlignVertical.bottom,
maxLines: 1,
inputFormatters: [],
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_515151),
focusNode: focusNode,
decoration: InputDecoration(
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: hintText,
hintStyle: TextStyle(
color: hintText == '请输入'
? MyColours.color_999999
: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32),
),
contentPadding: EdgeInsets.zero,
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: inputType,
)),
),
Spacer(),
Container(
padding: EdgeInsets.only(left: w(16), right: w(12)),
child: Text(
subTitle,
style: TextStyle(
color: MyColours.color_000000,
fontSize: ScreenUtil().setSp(32)),
),
),
],
),
);
}
Widget buildFeastTypeItem(String title) {
return Container(
height: h(48),
margin: EdgeInsets.only(bottom: w(12)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))),
child: Row(
children: [
Text(
title,
style:
TextStyle(fontSize: font(16), color: MyColours.color_E5000000),
),
Spacer(),
InkWell(
onTap: () {
NavigatorUtil.goFeastDishPage(context);
},
child: Text(
'修改',
style: TextStyle(
decoration: TextDecoration.underline,
fontSize: font(16),
color: MyColours.color_438E93),
)),
HEmptyView(32),
InkWell(
onTap: () {
//已经传到服务器,弹提醒窗口,是否删除
//修改之前有内容,则弹框
DialogUtil.cupertinoAlertDialogFeast(context,
rTitle: '删除',
title: "是否确认删除",
content: "热菜(18道)", lCallback: () {
print("取消");
}, rCallback: () {
print("确定");
// widget.deleteCallback(index);
});
},
child: Image.asset(
Utils.getImgPath(true ? 'f_delete_red_un' : 'f_delete_red'),
width: w(32),
height: w(32),
)),
HEmptyView(32),
],
),
);
}
Widget _callButton(
{GestureTapCallback onPress,
content,
hasLeftBorder = true,
isSelect = false}) {
return InkWell(
onTap: onPress,
child: Container(
height: h(48),
decoration: BoxDecoration(
color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff,
border: Border(
bottom: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
top: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
left: hasLeftBorder
? BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2))
: BorderSide.none,
right: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)))),
child: Align(
alignment: Alignment.center,
child: Text(
content,
style: TextStyle(
color:
isSelect ? MyColours.color_F6F6F6 : MyColours.color_438E93,
fontSize: ScreenUtil().setSp(36)),
),
),
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
widget.isCreate ? '添加套餐' : mealNameC.text,
needWhite: true,
bgColor: MyColours.color_438E93,
titleColor: MyColours.color_F6F6F6,
onTap: () {
Navigator.pop(context);
},
),
body: Column(
children: [
Expanded(
child: Padding(
padding: EdgeInsets.only(
left: w(16),
),
child: SingleChildScrollView(
controller: controller,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_textfield('套餐名称', '1299套餐', mealNameC, mealF, ''),
_textfield(
'套餐价格', '1299', mealPriceC, mealPriceF, '元'),
Container(
height: w(48),
margin: EdgeInsets.only(top: w(12)),
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.center,
child: Text(
'是否议价',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_E5000000),
),
),
Spacer(),
InkWell(
onTap: () {
setState(() {
canBargaining = !canBargaining;
});
},
child: Container(
padding: EdgeInsets.only(
left: w(16), right: w(16)),
child: Image.asset(
Utils.getImgPath(canBargaining
? 'swich_on'
: 'swich_off'),
width: w(44),
))),
],
),
),
VEmptyView(52),
Text(
'套餐菜品',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_999999),
),
VEmptyView(30),
RoundButton(
onPressed: () async {
DialogUtil.textfeildAlertDialog(context,
title: '菜品分类',
hintText: '输入分类名称',
text: '',
lenghtLimit: false,
toast: '请输入分类名称', rCallback: (name) {
// _addCookbookClass(name, showLoading: true);
});
},
text: '添加菜品分类',
fontSize: 32,
isBold: false,
height: h(32),
width: w(112),
textColor: MyColours.color_438E93,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
radius: r(6),
),
VEmptyView(14),
ListView.builder(
itemCount: 100,
shrinkWrap: true,
controller: controller,
itemBuilder: (BuildContext context, int index) {
return buildFeastTypeItem('热菜(18道)');
})
],
)))),
Row(
children: [
Expanded(
child: _callButton(
onPress: () {
Navigator.pop(context);
},
content: '返回',
hasLeftBorder: true,
isSelect: false)),
Expanded(
child: _callButton(
onPress: () {},
content: '保存',
hasLeftBorder: true,
isSelect: true))
],
)
],
));
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import '../../../res/colors.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/system_app_bar.dart';
/**
* 套餐管理
*/
class FeastSetmealManagePage extends StatefulWidget {
FeastSetmealManagePage({Key key}) : super(key: key);
@override
_FeastSetmealManagePageState createState() => _FeastSetmealManagePageState();
}
class _FeastSetmealManagePageState extends State<FeastSetmealManagePage> {
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_438E93);
}
Widget buildFeastTypeHeader() {
return RoundButton(
onPressed: () async {
NavigatorUtil.goFeastSetmealManageEditPage(context);
},
text: '添加一项',
fontSize: 32,
isBold: false,
height: h(32),
width: w(80),
margin: EdgeInsets.only(top: w(18), bottom: w(4)),
textColor: MyColours.color_438E93,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
radius: r(6),
);
}
Widget buildFeastTypeItem(String title, String subTitle) {
return Container(
height: h(48),
margin: EdgeInsets.only(top: w(12)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(width:w(0.5), color: MyColours.color_E7E7E7))),
child: Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontSize: font(16), color: MyColours.color_E6000000),
),
VEmptyView(12),
Text(
subTitle,
style: TextStyle(
fontSize: font(12), color: MyColours.color_999999),
)
],
),
Spacer(),
InkWell(
onTap: () {
NavigatorUtil.goFeastSetmealManageEditPage(context);
},
child: Text(
'修改',
style: TextStyle(
decoration: TextDecoration.underline,
fontSize: font(16),
color: MyColours.color_438E93),
)),
HEmptyView(32),
InkWell(
onTap: () {
//已经传到服务器,弹提醒窗口,是否删除
//修改之前有内容,则弹框
DialogUtil.cupertinoAlertDialogFeast(context,
rTitle: '删除',
title: "是否确认删除",
content: "1299套餐", lCallback: () {
print("取消");
}, rCallback: () {
print("确定");
// widget.deleteCallback(index);
});
},
child: Image.asset(
Utils.getImgPath(true ? 'f_delete_red_un' : 'f_delete_red'),
width: w(32),
height: w(32),
)),
HEmptyView(32),
],
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'套餐管理',
needWhite: true,
bgColor: MyColours.color_438E93,
titleColor: MyColours.color_F6F6F6,
onTap: () {
Navigator.pop(context);
},
),
body: NestedScrollView(
// controller: _scrollViewController,
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
pinned: true,
floating: false,
leading: null,
backgroundColor: MyColours.color_ffffff,
expandedHeight: ScreenUtil().setWidth(56 * 2),
automaticallyImplyLeading: false,
title: buildFeastTypeHeader(),
// flexibleSpace: FlexibleSpaceBar(
// collapseMode: CollapseMode.pin,
// title: buildFeastTypeHeader())
)
];
},
body: ListView.builder(
itemCount: 100,
padding: EdgeInsets.only(left: w(16)),
itemBuilder: (BuildContext context, int index) {
return buildFeastTypeItem('1299套餐', '1499元 不可议价');
}),
),
);
}
}
... ...
... ... @@ -59,7 +59,7 @@ class _FeastTypePageState extends State<FeastTypePage> {
margin: EdgeInsets.only(top: w(12)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(width: w(1), color: MyColours.color_E7E7E7))),
bottom: BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))),
child: Row(
children: [
Text(
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import '../../../res/colors.dart';
import '../../../route/navigator_util.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/system_app_bar.dart';
/**
* 酒水添加
*/
class FeastWineManageEditPage extends StatefulWidget {
final isCreate;
FeastWineManageEditPage({
Key key,
this.isCreate = true,
}) : super(key: key);
@override
_FeastWineManageEditPageState createState() =>
_FeastWineManageEditPageState();
}
class _FeastWineManageEditPageState extends State<FeastWineManageEditPage> {
TextEditingController wineNameC = TextEditingController(); //酒水名称
FocusNode wineF = FocusNode();
TextEditingController winePriceC = TextEditingController(); //酒水价格
FocusNode winePriceF = FocusNode();
TextEditingController winePerC = TextEditingController(); //酒水规格
FocusNode winePerF = FocusNode();
bool canBargaining = true; //是否议价
ScrollController controller = ScrollController();
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_438E93);
}
///请输入
///输入框
Widget _textfield(
String title,
String hintText,
TextEditingController editingController,
FocusNode focusNode,
String subTitle,
{TextInputType inputType = TextInputType.number}) {
return Container(
height: w(48),
margin: EdgeInsets.only(top: w(12)),
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.center,
child: Text(
title,
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_E5000000),
),
),
HEmptyView(32),
Expanded(
child: Container(
// height: ScreenUtil().setHeight(120),
height: w(48),
padding: EdgeInsets.only(top: w(4)),
child: TextField(
controller: editingController,
// textAlign: TextAlign.right,
// textAlignVertical: TextAlignVertical.bottom,
maxLines: 1,
inputFormatters: [],
// //光标颜色
// cursorColor:
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_515151),
focusNode: focusNode,
decoration: InputDecoration(
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: hintText,
hintStyle: TextStyle(
color: hintText == '请输入'
? MyColours.color_999999
: MyColours.color_515151,
fontSize: ScreenUtil().setSp(32),
),
contentPadding: EdgeInsets.zero,
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context)
.requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: inputType,
)),
),
Container(
padding: EdgeInsets.only(left: w(16), right: w(12)),
child: Text(
subTitle,
style: TextStyle(
color: MyColours.color_000000,
fontSize: ScreenUtil().setSp(32)),
),
),
],
),
);
}
Widget _callButton(
{GestureTapCallback onPress,
content,
hasLeftBorder = true,
isSelect = false}) {
return InkWell(
onTap: onPress,
child: Container(
height: h(48),
decoration: BoxDecoration(
color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff,
border: Border(
bottom: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
top: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
left: hasLeftBorder
? BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2))
: BorderSide.none,
right: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)))),
child: Align(
alignment: Alignment.center,
child: Text(
content,
style: TextStyle(
color:
isSelect ? MyColours.color_F6F6F6 : MyColours.color_438E93,
fontSize: ScreenUtil().setSp(36)),
),
),
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
widget.isCreate ? '添加酒水' : wineNameC.text,
needWhite: true,
bgColor: MyColours.color_438E93,
titleColor: MyColours.color_F6F6F6,
onTap: () {
Navigator.pop(context);
},
),
body: Column(
children: [
Expanded(
child: Padding(
padding: EdgeInsets.only(
left: w(16),
),
child: SingleChildScrollView(
controller: controller,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_textfield(
'酒水名称', '剑南春52度500ml', wineNameC, wineF, ''),
_textfield(
'酒水单价', '1299', winePriceC, winePriceF, '元'),
_textfield('酒水规格', '份', winePerC, winePerF, ''),
Container(
height: w(48),
margin: EdgeInsets.only(top: w(12)),
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.center,
child: Text(
'是否议价',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_E5000000),
),
),
Spacer(),
InkWell(
onTap: () {
setState(() {
canBargaining = !canBargaining;
});
},
child: Container(
padding: EdgeInsets.only(
left: w(16), right: w(16)),
child: Image.asset(
Utils.getImgPath(canBargaining
? 'swich_on'
: 'swich_off'),
width: w(44),
))),
],
),
),
],
)))),
Row(
children: [
Expanded(
child: _callButton(
onPress: () {
Navigator.pop(context);
},
content: '返回',
hasLeftBorder: true,
isSelect: false)),
Expanded(
child: _callButton(
onPress: () {},
content: '保存',
hasLeftBorder: true,
isSelect: true))
],
)
],
));
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import '../../../res/colors.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/screen_util.dart';
import '../../../utils/utils.dart';
import '../../../widgets/h_empty_view.dart';
import '../../../widgets/round_button.dart';
import '../../../widgets/system_app_bar.dart';
/**
* 酒水管理
*/
class FeastWineManagePage extends StatefulWidget {
FeastWineManagePage({Key key}) : super(key: key);
@override
_FeastWineManagePageState createState() => _FeastWineManagePageState();
}
class _FeastWineManagePageState extends State<FeastWineManagePage> {
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_438E93);
}
Widget buildFeastTypeHeader() {
return RoundButton(
onPressed: () async {
NavigatorUtil.goFeastWineManageEditPage(context);
},
text: '添加一项',
fontSize: 32,
isBold: false,
height: h(32),
width: w(80),
margin: EdgeInsets.only(top: w(18), bottom: w(4)),
textColor: MyColours.color_438E93,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
radius: r(6),
);
}
Widget buildFeastTypeItem(String title, String subTitle) {
return Container(
height: h(48),
margin: EdgeInsets.only(top: w(12)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))),
child: Row(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title,
style: TextStyle(
fontSize: font(16), color: MyColours.color_E6000000),
),
VEmptyView(12),
Text(
subTitle,
style: TextStyle(
fontSize: font(12), color: MyColours.color_999999),
)
],
),
Spacer(),
InkWell(
onTap: () {
NavigatorUtil.goFeastWineManageEditPage(context);
},
child: Text(
'修改',
style: TextStyle(
decoration: TextDecoration.underline,
fontSize: font(16),
color: MyColours.color_438E93),
)),
HEmptyView(32),
InkWell(
onTap: () {
//已经传到服务器,弹提醒窗口,是否删除
//修改之前有内容,则弹框
DialogUtil.cupertinoAlertDialogFeast(context,
rTitle: '删除',
title: "是否确认删除",
content: "剑南春52度500ml", lCallback: () {
print("取消");
}, rCallback: () {
print("确定");
// widget.deleteCallback(index);
});
},
child: Image.asset(
Utils.getImgPath(true ? 'f_delete_red_un' : 'f_delete_red'),
width: w(32),
height: w(32),
)),
HEmptyView(32),
],
),
);
}
Widget _callButton(
{GestureTapCallback onPress,
content,
hasLeftBorder = true,
isSelect = false}) {
return InkWell(
onTap: onPress,
child: Container(
height: h(48),
decoration: BoxDecoration(
color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff,
border: Border(
bottom: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
top: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)),
left: hasLeftBorder
? BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2))
: BorderSide.none,
right: BorderSide(
color: MyColours.color_438E93,
width: ScreenUtil().setWidth(2)))),
child: Align(
alignment: Alignment.center,
child: Text(
content,
style: TextStyle(
color:
isSelect ? MyColours.color_F6F6F6 : MyColours.color_438E93,
fontSize: ScreenUtil().setSp(36)),
),
),
),
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: MyColours.color_ffffff,
appBar: SystemAppBar(
'酒水管理',
needWhite: true,
bgColor: MyColours.color_438E93,
titleColor: MyColours.color_F6F6F6,
onTap: () {
Navigator.pop(context);
},
),
body: Column(
children: [
Expanded(
child: NestedScrollView(
// controller: _scrollViewController,
headerSliverBuilder:
(BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
pinned: true,
floating: false,
leading: null,
backgroundColor: MyColours.color_ffffff,
expandedHeight: ScreenUtil().setWidth(56 * 2),
automaticallyImplyLeading: false,
title: buildFeastTypeHeader(),
// flexibleSpace: FlexibleSpaceBar(
// collapseMode: CollapseMode.pin,
// title: buildFeastTypeHeader())
)
];
},
body: ListView.builder(
itemCount: 100,
padding: EdgeInsets.only(left: w(16)),
itemBuilder: (BuildContext context, int index) {
return buildFeastTypeItem('剑南春52度500ml', '1150元/份 不可议价');
}),
)),
Row(
children: [
Expanded(
child: _callButton(
onPress: () {
Navigator.pop(context);
},
content: '返回',
hasLeftBorder: true,
isSelect: false)),
Expanded(
child: _callButton(
onPress: () {},
content: '保存',
hasLeftBorder: true,
isSelect: true))
],
)
],
),
);
}
}
... ...
... ... @@ -913,4 +913,66 @@ class NavigatorUtil {
return _navigateTo(context, "${Routes.feast_personal_page}",
replace: replace);
}
///宴会----宴会管理 --- 套餐管理
static Future<dynamic> goFeastSetmealManagePage(BuildContext context,
{replace = false, bool onlyShow = false}) {
return _navigateTo(context, "${Routes.feast_setmeal_manage_page}",
replace: replace);
}
///宴会----宴会管理 --- 套餐添加
static Future<dynamic> goFeastSetmealManageEditPage(BuildContext context,
{replace = false, bool onlyShow = false}) {
return _navigateTo(context, "${Routes.feast_setmeal_manage_edit_page}",
replace: replace);
}
///宴会----宴会管理 --- 套餐---菜品
static Future<dynamic> goFeastDishPage(BuildContext context,
{replace = false, bool onlyShow = false}) {
return _navigateTo(context, "${Routes.feast_dish_page}", replace: replace);
}
///宴会----宴会管理 --- 酒水管理
static Future<dynamic> goFeastWineManagePage(BuildContext context,
{replace = false, bool onlyShow = false}) {
return _navigateTo(context, "${Routes.feast_wine_manage_page}",
replace: replace);
}
///宴会----宴会管理 --- 酒水添加
static Future<dynamic> goFeastWineManageEditPage(BuildContext context,
{replace = false, bool onlyShow = false}) {
return _navigateTo(context, "${Routes.feast_wine_manage_edit_page}",
replace: replace);
}
///宴会----宴会管理 --- 其他配置管理
static Future<dynamic> goFeastOthersetManagePage(BuildContext context,
{replace = false, bool onlyShow = false}) {
return _navigateTo(context, "${Routes.feast_otherset_manage_page}",
replace: replace);
}
///宴会----宴会管理 --- 其他配置添加
static Future<dynamic> goFeastOthersetManageEditPage(BuildContext context,
{replace = false, bool onlyShow = false}) {
return _navigateTo(context, "${Routes.feast_otherset_manage_edit_page}",
replace: replace);
}
///宴会----宴会管理 --- 定金管理
static Future<dynamic> goFeastDepositManagePage(BuildContext context,
{replace = false, bool onlyShow = false}) {
return _navigateTo(context, "${Routes.feast_deposit_manage_page}",
replace: replace);
}
///宴会----宴会管理 --- 定金类型
static Future<dynamic> goFeastDepositTypePage(BuildContext context,
{replace = false, bool onlyShow = false}) {
return _navigateTo(context, "${Routes.feast_deposit_type_page}",
replace: replace);
}
}
... ...
... ... @@ -77,7 +77,9 @@ import 'package:one_key/pages/my/customer_type/store_customer/make_marking_page.
import 'package:one_key/pages/my/customer_type/store_customer/marketing_records_detail_page.dart';
import 'package:one_key/pages/my/customer_type/store_customer/marketing_records_page.dart';
import 'package:one_key/pages/my/customer_type/store_customer/store_customer_page.dart';
import 'package:one_key/pages/my/feast_manage/feast_deposit_manage_page.dart';
import 'package:one_key/pages/my/feast_manage/feast_personal_page.dart';
import 'package:one_key/pages/my/feast_manage/feast_setmeal_manage_page.dart';
import 'package:one_key/pages/my/personnel_type/base_info_personnal_page.dart';
import 'package:one_key/pages/my/personnel_type/personnel_detail_page.dart';
import 'package:one_key/pages/my/personnel_type/personnel_manage_page.dart';
... ... @@ -150,8 +152,15 @@ import '../pages/feast/feast_menu_page.dart';
import '../pages/feast/feast_set_page.dart';
import '../pages/feast/feast_setmeal_page.dart';
import '../pages/feast/feast_wine_page.dart';
import '../pages/my/feast_manage/feast_deposit_type_page.dart';
import '../pages/my/feast_manage/feast_dish_page.dart';
import '../pages/my/feast_manage/feast_manage_home_page.dart';
import '../pages/my/feast_manage/feast_otherset_manage_edit_page.dart';
import '../pages/my/feast_manage/feast_otherset_manage_page.dart';
import '../pages/my/feast_manage/feast_setmeal_manage_edit_page.dart';
import '../pages/my/feast_manage/feast_type_page.dart';
import '../pages/my/feast_manage/feast_wine_manage_edit_page.dart';
import '../pages/my/feast_manage/feast_wine_manage_page.dart';
import '../provider/feast_model.dart';
// 登录页
... ... @@ -1439,3 +1448,101 @@ var feastPersonalPageHandle = new Handler(
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(), child: FeastPersonalPage());
});
///宴会---套餐管理
var feastSetmealManagePageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String uids = params["uids"].first;
// bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first);
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(), child: FeastSetmealManagePage());
});
///宴会---套餐管理
var feastSetmealManageEditPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String uids = params["uids"].first;
// bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first);
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(), child: FeastSetmealManageEditPage());
});
///宴会---菜品
var feastDishPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String uids = params["uids"].first;
// bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first);
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(), child: FeastDishPage());
});
///宴会---酒水管理
var feastWineManagePageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String uids = params["uids"].first;
// bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first);
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(), child: FeastWineManagePage());
});
///宴会---酒水添加
var feastWineManageEditPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String uids = params["uids"].first;
// bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first);
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(), child: FeastWineManageEditPage());
});
///宴会---其他配置管理
var feastOthersetManagePageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String uids = params["uids"].first;
// bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first);
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(), child: FeastOthersetManagePage());
});
///宴会---其他配置添加
var feastOthersetManageEditPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String uids = params["uids"].first;
// bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first);
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(), child: FeastOthersetManageEditPage());
});
///宴会---定金管理
var feastDepositManagePageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String uids = params["uids"].first;
// bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first);
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(), child: FeastDepositManagePage());
});
///宴会---定金类型
var feastDepositTypePageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String uids = params["uids"].first;
// bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first);
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(), child: FeastDepositTypePage());
});
... ...
... ... @@ -125,10 +125,25 @@ class Routes {
static String feast_invoice_page = "/feast_invoice_page"; //宴会----添加发票
static String feast_manage_home_page = "/feast_manage_home_page"; //宴会----宴会管理
static String feast_type_page = "/feast_type_page"; //宴会----宴会类型
static String feast_personal_page = "/feast_personal_page"; //宴会----宴会员工
static String feast_personal_page = "/feast_personal_page"; //宴会----宴会员工
static String feast_setmeal_manage_page =
"/feast_setmeal_manage_page"; //宴会----套餐管理
static String feast_setmeal_manage_edit_page =
"/feast_setmeal_manage_edit_page"; //宴会----套餐添加
static String feast_dish_page = "/feast_dish_page"; //宴会----菜品
static String feast_wine_manage_page = "/feast_wine_manage_page"; //宴会----酒水管理
static String feast_wine_manage_edit_page =
"/feast_wine_manage_edit_page"; //宴会----酒水添加
static String feast_otherset_manage_edit_page =
"/feast_otherset_manage_edit_page"; //宴会----其他配置添加
static String feast_otherset_manage_page =
"/feast_otherset_manage_page"; //宴会-----其他配置管理
static String feast_deposit_manage_page =
"/feast_deposit_manage_page"; //宴会-----定金管理
static String feast_deposit_type_page =
"/feast_deposit_type_page"; //宴会-----定金类型
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
... ... @@ -256,12 +271,24 @@ class Routes {
router.define(feast_set_page, handler: feastSetPageHandle);
router.define(feast_invoice_page, handler: feastInvoicePageHandle);
router.define(feast_manage_home_page, handler: feastManageHomePageHandle);
router.define(feast_type_page, handler: feastTypePageHandle);
router.define(feast_personal_page, handler: feastPersonalPageHandle);
router.define(feast_type_page, handler: feastTypePageHandle);
router.define(feast_personal_page, handler: feastPersonalPageHandle);
router.define(feast_setmeal_manage_page,
handler: feastSetmealManagePageHandle);
router.define(feast_setmeal_manage_edit_page,
handler: feastSetmealManageEditPageHandle);
router.define(feast_dish_page, handler: feastDishPageHandle);
router.define(feast_wine_manage_page, handler: feastWineManagePageHandle);
router.define(feast_wine_manage_edit_page,
handler: feastWineManageEditPageHandle);
router.define(feast_otherset_manage_page,
handler: feastOthersetManagePageHandle);
router.define(feast_otherset_manage_edit_page,
handler: feastOthersetManageEditPageHandle);
router.define(feast_deposit_manage_page,
handler: feastDepositManagePageHandle);
router.define(feast_deposit_type_page, handler: feastDepositTypePageHandle);
}
}
... ...
... ... @@ -687,6 +687,258 @@ class DialogUtil {
);
}
//宴会---添加菜品
static Future feastDishEditDialog(
BuildContext context, {
CustomCallBackMap onTap,
String title = '菜品信息',
String content = '',
String per = '',
bool can = true,
}) async {
TextEditingController nameC = TextEditingController();
TextEditingController perC = TextEditingController();
nameC.text = content;
perC.text = per;
// 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(346 * 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(
'菜品名称',
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: 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: TextInputType.text,
),
))
])),
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.center,
child: Text(
'是否可调菜',
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('请输入菜品名称!');
return;
}
if (perC.text.trim() == '') {
Utils.showToast('请输入菜品规格!');
return;
}
onTap({
'name': nameC.text,
'per': perC.text,
'can': can ? '1' : '0'
});
Navigator.pop(context, {
'name': nameC.text,
'per': perC.text,
'can': can
});
}),
],
)
],
),
),
)),
),
));
});
},
);
}
static Future openCreateAreaDialog(BuildContext context,
{CustomCallBack onTap}) async {
TextEditingController controller = TextEditingController();
... ...