Commit d761d778a8ea5afb6696639bbfab7f48478da7b4

Authored by wdn127929
1 parent a897a84d

签约部分

import 'package:cached_network_image/cached_network_image.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/models/cookbook_one_model.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/round_button.dart';
... ... @@ -991,6 +993,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
isBold: false,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
onPressed: () {
NavigatorUtil.goFeastSetmealPage(context);
},
),
VEmptyView(52),
Text(
... ... @@ -1049,6 +1054,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
isBold: false,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
onPressed: () {
NavigatorUtil.goFeastWinePage(context);
},
),
VEmptyView(52),
Text(
... ... @@ -1107,6 +1115,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
isBold: false,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
onPressed: () {
NavigatorUtil.goFeastSetPage(context);
},
),
],
)),
... ... @@ -1242,10 +1253,22 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
fontSize: font(12)),
),
InkWell(
onTap: () {
//弹框确认是否删除
DialogUtil.cupertinoAlertDialog(context,
title: "",
content: "是否确定删除?",
isBoldContent: true,
contentColor: MyColours.color_E6000000,
rTitle: "删除", rCallback: () {
Navigator.pop(context);
// _delGuestInfocDay(model.cday[index].id);
});
},
child: Image.asset(
Utils.getImgPath('f_dj_delete'),
width: w(20),
))
Utils.getImgPath('f_dj_delete'),
width: w(20),
))
],
),
),
... ... @@ -1408,9 +1431,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
Expanded(
child: _callButton(
onPress: () {
selectMenu = '选台';
menuSet.add('意向');
menuSet.add('选台');
selectMenu = '签约';
menuSet.add('定金');
menuSet.add('签约');
setState(() {});
},
content: '保存并下一步',
... ... @@ -1421,6 +1445,400 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
],
);
}
/***********签约widget */
///基本信息item
Widget baseInfoItem(String title, String content) {
return Padding(
padding: EdgeInsets.symmetric(vertical: h(6)),
child: Row(
children: [
Container(
width: w(80),
child: Text(title,
style: TextStyle(
color: MyColours.color_999999, fontSize: font(12))),
),
Expanded(
child: Text(content,
style: TextStyle(
color: MyColours.color_515151, fontSize: font(12))))
],
));
}
//基本信息板块
Widget baseInfoWidget() {
return Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(r(6)),
border: Border.all(width: w(1), color: MyColours.color_438E93)),
child: Column(
children: [
Container(
width: double.infinity,
// height: h(31),
padding: EdgeInsets.symmetric(horizontal: w(12), vertical: h(6)),
decoration: BoxDecoration(
color: MyColours.color_438E93,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(r(5)),
topRight: Radius.circular(r(5)))),
child: Text(
'基本信息',
style:
TextStyle(color: MyColours.color_F6F6F6, fontSize: font(14)),
),
),
Padding(
padding: EdgeInsets.only(
left: w(12), right: w(12), top: w(8), bottom: w(11)),
child: Column(
children: [
baseInfoItem('宴会日期:', '2022-08-02 (周二 七月初五)'),
baseInfoItem('宴会类型:', '婚宴'),
baseInfoItem('预订人:', '方 先生'),
baseInfoItem('场次数量:', '共 1 场'),
baseInfoItem('电话:', '15833517582'),
baseInfoItem('服务经理:', '刘经理'),
baseInfoItem('备注:', '无'),
],
))
],
),
);
}
///第一场 。第二场。。。。
Widget sessionsWidget(
String title,
) {
return Container(
margin: EdgeInsets.only(bottom: h(26)),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(r(6)),
border: Border.all(width: w(1), color: MyColours.color_438E93)),
child: Column(
children: [
Container(
width: double.infinity,
// height: h(31),
padding: EdgeInsets.symmetric(horizontal: w(12), vertical: h(6)),
decoration: BoxDecoration(
color: MyColours.color_438E93,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(r(5)),
topRight: Radius.circular(r(5)))),
child: Text(
title,
style:
TextStyle(color: MyColours.color_F6F6F6, fontSize: font(14)),
),
),
Padding(
padding: EdgeInsets.only(
left: w(12), right: w(12), top: w(8), bottom: w(11)),
child: Column(
children: [
baseInfoItem('场次时间:', '2022-08-02 午餐 12:00至14:00'),
baseInfoItem('桌位数量:', '共 32 桌'),
baseInfoItem('桌位信息:', '凤凰厅 (30桌)、包间1 (1桌)、包间2 (1桌)'),
Padding(
padding: EdgeInsets.symmetric(vertical: h(6)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: w(80),
child: Text('套餐安排',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(12))),
),
Expanded(
child: ListView.builder(
itemCount: 3,
shrinkWrap: true,
controller: _scrollController,
itemBuilder:
(BuildContext context, int index) {
return Container(
padding: EdgeInsets.only(bottom: w(8)),
margin: EdgeInsets.only(bottom: w(12)),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: w(1),
color: MyColours
.color_DBDBDB))),
child: Column(
children: [
Row(
children: [
Text('1299套餐',
style: TextStyle(
color: MyColours
.color_515151,
fontSize: font(12))),
Spacer(),
RoundButton(
text: '查看菜单',
radius: r(7),
width: w(48),
height: h(18),
fontSize: 20,
textColor:
MyColours.color_F6F6F6,
isBold: false,
gradientStart:
MyColours.color_438E93,
gradientEnd:
MyColours.color_438E93,
onPressed: () {
// NavigatorUtil.goFeastSetmealPage(context);
},
),
],
),
VEmptyView(16),
Row(
children: [
Text('10 人/桌',
style: TextStyle(
color: MyColours
.color_999999,
fontSize: font(12))),
HEmptyView(24),
Text('保证 30 桌',
style: TextStyle(
color: MyColours
.color_999999,
fontSize: font(12))),
HEmptyView(24),
Text('备用 2 桌',
style: TextStyle(
color: MyColours
.color_999999,
fontSize: font(12))),
],
)
],
));
}))
],
)),
sessionsItem('酒水安排:'),
sessionsItem('其他配置:'),
remarkItem('备注:')
],
))
],
),
);
}
///备注----照片
Widget remarkItem(String title) {
return Padding(
padding: EdgeInsets.symmetric(vertical: h(6)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: w(80),
child: Text(title,
style: TextStyle(
color: MyColours.color_999999, fontSize: font(12))),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'剑南春52度剑南春52度500ml剑南春52度500ml剑南春52度500ml剑南春52度500ml剑南春52度500ml剑南春52度500ml剑南春52度500ml剑南春52度500ml500ml',
style: TextStyle(
color: MyColours.color_515151, fontSize: font(12))),
VEmptyView(16),
_getGridImg(['fff', '', 'fff', '', 'fff', '', 'fff', ''])
],
)),
],
));
}
///三组 左---中----右
Widget sessionsItem(String title) {
return Padding(
padding: EdgeInsets.symmetric(vertical: h(6)),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: w(80),
child: Text(title,
style: TextStyle(
color: MyColours.color_999999, fontSize: font(12))),
),
Expanded(
child: ListView.builder(
itemCount: 3,
shrinkWrap: true,
controller: _scrollController,
itemBuilder: (BuildContext context, int index) {
return Container(
padding: EdgeInsets.only(bottom: w(8)),
margin: EdgeInsets.only(bottom: w(12)),
// decoration: BoxDecoration(
// border: Border(
// bottom: BorderSide(
// width: w(1),
// color: MyColours.color_DBDBDB))),
child: Row(
children: [
Expanded(
child: Text('剑南春52度500ml',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)))),
Text('60 份',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)))
],
));
})),
],
));
}
/// 九宫格
Widget _getGridImg(List<String> data) {
return GridView.builder(
controller: _scrollController,
// padding: EdgeInsets.only(top: ScreenUtil().getAdapterSize(10)),
shrinkWrap: true,
itemCount: data.length,
//SliverGridDelegateWithFixedCrossAxisCount 构建一个横轴固定数量Widget
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
//横轴元素个数
crossAxisCount: 4,
//纵轴间距
mainAxisSpacing: ScreenUtil().setWidth(52),
//横轴间距
crossAxisSpacing: ScreenUtil().setWidth(60),
//子组件宽高长度比例
childAspectRatio: 1.0),
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
// _showPhotoView(
// context, index, widget.model.imageQiniuUrlList);
},
child: Stack(
// alignment: Alignment.topRight,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(r(5)),
child: CachedNetworkImage(
// imageUrl: data[index].qiniuUrl,
imageUrl:
'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F4k%2Fs%2F02%2F2109242332225H9-0-lp.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1662806063&t=d576b5247e04ce721c266f098625f145',
fit: BoxFit.cover,
width: ScreenUtil().setWidth(38 * 2),
height: ScreenUtil().setWidth(38 * 2),
),
),
Positioned(
top: 0,
right: 0,
child: GestureDetector(
child: Image.asset(
Utils.getImgPath("f_delete"),
width: ScreenUtil().setWidth(24),
height: ScreenUtil().setWidth(24),
),
onTap: () {
//已经传到服务器,弹提醒窗口,是否删除
//修改之前有内容,则弹框
DialogUtil.cupertinoAlertDialog(context,
title: "确认删除",
content: "是否确定删除该照片,删除操作不可逆转,请谨慎操作",
lCallback: () {
print("取消");
}, rCallback: () {
print("确定");
// widget.deleteCallback(index);
});
}
// else {
// //点击删除按钮
// setState(() {
// temp.removeWhere((element) =>
// element == temp[index]);
// widget.model.imageQiniuUrlList
// .removeWhere((element) =>
// element ==
// widget.model
// .imageQiniuUrlList[index]);
// });
// }
// },
)),
],
),
);
});
}
///签约
Widget qyWidget() {
return Column(children: [
Expanded(
child: SingleChildScrollView(
child: Column(children: <Widget>[
menu(),
MyDivider(double.infinity, h(1), color: MyColours.color_DBDBDB),
VEmptyView(26),
Padding(
padding: EdgeInsets.symmetric(horizontal: w(12)),
child: Column(children: [
baseInfoWidget(),
VEmptyView(52),
ListView.builder(
itemCount: 3,
shrinkWrap: true,
controller: _scrollController,
itemBuilder: (BuildContext context, int index) {
return sessionsWidget('第${index + 1}场');
}),
VEmptyView(52),
]))
]))),
Row(
children: [
Expanded(
child: _callButton(
onPress: () {},
content: '分享宴会单',
hasLeftBorder: true,
isSelect: false)),
Expanded(
child: _callButton(
onPress: () {
selectMenu = '签约';
menuSet.add('定金');
menuSet.add('签约');
setState(() {});
},
content: '保存',
hasLeftBorder: true,
isSelect: true))
],
)
]);
}
Widget taocanTextType(String per1, String title, String per) {
return RichText(
... ... @@ -1555,6 +1973,6 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
? xtWidget()
: selectMenu == '定金'
? djWidget()
: SizedBox());
: qyWidget());
}
}
... ...
... ... @@ -133,6 +133,7 @@ class _FeastMenuPageState extends State<FeastMenuPage> {
return _buildHeaderWidget(context, index);
} else {
int itemIndex = index - 1;
return Container(
margin: new EdgeInsets.only(bottom: h(12)),
color: MyColours.color_ffffff,
... ... @@ -166,18 +167,32 @@ class _FeastMenuPageState extends State<FeastMenuPage> {
fontSize: ScreenUtil().setSp(32)),
)),
HEmptyView(16),
Text(
'调为',
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(32)),
),
HEmptyView(16),
Expanded(child: _textfield('菜名', null, null)),
HEmptyView(16),
_textfield('数量', null, null, width: w(56))
index == 1
? Text(
'不可调菜',
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: MyColours.color_E34D59,
fontSize: ScreenUtil().setSp(32)),
)
: Expanded(
child: Row(
children: [
Text(
'调为',
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(32)),
),
HEmptyView(16),
Expanded(child: _textfield('菜名', null, null)),
HEmptyView(16),
_textfield('数量', null, null, width: w(56))
],
))
],
)),
),
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import '../../res/colors.dart';
import '../../utils/screen_util.dart';
import '../../utils/utils.dart';
import '../../widgets/round_button.dart';
import '../../widgets/system_app_bar.dart';
import '../../widgets/v_empty_view.dart';
/**
* 添加配置
*/
class FeastSetPage extends StatefulWidget {
FeastSetPage({Key key}) : super(key: key);
@override
_FeastSetPageState createState() => _FeastSetPageState();
}
class _FeastSetPageState extends State<FeastSetPage> {
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_438E93);
}
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)),
),
),
),
);
}
///输入框
Widget _textfield(String hintText, TextEditingController editingController,
FocusNode focusNode,
{TextInputType inputType = TextInputType.text, double width}) {
return Container(
width: width,
padding: EdgeInsets.symmetric(horizontal: w(6)),
decoration: BoxDecoration(
border: Border.all(width: h(1), color: MyColours.color_438E93)),
child: Container(
// height: ScreenUtil().setHeight(120),
height: ScreenUtil().setWidth(44),
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),
),
focusNode: focusNode,
textAlign: TextAlign.center,
decoration: InputDecoration(
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: hintText,
hintStyle: TextStyle(
color: hintText == ''
? MyColours.color_999999
: MyColours.color_000000,
fontSize: ScreenUtil().setSp(28),
),
contentPadding: EdgeInsets.zero,
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: inputType,
)),
);
}
Widget buildListItem(BuildContext context, int index, bool select) {
return Container(
padding: EdgeInsets.only(
top: h(25), bottom: h(10), left: w(12), right: w(12)),
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(width: w(1), color: MyColours.color_DBDBDB))),
child: Column(
children: [
Row(
children: [
Row(children: [
InkWell(
onTap: () {
setState(() {
select = !select;
});
},
child: Row(
children: [
Image.asset(
Utils.getImgPath(
select ? 'f_select' : 'f_select_not'),
width: w(24),
),
HEmptyView(24),
Text(
'LED大屏',
style: TextStyle(
color: select
? MyColours.color_515151
: MyColours.color_999999,
fontSize: font(16),
fontWeight: FontWeight.bold),
)
],
))
]),
Spacer(),
Text(
'原价:1100元/份',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(14),
),
),
],
),
select ? VEmptyView(42) : SizedBox(),
select
? Row(
children: [
Text(
'议价:不可议价',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
// _textfield('1299', null, null, width: w(103)),
// Text(
// ' 元',
// style: TextStyle(
// color: MyColours.color_515151,
// fontSize: font(14),
// ),
// ),
Spacer(),
Text(
'数量:',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
_textfield('1299', null, null, width: w(103)),
Text(
' 份',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
],
)
: SizedBox(),
],
));
}
@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(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: 10,
itemBuilder: (BuildContext context, int index) {
return buildListItem(context, index, true);
},
)),
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/widgets/h_empty_view.dart';
import '../../res/colors.dart';
import '../../utils/screen_util.dart';
import '../../utils/utils.dart';
import '../../widgets/round_button.dart';
import '../../widgets/system_app_bar.dart';
import '../../widgets/v_empty_view.dart';
/**
* 添加套餐
*/
class FeastSetmealPage extends StatefulWidget {
FeastSetmealPage({Key key}) : super(key: key);
@override
_FeastSetmealPageState createState() => _FeastSetmealPageState();
}
class _FeastSetmealPageState extends State<FeastSetmealPage> {
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_438E93);
}
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)),
),
),
),
);
}
///输入框
Widget _textfield(String hintText, TextEditingController editingController,
FocusNode focusNode,
{TextInputType inputType = TextInputType.text, double width}) {
return Container(
width: width,
padding: EdgeInsets.symmetric(horizontal: w(6)),
decoration: BoxDecoration(
border: Border.all(width: h(1), color: MyColours.color_438E93)),
child: Container(
// height: ScreenUtil().setHeight(120),
height: ScreenUtil().setWidth(44),
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),
),
focusNode: focusNode,
textAlign: TextAlign.center,
decoration: InputDecoration(
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: hintText,
hintStyle: TextStyle(
color: hintText == ''
? MyColours.color_999999
: MyColours.color_000000,
fontSize: ScreenUtil().setSp(28),
),
contentPadding: EdgeInsets.zero,
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: inputType,
)),
);
}
Widget buildListItem(BuildContext context, int index, bool select) {
return Container(
padding: EdgeInsets.only(
top: h(25), bottom: h(10), left: w(12), right: w(12)),
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(width: w(1), color: MyColours.color_DBDBDB))),
child: Column(
children: [
Row(
children: [
InkWell(
onTap: () {
setState(() {
select = !select;
});
},
child: Row(
children: [
Image.asset(
Utils.getImgPath(
select ? 'f_select' : 'f_select_not'),
width: w(24),
),
HEmptyView(24),
Text(
'1299套餐',
style: TextStyle(
color: select
? MyColours.color_515151
: MyColours.color_999999,
fontSize: font(16),
fontWeight: FontWeight.bold),
)
],
)),
Spacer(),
RoundButton(
text: '查看菜单',
radius: r(7),
width: w(48),
height: h(18),
fontSize: 20,
textColor: MyColours.color_F6F6F6,
isBold: false,
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
onPressed: () {
// NavigatorUtil.goFeastSetmealPage(context);
},
),
],
),
select
? Column(
children: [
VEmptyView(42),
Row(
children: [
Text(
'原价:1299元',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
Spacer(),
Text(
'议价:',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
_textfield('1299', null, null, width: w(126)),
Text(
' 元',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
],
),
VEmptyView(42),
Row(
children: [
Text(
'每桌:',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
_textfield('3', null, null, width: w(45)),
Text(
' 人',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
Spacer(),
Text(
'保证:',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
_textfield('3', null, null, width: w(45)),
Text(
' 桌',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
Spacer(),
Text(
'备用:',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
_textfield('3', null, null, width: w(45)),
Text(
' 桌',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
],
),
],
)
: SizedBox()
],
));
}
@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(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: 10,
itemBuilder: (BuildContext context, int index) {
return buildListItem(context, index, true);
},
)),
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/widgets/h_empty_view.dart';
import '../../res/colors.dart';
import '../../utils/screen_util.dart';
import '../../utils/utils.dart';
import '../../widgets/round_button.dart';
import '../../widgets/system_app_bar.dart';
import '../../widgets/v_empty_view.dart';
/**
* 添加酒水
*/
class FeastWinePage extends StatefulWidget {
FeastWinePage({Key key}) : super(key: key);
@override
_FeastWinePageState createState() => _FeastWinePageState();
}
class _FeastWinePageState extends State<FeastWinePage> {
@override
void initState() {
super.initState();
Utils.changeStatusColor(color: MyColours.color_438E93);
}
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)),
),
),
),
);
}
///输入框
Widget _textfield(String hintText, TextEditingController editingController,
FocusNode focusNode,
{TextInputType inputType = TextInputType.text, double width}) {
return Container(
width: width,
padding: EdgeInsets.symmetric(horizontal: w(6)),
decoration: BoxDecoration(
border: Border.all(width: h(1), color: MyColours.color_438E93)),
child: Container(
// height: ScreenUtil().setHeight(120),
height: ScreenUtil().setWidth(44),
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),
),
focusNode: focusNode,
textAlign: TextAlign.center,
decoration: InputDecoration(
border: OutlineInputBorder(borderSide: BorderSide.none),
hintText: hintText,
hintStyle: TextStyle(
color: hintText == ''
? MyColours.color_999999
: MyColours.color_000000,
fontSize: ScreenUtil().setSp(28),
),
contentPadding: EdgeInsets.zero,
),
onChanged: (value) {},
onEditingComplete: () {
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
},
keyboardType: inputType,
)),
);
}
Widget buildListItem(BuildContext context, int index, bool select) {
return Container(
padding: EdgeInsets.only(
top: h(25), bottom: h(10), left: w(12), right: w(12)),
decoration: BoxDecoration(
border: Border(
bottom:
BorderSide(width: w(1), color: MyColours.color_DBDBDB))),
child: Column(
children: [
Row(
children: [
Row(children: [
InkWell(
onTap: () {
setState(() {
select = !select;
});
},
child: Row(
children: [
Image.asset(
Utils.getImgPath(
select ? 'f_select' : 'f_select_not'),
width: w(24),
),
HEmptyView(24),
Text(
'剑南春52度500ml',
style: TextStyle(
color: select
? MyColours.color_515151
: MyColours.color_999999,
fontSize: font(16),
fontWeight: FontWeight.bold),
)
],
))
]),
Spacer(),
Text(
'原价:460元/份',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(14),
),
),
],
),
select ? VEmptyView(42) : SizedBox(),
select
? Row(
children: [
Text(
'议价:',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
_textfield('1299', null, null, width: w(103)),
Text(
' 元',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
Spacer(),
Text(
'数量:',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
_textfield('1299', null, null, width: w(103)),
Text(
' 份',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(14),
),
),
],
)
: SizedBox(),
],
));
}
@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(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: 10,
itemBuilder: (BuildContext context, int index) {
return buildListItem(context, index, true);
},
)),
Row(
children: [
Expanded(
child: _callButton(
onPress: () {
Navigator.pop(context);
},
content: '返回',
hasLeftBorder: true,
isSelect: false)),
Expanded(
child: _callButton(
onPress: () {},
content: '保存并返回',
hasLeftBorder: true,
isSelect: true))
],
)
],
));
}
}
... ...
... ... @@ -867,4 +867,23 @@ class NavigatorUtil {
{replace = false, bool onlyShow = false}) {
return _navigateTo(context, "${Routes.feast_menu_page}", replace: replace);
}
///宴会----添加套餐
static Future<dynamic> goFeastSetmealPage(BuildContext context,
{replace = false, bool onlyShow = false}) {
return _navigateTo(context, "${Routes.feast_setmeal_page}",
replace: replace);
}
///宴会----添加酒水
static Future<dynamic> goFeastWinePage(BuildContext context,
{replace = false, bool onlyShow = false}) {
return _navigateTo(context, "${Routes.feast_wine_page}", replace: replace);
}
///宴会----添加配置
static Future<dynamic> goFeastSetPage(BuildContext context,
{replace = false, bool onlyShow = false}) {
return _navigateTo(context, "${Routes.feast_set_page}", replace: replace);
}
}
... ...
... ... @@ -145,6 +145,9 @@ import '../pages/feast/feast_board.dart';
import '../pages/feast/feast_create_page.dart';
import '../pages/feast/feast_deposit_page.dart';
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 '../provider/feast_model.dart';
// 登录页
... ... @@ -1362,3 +1365,36 @@ var feastMenuPageHandle = new Handler(
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(), child: FeastMenuPage());
});
///宴会----添加套餐
var feastSetmealPageHandle = 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: FeastSetmealPage());
});
///宴会----添加酒水
var feastWinePageHandle = 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: FeastWinePage());
});
///宴会----添加配置
var feastSetPageHandle = 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: FeastSetPage());
});
... ...
... ... @@ -119,6 +119,9 @@ class Routes {
static String feast_create_page = "/feast_create_page"; //宴会----新建宴会
static String feast_deposit_page = "/feast_deposit_page"; //宴会----定金
static String feast_menu_page = "/feast_menu_page"; //宴会----调菜
static String feast_setmeal_page = "/feast_setmeal_page"; //宴会----添加套餐
static String feast_wine_page = "/feast_wine_page"; //宴会----添加酒水
static String feast_set_page = "/feast_set_page"; //宴会----添加配置
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
... ... @@ -240,7 +243,9 @@ class Routes {
router.define(feast_board_page, handler: feastBoardPageHandle);
router.define(feast_create_page, handler: feastCreatePageHandle);
router.define(feast_deposit_page, handler: feastDepositPageHandle);
router.define(feast_menu_page, handler: feastMenuPageHandle);
router.define(feast_setmeal_page, handler: feastSetmealPageHandle);
router.define(feast_wine_page, handler: feastWinePageHandle);
router.define(feast_set_page, handler: feastSetPageHandle);
}
}
... ...
... ... @@ -4192,7 +4192,7 @@ class DialogUtil {
if (valueChanged != null) {
valueChanged(picker.adapter.text);
}
}).showModal(context,backgroundColor: MyColours.color_40000000);
}).showModal(context, backgroundColor: MyColours.color_40000000);
}
///年月日时分秒选择器
... ... @@ -4706,6 +4706,7 @@ class DialogUtil {
Color rColor = MyColours.color_438E93,
bool isBold = false,
bool isBoldContent = false,
Color contentColor = MyColours.color_99000000,
VoidCallback lCallback,
VoidCallback rCallback}) {
showCupertinoDialog(
... ... @@ -4724,7 +4725,8 @@ class DialogUtil {
fontWeight:
isBoldContent ? FontWeight.bold : FontWeight.normal,
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_99000000)),
color: contentColor
)),
actions: [
CupertinoDialogAction(
child: Text(lTitle,
... ...