Commit 09fb625641c20f821375eaf85fbf20a24c3b9aa2

Authored by wdn127929
1 parent 033e5f81

预排菜4.0-4.5UI

813 Bytes

  1 +import 'package:flutter/material.dart';
  2 +import 'package:one_key/widgets/system_app_bar.dart';
  3 +
  4 +import '../../../res/colors.dart';
  5 +import '../../../utils/screen_util.dart';
  6 +import '../../../utils/utils.dart';
  7 +import '../../../widgets/MyDivider.dart';
  8 +import '../../../widgets/h_empty_view.dart';
  9 +import '../../../widgets/round_button.dart';
  10 +import '../../../widgets/v_empty_view.dart';
  11 +
  12 +class FinalPlanDishPage extends StatefulWidget {
  13 + FinalPlanDishPage({Key key}) : super(key: key);
  14 +
  15 + @override
  16 + _FinalPlanDishPageState createState() => _FinalPlanDishPageState();
  17 +}
  18 +
  19 +class _FinalPlanDishPageState extends State<FinalPlanDishPage> {
  20 + ScrollController controller = ScrollController();
  21 + Widget _laduWidget() {
  22 + // if (labelIcon[widget
  23 + // .cookBookList.labelList[index].icon] is int) {
  24 + // int ladu = labelIcon[
  25 + // widget.cookBookList.labelList[index].icon];
  26 + int ladu = 6;
  27 + List<Widget> widgetList = [];
  28 + for (var i = 0; i < ladu; i++) {
  29 + widgetList.add(Image.asset(
  30 + Utils.getImgPath('ladu'),
  31 + width: w(10),
  32 + ));
  33 + }
  34 + // widgetList.add(HEmptyView(10));
  35 + return Row(
  36 + children: widgetList,
  37 + );
  38 + // }else{
  39 + // return SizedBox();
  40 + // }
  41 + }
  42 +
  43 + @override
  44 + Widget build(BuildContext context) {
  45 + return Scaffold(
  46 + appBar: SystemAppBar('排菜单'),
  47 + backgroundColor: MyColours.color_ffffff,
  48 + body: Column(
  49 + children: [
  50 + Container(
  51 + width: double.infinity,
  52 + // width: w(32),
  53 + height: w(48),
  54 + padding: EdgeInsets.symmetric(horizontal: w(10)),
  55 + decoration: BoxDecoration(
  56 + border: Border(
  57 + top: BorderSide(
  58 + width: w(1), color: MyColours.color_DBDBDB),
  59 + bottom: BorderSide(
  60 + width: w(1), color: MyColours.color_DBDBDB))),
  61 + // constraints: BoxConstraints(minWidth: w(20)),
  62 + child: TextField(
  63 + maxLines: 1,
  64 + // controller:
  65 + // focusNode: _focusNode,
  66 + // autofocus: true,
  67 +
  68 + style: TextStyle(
  69 + color: MyColours.color_515151,
  70 + fontSize: font(16),
  71 + fontWeight: FontWeight.bold),
  72 + textAlign: TextAlign.left,
  73 + // textAlignVertical: TextAlignVertical.center,
  74 + decoration: InputDecoration(
  75 + hintText: "请输入排菜名称",
  76 + hintStyle: TextStyle(
  77 + color: MyColours.color_999999,
  78 + fontSize: font(16),
  79 + fontWeight: FontWeight.bold),
  80 + // isCollapsed:
  81 + // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
  82 + border: OutlineInputBorder(borderSide: BorderSide.none),
  83 + contentPadding: EdgeInsets.zero,
  84 + ),
  85 + keyboardType: TextInputType.text,
  86 + textInputAction: TextInputAction.done,
  87 +
  88 + onChanged: (value) {
  89 + // setState(() {});
  90 + // _searchSellerLocation();
  91 + // customerProvider.searchData(value);
  92 + },
  93 + onEditingComplete: () {
  94 + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  95 + // contantShowModel.searchData(
  96 + // contantShowModel.controller.text);
  97 + // _searchSellerLocation();
  98 + // _focusNode.unfocus();
  99 + },
  100 + )),
  101 + Expanded(
  102 + child: ListView.builder(
  103 + itemCount: 2,
  104 + shrinkWrap: true,
  105 + controller: controller,
  106 + itemBuilder: (context, index) {
  107 + return ListView.builder(
  108 + itemCount: 2 + 1,
  109 + shrinkWrap: true,
  110 + controller: controller,
  111 + itemBuilder: (context, index) {
  112 + if (index == 0) {
  113 + return Column(
  114 + children: [
  115 + //头
  116 + Container(
  117 + width: double.infinity,
  118 + // width: w(32),
  119 + height: w(48),
  120 + padding:
  121 + EdgeInsets.symmetric(horizontal: w(10)),
  122 + decoration: BoxDecoration(
  123 + border: Border(
  124 + bottom: BorderSide(
  125 + width: w(1),
  126 + color:
  127 + MyColours.color_DBDBDB))),
  128 + // constraints: BoxConstraints(minWidth: w(20)),
  129 + child: Row(
  130 + mainAxisAlignment:
  131 + MainAxisAlignment.spaceBetween,
  132 + children: [
  133 + Text(
  134 + '热菜',
  135 + style: TextStyle(
  136 + fontSize: font(16),
  137 + color: MyColours.color_515151,
  138 + fontWeight: FontWeight.bold),
  139 + ),
  140 + Text(
  141 + '6道',
  142 + style: TextStyle(
  143 + fontSize: font(14),
  144 + color: MyColours.color_515151,
  145 + ),
  146 + ),
  147 + ],
  148 + ))
  149 + ],
  150 + );
  151 + }
  152 + int indexReal = index - 1;
  153 + return Container(
  154 + padding: EdgeInsets.symmetric(
  155 + horizontal: w(20), vertical: w(13)),
  156 + decoration: BoxDecoration(
  157 + border: Border(
  158 + bottom: BorderSide(
  159 + width: w(1),
  160 + color: MyColours.color_DBDBDB))),
  161 + child: Row(
  162 + children: [
  163 + Container(
  164 + constraints:
  165 + BoxConstraints(maxWidth: w(80)),
  166 + child: Text(
  167 + '山城辣子鸡',
  168 + maxLines: 10,
  169 + overflow: TextOverflow.ellipsis,
  170 + style: TextStyle(
  171 + fontSize: font(14),
  172 + color: MyColours.color_515151),
  173 + )),
  174 + HEmptyView(8),
  175 + _laduWidget(),
  176 + Spacer(),
  177 + Text(
  178 + '38元/份',
  179 + maxLines: 2,
  180 + overflow: TextOverflow.ellipsis,
  181 + style: TextStyle(
  182 + fontSize: font(12),
  183 + color: MyColours.color_999999),
  184 + ),
  185 + HEmptyView(28),
  186 + Text(
  187 + '38元/份',
  188 + maxLines: 2,
  189 + overflow: TextOverflow.ellipsis,
  190 + style: TextStyle(
  191 + fontSize: font(10),
  192 + color: MyColours.color_8EBBBE),
  193 + ),
  194 + HEmptyView(20),
  195 + Image.asset(
  196 + Utils.getImgPath('plan_dish_minus'),
  197 + width: w(16),
  198 + ),
  199 + HEmptyView(8),
  200 + Container(
  201 + width: w(32),
  202 + height: w(16),
  203 + decoration: BoxDecoration(
  204 + borderRadius:
  205 + BorderRadius.circular(r(5)),
  206 + border: Border.all(
  207 + width: w(1),
  208 + color: MyColours.color_999999)),
  209 + // constraints: BoxConstraints(minWidth: w(20)),
  210 + child: TextField(
  211 + maxLines: 1,
  212 + // controller:
  213 + // focusNode: _focusNode,
  214 + // autofocus: true,
  215 +
  216 + style: TextStyle(
  217 + color: MyColours.color_438E93,
  218 + fontSize: font(12)),
  219 + textAlign: TextAlign.center,
  220 + // textAlignVertical: TextAlignVertical.center,
  221 + decoration: InputDecoration(
  222 + hintText: "数量",
  223 + hintStyle: TextStyle(
  224 + color: MyColours.color_999999,
  225 + fontSize: font(12),
  226 + ),
  227 + // isCollapsed:
  228 + // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
  229 + border: OutlineInputBorder(
  230 + borderSide: BorderSide.none),
  231 + contentPadding: EdgeInsets.zero,
  232 + ),
  233 + keyboardType: TextInputType.number,
  234 + textInputAction: TextInputAction.done,
  235 +
  236 + onChanged: (value) {
  237 + // setState(() {});
  238 + // _searchSellerLocation();
  239 + // customerProvider.searchData(value);
  240 + },
  241 + onEditingComplete: () {
  242 + FocusScope.of(context).requestFocus(
  243 + FocusNode()); //点击空白处隐藏键盘
  244 + // contantShowModel.searchData(
  245 + // contantShowModel.controller.text);
  246 + // _searchSellerLocation();
  247 + // _focusNode.unfocus();
  248 + },
  249 + )),
  250 + HEmptyView(8),
  251 + Image.asset(
  252 + Utils.getImgPath('plan_dish_add'),
  253 + width: w(16),
  254 + ),
  255 + ],
  256 + ),
  257 + );
  258 + });
  259 + })),
  260 + Container(
  261 + padding: EdgeInsets.symmetric(horizontal: w(15), vertical: w(7)),
  262 + margin: EdgeInsets.only(
  263 + top: w(7), bottom: w(13), left: w(20), right: w(20)),
  264 + decoration: BoxDecoration(
  265 + borderRadius: BorderRadius.circular(r(5)),
  266 + border: Border.all(width: w(1), color: MyColours.color_515151)),
  267 + child: TextField(
  268 + maxLines: 4,
  269 + // controller:
  270 + // focusNode: _focusNode,
  271 + // autofocus: true,
  272 +
  273 + style:
  274 + TextStyle(color: MyColours.color_515151, fontSize: font(12)),
  275 + textAlign: TextAlign.left,
  276 + // textAlignVertical: TextAlignVertical.center,
  277 + decoration: InputDecoration(
  278 + hintText: "请输入整单备注",
  279 + hintStyle: TextStyle(
  280 + color: MyColours.color_999999,
  281 + fontSize: font(12),
  282 + ),
  283 + // isCollapsed:
  284 + // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
  285 + border: OutlineInputBorder(borderSide: BorderSide.none),
  286 + contentPadding: EdgeInsets.zero,
  287 + ),
  288 + keyboardType: TextInputType.number,
  289 + textInputAction: TextInputAction.done,
  290 +
  291 + onChanged: (value) {
  292 + // setState(() {});
  293 + // _searchSellerLocation();
  294 + // customerProvider.searchData(value);
  295 + },
  296 + onEditingComplete: () {
  297 + FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
  298 + // contantShowModel.searchData(
  299 + // contantShowModel.controller.text);
  300 + // _searchSellerLocation();
  301 + // _focusNode.unfocus();
  302 + },
  303 + ),
  304 + ),
  305 + Container(
  306 + decoration: BoxDecoration(
  307 + border: Border(
  308 + top: BorderSide(
  309 + width: w(1), color: MyColours.color_DBDBDB))),
  310 + padding: EdgeInsets.symmetric(horizontal: w(20), vertical: w(15)),
  311 + child: Row(
  312 + children: [
  313 + Stack(
  314 + clipBehavior: Clip.none,
  315 + children: [
  316 + Image.asset(
  317 + Utils.getImgPath('plan_dish_car'),
  318 + width: w(35),
  319 + ),
  320 + Positioned(
  321 + top: w(-3),
  322 + right: w(-4),
  323 + child: Container(
  324 + // width: w(16),
  325 + constraints: BoxConstraints(minWidth: w(16)),
  326 + height: w(16),
  327 + alignment: Alignment.center,
  328 + decoration: BoxDecoration(
  329 + borderRadius: BorderRadius.circular(r(8)),
  330 + color: MyColours.color_E34D59),
  331 + child: Text(
  332 + '23',
  333 + style: TextStyle(
  334 + fontSize: font(10),
  335 + color: MyColours.color_F6F6F6),
  336 + ),
  337 + ))
  338 + ],
  339 + ),
  340 + HEmptyView(66),
  341 + Expanded(
  342 + child: Column(
  343 + children: [
  344 + Row(
  345 + children: [
  346 + Text(
  347 + '总计:',
  348 + style: TextStyle(
  349 + fontSize: font(12),
  350 + color: MyColours.color_515151),
  351 + ),
  352 + Text(
  353 + '0.00',
  354 + style: TextStyle(
  355 + fontSize: font(12),
  356 + color: MyColours.color_000000),
  357 + ),
  358 + Text(
  359 + '元',
  360 + style: TextStyle(
  361 + fontSize: font(12),
  362 + color: MyColours.color_515151),
  363 + ),
  364 + ],
  365 + ),
  366 + VEmptyView(20),
  367 + Row(
  368 + children: [
  369 + Text(
  370 + '会员价:',
  371 + style: TextStyle(
  372 + fontSize: font(12),
  373 + color: MyColours.color_515151),
  374 + ),
  375 + Text(
  376 + '0.00',
  377 + style: TextStyle(
  378 + fontSize: font(12),
  379 + color: MyColours.color_000000),
  380 + ),
  381 + Text(
  382 + '元',
  383 + style: TextStyle(
  384 + fontSize: font(12),
  385 + color: MyColours.color_515151),
  386 + ),
  387 + ],
  388 + )
  389 + ],
  390 + )),
  391 + HEmptyView(10),
  392 + Text(
  393 + '排菜价:',
  394 + style: TextStyle(
  395 + fontSize: font(12), color: MyColours.color_515151),
  396 + ),
  397 + Container(
  398 + width: w(65),
  399 + height: w(30),
  400 + decoration: BoxDecoration(
  401 + borderRadius: BorderRadius.circular(r(5)),
  402 + border: Border.all(
  403 + color: MyColours.color_515151, width: w(1))),
  404 + // constraints: BoxConstraints(minWidth: w(20)),
  405 + child: TextField(
  406 + maxLines: 1,
  407 + // controller:
  408 + // focusNode: _focusNode,
  409 + // autofocus: true,
  410 +
  411 + style: TextStyle(
  412 + color: MyColours.color_000000, fontSize: font(12)),
  413 + textAlign: TextAlign.center,
  414 + // textAlignVertical: TextAlignVertical.center,
  415 + decoration: InputDecoration(
  416 + hintText: "0.00",
  417 + hintStyle: TextStyle(
  418 + color: MyColours.color_999999,
  419 + fontSize: font(12),
  420 + ),
  421 + // isCollapsed:
  422 + // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
  423 + border: OutlineInputBorder(borderSide: BorderSide.none),
  424 + contentPadding: EdgeInsets.zero,
  425 + ),
  426 + keyboardType: TextInputType.number,
  427 + textInputAction: TextInputAction.done,
  428 +
  429 + onChanged: (value) {
  430 + // setState(() {});
  431 + // _searchSellerLocation();
  432 + // customerProvider.searchData(value);
  433 + },
  434 + onEditingComplete: () {
  435 + FocusScope.of(context)
  436 + .requestFocus(FocusNode()); //点击空白处隐藏键盘
  437 + // contantShowModel.searchData(
  438 + // contantShowModel.controller.text);
  439 + // _searchSellerLocation();
  440 + // _focusNode.unfocus();
  441 + },
  442 + )),
  443 + Text(
  444 + '元',
  445 + style: TextStyle(
  446 + fontSize: font(12), color: MyColours.color_515151),
  447 + ),
  448 + ],
  449 + ),
  450 + ),
  451 + Container(
  452 + color: MyColours.color_FAFAFA,
  453 + padding: EdgeInsets.only(
  454 + top: w(12), bottom: w(25), left: w(23), right: w(23)),
  455 + child: Row(
  456 + // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  457 + children: [
  458 + RoundButton(
  459 + text: '生成预览',
  460 + gradientStart: MyColours.color_ffffff,
  461 + gradientEnd: MyColours.color_ffffff,
  462 + borderColor: MyColours.color_438E93,
  463 + textColor: MyColours.color_438E93,
  464 + width: w(100),
  465 + height: w(43),
  466 + radius: r(5),
  467 + fontSize: 32,
  468 + isBold: false,
  469 + onPressed: () {
  470 + // NavigatorUtil.goFinalPlanDishPage(context);
  471 + },
  472 + ),
  473 + HEmptyView(30),
  474 + Expanded(
  475 + child: RoundButton(
  476 + text: '保存排菜单',
  477 + gradientStart: MyColours.color_438E93,
  478 + gradientEnd: MyColours.color_438E93,
  479 + height: w(43),
  480 + radius: r(5),
  481 + fontSize: 36,
  482 + isBold: false,
  483 + onPressed: () {
  484 + // NavigatorUtil.goFinalPlanDishPage(context);
  485 + },
  486 + ),
  487 + )
  488 + ],
  489 + ))
  490 + ],
  491 + ),
  492 + );
  493 + }
  494 +}
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
  2 +import 'package:one_key/route/navigator_util.dart';
