Showing
16 changed files
with
2538 additions
and
15 deletions
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | + | ||
| 4 | +import '../../../res/colors.dart'; | ||
| 5 | +import '../../../route/navigator_util.dart'; | ||
| 6 | +import '../../../utils/screen_util.dart'; | ||
| 7 | +import '../../../utils/utils.dart'; | ||
| 8 | +import '../../../widgets/h_empty_view.dart'; | ||
| 9 | +import '../../../widgets/system_app_bar.dart'; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * | ||
| 13 | + * 定金设置 | ||
| 14 | + */ | ||
| 15 | + | ||
| 16 | +class FeastDepositManagePage extends StatefulWidget { | ||
| 17 | + FeastDepositManagePage({Key key}) : super(key: key); | ||
| 18 | + | ||
| 19 | + @override | ||
| 20 | + _FeastDepositManagePageState createState() => _FeastDepositManagePageState(); | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +class _FeastDepositManagePageState extends State<FeastDepositManagePage> { | ||
| 24 | + bool canrReturn = true; //是否可退 | ||
| 25 | + @override | ||
| 26 | + void initState() { | ||
| 27 | + super.initState(); | ||
| 28 | + Utils.changeStatusColor(color: MyColours.color_438E93); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + Widget feastManegeItem(String title, {GestureTapCallback onTap}) { | ||
| 32 | + return InkWell( | ||
| 33 | + onTap: onTap, | ||
| 34 | + child: Container( | ||
| 35 | + height: h(48), | ||
| 36 | + margin: EdgeInsets.only(top: w(12)), | ||
| 37 | + decoration: BoxDecoration( | ||
| 38 | + border: Border( | ||
| 39 | + bottom: BorderSide( | ||
| 40 | + width: w(0.5), color: MyColours.color_E7E7E7))), | ||
| 41 | + child: Row( | ||
| 42 | + children: [ | ||
| 43 | + Text( | ||
| 44 | + title, | ||
| 45 | + style: TextStyle( | ||
| 46 | + fontSize: font(16), color: MyColours.color_E5000000), | ||
| 47 | + ), | ||
| 48 | + Spacer(), | ||
| 49 | + Text( | ||
| 50 | + '修改/添加', | ||
| 51 | + style: TextStyle( | ||
| 52 | + fontSize: font(16), color: MyColours.color_66000000), | ||
| 53 | + ), | ||
| 54 | + HEmptyView(22), | ||
| 55 | + Image.asset( | ||
| 56 | + "assets/arrow_right_new.png", | ||
| 57 | + width: ScreenUtil().setWidth(9 * 2), | ||
| 58 | + height: ScreenUtil().setWidth(16 * 2), | ||
| 59 | + ), | ||
| 60 | + HEmptyView(48), | ||
| 61 | + ], | ||
| 62 | + ), | ||
| 63 | + )); | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + @override | ||
| 67 | + Widget build(BuildContext context) { | ||
| 68 | + return Scaffold( | ||
| 69 | + backgroundColor: MyColours.color_ffffff, | ||
| 70 | + appBar: SystemAppBar( | ||
| 71 | + '定金设置', | ||
| 72 | + needWhite: true, | ||
| 73 | + bgColor: MyColours.color_438E93, | ||
| 74 | + titleColor: MyColours.color_F6F6F6, | ||
| 75 | + onTap: () { | ||
| 76 | + Navigator.pop(context); | ||
| 77 | + }, | ||
| 78 | + ), | ||
| 79 | + body: Padding( | ||
| 80 | + padding: EdgeInsets.only(left: w(16)), | ||
| 81 | + child: Column( | ||
| 82 | + children: [ | ||
| 83 | + feastManegeItem('定金类型', onTap: () { | ||
| 84 | + NavigatorUtil.goFeastDepositTypePage(context); | ||
| 85 | + }), | ||
| 86 | + Container( | ||
| 87 | + height: w(48), | ||
| 88 | + margin: EdgeInsets.only(top: w(12)), | ||
| 89 | + decoration: BoxDecoration( | ||
| 90 | + border: Border( | ||
| 91 | + bottom: BorderSide( | ||
| 92 | + width: h(0.5), color: MyColours.color_E7E7E7))), | ||
| 93 | + child: Row( | ||
| 94 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 95 | + children: [ | ||
| 96 | + Container( | ||
| 97 | + width: w(81), | ||
| 98 | + height: w(48), | ||
| 99 | + alignment: Alignment.centerLeft, | ||
| 100 | + child: Text( | ||
| 101 | + '是否议价', | ||
| 102 | + style: TextStyle( | ||
| 103 | + fontSize: ScreenUtil().setSp(32), | ||
| 104 | + color: MyColours.color_E5000000), | ||
| 105 | + ), | ||
| 106 | + ), | ||
| 107 | + Spacer(), | ||
| 108 | + InkWell( | ||
| 109 | + onTap: () { | ||
| 110 | + setState(() { | ||
| 111 | + canrReturn = !canrReturn; | ||
| 112 | + }); | ||
| 113 | + }, | ||
| 114 | + child: Container( | ||
| 115 | + padding: | ||
| 116 | + EdgeInsets.only(left: w(16), right: w(16)), | ||
| 117 | + child: Image.asset( | ||
| 118 | + Utils.getImgPath( | ||
| 119 | + canrReturn ? 'swich_on' : 'swich_off'), | ||
| 120 | + width: w(44), | ||
| 121 | + ))), | ||
| 122 | + ], | ||
| 123 | + ), | ||
| 124 | + ), | ||
| 125 | + ], | ||
| 126 | + ))); | ||
| 127 | + } | ||
| 128 | +} |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | + | ||
| 4 | +import '../../../res/colors.dart'; | ||
| 5 | +import '../../../utils/dialog_util.dart'; | ||
| 6 | +import '../../../utils/screen_util.dart'; | ||
| 7 | +import '../../../utils/utils.dart'; | ||
| 8 | +import '../../../widgets/h_empty_view.dart'; | ||
| 9 | +import '../../../widgets/round_button.dart'; | ||
| 10 | +import '../../../widgets/system_app_bar.dart'; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * 定金类型 | ||
| 14 | + */ | ||
| 15 | + | ||
| 16 | +class FeastDepositTypePage extends StatefulWidget { | ||
| 17 | + FeastDepositTypePage({Key key}) : super(key: key); | ||
| 18 | + | ||
| 19 | + @override | ||
| 20 | + _FeastDepositTypePageState createState() => _FeastDepositTypePageState(); | ||
| 21 | +} | ||
| 22 | + | ||
| 23 | +class _FeastDepositTypePageState extends State<FeastDepositTypePage> { | ||
| 24 | + @override | ||
| 25 | + void initState() { | ||
| 26 | + super.initState(); | ||
| 27 | + Utils.changeStatusColor(color: MyColours.color_438E93); | ||
| 28 | + } | ||
| 29 | + | ||
| 30 | + Widget buildFeastTypeHeader() { | ||
| 31 | + return RoundButton( | ||
| 32 | + onPressed: () async { | ||
| 33 | + DialogUtil.textfeildAlertDialog(context, | ||
| 34 | + title: '输入类型名称', | ||
| 35 | + hintText: '请输入', | ||
| 36 | + text: '', | ||
| 37 | + lenghtLimit: false, | ||
| 38 | + toast: '请输入类型名称', rCallback: (name) { | ||
| 39 | + // _addCookbookClass(name, showLoading: true); | ||
| 40 | + }); | ||
| 41 | + }, | ||
| 42 | + text: '添加一项', | ||
| 43 | + fontSize: 32, | ||
| 44 | + isBold: false, | ||
| 45 | + height: h(32), | ||
| 46 | + width: w(80), | ||
| 47 | + margin: EdgeInsets.only(top: w(18), bottom: w(4)), | ||
| 48 | + textColor: MyColours.color_438E93, | ||
| 49 | + gradientStart: MyColours.color_ffffff, | ||
| 50 | + gradientEnd: MyColours.color_ffffff, | ||
| 51 | + borderColor: MyColours.color_438E93, | ||
| 52 | + radius: r(6), | ||
| 53 | + ); | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + Widget buildFeastTypeItem(String title) { | ||
| 57 | + return Container( | ||
| 58 | + height: h(48), | ||
| 59 | + margin: EdgeInsets.only(top: w(12)), | ||
| 60 | + decoration: BoxDecoration( | ||
| 61 | + border: Border( | ||
| 62 | + bottom: | ||
| 63 | + BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))), | ||
| 64 | + child: Row( | ||
| 65 | + children: [ | ||
| 66 | + Text( | ||
| 67 | + title, | ||
| 68 | + style: | ||
| 69 | + TextStyle(fontSize: font(16), color: MyColours.color_E6000000), | ||
| 70 | + ), | ||
| 71 | + Spacer(), | ||
| 72 | + InkWell( | ||
| 73 | + onTap: () { | ||
| 74 | + DialogUtil.textfeildAlertDialog(context, | ||
| 75 | + title: '输入类型名称', | ||
| 76 | + hintText: '请输入', | ||
| 77 | + text: '原来的内容', | ||
| 78 | + lenghtLimit: true, | ||
| 79 | + toast: '请输入类型名称', rCallback: (name) { | ||
| 80 | + // _addCookbookClass(name, showLoading: true); | ||
| 81 | + }); | ||
| 82 | + }, | ||
| 83 | + child: Text( | ||
| 84 | + '修改', | ||
| 85 | + style: TextStyle( | ||
| 86 | + decoration: TextDecoration.underline, | ||
| 87 | + fontSize: font(16), | ||
| 88 | + color: MyColours.color_438E93), | ||
| 89 | + )), | ||
| 90 | + HEmptyView(32), | ||
| 91 | + InkWell( | ||
| 92 | + onTap: () { | ||
| 93 | + //已经传到服务器,弹提醒窗口,是否删除 | ||
| 94 | + //修改之前有内容,则弹框 | ||
| 95 | + DialogUtil.cupertinoAlertDialogFeast(context, | ||
| 96 | + rTitle: '删除', | ||
| 97 | + title: "是否确认删除", | ||
| 98 | + content: "酒水定金", lCallback: () { | ||
| 99 | + print("取消"); | ||
| 100 | + }, rCallback: () { | ||
| 101 | + print("确定"); | ||
| 102 | + // widget.deleteCallback(index); | ||
| 103 | + }); | ||
| 104 | + }, | ||
| 105 | + child: Image.asset( | ||
| 106 | + Utils.getImgPath(true ? 'f_delete_red_un' : 'f_delete_red'), | ||
| 107 | + width: w(32), | ||
| 108 | + height: w(32), | ||
| 109 | + )), | ||
| 110 | + HEmptyView(32), | ||
| 111 | + ], | ||
| 112 | + ), | ||
| 113 | + ); | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + @override | ||
| 117 | + Widget build(BuildContext context) { | ||
| 118 | + return Scaffold( | ||
| 119 | + backgroundColor: MyColours.color_ffffff, | ||
| 120 | + appBar: SystemAppBar( | ||
| 121 | + '定金类型', | ||
| 122 | + needWhite: true, | ||
| 123 | + bgColor: MyColours.color_438E93, | ||
| 124 | + titleColor: MyColours.color_F6F6F6, | ||
| 125 | + onTap: () { | ||
| 126 | + Navigator.pop(context); | ||
| 127 | + }, | ||
| 128 | + ), | ||
| 129 | + body: NestedScrollView( | ||
| 130 | + // controller: _scrollViewController, | ||
| 131 | + headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { | ||
| 132 | + return <Widget>[ | ||
| 133 | + SliverAppBar( | ||
| 134 | + pinned: true, | ||
| 135 | + floating: false, | ||
| 136 | + leading: null, | ||
| 137 | + backgroundColor: MyColours.color_ffffff, | ||
| 138 | + expandedHeight: ScreenUtil().setWidth(56 * 2), | ||
| 139 | + automaticallyImplyLeading: false, | ||
| 140 | + title: buildFeastTypeHeader(), | ||
| 141 | + // flexibleSpace: FlexibleSpaceBar( | ||
| 142 | + // collapseMode: CollapseMode.pin, | ||
| 143 | + // title: buildFeastTypeHeader()) | ||
| 144 | + ) | ||
| 145 | + ]; | ||
| 146 | + }, | ||
| 147 | + body: ListView.builder( | ||
| 148 | + itemCount: 100, | ||
| 149 | + padding: EdgeInsets.only(left: w(16)), | ||
| 150 | + itemBuilder: (BuildContext context, int index) { | ||
| 151 | + return buildFeastTypeItem('酒水定金'); | ||
| 152 | + }), | ||
| 153 | + ), | ||
| 154 | + ); | ||
| 155 | + } | ||
| 156 | +} |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | +import 'package:one_key/route/navigator_util.dart'; | ||
| 4 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 5 | + | ||
| 6 | +import '../../../res/colors.dart'; | ||
| 7 | +import '../../../utils/dialog_util.dart'; | ||
| 8 | +import '../../../utils/screen_util.dart'; | ||
| 9 | +import '../../../utils/utils.dart'; | ||
| 10 | +import '../../../widgets/h_empty_view.dart'; | ||
| 11 | +import '../../../widgets/round_button.dart'; | ||
| 12 | +import '../../../widgets/system_app_bar.dart'; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 菜品 | ||
| 16 | + */ | ||
| 17 | + | ||
| 18 | +class FeastDishPage extends StatefulWidget { | ||
| 19 | + FeastDishPage({Key key}) : super(key: key); | ||
| 20 | + | ||
| 21 | + @override | ||
| 22 | + _FeastDishPageState createState() => _FeastDishPageState(); | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +class _FeastDishPageState extends State<FeastDishPage> { | ||
| 26 | + ScrollController controller = ScrollController(); | ||
| 27 | + TextEditingController typeNameC = TextEditingController(); //分类名称 | ||
| 28 | + FocusNode typeF = FocusNode(); | ||
| 29 | + @override | ||
| 30 | + void initState() { | ||
| 31 | + super.initState(); | ||
| 32 | + Utils.changeStatusColor(color: MyColours.color_438E93); | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + Widget buildFeastTypeHeader() { | ||
| 36 | + return RoundButton( | ||
| 37 | + onPressed: () async { | ||
| 38 | + NavigatorUtil.goFeastSetmealManageEditPage(context); | ||
| 39 | + }, | ||
| 40 | + text: '添加一项', | ||
| 41 | + fontSize: 32, | ||
| 42 | + isBold: false, | ||
| 43 | + height: h(32), | ||
| 44 | + width: w(80), | ||
| 45 | + margin: EdgeInsets.only(top: w(18), bottom: w(4)), | ||
| 46 | + textColor: MyColours.color_438E93, | ||
| 47 | + gradientStart: MyColours.color_ffffff, | ||
| 48 | + gradientEnd: MyColours.color_ffffff, | ||
| 49 | + borderColor: MyColours.color_438E93, | ||
| 50 | + radius: r(6), | ||
| 51 | + ); | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + Widget buildFeastTypeItem() { | ||
| 55 | + return Container( | ||
| 56 | + margin: EdgeInsets.only(bottom: w(12)), | ||
| 57 | + child: Row( | ||
| 58 | + children: [ | ||
| 59 | + Container( | ||
| 60 | + width: w(120), | ||
| 61 | + child: Text( | ||
| 62 | + '鱼香肉丝', | ||
| 63 | + style: TextStyle( | ||
| 64 | + fontSize: font(16), color: MyColours.color_E6000000), | ||
| 65 | + )), | ||
| 66 | + HEmptyView(16), | ||
| 67 | + Container( | ||
| 68 | + width: w(36), | ||
| 69 | + child: Text( | ||
| 70 | + '份', | ||
| 71 | + style: TextStyle( | ||
| 72 | + fontSize: font(16), color: MyColours.color_515151), | ||
| 73 | + )), | ||
| 74 | + HEmptyView(16), | ||
| 75 | + Container( | ||
| 76 | + width: w(80), | ||
| 77 | + child: Text( | ||
| 78 | + '可调菜/不可调菜', | ||
| 79 | + style: TextStyle( | ||
| 80 | + fontSize: font(16), | ||
| 81 | + color: | ||
| 82 | + true ? MyColours.color_00A870 : MyColours.color_E34D59), | ||
| 83 | + )), | ||
| 84 | + Spacer(), | ||
| 85 | + InkWell( | ||
| 86 | + onTap: () { | ||
| 87 | + FocusScope.of(context).requestFocus(FocusNode()); | ||
| 88 | + DialogUtil.feastDishEditDialog(context, onTap: (Map map) { | ||
| 89 | + String per = map['per']; | ||
| 90 | + String name = map['name']; | ||
| 91 | + String can = map['can']; | ||
| 92 | + print(can); | ||
| 93 | + }); | ||
| 94 | + }, | ||
| 95 | + child: Text( | ||
| 96 | + '修改', | ||
| 97 | + style: TextStyle( | ||
| 98 | + decoration: TextDecoration.underline, | ||
| 99 | + fontSize: font(16), | ||
| 100 | + color: MyColours.color_438E93), | ||
| 101 | + )), | ||
| 102 | + HEmptyView(24), | ||
| 103 | + InkWell( | ||
| 104 | + onTap: () { | ||
| 105 | + //已经传到服务器,弹提醒窗口,是否删除 | ||
| 106 | + //修改之前有内容,则弹框 | ||
| 107 | + DialogUtil.cupertinoAlertDialogFeast(context, | ||
| 108 | + rTitle: '删除', | ||
| 109 | + title: "是否确认删除", | ||
| 110 | + content: "鱼香肉丝", lCallback: () { | ||
| 111 | + print("取消"); | ||
| 112 | + }, rCallback: () { | ||
| 113 | + print("确定"); | ||
| 114 | + // widget.deleteCallback(index); | ||
| 115 | + }); | ||
| 116 | + }, | ||
| 117 | + child: Image.asset( | ||
| 118 | + Utils.getImgPath(true ? 'f_delete_red_un' : 'f_delete_red'), | ||
| 119 | + width: w(24), | ||
| 120 | + height: w(24), | ||
| 121 | + )), | ||
| 122 | + HEmptyView(24), | ||
| 123 | + ], | ||
| 124 | + ), | ||
| 125 | + ); | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + Widget _textfield( | ||
| 129 | + String title, | ||
| 130 | + String hintText, | ||
| 131 | + TextEditingController editingController, | ||
| 132 | + FocusNode focusNode, | ||
| 133 | + String subTitle, | ||
| 134 | + {TextInputType inputType = TextInputType.number}) { | ||
| 135 | + return Container( | ||
| 136 | + height: w(48), | ||
| 137 | + margin: EdgeInsets.only(top: w(12)), | ||
| 138 | + decoration: BoxDecoration( | ||
| 139 | + border: Border( | ||
| 140 | + bottom: | ||
| 141 | + BorderSide(width: h(0.5), color: MyColours.color_E7E7E7))), | ||
| 142 | + child: Row( | ||
| 143 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 144 | + children: [ | ||
| 145 | + Container( | ||
| 146 | + width: w(81), | ||
| 147 | + height: w(48), | ||
| 148 | + alignment: Alignment.center, | ||
| 149 | + child: Text( | ||
| 150 | + title, | ||
| 151 | + style: TextStyle( | ||
| 152 | + fontSize: ScreenUtil().setSp(32), | ||
| 153 | + color: MyColours.color_E5000000), | ||
| 154 | + ), | ||
| 155 | + ), | ||
| 156 | + HEmptyView(32), | ||
| 157 | + Expanded( | ||
| 158 | + child: Container( | ||
| 159 | + // height: ScreenUtil().setHeight(120), | ||
| 160 | + height: w(48), | ||
| 161 | + padding: EdgeInsets.only(top: w(4)), | ||
| 162 | + child: TextField( | ||
| 163 | + controller: editingController, | ||
| 164 | + // textAlign: TextAlign.right, | ||
| 165 | + // textAlignVertical: TextAlignVertical.bottom, | ||
| 166 | + maxLines: 1, | ||
| 167 | + inputFormatters: [], | ||
| 168 | + | ||
| 169 | + // //光标颜色 | ||
| 170 | + // cursorColor: | ||
| 171 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 172 | + //输入文本的样式 | ||
| 173 | + style: TextStyle( | ||
| 174 | + fontSize: ScreenUtil().setSp(32), | ||
| 175 | + color: MyColours.color_515151), | ||
| 176 | + focusNode: focusNode, | ||
| 177 | + decoration: InputDecoration( | ||
| 178 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 179 | + hintText: hintText, | ||
| 180 | + hintStyle: TextStyle( | ||
| 181 | + color: hintText == '请输入' | ||
| 182 | + ? MyColours.color_999999 | ||
| 183 | + : MyColours.color_515151, | ||
| 184 | + fontSize: ScreenUtil().setSp(32), | ||
| 185 | + ), | ||
| 186 | + contentPadding: EdgeInsets.zero, | ||
| 187 | + ), | ||
| 188 | + onChanged: (value) { | ||
| 189 | + typeNameC.text = value; | ||
| 190 | + setState(() {}); | ||
| 191 | + }, | ||
| 192 | + onEditingComplete: () { | ||
| 193 | + FocusScope.of(context) | ||
| 194 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 195 | + }, | ||
| 196 | + keyboardType: inputType, | ||
| 197 | + )), | ||
| 198 | + ), | ||
| 199 | + HEmptyView(24) | ||
| 200 | + // Spacer(), | ||
| 201 | + // Container( | ||
| 202 | + // padding: EdgeInsets.only(left: w(16), right: w(12)), | ||
| 203 | + // child: Text( | ||
| 204 | + // subTitle, | ||
| 205 | + // style: TextStyle( | ||
| 206 | + // color: MyColours.color_000000, | ||
| 207 | + // fontSize: ScreenUtil().setSp(32)), | ||
| 208 | + // ), | ||
| 209 | + // ), | ||
| 210 | + ], | ||
| 211 | + ), | ||
| 212 | + ); | ||
| 213 | + } | ||
| 214 | + | ||
| 215 | + Widget _callButton( | ||
| 216 | + {GestureTapCallback onPress, | ||
| 217 | + content, | ||
| 218 | + hasLeftBorder = true, | ||
| 219 | + isSelect = false}) { | ||
| 220 | + return InkWell( | ||
| 221 | + onTap: onPress, | ||
| 222 | + child: Container( | ||
| 223 | + height: h(48), | ||
| 224 | + decoration: BoxDecoration( | ||
| 225 | + color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff, | ||
| 226 | + border: Border( | ||
| 227 | + bottom: BorderSide( | ||
| 228 | + color: MyColours.color_438E93, | ||
| 229 | + width: ScreenUtil().setWidth(2)), | ||
| 230 | + top: BorderSide( | ||
| 231 | + color: MyColours.color_438E93, | ||
| 232 | + width: ScreenUtil().setWidth(2)), | ||
| 233 | + left: hasLeftBorder | ||
| 234 | + ? BorderSide( | ||
| 235 | + color: MyColours.color_438E93, | ||
| 236 | + width: ScreenUtil().setWidth(2)) | ||
| 237 | + : BorderSide.none, | ||
| 238 | + right: BorderSide( | ||
| 239 | + color: MyColours.color_438E93, | ||
| 240 | + width: ScreenUtil().setWidth(2)))), | ||
| 241 | + child: Align( | ||
| 242 | + alignment: Alignment.center, | ||
| 243 | + child: Text( | ||
| 244 | + content, | ||
| 245 | + style: TextStyle( | ||
| 246 | + color: | ||
| 247 | + isSelect ? MyColours.color_F6F6F6 : MyColours.color_438E93, | ||
| 248 | + fontSize: ScreenUtil().setSp(36)), | ||
| 249 | + ), | ||
| 250 | + ), | ||
| 251 | + ), | ||
| 252 | + ); | ||
| 253 | + } | ||
| 254 | + | ||
| 255 | + @override | ||
| 256 | + Widget build(BuildContext context) { | ||
| 257 | + return Scaffold( | ||
| 258 | + backgroundColor: MyColours.color_ffffff, | ||
| 259 | + appBar: SystemAppBar( | ||
| 260 | + typeNameC.text, | ||
| 261 | + needWhite: true, | ||
| 262 | + bgColor: MyColours.color_438E93, | ||
| 263 | + titleColor: MyColours.color_F6F6F6, | ||
| 264 | + onTap: () { | ||
| 265 | + Navigator.pop(context); | ||
| 266 | + }, | ||
| 267 | + ), | ||
| 268 | + body: Column( | ||
| 269 | + children: [ | ||
| 270 | + Expanded( | ||
| 271 | + child: SingleChildScrollView( | ||
| 272 | + controller: controller, | ||
| 273 | + child: Padding( | ||
| 274 | + padding: EdgeInsets.only(left: w(16)), | ||
| 275 | + child: Column( | ||
| 276 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 277 | + children: [ | ||
| 278 | + _textfield('分类名称', '热菜', typeNameC, typeF, ''), | ||
| 279 | + buildFeastTypeHeader(), | ||
| 280 | + VEmptyView(54), | ||
| 281 | + ListView.builder( | ||
| 282 | + itemCount: 100, | ||
| 283 | + shrinkWrap: true, | ||
| 284 | + controller: controller, | ||
| 285 | + itemBuilder: (BuildContext context, int index) { | ||
| 286 | + return buildFeastTypeItem(); | ||
| 287 | + }), | ||
| 288 | + ], | ||
| 289 | + )), | ||
| 290 | + )), | ||
| 291 | + Row( | ||
| 292 | + children: [ | ||
| 293 | + Expanded( | ||
| 294 | + child: _callButton( | ||
| 295 | + onPress: () { | ||
| 296 | + Navigator.pop(context); | ||
| 297 | + }, | ||
| 298 | + content: '返回', | ||
| 299 | + hasLeftBorder: true, | ||
| 300 | + isSelect: false)), | ||
| 301 | + Expanded( | ||
| 302 | + child: _callButton( | ||
| 303 | + onPress: () {}, | ||
| 304 | + content: '保存', | ||
| 305 | + hasLeftBorder: true, | ||
| 306 | + isSelect: true)) | ||
| 307 | + ], | ||
| 308 | + ) | ||
| 309 | + ], | ||
| 310 | + )); | ||
| 311 | + } | ||
| 312 | +} |
| @@ -35,7 +35,7 @@ class _FeastManageHomePageState extends State<FeastManageHomePage> { | @@ -35,7 +35,7 @@ class _FeastManageHomePageState extends State<FeastManageHomePage> { | ||
| 35 | decoration: BoxDecoration( | 35 | decoration: BoxDecoration( |
| 36 | border: Border( | 36 | border: Border( |
| 37 | bottom: | 37 | bottom: |
| 38 | - BorderSide(width: w(1), color: MyColours.color_E7E7E7))), | 38 | + BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))), |
| 39 | child: Row( | 39 | child: Row( |
| 40 | children: [ | 40 | children: [ |
| 41 | Text( | 41 | Text( |
| @@ -85,10 +85,18 @@ class _FeastManageHomePageState extends State<FeastManageHomePage> { | @@ -85,10 +85,18 @@ class _FeastManageHomePageState extends State<FeastManageHomePage> { | ||
| 85 | feastManegeItem('宴会员工', onTap: () { | 85 | feastManegeItem('宴会员工', onTap: () { |
| 86 | NavigatorUtil.goFeastPersonalPage(context); | 86 | NavigatorUtil.goFeastPersonalPage(context); |
| 87 | }), | 87 | }), |
| 88 | - feastManegeItem('套餐管理'), | ||
| 89 | - feastManegeItem('酒水管理'), | ||
| 90 | - feastManegeItem('其他配置管理'), | ||
| 91 | - feastManegeItem('定金设置'), | 88 | + feastManegeItem('套餐管理', onTap: () { |
| 89 | + NavigatorUtil.goFeastSetmealManagePage(context); | ||
| 90 | + }), | ||
| 91 | + feastManegeItem('酒水管理', onTap: () { | ||
| 92 | + NavigatorUtil.goFeastWineManagePage(context); | ||
| 93 | + }), | ||
| 94 | + feastManegeItem('其他配置管理', onTap: () { | ||
| 95 | + NavigatorUtil.goFeastOthersetManagePage(context); | ||
| 96 | + }), | ||
| 97 | + feastManegeItem('定金设置', onTap: () { | ||
| 98 | + NavigatorUtil.goFeastDepositManagePage(context); | ||
| 99 | + }), | ||
| 92 | ], | 100 | ], |
| 93 | ), | 101 | ), |
| 94 | ), | 102 | ), |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 4 | + | ||
| 5 | +import '../../../res/colors.dart'; | ||
| 6 | +import '../../../route/navigator_util.dart'; | ||
| 7 | +import '../../../utils/dialog_util.dart'; | ||
| 8 | +import '../../../utils/screen_util.dart'; | ||
| 9 | +import '../../../utils/utils.dart'; | ||
| 10 | +import '../../../widgets/h_empty_view.dart'; | ||
| 11 | +import '../../../widgets/round_button.dart'; | ||
| 12 | +import '../../../widgets/system_app_bar.dart'; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 其他配置添加 | ||
| 16 | + */ | ||
| 17 | +class FeastOthersetManageEditPage extends StatefulWidget { | ||
| 18 | + final isCreate; | ||
| 19 | + FeastOthersetManageEditPage({ | ||
| 20 | + Key key, | ||
| 21 | + this.isCreate = true, | ||
| 22 | + }) : super(key: key); | ||
| 23 | + | ||
| 24 | + @override | ||
| 25 | + _FeastOthersetManageEditPageState createState() => | ||
| 26 | + _FeastOthersetManageEditPageState(); | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +class _FeastOthersetManageEditPageState extends State<FeastOthersetManageEditPage> { | ||
| 30 | + TextEditingController othersetNameC = TextEditingController(); //其他配置名称 | ||
| 31 | + FocusNode othersetF = FocusNode(); | ||
| 32 | + TextEditingController othersetPriceC = TextEditingController(); //其他配置价格 | ||
| 33 | + FocusNode othersetPriceF = FocusNode(); | ||
| 34 | + TextEditingController othersetPerC = TextEditingController(); //其他配置规格 | ||
| 35 | + FocusNode othersetPerF = FocusNode(); | ||
| 36 | + bool canBargaining = true; //是否议价 | ||
| 37 | + ScrollController controller = ScrollController(); | ||
| 38 | + | ||
| 39 | + @override | ||
| 40 | + void initState() { | ||
| 41 | + super.initState(); | ||
| 42 | + Utils.changeStatusColor(color: MyColours.color_438E93); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + ///请输入 | ||
| 46 | + ///输入框 | ||
| 47 | + Widget _textfield( | ||
| 48 | + String title, | ||
| 49 | + String hintText, | ||
| 50 | + TextEditingController editingController, | ||
| 51 | + FocusNode focusNode, | ||
| 52 | + String subTitle, | ||
| 53 | + {TextInputType inputType = TextInputType.number}) { | ||
| 54 | + return Container( | ||
| 55 | + height: w(48), | ||
| 56 | + margin: EdgeInsets.only(top: w(12)), | ||
| 57 | + decoration: BoxDecoration( | ||
| 58 | + border: Border( | ||
| 59 | + bottom: | ||
| 60 | + BorderSide(width: h(0.5), color: MyColours.color_E7E7E7))), | ||
| 61 | + child: Row( | ||
| 62 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 63 | + children: [ | ||
| 64 | + Container( | ||
| 65 | + width: w(81), | ||
| 66 | + height: w(48), | ||
| 67 | + alignment: Alignment.center, | ||
| 68 | + child: Text( | ||
| 69 | + title, | ||
| 70 | + style: TextStyle( | ||
| 71 | + fontSize: ScreenUtil().setSp(32), | ||
| 72 | + color: MyColours.color_E5000000), | ||
| 73 | + ), | ||
| 74 | + ), | ||
| 75 | + HEmptyView(32), | ||
| 76 | + Expanded( | ||
| 77 | + child: Container( | ||
| 78 | + // height: ScreenUtil().setHeight(120), | ||
| 79 | + height: w(48), | ||
| 80 | + padding: EdgeInsets.only(top: w(4)), | ||
| 81 | + child: TextField( | ||
| 82 | + controller: editingController, | ||
| 83 | + // textAlign: TextAlign.right, | ||
| 84 | + // textAlignVertical: TextAlignVertical.bottom, | ||
| 85 | + maxLines: 1, | ||
| 86 | + inputFormatters: [], | ||
| 87 | + | ||
| 88 | + // //光标颜色 | ||
| 89 | + // cursorColor: | ||
| 90 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 91 | + //输入文本的样式 | ||
| 92 | + style: TextStyle( | ||
| 93 | + fontSize: ScreenUtil().setSp(32), | ||
| 94 | + color: MyColours.color_515151), | ||
| 95 | + focusNode: focusNode, | ||
| 96 | + decoration: InputDecoration( | ||
| 97 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 98 | + hintText: hintText, | ||
| 99 | + hintStyle: TextStyle( | ||
| 100 | + color: hintText == '请输入' | ||
| 101 | + ? MyColours.color_999999 | ||
| 102 | + : MyColours.color_515151, | ||
| 103 | + fontSize: ScreenUtil().setSp(32), | ||
| 104 | + ), | ||
| 105 | + contentPadding: EdgeInsets.zero, | ||
| 106 | + ), | ||
| 107 | + onChanged: (value) {}, | ||
| 108 | + onEditingComplete: () { | ||
| 109 | + FocusScope.of(context) | ||
| 110 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 111 | + }, | ||
| 112 | + keyboardType: inputType, | ||
| 113 | + )), | ||
| 114 | + ), | ||
| 115 | + Container( | ||
| 116 | + padding: EdgeInsets.only(left: w(16), right: w(12)), | ||
| 117 | + child: Text( | ||
| 118 | + subTitle, | ||
| 119 | + style: TextStyle( | ||
| 120 | + color: MyColours.color_000000, | ||
| 121 | + fontSize: ScreenUtil().setSp(32)), | ||
| 122 | + ), | ||
| 123 | + ), | ||
| 124 | + ], | ||
| 125 | + ), | ||
| 126 | + ); | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + Widget _callButton( | ||
| 130 | + {GestureTapCallback onPress, | ||
| 131 | + content, | ||
| 132 | + hasLeftBorder = true, | ||
| 133 | + isSelect = false}) { | ||
| 134 | + return InkWell( | ||
| 135 | + onTap: onPress, | ||
| 136 | + child: Container( | ||
| 137 | + height: h(48), | ||
| 138 | + decoration: BoxDecoration( | ||
| 139 | + color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff, | ||
| 140 | + border: Border( | ||
| 141 | + bottom: BorderSide( | ||
| 142 | + color: MyColours.color_438E93, | ||
| 143 | + width: ScreenUtil().setWidth(2)), | ||
| 144 | + top: BorderSide( | ||
| 145 | + color: MyColours.color_438E93, | ||
| 146 | + width: ScreenUtil().setWidth(2)), | ||
| 147 | + left: hasLeftBorder | ||
| 148 | + ? BorderSide( | ||
| 149 | + color: MyColours.color_438E93, | ||
| 150 | + width: ScreenUtil().setWidth(2)) | ||
| 151 | + : BorderSide.none, | ||
| 152 | + right: BorderSide( | ||
| 153 | + color: MyColours.color_438E93, | ||
| 154 | + width: ScreenUtil().setWidth(2)))), | ||
| 155 | + child: Align( | ||
| 156 | + alignment: Alignment.center, | ||
| 157 | + child: Text( | ||
| 158 | + content, | ||
| 159 | + style: TextStyle( | ||
| 160 | + color: | ||
| 161 | + isSelect ? MyColours.color_F6F6F6 : MyColours.color_438E93, | ||
| 162 | + fontSize: ScreenUtil().setSp(36)), | ||
| 163 | + ), | ||
| 164 | + ), | ||
| 165 | + ), | ||
| 166 | + ); | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + @override | ||
| 170 | + Widget build(BuildContext context) { | ||
| 171 | + return Scaffold( | ||
| 172 | + backgroundColor: MyColours.color_ffffff, | ||
| 173 | + appBar: SystemAppBar( | ||
| 174 | + widget.isCreate ? '添加其他配置' : othersetNameC.text, | ||
| 175 | + needWhite: true, | ||
| 176 | + bgColor: MyColours.color_438E93, | ||
| 177 | + titleColor: MyColours.color_F6F6F6, | ||
| 178 | + onTap: () { | ||
| 179 | + Navigator.pop(context); | ||
| 180 | + }, | ||
| 181 | + ), | ||
| 182 | + body: Column( | ||
| 183 | + children: [ | ||
| 184 | + Expanded( | ||
| 185 | + child: Padding( | ||
| 186 | + padding: EdgeInsets.only( | ||
| 187 | + left: w(16), | ||
| 188 | + ), | ||
| 189 | + child: SingleChildScrollView( | ||
| 190 | + controller: controller, | ||
| 191 | + child: Column( | ||
| 192 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 193 | + children: [ | ||
| 194 | + _textfield( | ||
| 195 | + '配置名称', '剑南春52度500ml', othersetNameC, othersetF, ''), | ||
| 196 | + _textfield( | ||
| 197 | + '配置单价', '1299', othersetPriceC, othersetPriceF, '元'), | ||
| 198 | + _textfield('配置规格', '份', othersetPerC, othersetPerF, ''), | ||
| 199 | + Container( | ||
| 200 | + height: w(48), | ||
| 201 | + margin: EdgeInsets.only(top: w(12)), | ||
| 202 | + decoration: BoxDecoration( | ||
| 203 | + border: Border( | ||
| 204 | + bottom: BorderSide( | ||
| 205 | + width: h(0.5), | ||
| 206 | + color: MyColours.color_E7E7E7))), | ||
| 207 | + child: Row( | ||
| 208 | + mainAxisAlignment: | ||
| 209 | + MainAxisAlignment.spaceBetween, | ||
| 210 | + children: [ | ||
| 211 | + Container( | ||
| 212 | + width: w(81), | ||
| 213 | + height: w(48), | ||
| 214 | + alignment: Alignment.center, | ||
| 215 | + child: Text( | ||
| 216 | + '是否议价', | ||
| 217 | + style: TextStyle( | ||
| 218 | + fontSize: ScreenUtil().setSp(32), | ||
| 219 | + color: MyColours.color_E5000000), | ||
| 220 | + ), | ||
| 221 | + ), | ||
| 222 | + Spacer(), | ||
| 223 | + InkWell( | ||
| 224 | + onTap: () { | ||
| 225 | + setState(() { | ||
| 226 | + canBargaining = !canBargaining; | ||
| 227 | + }); | ||
| 228 | + }, | ||
| 229 | + child: Container( | ||
| 230 | + padding: EdgeInsets.only( | ||
| 231 | + left: w(16), right: w(16)), | ||
| 232 | + child: Image.asset( | ||
| 233 | + Utils.getImgPath(canBargaining | ||
| 234 | + ? 'swich_on' | ||
| 235 | + : 'swich_off'), | ||
| 236 | + width: w(44), | ||
| 237 | + ))), | ||
| 238 | + ], | ||
| 239 | + ), | ||
| 240 | + ), | ||
| 241 | + ], | ||
| 242 | + )))), | ||
| 243 | + Row( | ||
| 244 | + children: [ | ||
| 245 | + Expanded( | ||
| 246 | + child: _callButton( | ||
| 247 | + onPress: () { | ||
| 248 | + Navigator.pop(context); | ||
| 249 | + }, | ||
| 250 | + content: '返回', | ||
| 251 | + hasLeftBorder: true, | ||
| 252 | + isSelect: false)), | ||
| 253 | + Expanded( | ||
| 254 | + child: _callButton( | ||
| 255 | + onPress: () {}, | ||
| 256 | + content: '保存', | ||
| 257 | + hasLeftBorder: true, | ||
| 258 | + isSelect: true)) | ||
| 259 | + ], | ||
| 260 | + ) | ||
| 261 | + ], | ||
| 262 | + )); | ||
| 263 | + } | ||
| 264 | +} |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | +import 'package:one_key/route/navigator_util.dart'; | ||
| 4 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 5 | + | ||
| 6 | +import '../../../res/colors.dart'; | ||
| 7 | +import '../../../utils/dialog_util.dart'; | ||
| 8 | +import '../../../utils/screen_util.dart'; | ||
| 9 | +import '../../../utils/utils.dart'; | ||
| 10 | +import '../../../widgets/h_empty_view.dart'; | ||
| 11 | +import '../../../widgets/round_button.dart'; | ||
| 12 | +import '../../../widgets/system_app_bar.dart'; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 其他配置管理 | ||
| 16 | + */ | ||
| 17 | + | ||
| 18 | +class FeastOthersetManagePage extends StatefulWidget { | ||
| 19 | + FeastOthersetManagePage({Key key}) : super(key: key); | ||
| 20 | + | ||
| 21 | + @override | ||
| 22 | + _FeastOthersetManagePageState createState() => | ||
| 23 | + _FeastOthersetManagePageState(); | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | +class _FeastOthersetManagePageState extends State<FeastOthersetManagePage> { | ||
| 27 | + @override | ||
| 28 | + void initState() { | ||
| 29 | + super.initState(); | ||
| 30 | + Utils.changeStatusColor(color: MyColours.color_438E93); | ||
| 31 | + } | ||
| 32 | + | ||
| 33 | + Widget buildFeastTypeHeader() { | ||
| 34 | + return RoundButton( | ||
| 35 | + onPressed: () async { | ||
| 36 | + NavigatorUtil.goFeastOthersetManageEditPage(context); | ||
| 37 | + }, | ||
| 38 | + text: '添加一项', | ||
| 39 | + fontSize: 32, | ||
| 40 | + isBold: false, | ||
| 41 | + height: h(32), | ||
| 42 | + width: w(80), | ||
| 43 | + margin: EdgeInsets.only(top: w(18), bottom: w(4)), | ||
| 44 | + textColor: MyColours.color_438E93, | ||
| 45 | + gradientStart: MyColours.color_ffffff, | ||
| 46 | + gradientEnd: MyColours.color_ffffff, | ||
| 47 | + borderColor: MyColours.color_438E93, | ||
| 48 | + radius: r(6), | ||
| 49 | + ); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + Widget buildFeastTypeItem(String title, String subTitle) { | ||
| 53 | + return Container( | ||
| 54 | + height: h(48), | ||
| 55 | + margin: EdgeInsets.only(top: w(12)), | ||
| 56 | + decoration: BoxDecoration( | ||
| 57 | + border: Border( | ||
| 58 | + bottom: BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))), | ||
| 59 | + child: Row( | ||
| 60 | + children: [ | ||
| 61 | + Column( | ||
| 62 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 63 | + children: [ | ||
| 64 | + Text( | ||
| 65 | + title, | ||
| 66 | + style: TextStyle( | ||
| 67 | + fontSize: font(16), color: MyColours.color_E6000000), | ||
| 68 | + ), | ||
| 69 | + VEmptyView(12), | ||
| 70 | + Text( | ||
| 71 | + subTitle, | ||
| 72 | + style: TextStyle( | ||
| 73 | + fontSize: font(12), color: MyColours.color_999999), | ||
| 74 | + ) | ||
| 75 | + ], | ||
| 76 | + ), | ||
| 77 | + Spacer(), | ||
| 78 | + InkWell( | ||
| 79 | + onTap: () { | ||
| 80 | + NavigatorUtil.goFeastOthersetManageEditPage(context); | ||
| 81 | + }, | ||
| 82 | + child: Text( | ||
| 83 | + '修改', | ||
| 84 | + style: TextStyle( | ||
| 85 | + decoration: TextDecoration.underline, | ||
| 86 | + fontSize: font(16), | ||
| 87 | + color: MyColours.color_438E93), | ||
| 88 | + )), | ||
| 89 | + HEmptyView(32), | ||
| 90 | + InkWell( | ||
| 91 | + onTap: () { | ||
| 92 | + //已经传到服务器,弹提醒窗口,是否删除 | ||
| 93 | + //修改之前有内容,则弹框 | ||
| 94 | + DialogUtil.cupertinoAlertDialogFeast(context, | ||
| 95 | + rTitle: '删除', | ||
| 96 | + title: "是否确认删除", | ||
| 97 | + content: "LED大屏", lCallback: () { | ||
| 98 | + print("取消"); | ||
| 99 | + }, rCallback: () { | ||
| 100 | + print("确定"); | ||
| 101 | + // widget.deleteCallback(index); | ||
| 102 | + }); | ||
| 103 | + }, | ||
| 104 | + child: Image.asset( | ||
| 105 | + Utils.getImgPath(true ? 'f_delete_red_un' : 'f_delete_red'), | ||
| 106 | + width: w(32), | ||
| 107 | + height: w(32), | ||
| 108 | + )), | ||
| 109 | + HEmptyView(32), | ||
| 110 | + ], | ||
| 111 | + ), | ||
| 112 | + ); | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + Widget _callButton( | ||
| 116 | + {GestureTapCallback onPress, | ||
| 117 | + content, | ||
| 118 | + hasLeftBorder = true, | ||
| 119 | + isSelect = false}) { | ||
| 120 | + return InkWell( | ||
| 121 | + onTap: onPress, | ||
| 122 | + child: Container( | ||
| 123 | + height: h(48), | ||
| 124 | + decoration: BoxDecoration( | ||
| 125 | + color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff, | ||
| 126 | + border: Border( | ||
| 127 | + bottom: BorderSide( | ||
| 128 | + color: MyColours.color_438E93, | ||
| 129 | + width: ScreenUtil().setWidth(2)), | ||
| 130 | + top: BorderSide( | ||
| 131 | + color: MyColours.color_438E93, | ||
| 132 | + width: ScreenUtil().setWidth(2)), | ||
| 133 | + left: hasLeftBorder | ||
| 134 | + ? BorderSide( | ||
| 135 | + color: MyColours.color_438E93, | ||
| 136 | + width: ScreenUtil().setWidth(2)) | ||
| 137 | + : BorderSide.none, | ||
| 138 | + right: BorderSide( | ||
| 139 | + color: MyColours.color_438E93, | ||
| 140 | + width: ScreenUtil().setWidth(2)))), | ||
| 141 | + child: Align( | ||
| 142 | + alignment: Alignment.center, | ||
| 143 | + child: Text( | ||
| 144 | + content, | ||
| 145 | + style: TextStyle( | ||
| 146 | + color: | ||
| 147 | + isSelect ? MyColours.color_F6F6F6 : MyColours.color_438E93, | ||
| 148 | + fontSize: ScreenUtil().setSp(36)), | ||
| 149 | + ), | ||
| 150 | + ), | ||
| 151 | + ), | ||
| 152 | + ); | ||
| 153 | + } | ||
| 154 | + | ||
| 155 | + @override | ||
| 156 | + Widget build(BuildContext context) { | ||
| 157 | + return Scaffold( | ||
| 158 | + backgroundColor: MyColours.color_ffffff, | ||
| 159 | + appBar: SystemAppBar( | ||
| 160 | + '其他配置管理', | ||
| 161 | + needWhite: true, | ||
| 162 | + bgColor: MyColours.color_438E93, | ||
| 163 | + titleColor: MyColours.color_F6F6F6, | ||
| 164 | + onTap: () { | ||
| 165 | + Navigator.pop(context); | ||
| 166 | + }, | ||
| 167 | + ), | ||
| 168 | + body: Column( | ||
| 169 | + children: [ | ||
| 170 | + Expanded( | ||
| 171 | + child: NestedScrollView( | ||
| 172 | + // controller: _scrollViewController, | ||
| 173 | + headerSliverBuilder: | ||
| 174 | + (BuildContext context, bool innerBoxIsScrolled) { | ||
| 175 | + return <Widget>[ | ||
| 176 | + SliverAppBar( | ||
| 177 | + pinned: true, | ||
| 178 | + floating: false, | ||
| 179 | + leading: null, | ||
| 180 | + backgroundColor: MyColours.color_ffffff, | ||
| 181 | + expandedHeight: ScreenUtil().setWidth(56 * 2), | ||
| 182 | + automaticallyImplyLeading: false, | ||
| 183 | + title: buildFeastTypeHeader(), | ||
| 184 | + // flexibleSpace: FlexibleSpaceBar( | ||
| 185 | + // collapseMode: CollapseMode.pin, | ||
| 186 | + // title: buildFeastTypeHeader()) | ||
| 187 | + ) | ||
| 188 | + ]; | ||
| 189 | + }, | ||
| 190 | + body: ListView.builder( | ||
| 191 | + itemCount: 100, | ||
| 192 | + padding: EdgeInsets.only(left: w(16)), | ||
| 193 | + itemBuilder: (BuildContext context, int index) { | ||
| 194 | + return buildFeastTypeItem('LED大屏', '1100元/次 不可议价'); | ||
| 195 | + }), | ||
| 196 | + )), | ||
| 197 | + Row( | ||
| 198 | + children: [ | ||
| 199 | + Expanded( | ||
| 200 | + child: _callButton( | ||
| 201 | + onPress: () { | ||
| 202 | + Navigator.pop(context); | ||
| 203 | + }, | ||
| 204 | + content: '返回', | ||
| 205 | + hasLeftBorder: true, | ||
| 206 | + isSelect: false)), | ||
| 207 | + Expanded( | ||
| 208 | + child: _callButton( | ||
| 209 | + onPress: () {}, | ||
| 210 | + content: '保存', | ||
| 211 | + hasLeftBorder: true, | ||
| 212 | + isSelect: true)) | ||
| 213 | + ], | ||
| 214 | + ) | ||
| 215 | + ], | ||
| 216 | + ), | ||
| 217 | + ); | ||
| 218 | + } | ||
| 219 | +} |
| @@ -84,7 +84,7 @@ class _FeastPersonalPageState extends State<FeastPersonalPage> { | @@ -84,7 +84,7 @@ class _FeastPersonalPageState extends State<FeastPersonalPage> { | ||
| 84 | padding: EdgeInsets.only(left: w(32)), | 84 | padding: EdgeInsets.only(left: w(32)), |
| 85 | child: MyDivider( | 85 | child: MyDivider( |
| 86 | double.infinity, | 86 | double.infinity, |
| 87 | - w(1), | 87 | + w(0.5), |
| 88 | color: MyColours.color_E7E7E7, | 88 | color: MyColours.color_E7E7E7, |
| 89 | )) | 89 | )) |
| 90 | ], | 90 | ], |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 4 | + | ||
| 5 | +import '../../../res/colors.dart'; | ||
| 6 | +import '../../../route/navigator_util.dart'; | ||
| 7 | +import '../../../utils/dialog_util.dart'; | ||
| 8 | +import '../../../utils/screen_util.dart'; | ||
| 9 | +import '../../../utils/utils.dart'; | ||
| 10 | +import '../../../widgets/h_empty_view.dart'; | ||
| 11 | +import '../../../widgets/round_button.dart'; | ||
| 12 | +import '../../../widgets/system_app_bar.dart'; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 套餐添加 | ||
| 16 | + */ | ||
| 17 | +class FeastSetmealManageEditPage extends StatefulWidget { | ||
| 18 | + final isCreate; | ||
| 19 | + FeastSetmealManageEditPage({ | ||
| 20 | + Key key, | ||
| 21 | + this.isCreate = true, | ||
| 22 | + }) : super(key: key); | ||
| 23 | + | ||
| 24 | + @override | ||
| 25 | + _FeastSetmealManageEditPageState createState() => | ||
| 26 | + _FeastSetmealManageEditPageState(); | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +class _FeastSetmealManageEditPageState | ||
| 30 | + extends State<FeastSetmealManageEditPage> { | ||
| 31 | + TextEditingController mealNameC = TextEditingController(); //套餐名称 | ||
| 32 | + FocusNode mealF = FocusNode(); | ||
| 33 | + TextEditingController mealPriceC = TextEditingController(); //套餐价格 | ||
| 34 | + FocusNode mealPriceF = FocusNode(); | ||
| 35 | + bool canBargaining = true; //是否议价 | ||
| 36 | + ScrollController controller = ScrollController(); | ||
| 37 | + | ||
| 38 | + @override | ||
| 39 | + void initState() { | ||
| 40 | + super.initState(); | ||
| 41 | + Utils.changeStatusColor(color: MyColours.color_438E93); | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + ///请输入 | ||
| 45 | + ///输入框 | ||
| 46 | + Widget _textfield( | ||
| 47 | + String title, | ||
| 48 | + String hintText, | ||
| 49 | + TextEditingController editingController, | ||
| 50 | + FocusNode focusNode, | ||
| 51 | + String subTitle, | ||
| 52 | + {TextInputType inputType = TextInputType.number}) { | ||
| 53 | + return Container( | ||
| 54 | + height: w(48), | ||
| 55 | + margin: EdgeInsets.only(top: w(12)), | ||
| 56 | + decoration: BoxDecoration( | ||
| 57 | + border: Border( | ||
| 58 | + bottom: | ||
| 59 | + BorderSide(width: h(0.5), color: MyColours.color_E7E7E7))), | ||
| 60 | + child: Row( | ||
| 61 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 62 | + children: [ | ||
| 63 | + Container( | ||
| 64 | + width: w(81), | ||
| 65 | + height: w(48), | ||
| 66 | + alignment: Alignment.center, | ||
| 67 | + child: Text( | ||
| 68 | + title, | ||
| 69 | + style: TextStyle( | ||
| 70 | + fontSize: ScreenUtil().setSp(32), | ||
| 71 | + color: MyColours.color_E5000000), | ||
| 72 | + ), | ||
| 73 | + ), | ||
| 74 | + HEmptyView(32), | ||
| 75 | + Expanded( | ||
| 76 | + child: Container( | ||
| 77 | + // height: ScreenUtil().setHeight(120), | ||
| 78 | + height: w(48), | ||
| 79 | + padding: EdgeInsets.only(top: w(4)), | ||
| 80 | + child: TextField( | ||
| 81 | + controller: editingController, | ||
| 82 | + // textAlign: TextAlign.right, | ||
| 83 | + // textAlignVertical: TextAlignVertical.bottom, | ||
| 84 | + maxLines: 1, | ||
| 85 | + inputFormatters: [], | ||
| 86 | + | ||
| 87 | + // //光标颜色 | ||
| 88 | + // cursorColor: | ||
| 89 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 90 | + //输入文本的样式 | ||
| 91 | + style: TextStyle( | ||
| 92 | + fontSize: ScreenUtil().setSp(32), | ||
| 93 | + color: MyColours.color_515151), | ||
| 94 | + focusNode: focusNode, | ||
| 95 | + decoration: InputDecoration( | ||
| 96 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 97 | + hintText: hintText, | ||
| 98 | + hintStyle: TextStyle( | ||
| 99 | + color: hintText == '请输入' | ||
| 100 | + ? MyColours.color_999999 | ||
| 101 | + : MyColours.color_515151, | ||
| 102 | + fontSize: ScreenUtil().setSp(32), | ||
| 103 | + ), | ||
| 104 | + contentPadding: EdgeInsets.zero, | ||
| 105 | + ), | ||
| 106 | + onChanged: (value) {}, | ||
| 107 | + onEditingComplete: () { | ||
| 108 | + FocusScope.of(context) | ||
| 109 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 110 | + }, | ||
| 111 | + keyboardType: inputType, | ||
| 112 | + )), | ||
| 113 | + ), | ||
| 114 | + Spacer(), | ||
| 115 | + Container( | ||
| 116 | + padding: EdgeInsets.only(left: w(16), right: w(12)), | ||
| 117 | + child: Text( | ||
| 118 | + subTitle, | ||
| 119 | + style: TextStyle( | ||
| 120 | + color: MyColours.color_000000, | ||
| 121 | + fontSize: ScreenUtil().setSp(32)), | ||
| 122 | + ), | ||
| 123 | + ), | ||
| 124 | + ], | ||
| 125 | + ), | ||
| 126 | + ); | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + Widget buildFeastTypeItem(String title) { | ||
| 130 | + return Container( | ||
| 131 | + height: h(48), | ||
| 132 | + margin: EdgeInsets.only(bottom: w(12)), | ||
| 133 | + decoration: BoxDecoration( | ||
| 134 | + border: Border( | ||
| 135 | + bottom: BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))), | ||
| 136 | + child: Row( | ||
| 137 | + children: [ | ||
| 138 | + Text( | ||
| 139 | + title, | ||
| 140 | + style: | ||
| 141 | + TextStyle(fontSize: font(16), color: MyColours.color_E5000000), | ||
| 142 | + ), | ||
| 143 | + Spacer(), | ||
| 144 | + InkWell( | ||
| 145 | + onTap: () { | ||
| 146 | + NavigatorUtil.goFeastDishPage(context); | ||
| 147 | + }, | ||
| 148 | + child: Text( | ||
| 149 | + '修改', | ||
| 150 | + style: TextStyle( | ||
| 151 | + decoration: TextDecoration.underline, | ||
| 152 | + fontSize: font(16), | ||
| 153 | + color: MyColours.color_438E93), | ||
| 154 | + )), | ||
| 155 | + HEmptyView(32), | ||
| 156 | + InkWell( | ||
| 157 | + onTap: () { | ||
| 158 | + //已经传到服务器,弹提醒窗口,是否删除 | ||
| 159 | + //修改之前有内容,则弹框 | ||
| 160 | + DialogUtil.cupertinoAlertDialogFeast(context, | ||
| 161 | + rTitle: '删除', | ||
| 162 | + title: "是否确认删除", | ||
| 163 | + content: "热菜(18道)", lCallback: () { | ||
| 164 | + print("取消"); | ||
| 165 | + }, rCallback: () { | ||
| 166 | + print("确定"); | ||
| 167 | + // widget.deleteCallback(index); | ||
| 168 | + }); | ||
| 169 | + }, | ||
| 170 | + child: Image.asset( | ||
| 171 | + Utils.getImgPath(true ? 'f_delete_red_un' : 'f_delete_red'), | ||
| 172 | + width: w(32), | ||
| 173 | + height: w(32), | ||
| 174 | + )), | ||
| 175 | + HEmptyView(32), | ||
| 176 | + ], | ||
| 177 | + ), | ||
| 178 | + ); | ||
| 179 | + } | ||
| 180 | + | ||
| 181 | + Widget _callButton( | ||
| 182 | + {GestureTapCallback onPress, | ||
| 183 | + content, | ||
| 184 | + hasLeftBorder = true, | ||
| 185 | + isSelect = false}) { | ||
| 186 | + return InkWell( | ||
| 187 | + onTap: onPress, | ||
| 188 | + child: Container( | ||
| 189 | + height: h(48), | ||
| 190 | + decoration: BoxDecoration( | ||
| 191 | + color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff, | ||
| 192 | + border: Border( | ||
| 193 | + bottom: BorderSide( | ||
| 194 | + color: MyColours.color_438E93, | ||
| 195 | + width: ScreenUtil().setWidth(2)), | ||
| 196 | + top: BorderSide( | ||
| 197 | + color: MyColours.color_438E93, | ||
| 198 | + width: ScreenUtil().setWidth(2)), | ||
| 199 | + left: hasLeftBorder | ||
| 200 | + ? BorderSide( | ||
| 201 | + color: MyColours.color_438E93, | ||
| 202 | + width: ScreenUtil().setWidth(2)) | ||
| 203 | + : BorderSide.none, | ||
| 204 | + right: BorderSide( | ||
| 205 | + color: MyColours.color_438E93, | ||
| 206 | + width: ScreenUtil().setWidth(2)))), | ||
| 207 | + child: Align( | ||
| 208 | + alignment: Alignment.center, | ||
| 209 | + child: Text( | ||
| 210 | + content, | ||
| 211 | + style: TextStyle( | ||
| 212 | + color: | ||
| 213 | + isSelect ? MyColours.color_F6F6F6 : MyColours.color_438E93, | ||
| 214 | + fontSize: ScreenUtil().setSp(36)), | ||
| 215 | + ), | ||
| 216 | + ), | ||
| 217 | + ), | ||
| 218 | + ); | ||
| 219 | + } | ||
| 220 | + | ||
| 221 | + @override | ||
| 222 | + Widget build(BuildContext context) { | ||
| 223 | + return Scaffold( | ||
| 224 | + backgroundColor: MyColours.color_ffffff, | ||
| 225 | + appBar: SystemAppBar( | ||
| 226 | + widget.isCreate ? '添加套餐' : mealNameC.text, | ||
| 227 | + needWhite: true, | ||
| 228 | + bgColor: MyColours.color_438E93, | ||
| 229 | + titleColor: MyColours.color_F6F6F6, | ||
| 230 | + onTap: () { | ||
| 231 | + Navigator.pop(context); | ||
| 232 | + }, | ||
| 233 | + ), | ||
| 234 | + body: Column( | ||
| 235 | + children: [ | ||
| 236 | + Expanded( | ||
| 237 | + child: Padding( | ||
| 238 | + padding: EdgeInsets.only( | ||
| 239 | + left: w(16), | ||
| 240 | + ), | ||
| 241 | + child: SingleChildScrollView( | ||
| 242 | + controller: controller, | ||
| 243 | + child: Column( | ||
| 244 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 245 | + children: [ | ||
| 246 | + _textfield('套餐名称', '1299套餐', mealNameC, mealF, ''), | ||
| 247 | + _textfield( | ||
| 248 | + '套餐价格', '1299', mealPriceC, mealPriceF, '元'), | ||
| 249 | + Container( | ||
| 250 | + height: w(48), | ||
| 251 | + margin: EdgeInsets.only(top: w(12)), | ||
| 252 | + decoration: BoxDecoration( | ||
| 253 | + border: Border( | ||
| 254 | + bottom: BorderSide( | ||
| 255 | + width: h(0.5), | ||
| 256 | + color: MyColours.color_E7E7E7))), | ||
| 257 | + child: Row( | ||
| 258 | + mainAxisAlignment: | ||
| 259 | + MainAxisAlignment.spaceBetween, | ||
| 260 | + children: [ | ||
| 261 | + Container( | ||
| 262 | + width: w(81), | ||
| 263 | + height: w(48), | ||
| 264 | + alignment: Alignment.center, | ||
| 265 | + child: Text( | ||
| 266 | + '是否议价', | ||
| 267 | + style: TextStyle( | ||
| 268 | + fontSize: ScreenUtil().setSp(32), | ||
| 269 | + color: MyColours.color_E5000000), | ||
| 270 | + ), | ||
| 271 | + ), | ||
| 272 | + Spacer(), | ||
| 273 | + InkWell( | ||
| 274 | + onTap: () { | ||
| 275 | + setState(() { | ||
| 276 | + canBargaining = !canBargaining; | ||
| 277 | + }); | ||
| 278 | + }, | ||
| 279 | + child: Container( | ||
| 280 | + padding: EdgeInsets.only( | ||
| 281 | + left: w(16), right: w(16)), | ||
| 282 | + child: Image.asset( | ||
| 283 | + Utils.getImgPath(canBargaining | ||
| 284 | + ? 'swich_on' | ||
| 285 | + : 'swich_off'), | ||
| 286 | + width: w(44), | ||
| 287 | + ))), | ||
| 288 | + ], | ||
| 289 | + ), | ||
| 290 | + ), | ||
| 291 | + VEmptyView(52), | ||
| 292 | + Text( | ||
| 293 | + '套餐菜品', | ||
| 294 | + style: TextStyle( | ||
| 295 | + fontSize: ScreenUtil().setSp(32), | ||
| 296 | + color: MyColours.color_999999), | ||
| 297 | + ), | ||
| 298 | + VEmptyView(30), | ||
| 299 | + RoundButton( | ||
| 300 | + onPressed: () async { | ||
| 301 | + DialogUtil.textfeildAlertDialog(context, | ||
| 302 | + title: '菜品分类', | ||
| 303 | + hintText: '输入分类名称', | ||
| 304 | + text: '', | ||
| 305 | + lenghtLimit: false, | ||
| 306 | + toast: '请输入分类名称', rCallback: (name) { | ||
| 307 | + // _addCookbookClass(name, showLoading: true); | ||
| 308 | + }); | ||
| 309 | + }, | ||
| 310 | + text: '添加菜品分类', | ||
| 311 | + fontSize: 32, | ||
| 312 | + isBold: false, | ||
| 313 | + height: h(32), | ||
| 314 | + width: w(112), | ||
| 315 | + textColor: MyColours.color_438E93, | ||
| 316 | + gradientStart: MyColours.color_ffffff, | ||
| 317 | + gradientEnd: MyColours.color_ffffff, | ||
| 318 | + borderColor: MyColours.color_438E93, | ||
| 319 | + radius: r(6), | ||
| 320 | + ), | ||
| 321 | + VEmptyView(14), | ||
| 322 | + ListView.builder( | ||
| 323 | + itemCount: 100, | ||
| 324 | + shrinkWrap: true, | ||
| 325 | + controller: controller, | ||
| 326 | + itemBuilder: (BuildContext context, int index) { | ||
| 327 | + return buildFeastTypeItem('热菜(18道)'); | ||
| 328 | + }) | ||
| 329 | + ], | ||
| 330 | + )))), | ||
| 331 | + Row( | ||
| 332 | + children: [ | ||
| 333 | + Expanded( | ||
| 334 | + child: _callButton( | ||
| 335 | + onPress: () { | ||
| 336 | + Navigator.pop(context); | ||
| 337 | + }, | ||
| 338 | + content: '返回', | ||
| 339 | + hasLeftBorder: true, | ||
| 340 | + isSelect: false)), | ||
| 341 | + Expanded( | ||
| 342 | + child: _callButton( | ||
| 343 | + onPress: () {}, | ||
| 344 | + content: '保存', | ||
| 345 | + hasLeftBorder: true, | ||
| 346 | + isSelect: true)) | ||
| 347 | + ], | ||
| 348 | + ) | ||
| 349 | + ], | ||
| 350 | + )); | ||
| 351 | + } | ||
| 352 | +} |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | +import 'package:one_key/route/navigator_util.dart'; | ||
| 4 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 5 | + | ||
| 6 | +import '../../../res/colors.dart'; | ||
| 7 | +import '../../../utils/dialog_util.dart'; | ||
| 8 | +import '../../../utils/screen_util.dart'; | ||
| 9 | +import '../../../utils/utils.dart'; | ||
| 10 | +import '../../../widgets/h_empty_view.dart'; | ||
| 11 | +import '../../../widgets/round_button.dart'; | ||
| 12 | +import '../../../widgets/system_app_bar.dart'; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 套餐管理 | ||
| 16 | + */ | ||
| 17 | + | ||
| 18 | +class FeastSetmealManagePage extends StatefulWidget { | ||
| 19 | + FeastSetmealManagePage({Key key}) : super(key: key); | ||
| 20 | + | ||
| 21 | + @override | ||
| 22 | + _FeastSetmealManagePageState createState() => _FeastSetmealManagePageState(); | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +class _FeastSetmealManagePageState extends State<FeastSetmealManagePage> { | ||
| 26 | + @override | ||
| 27 | + void initState() { | ||
| 28 | + super.initState(); | ||
| 29 | + Utils.changeStatusColor(color: MyColours.color_438E93); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + Widget buildFeastTypeHeader() { | ||
| 33 | + return RoundButton( | ||
| 34 | + onPressed: () async { | ||
| 35 | + NavigatorUtil.goFeastSetmealManageEditPage(context); | ||
| 36 | + }, | ||
| 37 | + text: '添加一项', | ||
| 38 | + fontSize: 32, | ||
| 39 | + isBold: false, | ||
| 40 | + height: h(32), | ||
| 41 | + width: w(80), | ||
| 42 | + margin: EdgeInsets.only(top: w(18), bottom: w(4)), | ||
| 43 | + textColor: MyColours.color_438E93, | ||
| 44 | + gradientStart: MyColours.color_ffffff, | ||
| 45 | + gradientEnd: MyColours.color_ffffff, | ||
| 46 | + borderColor: MyColours.color_438E93, | ||
| 47 | + radius: r(6), | ||
| 48 | + ); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + Widget buildFeastTypeItem(String title, String subTitle) { | ||
| 52 | + return Container( | ||
| 53 | + height: h(48), | ||
| 54 | + margin: EdgeInsets.only(top: w(12)), | ||
| 55 | + decoration: BoxDecoration( | ||
| 56 | + border: Border( | ||
| 57 | + bottom: BorderSide(width:w(0.5), color: MyColours.color_E7E7E7))), | ||
| 58 | + child: Row( | ||
| 59 | + children: [ | ||
| 60 | + Column( | ||
| 61 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 62 | + children: [ | ||
| 63 | + Text( | ||
| 64 | + title, | ||
| 65 | + style: TextStyle( | ||
| 66 | + fontSize: font(16), color: MyColours.color_E6000000), | ||
| 67 | + ), | ||
| 68 | + VEmptyView(12), | ||
| 69 | + Text( | ||
| 70 | + subTitle, | ||
| 71 | + style: TextStyle( | ||
| 72 | + fontSize: font(12), color: MyColours.color_999999), | ||
| 73 | + ) | ||
| 74 | + ], | ||
| 75 | + ), | ||
| 76 | + Spacer(), | ||
| 77 | + InkWell( | ||
| 78 | + onTap: () { | ||
| 79 | + NavigatorUtil.goFeastSetmealManageEditPage(context); | ||
| 80 | + }, | ||
| 81 | + child: Text( | ||
| 82 | + '修改', | ||
| 83 | + style: TextStyle( | ||
| 84 | + decoration: TextDecoration.underline, | ||
| 85 | + fontSize: font(16), | ||
| 86 | + color: MyColours.color_438E93), | ||
| 87 | + )), | ||
| 88 | + HEmptyView(32), | ||
| 89 | + InkWell( | ||
| 90 | + onTap: () { | ||
| 91 | + //已经传到服务器,弹提醒窗口,是否删除 | ||
| 92 | + //修改之前有内容,则弹框 | ||
| 93 | + DialogUtil.cupertinoAlertDialogFeast(context, | ||
| 94 | + rTitle: '删除', | ||
| 95 | + title: "是否确认删除", | ||
| 96 | + content: "1299套餐", lCallback: () { | ||
| 97 | + print("取消"); | ||
| 98 | + }, rCallback: () { | ||
| 99 | + print("确定"); | ||
| 100 | + // widget.deleteCallback(index); | ||
| 101 | + }); | ||
| 102 | + }, | ||
| 103 | + child: Image.asset( | ||
| 104 | + Utils.getImgPath(true ? 'f_delete_red_un' : 'f_delete_red'), | ||
| 105 | + width: w(32), | ||
| 106 | + height: w(32), | ||
| 107 | + )), | ||
| 108 | + HEmptyView(32), | ||
| 109 | + ], | ||
| 110 | + ), | ||
| 111 | + ); | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + @override | ||
| 115 | + Widget build(BuildContext context) { | ||
| 116 | + return Scaffold( | ||
| 117 | + backgroundColor: MyColours.color_ffffff, | ||
| 118 | + appBar: SystemAppBar( | ||
| 119 | + '套餐管理', | ||
| 120 | + needWhite: true, | ||
| 121 | + bgColor: MyColours.color_438E93, | ||
| 122 | + titleColor: MyColours.color_F6F6F6, | ||
| 123 | + onTap: () { | ||
| 124 | + Navigator.pop(context); | ||
| 125 | + }, | ||
| 126 | + ), | ||
| 127 | + body: NestedScrollView( | ||
| 128 | + // controller: _scrollViewController, | ||
| 129 | + headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) { | ||
| 130 | + return <Widget>[ | ||
| 131 | + SliverAppBar( | ||
| 132 | + pinned: true, | ||
| 133 | + floating: false, | ||
| 134 | + leading: null, | ||
| 135 | + backgroundColor: MyColours.color_ffffff, | ||
| 136 | + expandedHeight: ScreenUtil().setWidth(56 * 2), | ||
| 137 | + automaticallyImplyLeading: false, | ||
| 138 | + title: buildFeastTypeHeader(), | ||
| 139 | + // flexibleSpace: FlexibleSpaceBar( | ||
| 140 | + // collapseMode: CollapseMode.pin, | ||
| 141 | + // title: buildFeastTypeHeader()) | ||
| 142 | + ) | ||
| 143 | + ]; | ||
| 144 | + }, | ||
| 145 | + body: ListView.builder( | ||
| 146 | + itemCount: 100, | ||
| 147 | + padding: EdgeInsets.only(left: w(16)), | ||
| 148 | + itemBuilder: (BuildContext context, int index) { | ||
| 149 | + return buildFeastTypeItem('1299套餐', '1499元 不可议价'); | ||
| 150 | + }), | ||
| 151 | + ), | ||
| 152 | + ); | ||
| 153 | + } | ||
| 154 | +} |
| @@ -59,7 +59,7 @@ class _FeastTypePageState extends State<FeastTypePage> { | @@ -59,7 +59,7 @@ class _FeastTypePageState extends State<FeastTypePage> { | ||
| 59 | margin: EdgeInsets.only(top: w(12)), | 59 | margin: EdgeInsets.only(top: w(12)), |
| 60 | decoration: BoxDecoration( | 60 | decoration: BoxDecoration( |
| 61 | border: Border( | 61 | border: Border( |
| 62 | - bottom: BorderSide(width: w(1), color: MyColours.color_E7E7E7))), | 62 | + bottom: BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))), |
| 63 | child: Row( | 63 | child: Row( |
| 64 | children: [ | 64 | children: [ |
| 65 | Text( | 65 | Text( |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 4 | + | ||
| 5 | +import '../../../res/colors.dart'; | ||
| 6 | +import '../../../route/navigator_util.dart'; | ||
| 7 | +import '../../../utils/dialog_util.dart'; | ||
| 8 | +import '../../../utils/screen_util.dart'; | ||
| 9 | +import '../../../utils/utils.dart'; | ||
| 10 | +import '../../../widgets/h_empty_view.dart'; | ||
| 11 | +import '../../../widgets/round_button.dart'; | ||
| 12 | +import '../../../widgets/system_app_bar.dart'; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 酒水添加 | ||
| 16 | + */ | ||
| 17 | +class FeastWineManageEditPage extends StatefulWidget { | ||
| 18 | + final isCreate; | ||
| 19 | + FeastWineManageEditPage({ | ||
| 20 | + Key key, | ||
| 21 | + this.isCreate = true, | ||
| 22 | + }) : super(key: key); | ||
| 23 | + | ||
| 24 | + @override | ||
| 25 | + _FeastWineManageEditPageState createState() => | ||
| 26 | + _FeastWineManageEditPageState(); | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | +class _FeastWineManageEditPageState extends State<FeastWineManageEditPage> { | ||
| 30 | + TextEditingController wineNameC = TextEditingController(); //酒水名称 | ||
| 31 | + FocusNode wineF = FocusNode(); | ||
| 32 | + TextEditingController winePriceC = TextEditingController(); //酒水价格 | ||
| 33 | + FocusNode winePriceF = FocusNode(); | ||
| 34 | + TextEditingController winePerC = TextEditingController(); //酒水规格 | ||
| 35 | + FocusNode winePerF = FocusNode(); | ||
| 36 | + bool canBargaining = true; //是否议价 | ||
| 37 | + ScrollController controller = ScrollController(); | ||
| 38 | + | ||
| 39 | + @override | ||
| 40 | + void initState() { | ||
| 41 | + super.initState(); | ||
| 42 | + Utils.changeStatusColor(color: MyColours.color_438E93); | ||
| 43 | + } | ||
| 44 | + | ||
| 45 | + ///请输入 | ||
| 46 | + ///输入框 | ||
| 47 | + Widget _textfield( | ||
| 48 | + String title, | ||
| 49 | + String hintText, | ||
| 50 | + TextEditingController editingController, | ||
| 51 | + FocusNode focusNode, | ||
| 52 | + String subTitle, | ||
| 53 | + {TextInputType inputType = TextInputType.number}) { | ||
| 54 | + return Container( | ||
| 55 | + height: w(48), | ||
| 56 | + margin: EdgeInsets.only(top: w(12)), | ||
| 57 | + decoration: BoxDecoration( | ||
| 58 | + border: Border( | ||
| 59 | + bottom: | ||
| 60 | + BorderSide(width: h(0.5), color: MyColours.color_E7E7E7))), | ||
| 61 | + child: Row( | ||
| 62 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 63 | + children: [ | ||
| 64 | + Container( | ||
| 65 | + width: w(81), | ||
| 66 | + height: w(48), | ||
| 67 | + alignment: Alignment.center, | ||
| 68 | + child: Text( | ||
| 69 | + title, | ||
| 70 | + style: TextStyle( | ||
| 71 | + fontSize: ScreenUtil().setSp(32), | ||
| 72 | + color: MyColours.color_E5000000), | ||
| 73 | + ), | ||
| 74 | + ), | ||
| 75 | + HEmptyView(32), | ||
| 76 | + Expanded( | ||
| 77 | + child: Container( | ||
| 78 | + // height: ScreenUtil().setHeight(120), | ||
| 79 | + height: w(48), | ||
| 80 | + padding: EdgeInsets.only(top: w(4)), | ||
| 81 | + child: TextField( | ||
| 82 | + controller: editingController, | ||
| 83 | + // textAlign: TextAlign.right, | ||
| 84 | + // textAlignVertical: TextAlignVertical.bottom, | ||
| 85 | + maxLines: 1, | ||
| 86 | + inputFormatters: [], | ||
| 87 | + | ||
| 88 | + // //光标颜色 | ||
| 89 | + // cursorColor: | ||
| 90 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 91 | + //输入文本的样式 | ||
| 92 | + style: TextStyle( | ||
| 93 | + fontSize: ScreenUtil().setSp(32), | ||
| 94 | + color: MyColours.color_515151), | ||
| 95 | + focusNode: focusNode, | ||
| 96 | + decoration: InputDecoration( | ||
| 97 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 98 | + hintText: hintText, | ||
| 99 | + hintStyle: TextStyle( | ||
| 100 | + color: hintText == '请输入' | ||
| 101 | + ? MyColours.color_999999 | ||
| 102 | + : MyColours.color_515151, | ||
| 103 | + fontSize: ScreenUtil().setSp(32), | ||
| 104 | + ), | ||
| 105 | + contentPadding: EdgeInsets.zero, | ||
| 106 | + ), | ||
| 107 | + onChanged: (value) {}, | ||
| 108 | + onEditingComplete: () { | ||
| 109 | + FocusScope.of(context) | ||
| 110 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 111 | + }, | ||
| 112 | + keyboardType: inputType, | ||
| 113 | + )), | ||
| 114 | + ), | ||
| 115 | + Container( | ||
| 116 | + padding: EdgeInsets.only(left: w(16), right: w(12)), | ||
| 117 | + child: Text( | ||
| 118 | + subTitle, | ||
| 119 | + style: TextStyle( | ||
| 120 | + color: MyColours.color_000000, | ||
| 121 | + fontSize: ScreenUtil().setSp(32)), | ||
| 122 | + ), | ||
| 123 | + ), | ||
| 124 | + ], | ||
| 125 | + ), | ||
| 126 | + ); | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + Widget _callButton( | ||
| 130 | + {GestureTapCallback onPress, | ||
| 131 | + content, | ||
| 132 | + hasLeftBorder = true, | ||
| 133 | + isSelect = false}) { | ||
| 134 | + return InkWell( | ||
| 135 | + onTap: onPress, | ||
| 136 | + child: Container( | ||
| 137 | + height: h(48), | ||
| 138 | + decoration: BoxDecoration( | ||
| 139 | + color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff, | ||
| 140 | + border: Border( | ||
| 141 | + bottom: BorderSide( | ||
| 142 | + color: MyColours.color_438E93, | ||
| 143 | + width: ScreenUtil().setWidth(2)), | ||
| 144 | + top: BorderSide( | ||
| 145 | + color: MyColours.color_438E93, | ||
| 146 | + width: ScreenUtil().setWidth(2)), | ||
| 147 | + left: hasLeftBorder | ||
| 148 | + ? BorderSide( | ||
| 149 | + color: MyColours.color_438E93, | ||
| 150 | + width: ScreenUtil().setWidth(2)) | ||
| 151 | + : BorderSide.none, | ||
| 152 | + right: BorderSide( | ||
| 153 | + color: MyColours.color_438E93, | ||
| 154 | + width: ScreenUtil().setWidth(2)))), | ||
| 155 | + child: Align( | ||
| 156 | + alignment: Alignment.center, | ||
| 157 | + child: Text( | ||
| 158 | + content, | ||
| 159 | + style: TextStyle( | ||
| 160 | + color: | ||
| 161 | + isSelect ? MyColours.color_F6F6F6 : MyColours.color_438E93, | ||
| 162 | + fontSize: ScreenUtil().setSp(36)), | ||
| 163 | + ), | ||
| 164 | + ), | ||
| 165 | + ), | ||
| 166 | + ); | ||
| 167 | + } | ||
| 168 | + | ||
| 169 | + @override | ||
| 170 | + Widget build(BuildContext context) { | ||
| 171 | + return Scaffold( | ||
| 172 | + backgroundColor: MyColours.color_ffffff, | ||
| 173 | + appBar: SystemAppBar( | ||
| 174 | + widget.isCreate ? '添加酒水' : wineNameC.text, | ||
| 175 | + needWhite: true, | ||
| 176 | + bgColor: MyColours.color_438E93, | ||
| 177 | + titleColor: MyColours.color_F6F6F6, | ||
| 178 | + onTap: () { | ||
| 179 | + Navigator.pop(context); | ||
| 180 | + }, | ||
| 181 | + ), | ||
| 182 | + body: Column( | ||
| 183 | + children: [ | ||
| 184 | + Expanded( | ||
| 185 | + child: Padding( | ||
| 186 | + padding: EdgeInsets.only( | ||
| 187 | + left: w(16), | ||
| 188 | + ), | ||
| 189 | + child: SingleChildScrollView( | ||
| 190 | + controller: controller, | ||
| 191 | + child: Column( | ||
| 192 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 193 | + children: [ | ||
| 194 | + _textfield( | ||
| 195 | + '酒水名称', '剑南春52度500ml', wineNameC, wineF, ''), | ||
| 196 | + _textfield( | ||
| 197 | + '酒水单价', '1299', winePriceC, winePriceF, '元'), | ||
| 198 | + _textfield('酒水规格', '份', winePerC, winePerF, ''), | ||
| 199 | + Container( | ||
| 200 | + height: w(48), | ||
| 201 | + margin: EdgeInsets.only(top: w(12)), | ||
| 202 | + decoration: BoxDecoration( | ||
| 203 | + border: Border( | ||
| 204 | + bottom: BorderSide( | ||
| 205 | + width: h(0.5), | ||
| 206 | + color: MyColours.color_E7E7E7))), | ||
| 207 | + child: Row( | ||
| 208 | + mainAxisAlignment: | ||
| 209 | + MainAxisAlignment.spaceBetween, | ||
| 210 | + children: [ | ||
| 211 | + Container( | ||
| 212 | + width: w(81), | ||
| 213 | + height: w(48), | ||
| 214 | + alignment: Alignment.center, | ||
| 215 | + child: Text( | ||
| 216 | + '是否议价', | ||
| 217 | + style: TextStyle( | ||
| 218 | + fontSize: ScreenUtil().setSp(32), | ||
| 219 | + color: MyColours.color_E5000000), | ||
| 220 | + ), | ||
| 221 | + ), | ||
| 222 | + Spacer(), | ||
| 223 | + InkWell( | ||
| 224 | + onTap: () { | ||
| 225 | + setState(() { | ||
| 226 | + canBargaining = !canBargaining; | ||
| 227 | + }); | ||
| 228 | + }, | ||
| 229 | + child: Container( | ||
| 230 | + padding: EdgeInsets.only( | ||
| 231 | + left: w(16), right: w(16)), | ||
| 232 | + child: Image.asset( | ||
| 233 | + Utils.getImgPath(canBargaining | ||
| 234 | + ? 'swich_on' | ||
| 235 | + : 'swich_off'), | ||
| 236 | + width: w(44), | ||
| 237 | + ))), | ||
| 238 | + ], | ||
| 239 | + ), | ||
| 240 | + ), | ||
| 241 | + ], | ||
| 242 | + )))), | ||
| 243 | + Row( | ||
| 244 | + children: [ | ||
| 245 | + Expanded( | ||
| 246 | + child: _callButton( | ||
| 247 | + onPress: () { | ||
| 248 | + Navigator.pop(context); | ||
| 249 | + }, | ||
| 250 | + content: '返回', | ||
| 251 | + hasLeftBorder: true, | ||
| 252 | + isSelect: false)), | ||
| 253 | + Expanded( | ||
| 254 | + child: _callButton( | ||
| 255 | + onPress: () {}, | ||
| 256 | + content: '保存', | ||
| 257 | + hasLeftBorder: true, | ||
| 258 | + isSelect: true)) | ||
| 259 | + ], | ||
| 260 | + ) | ||
| 261 | + ], | ||
| 262 | + )); | ||
| 263 | + } | ||
| 264 | +} |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | +import 'package:one_key/route/navigator_util.dart'; | ||
| 4 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 5 | + | ||
| 6 | +import '../../../res/colors.dart'; | ||
| 7 | +import '../../../utils/dialog_util.dart'; | ||
| 8 | +import '../../../utils/screen_util.dart'; | ||
| 9 | +import '../../../utils/utils.dart'; | ||
| 10 | +import '../../../widgets/h_empty_view.dart'; | ||
| 11 | +import '../../../widgets/round_button.dart'; | ||
| 12 | +import '../../../widgets/system_app_bar.dart'; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 酒水管理 | ||
| 16 | + */ | ||
| 17 | + | ||
| 18 | +class FeastWineManagePage extends StatefulWidget { | ||
| 19 | + FeastWineManagePage({Key key}) : super(key: key); | ||
| 20 | + | ||
| 21 | + @override | ||
| 22 | + _FeastWineManagePageState createState() => _FeastWineManagePageState(); | ||
| 23 | +} | ||
| 24 | + | ||
| 25 | +class _FeastWineManagePageState extends State<FeastWineManagePage> { | ||
| 26 | + @override | ||
| 27 | + void initState() { | ||
| 28 | + super.initState(); | ||
| 29 | + Utils.changeStatusColor(color: MyColours.color_438E93); | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + Widget buildFeastTypeHeader() { | ||
| 33 | + return RoundButton( | ||
| 34 | + onPressed: () async { | ||
| 35 | + NavigatorUtil.goFeastWineManageEditPage(context); | ||
| 36 | + }, | ||
| 37 | + text: '添加一项', | ||
| 38 | + fontSize: 32, | ||
| 39 | + isBold: false, | ||
| 40 | + height: h(32), | ||
| 41 | + width: w(80), | ||
| 42 | + margin: EdgeInsets.only(top: w(18), bottom: w(4)), | ||
| 43 | + textColor: MyColours.color_438E93, | ||
| 44 | + gradientStart: MyColours.color_ffffff, | ||
| 45 | + gradientEnd: MyColours.color_ffffff, | ||
| 46 | + borderColor: MyColours.color_438E93, | ||
| 47 | + radius: r(6), | ||
| 48 | + ); | ||
| 49 | + } | ||
| 50 | + | ||
| 51 | + Widget buildFeastTypeItem(String title, String subTitle) { | ||
| 52 | + return Container( | ||
| 53 | + height: h(48), | ||
| 54 | + margin: EdgeInsets.only(top: w(12)), | ||
| 55 | + decoration: BoxDecoration( | ||
| 56 | + border: Border( | ||
| 57 | + bottom: BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))), | ||
| 58 | + child: Row( | ||
| 59 | + children: [ | ||
| 60 | + Column( | ||
| 61 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 62 | + children: [ | ||
| 63 | + Text( | ||
| 64 | + title, | ||
| 65 | + style: TextStyle( | ||
| 66 | + fontSize: font(16), color: MyColours.color_E6000000), | ||
| 67 | + ), | ||
| 68 | + VEmptyView(12), | ||
| 69 | + Text( | ||
| 70 | + subTitle, | ||
| 71 | + style: TextStyle( | ||
| 72 | + fontSize: font(12), color: MyColours.color_999999), | ||
| 73 | + ) | ||
| 74 | + ], | ||
| 75 | + ), | ||
| 76 | + Spacer(), | ||
| 77 | + InkWell( | ||
| 78 | + onTap: () { | ||
| 79 | + NavigatorUtil.goFeastWineManageEditPage(context); | ||
| 80 | + }, | ||
| 81 | + child: Text( | ||
| 82 | + '修改', | ||
| 83 | + style: TextStyle( | ||
| 84 | + decoration: TextDecoration.underline, | ||
| 85 | + fontSize: font(16), | ||
| 86 | + color: MyColours.color_438E93), | ||
| 87 | + )), | ||
| 88 | + HEmptyView(32), | ||
| 89 | + InkWell( | ||
| 90 | + onTap: () { | ||
| 91 | + //已经传到服务器,弹提醒窗口,是否删除 | ||
| 92 | + //修改之前有内容,则弹框 | ||
| 93 | + DialogUtil.cupertinoAlertDialogFeast(context, | ||
| 94 | + rTitle: '删除', | ||
| 95 | + title: "是否确认删除", | ||
| 96 | + content: "剑南春52度500ml", lCallback: () { | ||
| 97 | + print("取消"); | ||
| 98 | + }, rCallback: () { | ||
| 99 | + print("确定"); | ||
| 100 | + // widget.deleteCallback(index); | ||
| 101 | + }); | ||
| 102 | + }, | ||
| 103 | + child: Image.asset( | ||
| 104 | + Utils.getImgPath(true ? 'f_delete_red_un' : 'f_delete_red'), | ||
| 105 | + width: w(32), | ||
| 106 | + height: w(32), | ||
| 107 | + )), | ||
| 108 | + HEmptyView(32), | ||
| 109 | + ], | ||
| 110 | + ), | ||
| 111 | + ); | ||
| 112 | + } | ||
| 113 | + | ||
| 114 | + Widget _callButton( | ||
| 115 | + {GestureTapCallback onPress, | ||
| 116 | + content, | ||
| 117 | + hasLeftBorder = true, | ||
| 118 | + isSelect = false}) { | ||
| 119 | + return InkWell( | ||
| 120 | + onTap: onPress, | ||
| 121 | + child: Container( | ||
| 122 | + height: h(48), | ||
| 123 | + decoration: BoxDecoration( | ||
| 124 | + color: isSelect ? MyColours.color_438E93 : MyColours.color_ffffff, | ||
| 125 | + border: Border( | ||
| 126 | + bottom: BorderSide( | ||
| 127 | + color: MyColours.color_438E93, | ||
| 128 | + width: ScreenUtil().setWidth(2)), | ||
| 129 | + top: BorderSide( | ||
| 130 | + color: MyColours.color_438E93, | ||
| 131 | + width: ScreenUtil().setWidth(2)), | ||
| 132 | + left: hasLeftBorder | ||
| 133 | + ? BorderSide( | ||
| 134 | + color: MyColours.color_438E93, | ||
| 135 | + width: ScreenUtil().setWidth(2)) | ||
| 136 | + : BorderSide.none, | ||
| 137 | + right: BorderSide( | ||
| 138 | + color: MyColours.color_438E93, | ||
| 139 | + width: ScreenUtil().setWidth(2)))), | ||
| 140 | + child: Align( | ||
| 141 | + alignment: Alignment.center, | ||
| 142 | + child: Text( | ||
| 143 | + content, | ||
| 144 | + style: TextStyle( | ||
| 145 | + color: | ||
| 146 | + isSelect ? MyColours.color_F6F6F6 : MyColours.color_438E93, | ||
| 147 | + fontSize: ScreenUtil().setSp(36)), | ||
| 148 | + ), | ||
| 149 | + ), | ||
| 150 | + ), | ||
| 151 | + ); | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + @override | ||
| 155 | + Widget build(BuildContext context) { | ||
| 156 | + return Scaffold( | ||
| 157 | + backgroundColor: MyColours.color_ffffff, | ||
| 158 | + appBar: SystemAppBar( | ||
| 159 | + '酒水管理', | ||
| 160 | + needWhite: true, | ||
| 161 | + bgColor: MyColours.color_438E93, | ||
| 162 | + titleColor: MyColours.color_F6F6F6, | ||
| 163 | + onTap: () { | ||
| 164 | + Navigator.pop(context); | ||
| 165 | + }, | ||
| 166 | + ), | ||
| 167 | + body: Column( | ||
| 168 | + children: [ | ||
| 169 | + Expanded( | ||
| 170 | + child: NestedScrollView( | ||
| 171 | + // controller: _scrollViewController, | ||
| 172 | + headerSliverBuilder: | ||
| 173 | + (BuildContext context, bool innerBoxIsScrolled) { | ||
| 174 | + return <Widget>[ | ||
| 175 | + SliverAppBar( | ||
| 176 | + pinned: true, | ||
| 177 | + floating: false, | ||
| 178 | + leading: null, | ||
| 179 | + backgroundColor: MyColours.color_ffffff, | ||
| 180 | + expandedHeight: ScreenUtil().setWidth(56 * 2), | ||
| 181 | + automaticallyImplyLeading: false, | ||
| 182 | + title: buildFeastTypeHeader(), | ||
| 183 | + // flexibleSpace: FlexibleSpaceBar( | ||
| 184 | + // collapseMode: CollapseMode.pin, | ||
| 185 | + // title: buildFeastTypeHeader()) | ||
| 186 | + ) | ||
| 187 | + ]; | ||
| 188 | + }, | ||
| 189 | + body: ListView.builder( | ||
| 190 | + itemCount: 100, | ||
| 191 | + padding: EdgeInsets.only(left: w(16)), | ||
| 192 | + itemBuilder: (BuildContext context, int index) { | ||
| 193 | + return buildFeastTypeItem('剑南春52度500ml', '1150元/份 不可议价'); | ||
| 194 | + }), | ||
| 195 | + )), | ||
| 196 | + Row( | ||
| 197 | + children: [ | ||
| 198 | + Expanded( | ||
| 199 | + child: _callButton( | ||
| 200 | + onPress: () { | ||
| 201 | + Navigator.pop(context); | ||
| 202 | + }, | ||
| 203 | + content: '返回', | ||
| 204 | + hasLeftBorder: true, | ||
| 205 | + isSelect: false)), | ||
| 206 | + Expanded( | ||
| 207 | + child: _callButton( | ||
| 208 | + onPress: () {}, | ||
| 209 | + content: '保存', | ||
| 210 | + hasLeftBorder: true, | ||
| 211 | + isSelect: true)) | ||
| 212 | + ], | ||
| 213 | + ) | ||
| 214 | + ], | ||
| 215 | + ), | ||
| 216 | + ); | ||
| 217 | + } | ||
| 218 | +} |
| @@ -913,4 +913,66 @@ class NavigatorUtil { | @@ -913,4 +913,66 @@ class NavigatorUtil { | ||
| 913 | return _navigateTo(context, "${Routes.feast_personal_page}", | 913 | return _navigateTo(context, "${Routes.feast_personal_page}", |
| 914 | replace: replace); | 914 | replace: replace); |
| 915 | } | 915 | } |
| 916 | + | ||
| 917 | + ///宴会----宴会管理 --- 套餐管理 | ||
| 918 | + static Future<dynamic> goFeastSetmealManagePage(BuildContext context, | ||
| 919 | + {replace = false, bool onlyShow = false}) { | ||
| 920 | + return _navigateTo(context, "${Routes.feast_setmeal_manage_page}", | ||
| 921 | + replace: replace); | ||
| 922 | + } | ||
| 923 | + | ||
| 924 | + ///宴会----宴会管理 --- 套餐添加 | ||
| 925 | + static Future<dynamic> goFeastSetmealManageEditPage(BuildContext context, | ||
| 926 | + {replace = false, bool onlyShow = false}) { | ||
| 927 | + return _navigateTo(context, "${Routes.feast_setmeal_manage_edit_page}", | ||
| 928 | + replace: replace); | ||
| 929 | + } | ||
| 930 | + | ||
| 931 | + ///宴会----宴会管理 --- 套餐---菜品 | ||
| 932 | + static Future<dynamic> goFeastDishPage(BuildContext context, | ||
| 933 | + {replace = false, bool onlyShow = false}) { | ||
| 934 | + return _navigateTo(context, "${Routes.feast_dish_page}", replace: replace); | ||
| 935 | + } | ||
| 936 | + | ||
| 937 | + ///宴会----宴会管理 --- 酒水管理 | ||
| 938 | + static Future<dynamic> goFeastWineManagePage(BuildContext context, | ||
| 939 | + {replace = false, bool onlyShow = false}) { | ||
| 940 | + return _navigateTo(context, "${Routes.feast_wine_manage_page}", | ||
| 941 | + replace: replace); | ||
| 942 | + } | ||
| 943 | + | ||
| 944 | + ///宴会----宴会管理 --- 酒水添加 | ||
| 945 | + static Future<dynamic> goFeastWineManageEditPage(BuildContext context, | ||
| 946 | + {replace = false, bool onlyShow = false}) { | ||
| 947 | + return _navigateTo(context, "${Routes.feast_wine_manage_edit_page}", | ||
| 948 | + replace: replace); | ||
| 949 | + } | ||
| 950 | + | ||
| 951 | + ///宴会----宴会管理 --- 其他配置管理 | ||
| 952 | + static Future<dynamic> goFeastOthersetManagePage(BuildContext context, | ||
| 953 | + {replace = false, bool onlyShow = false}) { | ||
| 954 | + return _navigateTo(context, "${Routes.feast_otherset_manage_page}", | ||
| 955 | + replace: replace); | ||
| 956 | + } | ||
| 957 | + | ||
| 958 | + ///宴会----宴会管理 --- 其他配置添加 | ||
| 959 | + static Future<dynamic> goFeastOthersetManageEditPage(BuildContext context, | ||
| 960 | + {replace = false, bool onlyShow = false}) { | ||
| 961 | + return _navigateTo(context, "${Routes.feast_otherset_manage_edit_page}", | ||
| 962 | + replace: replace); | ||
| 963 | + } | ||
| 964 | + | ||
| 965 | + ///宴会----宴会管理 --- 定金管理 | ||
| 966 | + static Future<dynamic> goFeastDepositManagePage(BuildContext context, | ||
| 967 | + {replace = false, bool onlyShow = false}) { | ||
| 968 | + return _navigateTo(context, "${Routes.feast_deposit_manage_page}", | ||
| 969 | + replace: replace); | ||
| 970 | + } | ||
| 971 | + | ||
| 972 | + ///宴会----宴会管理 --- 定金类型 | ||
| 973 | + static Future<dynamic> goFeastDepositTypePage(BuildContext context, | ||
| 974 | + {replace = false, bool onlyShow = false}) { | ||
| 975 | + return _navigateTo(context, "${Routes.feast_deposit_type_page}", | ||
| 976 | + replace: replace); | ||
| 977 | + } | ||
| 916 | } | 978 | } |
| @@ -77,7 +77,9 @@ import 'package:one_key/pages/my/customer_type/store_customer/make_marking_page. | @@ -77,7 +77,9 @@ import 'package:one_key/pages/my/customer_type/store_customer/make_marking_page. | ||
| 77 | import 'package:one_key/pages/my/customer_type/store_customer/marketing_records_detail_page.dart'; | 77 | import 'package:one_key/pages/my/customer_type/store_customer/marketing_records_detail_page.dart'; |
| 78 | import 'package:one_key/pages/my/customer_type/store_customer/marketing_records_page.dart'; | 78 | import 'package:one_key/pages/my/customer_type/store_customer/marketing_records_page.dart'; |
| 79 | import 'package:one_key/pages/my/customer_type/store_customer/store_customer_page.dart'; | 79 | import 'package:one_key/pages/my/customer_type/store_customer/store_customer_page.dart'; |
| 80 | +import 'package:one_key/pages/my/feast_manage/feast_deposit_manage_page.dart'; | ||
| 80 | import 'package:one_key/pages/my/feast_manage/feast_personal_page.dart'; | 81 | import 'package:one_key/pages/my/feast_manage/feast_personal_page.dart'; |
| 82 | +import 'package:one_key/pages/my/feast_manage/feast_setmeal_manage_page.dart'; | ||
| 81 | import 'package:one_key/pages/my/personnel_type/base_info_personnal_page.dart'; | 83 | import 'package:one_key/pages/my/personnel_type/base_info_personnal_page.dart'; |
| 82 | import 'package:one_key/pages/my/personnel_type/personnel_detail_page.dart'; | 84 | import 'package:one_key/pages/my/personnel_type/personnel_detail_page.dart'; |
| 83 | import 'package:one_key/pages/my/personnel_type/personnel_manage_page.dart'; | 85 | import 'package:one_key/pages/my/personnel_type/personnel_manage_page.dart'; |
| @@ -150,8 +152,15 @@ import '../pages/feast/feast_menu_page.dart'; | @@ -150,8 +152,15 @@ import '../pages/feast/feast_menu_page.dart'; | ||
| 150 | import '../pages/feast/feast_set_page.dart'; | 152 | import '../pages/feast/feast_set_page.dart'; |
| 151 | import '../pages/feast/feast_setmeal_page.dart'; | 153 | import '../pages/feast/feast_setmeal_page.dart'; |
| 152 | import '../pages/feast/feast_wine_page.dart'; | 154 | import '../pages/feast/feast_wine_page.dart'; |
| 155 | +import '../pages/my/feast_manage/feast_deposit_type_page.dart'; | ||
| 156 | +import '../pages/my/feast_manage/feast_dish_page.dart'; | ||
| 153 | import '../pages/my/feast_manage/feast_manage_home_page.dart'; | 157 | import '../pages/my/feast_manage/feast_manage_home_page.dart'; |
| 158 | +import '../pages/my/feast_manage/feast_otherset_manage_edit_page.dart'; | ||
| 159 | +import '../pages/my/feast_manage/feast_otherset_manage_page.dart'; | ||
| 160 | +import '../pages/my/feast_manage/feast_setmeal_manage_edit_page.dart'; | ||
| 154 | import '../pages/my/feast_manage/feast_type_page.dart'; | 161 | import '../pages/my/feast_manage/feast_type_page.dart'; |
| 162 | +import '../pages/my/feast_manage/feast_wine_manage_edit_page.dart'; | ||
| 163 | +import '../pages/my/feast_manage/feast_wine_manage_page.dart'; | ||
| 155 | import '../provider/feast_model.dart'; | 164 | import '../provider/feast_model.dart'; |
| 156 | 165 | ||
| 157 | // 登录页 | 166 | // 登录页 |
| @@ -1439,3 +1448,101 @@ var feastPersonalPageHandle = new Handler( | @@ -1439,3 +1448,101 @@ var feastPersonalPageHandle = new Handler( | ||
| 1439 | return ChangeNotifierProvider<FeastModel>( | 1448 | return ChangeNotifierProvider<FeastModel>( |
| 1440 | create: (_) => FeastModel(), child: FeastPersonalPage()); | 1449 | create: (_) => FeastModel(), child: FeastPersonalPage()); |
| 1441 | }); | 1450 | }); |
| 1451 | + | ||
| 1452 | +///宴会---套餐管理 | ||
| 1453 | +var feastSetmealManagePageHandle = new Handler( | ||
| 1454 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 1455 | + // String uids = params["uids"].first; | ||
| 1456 | + | ||
| 1457 | + // bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first); | ||
| 1458 | + return ChangeNotifierProvider<FeastModel>( | ||
| 1459 | + create: (_) => FeastModel(), child: FeastSetmealManagePage()); | ||
| 1460 | +}); | ||
| 1461 | + | ||
| 1462 | +///宴会---套餐管理 | ||
| 1463 | +var feastSetmealManageEditPageHandle = new Handler( | ||
| 1464 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 1465 | + // String uids = params["uids"].first; | ||
| 1466 | + | ||
| 1467 | + // bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first); | ||
| 1468 | + return ChangeNotifierProvider<FeastModel>( | ||
| 1469 | + create: (_) => FeastModel(), child: FeastSetmealManageEditPage()); | ||
| 1470 | +}); | ||
| 1471 | + | ||
| 1472 | +///宴会---菜品 | ||
| 1473 | +var feastDishPageHandle = new Handler( | ||
| 1474 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 1475 | + // String uids = params["uids"].first; | ||
| 1476 | + | ||
| 1477 | + // bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first); | ||
| 1478 | + return ChangeNotifierProvider<FeastModel>( | ||
| 1479 | + create: (_) => FeastModel(), child: FeastDishPage()); | ||
| 1480 | +}); | ||
| 1481 | + | ||
| 1482 | +///宴会---酒水管理 | ||
| 1483 | +var feastWineManagePageHandle = new Handler( | ||
| 1484 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 1485 | + // String uids = params["uids"].first; | ||
| 1486 | + | ||
| 1487 | + // bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first); | ||
| 1488 | + return ChangeNotifierProvider<FeastModel>( | ||
| 1489 | + create: (_) => FeastModel(), child: FeastWineManagePage()); | ||
| 1490 | +}); | ||
| 1491 | + | ||
| 1492 | +///宴会---酒水添加 | ||
| 1493 | +var feastWineManageEditPageHandle = new Handler( | ||
| 1494 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 1495 | + // String uids = params["uids"].first; | ||
| 1496 | + | ||
| 1497 | + // bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first); | ||
| 1498 | + return ChangeNotifierProvider<FeastModel>( | ||
| 1499 | + create: (_) => FeastModel(), child: FeastWineManageEditPage()); | ||
| 1500 | +}); | ||
| 1501 | + | ||
| 1502 | +///宴会---其他配置管理 | ||
| 1503 | +var feastOthersetManagePageHandle = new Handler( | ||
| 1504 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 1505 | + // String uids = params["uids"].first; | ||
| 1506 | + | ||
| 1507 | + // bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first); | ||
| 1508 | + return ChangeNotifierProvider<FeastModel>( | ||
| 1509 | + create: (_) => FeastModel(), child: FeastOthersetManagePage()); | ||
| 1510 | +}); | ||
| 1511 | + | ||
| 1512 | +///宴会---其他配置添加 | ||
| 1513 | +var feastOthersetManageEditPageHandle = new Handler( | ||
| 1514 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 1515 | + // String uids = params["uids"].first; | ||
| 1516 | + | ||
| 1517 | + // bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first); | ||
| 1518 | + return ChangeNotifierProvider<FeastModel>( | ||
| 1519 | + create: (_) => FeastModel(), child: FeastOthersetManageEditPage()); | ||
| 1520 | +}); | ||
| 1521 | + | ||
| 1522 | + | ||
| 1523 | +///宴会---定金管理 | ||
| 1524 | +var feastDepositManagePageHandle = new Handler( | ||
| 1525 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 1526 | + // String uids = params["uids"].first; | ||
| 1527 | + | ||
| 1528 | + // bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first); | ||
| 1529 | + return ChangeNotifierProvider<FeastModel>( | ||
| 1530 | + create: (_) => FeastModel(), child: FeastDepositManagePage()); | ||
| 1531 | +}); | ||
| 1532 | + | ||
| 1533 | +///宴会---定金类型 | ||
| 1534 | +var feastDepositTypePageHandle = new Handler( | ||
| 1535 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 1536 | + // String uids = params["uids"].first; | ||
| 1537 | + | ||
| 1538 | + // bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first); | ||
| 1539 | + return ChangeNotifierProvider<FeastModel>( | ||
| 1540 | + create: (_) => FeastModel(), child: FeastDepositTypePage()); | ||
| 1541 | +}); | ||
| 1542 | + | ||
| 1543 | + | ||
| 1544 | + | ||
| 1545 | + | ||
| 1546 | + | ||
| 1547 | + | ||
| 1548 | + |
| @@ -125,10 +125,25 @@ class Routes { | @@ -125,10 +125,25 @@ class Routes { | ||
| 125 | static String feast_invoice_page = "/feast_invoice_page"; //宴会----添加发票 | 125 | static String feast_invoice_page = "/feast_invoice_page"; //宴会----添加发票 |
| 126 | static String feast_manage_home_page = "/feast_manage_home_page"; //宴会----宴会管理 | 126 | static String feast_manage_home_page = "/feast_manage_home_page"; //宴会----宴会管理 |
| 127 | static String feast_type_page = "/feast_type_page"; //宴会----宴会类型 | 127 | static String feast_type_page = "/feast_type_page"; //宴会----宴会类型 |
| 128 | - static String feast_personal_page = "/feast_personal_page"; //宴会----宴会员工 | 128 | + static String feast_personal_page = "/feast_personal_page"; //宴会----宴会员工 |
| 129 | + static String feast_setmeal_manage_page = | ||
| 130 | + "/feast_setmeal_manage_page"; //宴会----套餐管理 | ||
| 131 | + static String feast_setmeal_manage_edit_page = | ||
| 132 | + "/feast_setmeal_manage_edit_page"; //宴会----套餐添加 | ||
| 133 | + static String feast_dish_page = "/feast_dish_page"; //宴会----菜品 | ||
| 129 | 134 | ||
| 130 | - | ||
| 131 | - | 135 | + static String feast_wine_manage_page = "/feast_wine_manage_page"; //宴会----酒水管理 |
| 136 | + static String feast_wine_manage_edit_page = | ||
| 137 | + "/feast_wine_manage_edit_page"; //宴会----酒水添加 | ||
| 138 | + static String feast_otherset_manage_edit_page = | ||
| 139 | + "/feast_otherset_manage_edit_page"; //宴会----其他配置添加 | ||
| 140 | + static String feast_otherset_manage_page = | ||
| 141 | + "/feast_otherset_manage_page"; //宴会-----其他配置管理 | ||
| 142 | + | ||
| 143 | + static String feast_deposit_manage_page = | ||
| 144 | + "/feast_deposit_manage_page"; //宴会-----定金管理 | ||
| 145 | + static String feast_deposit_type_page = | ||
| 146 | + "/feast_deposit_type_page"; //宴会-----定金类型 | ||
| 132 | 147 | ||
| 133 | static void configureRoutes(FluroRouter router) { | 148 | static void configureRoutes(FluroRouter router) { |
| 134 | router.notFoundHandler = new Handler( | 149 | router.notFoundHandler = new Handler( |
| @@ -256,12 +271,24 @@ class Routes { | @@ -256,12 +271,24 @@ class Routes { | ||
| 256 | router.define(feast_set_page, handler: feastSetPageHandle); | 271 | router.define(feast_set_page, handler: feastSetPageHandle); |
| 257 | router.define(feast_invoice_page, handler: feastInvoicePageHandle); | 272 | router.define(feast_invoice_page, handler: feastInvoicePageHandle); |
| 258 | router.define(feast_manage_home_page, handler: feastManageHomePageHandle); | 273 | router.define(feast_manage_home_page, handler: feastManageHomePageHandle); |
| 259 | - router.define(feast_type_page, handler: feastTypePageHandle); | ||
| 260 | -router.define(feast_personal_page, handler: feastPersonalPageHandle); | ||
| 261 | - | ||
| 262 | - | 274 | + router.define(feast_type_page, handler: feastTypePageHandle); |
| 275 | + router.define(feast_personal_page, handler: feastPersonalPageHandle); | ||
| 276 | + router.define(feast_setmeal_manage_page, | ||
| 277 | + handler: feastSetmealManagePageHandle); | ||
| 263 | 278 | ||
| 264 | - | 279 | + router.define(feast_setmeal_manage_edit_page, |
| 280 | + handler: feastSetmealManageEditPageHandle); | ||
| 265 | 281 | ||
| 282 | + router.define(feast_dish_page, handler: feastDishPageHandle); | ||
| 283 | + router.define(feast_wine_manage_page, handler: feastWineManagePageHandle); | ||
| 284 | + router.define(feast_wine_manage_edit_page, | ||
| 285 | + handler: feastWineManageEditPageHandle); | ||
| 286 | + router.define(feast_otherset_manage_page, | ||
| 287 | + handler: feastOthersetManagePageHandle); | ||
| 288 | + router.define(feast_otherset_manage_edit_page, | ||
| 289 | + handler: feastOthersetManageEditPageHandle); | ||
| 290 | + router.define(feast_deposit_manage_page, | ||
| 291 | + handler: feastDepositManagePageHandle); | ||
| 292 | + router.define(feast_deposit_type_page, handler: feastDepositTypePageHandle); | ||
| 266 | } | 293 | } |
| 267 | } | 294 | } |
| @@ -687,6 +687,258 @@ class DialogUtil { | @@ -687,6 +687,258 @@ class DialogUtil { | ||
| 687 | ); | 687 | ); |
| 688 | } | 688 | } |
| 689 | 689 | ||
| 690 | + //宴会---添加菜品 | ||
| 691 | + static Future feastDishEditDialog( | ||
| 692 | + BuildContext context, { | ||
| 693 | + CustomCallBackMap onTap, | ||
| 694 | + String title = '菜品信息', | ||
| 695 | + String content = '', | ||
| 696 | + String per = '', | ||
| 697 | + bool can = true, | ||
| 698 | + }) async { | ||
| 699 | + TextEditingController nameC = TextEditingController(); | ||
| 700 | + TextEditingController perC = TextEditingController(); | ||
| 701 | + nameC.text = content; | ||
| 702 | + perC.text = per; | ||
| 703 | + // bool isRed = content != '' ? false : true; | ||
| 704 | + final action = await showDialog( | ||
| 705 | + context: context, | ||
| 706 | + barrierDismissible: false, | ||
| 707 | + builder: (BuildContext context) { | ||
| 708 | + return StatefulBuilder(builder: (context, state) { | ||
| 709 | + return Scaffold( | ||
| 710 | + backgroundColor: Colors.transparent, | ||
| 711 | + body: Center( | ||
| 712 | + child: Container( | ||
| 713 | + padding: EdgeInsets.symmetric( | ||
| 714 | + horizontal: ScreenUtil().setWidth(50)), | ||
| 715 | + height: ScreenUtil().setWidth(346 * 2), | ||
| 716 | + decoration: BoxDecoration( | ||
| 717 | + borderRadius: | ||
| 718 | + BorderRadius.circular(ScreenUtil().setWidth(16))), | ||
| 719 | + child: SingleChildScrollView( | ||
| 720 | + child: Card( | ||
| 721 | + shape: RoundedRectangleBorder( | ||
| 722 | + borderRadius: BorderRadius.all( | ||
| 723 | + Radius.circular(ScreenUtil().setWidth(10)))), //设置圆角 | ||
| 724 | + child: Container( | ||
| 725 | + child: Column( | ||
| 726 | + children: [ | ||
| 727 | + VEmptyView(64), | ||
| 728 | + Container( | ||
| 729 | + alignment: Alignment.center, | ||
| 730 | + child: Text(title, | ||
| 731 | + style: TextStyle( | ||
| 732 | + fontWeight: FontWeight.bold, | ||
| 733 | + fontSize: ScreenUtil().setSp(32), | ||
| 734 | + color: MyColours.color_E5000000)), | ||
| 735 | + ), | ||
| 736 | + VEmptyView(32), | ||
| 737 | + Padding( | ||
| 738 | + padding: EdgeInsets.symmetric(horizontal: w(16)), | ||
| 739 | + child: Row(children: [ | ||
| 740 | + Text( | ||
| 741 | + '菜品名称', | ||
| 742 | + style: TextStyle( | ||
| 743 | + fontSize: ScreenUtil().setSp(32), | ||
| 744 | + color: MyColours.color_000000), | ||
| 745 | + ), | ||
| 746 | + HEmptyView(24), | ||
| 747 | + Expanded( | ||
| 748 | + child: Container( | ||
| 749 | + height: ScreenUtil().setWidth(48 * 2), | ||
| 750 | + decoration: BoxDecoration( | ||
| 751 | + color: MyColours.color_f3f3f3, | ||
| 752 | + borderRadius: BorderRadius.circular( | ||
| 753 | + ScreenUtil().setWidth(8))), | ||
| 754 | + padding: | ||
| 755 | + EdgeInsets.symmetric(horizontal: w(12)), | ||
| 756 | + child: TextField( | ||
| 757 | + controller: nameC, | ||
| 758 | + maxLines: 1, | ||
| 759 | + style: TextStyle( | ||
| 760 | + fontSize: ScreenUtil().setSp(32), | ||
| 761 | + color: MyColours.color_515151), | ||
| 762 | + decoration: InputDecoration( | ||
| 763 | + contentPadding: EdgeInsets.only( | ||
| 764 | + bottom: ScreenUtil() | ||
| 765 | + .setWidth(40)), //设置文字内容与边框距离 | ||
| 766 | + | ||
| 767 | + border: OutlineInputBorder( | ||
| 768 | + borderSide: BorderSide.none), | ||
| 769 | + hintText: '请输入', | ||
| 770 | + hintStyle: TextStyle( | ||
| 771 | + color: MyColours.color_66000000, | ||
| 772 | + fontSize: ScreenUtil().setSp(32), | ||
| 773 | + ), | ||
| 774 | + ), | ||
| 775 | + onChanged: (value) {}, | ||
| 776 | + onEditingComplete: () { | ||
| 777 | + FocusScope.of(context).requestFocus( | ||
| 778 | + FocusNode()); //点击空白处隐藏键盘 | ||
| 779 | + }, | ||
| 780 | + keyboardType: TextInputType.text, | ||
| 781 | + ), | ||
| 782 | + )) | ||
| 783 | + ])), | ||
| 784 | + VEmptyView(32), | ||
| 785 | + Padding( | ||
| 786 | + padding: EdgeInsets.symmetric(horizontal: w(16)), | ||
| 787 | + child: Row(children: [ | ||
| 788 | + Text( | ||
| 789 | + '菜品规格', | ||
| 790 | + style: TextStyle( | ||
| 791 | + fontSize: ScreenUtil().setSp(32), | ||
| 792 | + color: MyColours.color_000000), | ||
| 793 | + ), | ||
| 794 | + HEmptyView(24), | ||
| 795 | + Expanded( | ||
| 796 | + child: Container( | ||
| 797 | + height: ScreenUtil().setWidth(48 * 2), | ||
| 798 | + decoration: BoxDecoration( | ||
| 799 | + color: MyColours.color_f3f3f3, | ||
| 800 | + borderRadius: BorderRadius.circular( | ||
| 801 | + ScreenUtil().setWidth(8))), | ||
| 802 | + padding: | ||
| 803 | + EdgeInsets.symmetric(horizontal: w(12)), | ||
| 804 | + child: TextField( | ||
| 805 | + controller: perC, | ||
| 806 | + maxLines: 1, | ||
| 807 | + style: TextStyle( | ||
| 808 | + fontSize: ScreenUtil().setSp(32), | ||
| 809 | + color: MyColours.color_515151), | ||
| 810 | + decoration: InputDecoration( | ||
| 811 | + contentPadding: EdgeInsets.only( | ||
| 812 | + bottom: ScreenUtil() | ||
| 813 | + .setWidth(40)), //设置文字内容与边框距离 | ||
| 814 | + | ||
| 815 | + border: OutlineInputBorder( | ||
| 816 | + borderSide: BorderSide.none), | ||
| 817 | + hintText: '请输入', | ||
| 818 | + hintStyle: TextStyle( | ||
| 819 | + color: MyColours.color_66000000, | ||
| 820 | + fontSize: ScreenUtil().setSp(32), | ||
| 821 | + ), | ||
| 822 | + ), | ||
| 823 | + onChanged: (value) {}, | ||
| 824 | + onEditingComplete: () { | ||
| 825 | + FocusScope.of(context).requestFocus( | ||
| 826 | + FocusNode()); //点击空白处隐藏键盘 | ||
| 827 | + }, | ||
| 828 | + keyboardType: TextInputType.text, | ||
| 829 | + ), | ||
| 830 | + )) | ||
| 831 | + ])), | ||
| 832 | + VEmptyView(32), | ||
| 833 | + Container( | ||
| 834 | + height: w(48), | ||
| 835 | + padding: EdgeInsets.only(left: w(16)), | ||
| 836 | + decoration: BoxDecoration( | ||
| 837 | + border: Border( | ||
| 838 | + bottom: BorderSide( | ||
| 839 | + width: h(0.5), | ||
| 840 | + color: MyColours.color_E7E7E7))), | ||
| 841 | + child: Row( | ||
| 842 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 843 | + children: [ | ||
| 844 | + Container( | ||
| 845 | + width: w(81), | ||
| 846 | + height: w(48), | ||
| 847 | + alignment: Alignment.center, | ||
| 848 | + child: Text( | ||
| 849 | + '是否可调菜', | ||
| 850 | + style: TextStyle( | ||
| 851 | + fontSize: ScreenUtil().setSp(32), | ||
| 852 | + color: MyColours.color_E6000000), | ||
| 853 | + ), | ||
| 854 | + ), | ||
| 855 | + Spacer(), | ||
| 856 | + InkWell( | ||
| 857 | + onTap: () { | ||
| 858 | + state(() { | ||
| 859 | + can = !can; | ||
| 860 | + }); | ||
| 861 | + }, | ||
| 862 | + child: Container( | ||
| 863 | + padding: EdgeInsets.only( | ||
| 864 | + left: w(16), right: w(16)), | ||
| 865 | + child: Image.asset( | ||
| 866 | + Utils.getImgPath( | ||
| 867 | + can ? 'swich_on' : 'swich_off'), | ||
| 868 | + width: w(44), | ||
| 869 | + ))), | ||
| 870 | + ], | ||
| 871 | + ), | ||
| 872 | + ), | ||
| 873 | + VEmptyView(64), | ||
| 874 | + MyDivider(double.infinity, ScreenUtil().setWidth(2), | ||
| 875 | + color: MyColours.color_f3f3f3), | ||
| 876 | + Row( | ||
| 877 | + // mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 878 | + children: [ | ||
| 879 | + RoundButton( | ||
| 880 | + text: '取消', | ||
| 881 | + width: (ScreenUtil().screenWidth - | ||
| 882 | + ScreenUtil().setWidth(62) * 2) / | ||
| 883 | + 2, | ||
| 884 | + height: ScreenUtil().setWidth(112), | ||
| 885 | + // radius: ScreenUtil().setWidth(10), | ||
| 886 | + gradientStart: Colors.transparent, | ||
| 887 | + gradientEnd: Colors.transparent, | ||
| 888 | + textColor: MyColours.color_E6000000, | ||
| 889 | + isBold: false, | ||
| 890 | + fontSize: 32, | ||
| 891 | + onPressed: () { | ||
| 892 | + Navigator.pop(context); | ||
| 893 | + }), | ||
| 894 | + MyDivider(ScreenUtil().setWidth(2), | ||
| 895 | + ScreenUtil().setWidth(112), | ||
| 896 | + color: MyColours.color_f3f3f3), | ||
| 897 | + RoundButton( | ||
| 898 | + text: '确定', | ||
| 899 | + width: (ScreenUtil().screenWidth - | ||
| 900 | + ScreenUtil().setWidth(62) * 2) / | ||
| 901 | + 2, | ||
| 902 | + height: ScreenUtil().setWidth(112), | ||
| 903 | + // radius: ScreenUtil().setWidth(10), | ||
| 904 | + gradientStart: Colors.transparent, | ||
| 905 | + gradientEnd: Colors.transparent, | ||
| 906 | + textColor: MyColours.color_438E93, | ||
| 907 | + fontSize: 32, | ||
| 908 | + onPressed: () { | ||
| 909 | + if (nameC.text.trim() == '') { | ||
| 910 | + Utils.showToast('请输入菜品名称!'); | ||
| 911 | + | ||
| 912 | + return; | ||
| 913 | + } | ||
| 914 | + if (perC.text.trim() == '') { | ||
| 915 | + Utils.showToast('请输入菜品规格!'); | ||
| 916 | + return; | ||
| 917 | + } | ||
| 918 | + onTap({ | ||
| 919 | + 'name': nameC.text, | ||
| 920 | + 'per': perC.text, | ||
| 921 | + 'can': can ? '1' : '0' | ||
| 922 | + }); | ||
| 923 | + Navigator.pop(context, { | ||
| 924 | + 'name': nameC.text, | ||
| 925 | + 'per': perC.text, | ||
| 926 | + 'can': can | ||
| 927 | + }); | ||
| 928 | + }), | ||
| 929 | + ], | ||
| 930 | + ) | ||
| 931 | + ], | ||
| 932 | + ), | ||
| 933 | + ), | ||
| 934 | + )), | ||
| 935 | + ), | ||
| 936 | + )); | ||
| 937 | + }); | ||
| 938 | + }, | ||
| 939 | + ); | ||
| 940 | + } | ||
| 941 | + | ||
| 690 | static Future openCreateAreaDialog(BuildContext context, | 942 | static Future openCreateAreaDialog(BuildContext context, |
| 691 | {CustomCallBack onTap}) async { | 943 | {CustomCallBack onTap}) async { |
| 692 | TextEditingController controller = TextEditingController(); | 944 | TextEditingController controller = TextEditingController(); |
-
Please register or login to post a comment