Commit 033e5f81bc2215c849db53c70fc074048e27e977

Authored by wdn127929
1 parent 2b02a47c

我的排菜首页+创建新排菜前置条件录入

... ... @@ -146,16 +146,24 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
Widget _item(String name, String title, {bool isRowLow = false}) {
return Column(
children: [
Image.asset(
name,
width: ScreenUtil().setWidth(32 * 2),
),
name == ''
? Container(
width: ScreenUtil().setWidth(32 * 2),
)
: Image.asset(
name,
width: ScreenUtil().setWidth(32 * 2),
),
VEmptyView(20),
Text(
title,
style: TextStyle(
fontWeight: FontWeight.bold,
color: isRowLow ? MyColours.color_999999 : MyColours.color_515151,
color: title == '空空空空'
? Colors.transparent
: isRowLow
? MyColours.color_999999
: MyColours.color_515151,
fontSize: ScreenUtil().setWidth(24)),
)
],
... ... @@ -609,35 +617,58 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
color: MyColours.color_ffffff,
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(14))),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
InkWell(
onTap: () {
NavigatorUtil.goBaseInfoPage(
context, FromPage.FromPageMyPage);
},
child:
_item(Utils.getImgPath('grxx'), '个人信息')),
InkWell(
onTap: () {
NavigatorUtil.goMyCustomerPage(context);
},
child:
_item(Utils.getImgPath('wdkq'), '我的客情')),
InkWell(
onTap: () {
NavigatorUtil.goCouponPage(context);
},
child: _item(Utils.getImgPath('yhq'), '优惠券')),
InkWell(
onTap: () {
NavigatorUtil.goRemarkManagerPage(context);
},
child:
_item(Utils.getImgPath('cybz'), '常用备注'))
],
),
child: Column(children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
InkWell(
onTap: () {
NavigatorUtil.goBaseInfoPage(
context, FromPage.FromPageMyPage);
},
child: _item(
Utils.getImgPath('grxx'), '个人信息')),
InkWell(
onTap: () {
NavigatorUtil.goMyCustomerPage(context);
},
child: _item(
Utils.getImgPath('wdkq'), '我的客情')),
InkWell(
onTap: () {
NavigatorUtil.goCouponPage(context);
},
child:
_item(Utils.getImgPath('yhq'), '优惠券')),
InkWell(
onTap: () {
NavigatorUtil.goRemarkManagerPage(
context);
},
child: _item(
Utils.getImgPath('cybz'), '常用备注')),
],
),
VEmptyView(68),
Row(
mainAxisAlignment:
MainAxisAlignment.spaceEvenly,
children: [
InkWell(
onTap: () {
NavigatorUtil.goMyPlanDishHomePage(
context);
},
child: _item(
Utils.getImgPath('cdgl'), '我的排菜')),
InkWell(
onTap: () {}, child: _item('', '空空空空')),
InkWell(
onTap: () {}, child: _item('', '空空空空')),
InkWell(
onTap: () {}, child: _item('', '空空空空')),
])
]),
)),
VEmptyView(20),
... ...
import 'package:flutter/material.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import '../../../utils/dialog_util.dart';
import '../../../utils/screen_util.dart';
/**
*
* 我的排菜首页
*/
class MyPlanDishHomePage extends StatefulWidget {
MyPlanDishHomePage({Key key}) : super(key: key);
@override
_MyPlanDishHomePageState createState() => _MyPlanDishHomePageState();
}
class _MyPlanDishHomePageState extends State<MyPlanDishHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: SystemAppBar('我的排菜'),
backgroundColor: MyColours.color_ffffff,
body: Column(
children: [
MyDivider(
double.infinity,
w(1),
color: MyColours.color_DBDBDB,
),
Expanded(
child: ListView.builder(
itemCount: 10,
itemBuilder: (context, index) {
return Container(
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
color: MyColours.color_DBDBDB, width: w(1)))),
child: Padding(
padding: EdgeInsets.only(
left: w(20), right: w(20), top: w(15), bottom: w(3)),
child: Column(
children: [
Row(
children: [
Expanded(
child: Text(
'8人聚会餐',
maxLines: 3,
style: TextStyle(
fontSize: font(16),
color: MyColours.color_515151),
overflow: TextOverflow.ellipsis,
)),
HEmptyView(22),
Text('1200元/8人',
style: TextStyle(
fontSize: font(14),
color: MyColours.color_515151)),
HEmptyView(22),
InkWell(
onTap: () {
//弹框确认是否删除
DialogUtil.cupertinoAlertDialog(context,
title: "",
content: "是否确定删除该排菜?",
rTitle: "确定删除", rCallback: () {
// Navigator.pop(context);
// _delGuestInfocDay(model.cday[index].id);
});
},
child: Padding(
padding: EdgeInsets.only(left: w(11)),
child: Image.asset(
Utils.getImgPath('f_delete_red'),
width: w(17),
)))
],
),
VEmptyView(22),
Text(
'铁锅炖大鹅,白山叫花鸡,主席红烧肉,清蒸鲈鱼,荷塘小炒,松仁玉米,咸蛋黄焗南瓜,黑椒牛柳,夫妻肺片,蒜泥茄子,卤水拼盘,东北大拉皮,西湖牛肉羹,扬州炒饭,咸蛋黄焗南瓜,黑椒牛柳,夫妻肺片,蒜泥茄子,卤水拼盘,东北大拉皮,西湖牛肉羹,扬州炒饭',
maxLines: 3,
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151),
overflow: TextOverflow.ellipsis,
),
VEmptyView(8),
Row(
children: [
Container(
height: w(24),
padding: EdgeInsets.only(top: w(6)),
child: Text('更新时间:2022-11-08',
style: TextStyle(
fontSize: font(12),
color: MyColours.color_515151)),
),
Spacer(),
RoundButton(
text: '复用',
width: w(80),
height: w(30),
fontSize: 24,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_438E93,
radius: r(5),
isBold: false,
),
HEmptyView(20),
RoundButton(
text: '修改',
width: w(80),
height: w(30),
fontSize: 24,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_438E93,
radius: r(5),
isBold: false,
)
],
)
],
),
),
);
}),
),
Padding(
padding: EdgeInsets.only(
top: w(12), bottom: w(25), left: w(45), right: w(45)),
child: RoundButton(
text: '创建新排菜',
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
width: double.infinity,
height: w(43),
radius: r(5),
fontSize: 36,
isBold: false,
onPressed: () {
NavigatorUtil.goPlanNewDishFirstPage(context);
},
),
)
],
),
);
}
}
... ...
import 'package:flutter/material.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';
/***
* 4.2我的-我的排菜-创建新排菜前置条件录入
*/
class PlanNewDishFirstPage extends StatefulWidget {
PlanNewDishFirstPage({Key key}) : super(key: key);
@override
_PlanNewDishFirstPageState createState() => _PlanNewDishFirstPageState();
}
class _PlanNewDishFirstPageState extends State<PlanNewDishFirstPage> {
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(),
],
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: SystemAppBar('预点菜'),
backgroundColor: MyColours.color_ffffff,
body: Column(
children: [
Padding(
padding: EdgeInsets.symmetric(horizontal: w(20)),
child: MyDivider(
double.infinity,
w(1),
color: MyColours.color_DBDBDB,
)),
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(),
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,
),
],
),
),
),
),
Padding(
padding: EdgeInsets.only(
top: w(12), bottom: w(25), left: w(45), right: w(45)),
child: RoundButton(
text: '菜单点菜',
gradientStart: MyColours.color_438E93,
gradientEnd: MyColours.color_438E93,
width: double.infinity,
height: w(43),
radius: r(5),
fontSize: 36,
isBold: false,
),
)
],
),
);
}
}
... ...
import 'package:flutter/material.dart';
/**
* 预排菜
*/
class PlanDishProvider extends ChangeNotifier {}
... ...
... ... @@ -858,7 +858,7 @@ class NavigatorUtil {
///宴会----新建宴会
static Future<dynamic> goFeastCreatePage(BuildContext context,
{replace = false, bool isCreate = false, Map banquetDetail,String rid}) {
{replace = false, bool isCreate = false, Map banquetDetail, String rid}) {
if (banquetDetail != null) {
return _navigateTo(context,
"${Routes.feast_create_page}?isCreate=$isCreate&rid=$rid&banquetDetail=${FluroConvertUtils.object2string(banquetDetail)}",
... ... @@ -1124,4 +1124,45 @@ class NavigatorUtil {
"${Routes.merge_table_select_page}?tids=$tids&tableidNow=$tableidNow&fromPage=$fromPage&canChoose=$canChoose",
replace: replace);
}
/**
* 排菜
*/
///我的---我的排菜
static Future<dynamic> goMyPlanDishHomePage(
BuildContext context, {
replace = false,
}) {
// if (invoice != null) {
// return _navigateTo(context,
// "${Routes.merge_table_select_page}?invoice=${FluroConvertUtils.object2string(invoice)}",
// replace: replace);
// }
// if (object != null) {
// return _navigateTo(context,
// "${Routes.my_plan_dish_home_page}?tids=$tids&tableidNow=$tableidNow&fromPage=$fromPage&canChoose=$canChoose&object=${FluroConvertUtils.object2string(object)}");
// }
return _navigateTo(context, "${Routes.my_plan_dish_home_page}",
replace: replace);
}
///我的-我的排菜-创建新排菜前置条件录入
///
static Future<dynamic> goPlanNewDishFirstPage(
BuildContext context, {
replace = false,
}) {
// if (invoice != null) {
// return _navigateTo(context,
// "${Routes.plan_new_dish_first_page}?invoice=${FluroConvertUtils.object2string(invoice)}",
// replace: replace);
// }
// if (object != null) {
// return _navigateTo(context,
// "${Routes.plan_new_dish_first_page}?tids=$tids&tableidNow=$tableidNow&fromPage=$fromPage&canChoose=$canChoose&object=${FluroConvertUtils.object2string(object)}");
// }
return _navigateTo(context, "${Routes.plan_new_dish_first_page}",
replace: replace);
}
}
... ...
... ... @@ -174,8 +174,11 @@ 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 '../pages/my/plan_dish/my_plan_dish_home_page.dart';
import '../pages/my/plan_dish/plan_new_dish_first_page.dart';
import '../pages/my/table_manage/merge_table_select_page.dart';
import '../provider/feast_model.dart';
import '../provider/plan_dish_provider.dart';
// 登录页
var loginHandler = new Handler(
... ... @@ -1390,17 +1393,16 @@ var feastCreatePageHandle = new Handler(
// });
banquetDetail = GetBanquetByIdNewSunModel.fromJson(temp);
String rid = params["rid"].first;
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(),
child: FeastCreatePage(banquetDetail: banquetDetail,isCreate:isCreate,rid:rid));
String rid = params["rid"].first;
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(),
child: FeastCreatePage(
banquetDetail: banquetDetail, isCreate: isCreate, rid: rid));
}
return ChangeNotifierProvider<FeastModel>(
create: (_) => FeastModel(),
child: FeastCreatePage(banquetDetail: banquetDetail,isCreate:isCreate));
child: FeastCreatePage(banquetDetail: banquetDetail, isCreate: isCreate));
});
///宴会----添加定金
... ... @@ -1819,3 +1821,50 @@ var mergeTableSelectPageHandle = new Handler(
fromPage: fromPage,
tids: tids));
});
/**
* 排菜
*/
///我的----我的排菜首页
var myPlanDishHomePageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String fromPage = params["fromPage"].first;
// String tids = params["tids"].first;
// String tableidNow = params["tableidNow"].first;
// bool canChoose = params["canChoose"].first == "true" ? true : false;
// List<TableList> res = [];
// if (params.keys.contains('object')) {
// Map object = FluroConvertUtils.string2map(params["object"].first);
// List temp = object['object'];
// for (var item in temp) {
// res.add(TableList.fromJson(item));
// }
// }
return ChangeNotifierProvider<PlanDishProvider>(
create: (_) => PlanDishProvider(), child: MyPlanDishHomePage());
});
///我的-我的排菜-创建新排菜前置条件录入
var planNewDishFirstPageHandle = new Handler(
handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
// String fromPage = params["fromPage"].first;
// String tids = params["tids"].first;
// String tableidNow = params["tableidNow"].first;
// bool canChoose = params["canChoose"].first == "true" ? true : false;
// List<TableList> res = [];
// if (params.keys.contains('object')) {
// Map object = FluroConvertUtils.string2map(params["object"].first);
// List temp = object['object'];
// for (var item in temp) {
// res.add(TableList.fromJson(item));
// }
// }
return ChangeNotifierProvider<PlanDishProvider>(
create: (_) => PlanDishProvider(), child: PlanNewDishFirstPage());
});
... ...
... ... @@ -155,10 +155,17 @@ class Routes {
"/feast_qy_menu_show_page"; //宴会-----新建宴会---签约菜单信息
static String feast_detail_page = "/feast_detail_page"; //宴会-----详情
static String feast_invoice_detail_page = "/feast_invoice_detail_page"; //宴会-----发票详情
static String feast_invoice_detail_page =
"/feast_invoice_detail_page"; //宴会-----发票详情
static String merge_table_select_page = "/merge_table_select_page"; //桌位管理---合并桌位选择桌位页面
static String merge_table_select_page =
"/merge_table_select_page"; //桌位管理---合并桌位选择桌位页面
/**
* 排菜
*/
static String my_plan_dish_home_page = "/my_plan_dish_home_page"; //我的-我的排菜
static String plan_new_dish_first_page = "/plan_new_dish_first_page"; //我的-我的排菜-创建新排菜前置条件录入
static void configureRoutes(FluroRouter router) {
... ... @@ -316,12 +323,14 @@ class Routes {
router.define(feast_qy_menu_show_page, handler: feastQYMenuPageHandle);
router.define(feast_detail_page, handler: feastDetailPageHandle);
router.define(feast_invoice_detail_page, handler: feastInvoiceDetailPageHandle);
router.define(merge_table_select_page, handler: mergeTableSelectPageHandle);
router.define(feast_invoice_detail_page,
handler: feastInvoiceDetailPageHandle);
router.define(merge_table_select_page, handler: mergeTableSelectPageHandle);
router.define(my_plan_dish_home_page, handler: myPlanDishHomePageHandle);
router.define(plan_new_dish_first_page, handler: planNewDishFirstPageHandle);
}
}
... ...