2 import 'package:one_key/utils/utils.dart'; 3 import 'package:one_key/utils/utils.dart';
3 import 'package:one_key/widgets/MyDivider.dart'; 4 import 'package:one_key/widgets/MyDivider.dart';
4 import 'package:one_key/widgets/h_empty_view.dart'; 5 import 'package:one_key/widgets/h_empty_view.dart';
@@ -26,7 +27,9 @@ class _PlanNewDishFirstPageState extends State<PlanNewDishFirstPage> { @@ -26,7 +27,9 @@ class _PlanNewDishFirstPageState extends State<PlanNewDishFirstPage> {
26 return Row( 27 return Row(
27 children: [ 28 children: [
28 HEmptyView(86), 29 HEmptyView(86),
29 - Image.asset(Utils.getImgPath(select ? 'plan_dish_select' : 'plan_dish_unselect'), 30 + Image.asset(
  31 + Utils.getImgPath(
  32 + select ? 'plan_dish_select' : 'plan_dish_unselect'),
30 width: w(20)), 33 width: w(20)),
31 HEmptyView(10), 34 HEmptyView(10),
32 Text( 35 Text(
@@ -204,6 +207,9 @@ class _PlanNewDishFirstPageState extends State<PlanNewDishFirstPage> { @@ -204,6 +207,9 @@ class _PlanNewDishFirstPageState extends State<PlanNewDishFirstPage> {
204 radius: r(5), 207 radius: r(5),
205 fontSize: 36, 208 fontSize: 36,
206 isBold: false, 209 isBold: false,
  210 + onPressed: () {
  211 + NavigatorUtil.goPlanNewDishPage(context);
  212 + },
207 ), 213 ),
208 ) 214 )
209 ], 215 ],
  1 +import 'package:flutter/material.dart';
  2 +import 'package:one_key/provider/plan_dish_provider.dart';
  3 +import 'package:one_key/utils/screen_util.dart';
  4 +import 'package:one_key/widgets/h_empty_view.dart';
  5 +import 'package:one_key/widgets/system_app_bar.dart';
  6 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  7 +import 'package:one_key/widgets/v_empty_view.dart';
  8 +import 'package:provider/provider.dart';
  9 +import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
  10 +
  11 +import '../../../constant/state.dart';
  12 +import '../../../res/colors.dart';
  13 +import '../../../route/navigator_util.dart';
  14 +import '../../../utils/utils.dart';
  15 +import '../../../widgets/MyDivider.dart';
  16 +import '../../../widgets/page_exception.dart';
  17 +import '../../../widgets/round_button.dart';
  18 +
  19 +const scrollDuration = Duration(microseconds: 500);
  20 +
  21 +class PlanNewDishPage extends StatefulWidget {
  22 + PlanNewDishPage({
  23 + Key key,
  24 + }) : super(key: key);
  25 +
  26 + @override
  27 + _PlanNewDishPageState createState() => _PlanNewDishPageState();
  28 +}
  29 +
  30 +class _PlanNewDishPageState extends State<PlanNewDishPage> {
  31 + int _selectIndex = 0;
  32 + int min;
  33 + int max;
  34 + bool isTap = false;
  35 +
  36 + final ItemScrollController itemScrollController = ItemScrollController();
  37 +
  38 + final ItemPositionsListener itemPositionsListener =
  39 + ItemPositionsListener.create();
  40 +
  41 + PlanDishProvider _planDishProvider;
  42 +
  43 + @override
  44 + void initState() {
  45 + super.initState();
  46 + WidgetsBinding.instance.addPostFrameCallback((_) async {
  47 + _getMenuData();
  48 + });
  49 + }
  50 +
  51 + ///接口
  52 + _getMenuData() {
  53 + // Map<String, dynamic> params = {"sellerid": int.parse(widget.sellerID)};
  54 + // _storeMenuProvider.getStoreMenu(context, params);
  55 + }
  56 +
  57 + Widget list(List data) => ScrollablePositionedList.builder(
  58 + // itemCount: data.length,
  59 + itemCount: 10,
  60 + itemBuilder: (context, index) => item(index),
  61 + itemScrollController: itemScrollController,
  62 + itemPositionsListener: itemPositionsListener,
  63 + reverse: false,
  64 + scrollDirection: Axis.vertical,
  65 + );
  66 +
  67 + void scrollTo(int index) => itemScrollController.scrollTo(
  68 + index: index,
  69 + duration: scrollDuration,
  70 + curve: Curves.easeInOutCubic,
  71 + alignment: 0);
  72 +
  73 + void jumpTo(int index) =>
  74 + itemScrollController.jumpTo(index: index, alignment: 0);
  75 +
  76 + /// Generate item number [i].
  77 + Widget item(int i) {
  78 + return ListView.builder(
  79 + shrinkWrap: true,
  80 + physics: NeverScrollableScrollPhysics(),
  81 + itemCount: 100,
  82 + itemBuilder: (BuildContext context, int index) {
  83 + return Container(
  84 + width: 200,
  85 + height: 200,
  86 + color: Colors.red,
  87 + );
  88 + });
  89 + // return Container(
  90 + // // height: ScreenUtil().setWidth(110 * 2) *
  91 + // // _storeMenuProvider.menulist[i].cookbooklist.length +
  92 + // // ScreenUtil().setWidth(60 * 2),
  93 + // height: ScreenUtil().setWidth(110 * 2) * 100 +
  94 + // ScreenUtil().setWidth(60 * 2),
  95 + // child: Column(
  96 + // children: [
  97 + // Container(
  98 + // alignment: Alignment.centerLeft,
  99 + // height: ScreenUtil().setWidth(60 * 2),
  100 + // child: Text('热菜',
  101 + // style: TextStyle(
  102 + // fontSize: ScreenUtil().setWidth(30),
  103 + // color: MyColours.color_666666)),
  104 + // ),
  105 + // Container(
  106 + // height: ScreenUtil().setWidth(110 * 2) * 100,
  107 + // child: ListView.builder(
  108 + // shrinkWrap: true,
  109 + // physics: NeverScrollableScrollPhysics(),
  110 + // itemCount: 100,
  111 + // itemBuilder: (BuildContext context, int index) {
  112 + // return Container();
  113 + // })),
  114 + // ],
  115 + // ));
  116 + }
  117 +
  118 + Widget _laduWidget() {
  119 + // if (labelIcon[widget
  120 + // .cookBookList.labelList[index].icon] is int) {
  121 + // int ladu = labelIcon[
  122 + // widget.cookBookList.labelList[index].icon];
  123 + int ladu = 3;
  124 + List<Widget> widgetList = [];
  125 + for (var i = 0; i < ladu; i++) {
  126 + widgetList.add(Image.asset(
  127 + Utils.getImgPath('ladu'),
  128 + width: w(10),
  129 + ));
  130 + }
  131 + // widgetList.add(HEmptyView(10));
  132 + return Row(
  133 + children: widgetList,
  134 + );
  135 + // }else{
  136 + // return SizedBox();
  137 + // }
  138 + }
  139 +
  140 + @override
  141 + Widget build(BuildContext context) {
  142 + _planDishProvider = Provider.of<PlanDishProvider>(context, listen: true);
  143 + return Scaffold(
  144 + backgroundColor: MyColours.color_ffffff,
  145 + appBar: SystemAppBar('经理排菜'),
  146 + body: Consumer<PlanDishProvider>(builder: (context, model, child) {
  147 + if (model.pageState == PageState.Success) {
  148 + return Column(
  149 + children: [
  150 + MyDivider(
  151 + double.infinity,
  152 + ScreenUtil().setWidth(1),
  153 + color: MyColours.color_DBDBDB,
  154 + ),
  155 + Expanded(
  156 + child: Row(
  157 + children: [
  158 + ValueListenableBuilder<Iterable<ItemPosition>>(
  159 + valueListenable: itemPositionsListener.itemPositions,
  160 + builder: (context, positions, child) {
  161 + // if (positions.isNotEmpty) {
  162 + // // max = positions
  163 + // // .where((ItemPosition position) =>
  164 + // // position.itemLeadingEdge < 1)
  165 + // // .reduce((ItemPosition max,
  166 + // // ItemPosition position) =>
  167 + // // position.itemLeadingEdge >
  168 + // // max.itemLeadingEdge
  169 + // // ? position
  170 + // // : max)
  171 + // // .index;
  172 + // min = positions
  173 + // .where((ItemPosition position) =>
  174 + // position.itemTrailingEdge > 0)
  175 + // .reduce((ItemPosition min,
  176 + // ItemPosition position) =>
  177 + // position.itemTrailingEdge <
  178 + // min.itemTrailingEdge
  179 + // ? position
  180 + // : min)
  181 + // .index;
  182 +
  183 + // if (isTap) {
  184 + // if (min >= _selectIndex) {
  185 + // _selectIndex = min;
  186 + // } else {
  187 + // _selectIndex = _selectIndex;
  188 + // }
  189 + // isTap = false;
  190 + // } else {
  191 + // _selectIndex = min;
  192 + // }
  193 + // }
  194 + return Container(
  195 + height: double.infinity,
  196 + color: MyColours.color_F9F9F9,
  197 + width: ScreenUtil().setWidth(85 * 2),
  198 + child: ListView.builder(
  199 + // itemCount:
  200 + // _storeMenuProvider.menulist.length,
  201 + itemCount: 100,
  202 + itemBuilder:
  203 + (BuildContext context, int index) {
  204 + return InkWell(
  205 + onTap: () {
  206 + isTap = true;
  207 + // scrollTo(index);
  208 + setState(() {
  209 + _selectIndex = index;
  210 + });
  211 + },
  212 + child: Stack(
  213 + children: [
  214 + Container(
  215 + height:
  216 + ScreenUtil().setWidth(60 * 2),
  217 + decoration: BoxDecoration(
  218 + color: _selectIndex == index
  219 + ? MyColours.color_DBDBDB
  220 + : MyColours.color_ffffff,
  221 + border: Border(
  222 + right: BorderSide(
  223 + width: w(1),
  224 + color: MyColours
  225 + .color_DBDBDB),
  226 + bottom: BorderSide(
  227 + width: w(1),
  228 + color: MyColours
  229 + .color_DBDBDB))),
  230 + alignment: Alignment.center,
  231 + padding: EdgeInsets.symmetric(
  232 + horizontal:
  233 + ScreenUtil().setWidth(30),
  234 + vertical: ScreenUtil()
  235 + .setWidth(20)),
  236 + child: Text(
  237 + // _storeMenuProvider
  238 + // .menulist[index].className,
  239 + '热菜',
  240 + maxLines: 2,
  241 + overflow: TextOverflow.ellipsis,
  242 + style: TextStyle(
  243 + fontSize:
  244 + ScreenUtil().setSp(28),
  245 + color: _selectIndex == index
  246 + ? MyColours.color_333333
  247 + : MyColours
  248 + .color_999999),
  249 + ),
  250 + ),
  251 + Positioned(
  252 + top: w(2),
  253 + right: w(2),
  254 + child: Container(
  255 + // width: w(16),
  256 + constraints: BoxConstraints(
  257 + minWidth: w(16)),
  258 + height: w(16),
  259 + alignment: Alignment.center,
  260 + decoration: BoxDecoration(
  261 + borderRadius:
  262 + BorderRadius.circular(
  263 + r(8)),
  264 + color: MyColours
  265 + .color_E34D59),
  266 + child: Text(
  267 + '23',
  268 + style: TextStyle(
  269 + fontSize: font(10),
  270 + color: MyColours
  271 + .color_F6F6F6),
  272 + ),
  273 + ))
  274 + ],
  275 + ),
  276 + );
  277 + }));
  278 + }),
  279 + Expanded(
  280 + child: Container(
  281 + padding: EdgeInsets.symmetric(horizontal: w(10)),
  282 + // width: ScreenUtil().setWidth(290 * 2),
  283 +
  284 + child: ListView.builder(
  285 + shrinkWrap: true,
  286 + // physics: NeverScrollableScrollPhysics(),
  287 + itemCount: 10,
  288 + itemBuilder:
  289 + (BuildContext context, int index) {
  290 + return Container(
  291 + padding:
  292 + EdgeInsets.symmetric(vertical: w(16)),
  293 + decoration: BoxDecoration(
  294 + border: Border(
  295 + bottom: BorderSide(
  296 + color: MyColours.color_DBDBDB,
  297 + width: w(1)))),
  298 + child: Row(
  299 + children: [
  300 + Expanded(
  301 + child: Column(
  302 + crossAxisAlignment:
  303 + CrossAxisAlignment.start,
  304 + children: [
  305 + Row(
  306 + children: [
  307 + Container(
  308 + constraints:
  309 + BoxConstraints(
  310 + maxWidth: w(100)),
  311 + child: Text(
  312 + '菜菜菜',
  313 + maxLines: 10,
  314 + overflow: TextOverflow
  315 + .ellipsis,
  316 + style: TextStyle(
  317 + fontSize: font(16),
  318 + fontWeight:
  319 + FontWeight.bold,
  320 + color: MyColours
  321 + .color_515151),
  322 + )),
  323 + HEmptyView(8),
  324 + _laduWidget()
  325 + ],
  326 + ),
  327 + VEmptyView(24),
  328 + Row(
  329 + children: [
  330 + Text(
  331 + '858.0元/份',
  332 + style: TextStyle(
  333 + fontSize: font(12),
  334 + color: MyColours
  335 + .color_999999),
  336 + ),
  337 + Text(
  338 + '824.0元/份',
  339 + style: TextStyle(
  340 + fontSize: font(10),
  341 + color: MyColours
  342 + .color_8EBBBE),
  343 + ),
  344 + ],
  345 + )
  346 + ],
  347 + )),
  348 + // Spacer(),
  349 + Image.asset(
  350 + Utils.getImgPath('plan_dish_minus'),
  351 + width: w(16),
  352 + ),
  353 + HEmptyView(8),
  354 + Container(
  355 + width: w(32),
  356 + height: w(16),
  357 + decoration: BoxDecoration(
  358 + borderRadius:
  359 + BorderRadius.circular(
  360 + r(5)),
  361 + border: Border.all(
  362 + width: w(1),
  363 + color: MyColours
  364 + .color_999999)),
  365 + // constraints: BoxConstraints(minWidth: w(20)),
  366 + child: TextField(
  367 + maxLines: 1,
  368 + // controller:
  369 + // focusNode: _focusNode,
  370 + // autofocus: true,
  371 +
  372 + style: TextStyle(
  373 + color:
  374 + MyColours.color_438E93,
  375 + fontSize: font(12)),
  376 + textAlign: TextAlign.center,
  377 + // textAlignVertical: TextAlignVertical.center,
  378 + decoration: InputDecoration(
  379 + hintText: "人数",
  380 + hintStyle: TextStyle(
  381 + color:
  382 + MyColours.color_999999,
  383 + fontSize: font(12),
  384 + ),
  385 + // isCollapsed:
  386 + // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
  387 + border: OutlineInputBorder(
  388 + borderSide:
  389 + BorderSide.none),
  390 + contentPadding:
  391 + EdgeInsets.zero,
  392 + ),
  393 + keyboardType:
  394 + TextInputType.number,
  395 + textInputAction:
  396 + TextInputAction.done,
  397 +
  398 + onChanged: (value) {
  399 + // setState(() {});
  400 + // _searchSellerLocation();
  401 + // customerProvider.searchData(value);
  402 + },
  403 + onEditingComplete: () {
  404 + FocusScope.of(context)
  405 + .requestFocus(
  406 + FocusNode()); //点击空白处隐藏键盘
  407 + // contantShowModel.searchData(
  408 + // contantShowModel.controller.text);
  409 + // _searchSellerLocation();
  410 + // _focusNode.unfocus();
  411 + },
  412 + )),
  413 + HEmptyView(8),
  414 + Image.asset(
  415 + Utils.getImgPath('plan_dish_add'),
  416 + width: w(16),
  417 + ),
  418 + ],
  419 + ),
  420 + );
  421 + })))
  422 + ],
  423 + ),
  424 + ),
  425 + Container(
  426 + decoration: BoxDecoration(
  427 + border: Border(
  428 + top: BorderSide(
  429 + width: w(1), color: MyColours.color_DBDBDB))),
  430 + padding:
  431 + EdgeInsets.symmetric(horizontal: w(20), vertical: w(15)),
  432 + child: Row(
  433 + children: [
  434 + Stack(
  435 + clipBehavior: Clip.none,
  436 + children: [
  437 + Image.asset(
  438 + Utils.getImgPath('plan_dish_car'),
  439 + width: w(35),
  440 + ),
  441 + Positioned(
  442 + top: w(-3),
  443 + right: w(-4),
  444 + child: Container(
  445 + // width: w(16),
  446 + constraints: BoxConstraints(minWidth: w(16)),
  447 + height: w(16),
  448 + alignment: Alignment.center,
  449 + decoration: BoxDecoration(
  450 + borderRadius: BorderRadius.circular(r(8)),
  451 + color: MyColours.color_E34D59),
  452 + child: Text(
  453 + '23',
  454 + style: TextStyle(
  455 + fontSize: font(10),
  456 + color: MyColours.color_F6F6F6),
  457 + ),
  458 + ))
  459 + ],
  460 + ),
  461 + HEmptyView(66),
  462 + Expanded(
  463 + child: Column(
  464 + children: [
  465 + Row(
  466 + children: [
  467 + Text(
  468 + '总计:',
  469 + style: TextStyle(
  470 + fontSize: font(12),
  471 + color: MyColours.color_515151),
  472 + ),
  473 + Text(
  474 + '0.00',
  475 + style: TextStyle(
  476 + fontSize: font(12),
  477 + color: MyColours.color_000000),
  478 + ),
  479 + Text(
  480 + '元',
  481 + style: TextStyle(
  482 + fontSize: font(12),
  483 + color: MyColours.color_515151),
  484 + ),
  485 + ],
  486 + ),
  487 + VEmptyView(20),
  488 + Row(
  489 + children: [
  490 + Text(
  491 + '会员价:',
  492 + style: TextStyle(
  493 + fontSize: font(12),
  494 + color: MyColours.color_515151),
  495 + ),
  496 + Text(
  497 + '0.00',
  498 + style: TextStyle(
  499 + fontSize: font(12),
  500 + color: MyColours.color_000000),
  501 + ),
  502 + Text(
  503 + '元',
  504 + style: TextStyle(
  505 + fontSize: font(12),
  506 + color: MyColours.color_515151),
  507 + ),
  508 + ],
  509 + )
  510 + ],
  511 + )),
  512 + HEmptyView(10),
  513 + Text(
  514 + '排菜价:',
  515 + style: TextStyle(
  516 + fontSize: font(12), color: MyColours.color_515151),
  517 + ),
  518 + Container(
  519 + width: w(65),
  520 + height: w(30),
  521 + decoration: BoxDecoration(
  522 + borderRadius: BorderRadius.circular(r(5)),
  523 + border: Border.all(
  524 + color: MyColours.color_515151, width: w(1))),
  525 + // constraints: BoxConstraints(minWidth: w(20)),
  526 + child: TextField(
  527 + maxLines: 1,
  528 + // controller:
  529 + // focusNode: _focusNode,
  530 + // autofocus: true,
  531 +
  532 + style: TextStyle(
  533 + color: MyColours.color_000000,
  534 + fontSize: font(12)),
  535 + textAlign: TextAlign.center,
  536 + // textAlignVertical: TextAlignVertical.center,
  537 + decoration: InputDecoration(
  538 + hintText: "0.00",
  539 + hintStyle: TextStyle(
  540 + color: MyColours.color_999999,
  541 + fontSize: font(12),
  542 + ),
  543 + // isCollapsed:
  544 + // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
  545 + border: OutlineInputBorder(
  546 + borderSide: BorderSide.none),
  547 + contentPadding: EdgeInsets.zero,
  548 + ),
  549 + keyboardType: TextInputType.number,
  550 + textInputAction: TextInputAction.done,
  551 +
  552 + onChanged: (value) {
  553 + // setState(() {});
  554 + // _searchSellerLocation();
  555 + // customerProvider.searchData(value);
  556 + },
  557 + onEditingComplete: () {
  558 + FocusScope.of(context)
  559 + .requestFocus(FocusNode()); //点击空白处隐藏键盘
  560 + // contantShowModel.searchData(
  561 + // contantShowModel.controller.text);
  562 + // _searchSellerLocation();
  563 + // _focusNode.unfocus();
  564 + },
  565 + )),
  566 + Text(
  567 + '元',
  568 + style: TextStyle(
  569 + fontSize: font(12), color: MyColours.color_515151),
  570 + ),
  571 + ],
  572 + ),
  573 + ),
  574 + Container(
  575 + color: MyColours.color_FAFAFA,
  576 + padding: EdgeInsets.only(
  577 + top: w(12), bottom: w(25), left: w(45), right: w(45)),
  578 + child: RoundButton(
  579 + text: '提交',
  580 + gradientStart: MyColours.color_438E93,
  581 + gradientEnd: MyColours.color_438E93,
  582 + width: double.infinity,
  583 + height: w(43),
  584 + radius: r(5),
  585 + fontSize: 36,
  586 + isBold: false,
  587 + onPressed: () {
  588 + NavigatorUtil.goFinalPlanDishPage(context);
  589 + },
  590 + ),
  591 + )
  592 + ],
  593 + );
  594 + } else {
  595 + return ExceptionPage(
  596 + pageState: model.pageState,
  597 + emptyMsg: '暂时没有菜单哦',
  598 + callback: () {
  599 + // _getMenuData();
  600 + },
  601 + );
  602 + }
  603 + }));
  604 + }
  605 +}
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
  2 +import 'package:one_key/constant/state.dart';
  3 +
2 /** 4 /**
3 * 预排菜 5 * 预排菜
4 */ 6 */
5 -class PlanDishProvider extends ChangeNotifier {} 7 +class PlanDishProvider extends ChangeNotifier {
  8 + PageState pageState = PageState.Success;
  9 +}
@@ -1165,4 +1165,44 @@ class NavigatorUtil { @@ -1165,4 +1165,44 @@ class NavigatorUtil {
1165 return _navigateTo(context, "${Routes.plan_new_dish_first_page}", 1165 return _navigateTo(context, "${Routes.plan_new_dish_first_page}",
1166 replace: replace); 1166 replace: replace);
1167 } 1167 }
  1168 +
  1169 + ///排菜-菜单点菜
  1170 + ///
  1171 +
  1172 + static Future<dynamic> goPlanNewDishPage(
  1173 + BuildContext context, {
  1174 + replace = false,
  1175 + }) {
  1176 + // if (invoice != null) {
  1177 + // return _navigateTo(context,
  1178 + // "${Routes.plan_new_dish_first_page}?invoice=${FluroConvertUtils.object2string(invoice)}",
  1179 + // replace: replace);
  1180 + // }
  1181 + // if (object != null) {
  1182 + // return _navigateTo(context,
  1183 + // "${Routes.plan_new_dish_first_page}?tids=$tids&tableidNow=$tableidNow&fromPage=$fromPage&canChoose=$canChoose&object=${FluroConvertUtils.object2string(object)}");
  1184 + // }
  1185 + return _navigateTo(context, "${Routes.plan_new_dish_page}",
  1186 + replace: replace);
  1187 + }
  1188 +
  1189 + ///排菜-排菜单
  1190 + ///
  1191 +
  1192 + static Future<dynamic> goFinalPlanDishPage(
  1193 + BuildContext context, {
  1194 + replace = false,
  1195 + }) {
  1196 + // if (invoice != null) {
  1197 + // return _navigateTo(context,
  1198 + // "${Routes.final_plan_dish_page}?invoice=${FluroConvertUtils.object2string(invoice)}",
  1199 + // replace: replace);
  1200 + // }
  1201 + // if (object != null) {
  1202 + // return _navigateTo(context,
  1203 + // "${Routes.final_plan_dish_page}?tids=$tids&tableidNow=$tableidNow&fromPage=$fromPage&canChoose=$canChoose&object=${FluroConvertUtils.object2string(object)}");
  1204 + // }
  1205 + return _navigateTo(context, "${Routes.final_plan_dish_page}",
  1206 + replace: replace);
  1207 + }
1168 } 1208 }
@@ -174,8 +174,10 @@ import '../pages/my/feast_manage/feast_setmeal_manage_edit_page.dart'; @@ -174,8 +174,10 @@ import '../pages/my/feast_manage/feast_setmeal_manage_edit_page.dart';
174 import '../pages/my/feast_manage/feast_type_page.dart'; 174 import '../pages/my/feast_manage/feast_type_page.dart';
175 import '../pages/my/feast_manage/feast_wine_manage_edit_page.dart'; 175 import '../pages/my/feast_manage/feast_wine_manage_edit_page.dart';
176 import '../pages/my/feast_manage/feast_wine_manage_page.dart'; 176 import '../pages/my/feast_manage/feast_wine_manage_page.dart';
  177 +import '../pages/my/plan_dish/final_plan_dish_page.dart';
177 import '../pages/my/plan_dish/my_plan_dish_home_page.dart'; 178 import '../pages/my/plan_dish/my_plan_dish_home_page.dart';
178 import '../pages/my/plan_dish/plan_new_dish_first_page.dart'; 179 import '../pages/my/plan_dish/plan_new_dish_first_page.dart';
  180 +import '../pages/my/plan_dish/plan_new_dish_page.dart';
179 import '../pages/my/table_manage/merge_table_select_page.dart'; 181 import '../pages/my/table_manage/merge_table_select_page.dart';
180 import '../provider/feast_model.dart'; 182 import '../provider/feast_model.dart';
181 import '../provider/plan_dish_provider.dart'; 183 import '../provider/plan_dish_provider.dart';
@@ -1847,7 +1849,6 @@ var myPlanDishHomePageHandle = new Handler( @@ -1847,7 +1849,6 @@ var myPlanDishHomePageHandle = new Handler(
1847 create: (_) => PlanDishProvider(), child: MyPlanDishHomePage()); 1849 create: (_) => PlanDishProvider(), child: MyPlanDishHomePage());
1848 }); 1850 });
1849 1851
1850 -  
1851 ///我的-我的排菜-创建新排菜前置条件录入 1852 ///我的-我的排菜-创建新排菜前置条件录入
1852 var planNewDishFirstPageHandle = new Handler( 1853 var planNewDishFirstPageHandle = new Handler(
1853 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { 1854 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
@@ -1868,3 +1869,45 @@ var planNewDishFirstPageHandle = new Handler( @@ -1868,3 +1869,45 @@ var planNewDishFirstPageHandle = new Handler(
1868 return ChangeNotifierProvider<PlanDishProvider>( 1869 return ChangeNotifierProvider<PlanDishProvider>(
1869 create: (_) => PlanDishProvider(), child: PlanNewDishFirstPage()); 1870 create: (_) => PlanDishProvider(), child: PlanNewDishFirstPage());
1870 }); 1871 });
  1872 +
  1873 +///排菜---菜单点菜
  1874 +var planNewDishPageHandle = new Handler(
  1875 + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  1876 + // String fromPage = params["fromPage"].first;
  1877 + // String tids = params["tids"].first;
  1878 +
  1879 + // String tableidNow = params["tableidNow"].first;
  1880 + // bool canChoose = params["canChoose"].first == "true" ? true : false;
  1881 + // List<TableList> res = [];
  1882 + // if (params.keys.contains('object')) {
  1883 + // Map object = FluroConvertUtils.string2map(params["object"].first);
  1884 + // List temp = object['object'];
  1885 +
  1886 + // for (var item in temp) {
  1887 + // res.add(TableList.fromJson(item));
  1888 + // }
  1889 + // }
  1890 + return ChangeNotifierProvider<PlanDishProvider>(
  1891 + create: (_) => PlanDishProvider(), child: PlanNewDishPage());
  1892 +});
  1893 +
  1894 +///排菜---排菜单
  1895 +var finalPlanDishPageHandle = new Handler(
  1896 + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  1897 + // String fromPage = params["fromPage"].first;
  1898 + // String tids = params["tids"].first;
  1899 +
  1900 + // String tableidNow = params["tableidNow"].first;
  1901 + // bool canChoose = params["canChoose"].first == "true" ? true : false;
  1902 + // List<TableList> res = [];
  1903 + // if (params.keys.contains('object')) {
  1904 + // Map object = FluroConvertUtils.string2map(params["object"].first);
  1905 + // List temp = object['object'];
  1906 +
  1907 + // for (var item in temp) {
  1908 + // res.add(TableList.fromJson(item));
  1909 + // }
  1910 + // }
  1911 + return ChangeNotifierProvider<PlanDishProvider>(
  1912 + create: (_) => PlanDishProvider(), child: FinalPlanDishPage());
  1913 +});
@@ -165,7 +165,10 @@ class Routes { @@ -165,7 +165,10 @@ class Routes {
165 */ 165 */
166 166
167 static String my_plan_dish_home_page = "/my_plan_dish_home_page"; //我的-我的排菜 167 static String my_plan_dish_home_page = "/my_plan_dish_home_page"; //我的-我的排菜
168 -static String plan_new_dish_first_page = "/plan_new_dish_first_page"; //我的-我的排菜-创建新排菜前置条件录入 168 + static String plan_new_dish_first_page =
  169 + "/plan_new_dish_first_page"; //我的-我的排菜-创建新排菜前置条件录入
  170 + static String plan_new_dish_page = "/plan_new_dish_page"; //排菜菜单点菜
  171 +static String final_plan_dish_page = "/final_plan_dish_page"; //排菜单
169 172
170 173
171 static void configureRoutes(FluroRouter router) { 174 static void configureRoutes(FluroRouter router) {
@@ -328,9 +331,10 @@ static String plan_new_dish_first_page = "/plan_new_dish_first_page"; //我的-æ @@ -328,9 +331,10 @@ static String plan_new_dish_first_page = "/plan_new_dish_first_page"; //我的-æ
328 router.define(merge_table_select_page, handler: mergeTableSelectPageHandle); 331 router.define(merge_table_select_page, handler: mergeTableSelectPageHandle);
329 332
330 router.define(my_plan_dish_home_page, handler: myPlanDishHomePageHandle); 333 router.define(my_plan_dish_home_page, handler: myPlanDishHomePageHandle);
331 - router.define(plan_new_dish_first_page, handler: planNewDishFirstPageHandle);  
332 -  
333 - 334 + router.define(plan_new_dish_first_page,
  335 + handler: planNewDishFirstPageHandle);
  336 + router.define(plan_new_dish_page, handler: planNewDishPageHandle);
  337 + router.define(final_plan_dish_page, handler: finalPlanDishPageHandle);
334 338
335 } 339 }
336 } 340 }