Showing
9 changed files
with
536 additions
and
6 deletions
| @@ -11,14 +11,14 @@ if (flutterRoot == null) { | @@ -11,14 +11,14 @@ if (flutterRoot == null) { | ||
| 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") | 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") |
| 12 | } | 12 | } |
| 13 | 13 | ||
| 14 | -def flutterVersionCode = "300" | 14 | +def flutterVersionCode = "301" |
| 15 | if (flutterVersionCode == null) { | 15 | if (flutterVersionCode == null) { |
| 16 | - flutterVersionCode = '300' | 16 | + flutterVersionCode = '301' |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | -def flutterVersionName = "3.0.0" | 19 | +def flutterVersionName = "3.0.1" |
| 20 | if (flutterVersionName == null) { | 20 | if (flutterVersionName == null) { |
| 21 | - flutterVersionName = '3.0.0' | 21 | + flutterVersionName = '3.0.1' |
| 22 | } | 22 | } |
| 23 | 23 | ||
| 24 | apply plugin: 'com.android.application' | 24 | apply plugin: 'com.android.application' |
lib/models/cookbook_model.dart
0 → 100644
| 1 | +///菜单 | ||
| 2 | + | ||
| 3 | +class MenuModel { | ||
| 4 | + String id; | ||
| 5 | + String sellerid; | ||
| 6 | + String className; | ||
| 7 | + Null classLabel; | ||
| 8 | + String order; | ||
| 9 | + String status; | ||
| 10 | + String classType; | ||
| 11 | + List<MenuSunModel> cookbooklist; | ||
| 12 | + | ||
| 13 | + MenuModel( | ||
| 14 | + {this.id, | ||
| 15 | + this.sellerid, | ||
| 16 | + this.className, | ||
| 17 | + this.classLabel, | ||
| 18 | + this.order, | ||
| 19 | + this.status, | ||
| 20 | + this.classType, | ||
| 21 | + this.cookbooklist}); | ||
| 22 | + | ||
| 23 | + MenuModel.fromJson(Map<String, dynamic> json) { | ||
| 24 | + id = json['id']; | ||
| 25 | + sellerid = json['sellerid']; | ||
| 26 | + className = json['class_name']; | ||
| 27 | + classLabel = json['class_label']; | ||
| 28 | + order = json['order']; | ||
| 29 | + status = json['status']; | ||
| 30 | + classType = json['class_type']; | ||
| 31 | + if (json['cookbooklist'] != null) { | ||
| 32 | + cookbooklist = []; | ||
| 33 | + json['cookbooklist'][0].forEach((v) { | ||
| 34 | + cookbooklist.add(new MenuSunModel.fromJson(v)); | ||
| 35 | + }); | ||
| 36 | + } | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + Map<String, dynamic> toJson() { | ||
| 40 | + final Map<String, dynamic> data = new Map<String, dynamic>(); | ||
| 41 | + data['id'] = this.id; | ||
| 42 | + data['sellerid'] = this.sellerid; | ||
| 43 | + data['class_name'] = this.className; | ||
| 44 | + data['class_label'] = this.classLabel; | ||
| 45 | + data['order'] = this.order; | ||
| 46 | + data['status'] = this.status; | ||
| 47 | + data['class_type'] = this.classType; | ||
| 48 | + if (this.cookbooklist != null) { | ||
| 49 | + data['cookbooklist'] = this.cookbooklist.map((v) => v.toJson()).toList(); | ||
| 50 | + } | ||
| 51 | + return data; | ||
| 52 | + } | ||
| 53 | +} | ||
| 54 | + | ||
| 55 | +class MenuSunModel { | ||
| 56 | + String id; | ||
| 57 | + String sellerid; | ||
| 58 | + String mid; | ||
| 59 | + String cid; | ||
| 60 | + String lid; | ||
| 61 | + String unit; | ||
| 62 | + String name; | ||
| 63 | + String price; | ||
| 64 | + String member_price; | ||
| 65 | + String first_name; | ||
| 66 | + String search_code; | ||
| 67 | + String channel; | ||
| 68 | + String dishesvideo; | ||
| 69 | + String dishesgif; | ||
| 70 | + String status; | ||
| 71 | + | ||
| 72 | + String setup; | ||
| 73 | + String give; | ||
| 74 | + String clear_num; | ||
| 75 | + String record_num; | ||
| 76 | + String image; | ||
| 77 | + String is_weigh; | ||
| 78 | + String desc; | ||
| 79 | + String order_o; | ||
| 80 | + String cdate; | ||
| 81 | + List spec; | ||
| 82 | + int isSpec; | ||
| 83 | + List practice; | ||
| 84 | + | ||
| 85 | + MenuSunModel({ | ||
| 86 | + this.id, | ||
| 87 | + this.sellerid, | ||
| 88 | + this.mid, | ||
| 89 | + this.cid, | ||
| 90 | + this.lid, | ||
| 91 | + this.unit, | ||
| 92 | + this.name, | ||
| 93 | + this.price, | ||
| 94 | + this.member_price, | ||
| 95 | + this.first_name, | ||
| 96 | + this.search_code, | ||
| 97 | + this.channel, | ||
| 98 | + this.dishesvideo, | ||
| 99 | + this.dishesgif, | ||
| 100 | + this.status, | ||
| 101 | + this.setup, | ||
| 102 | + this.give, | ||
| 103 | + this.clear_num, | ||
| 104 | + this.record_num, | ||
| 105 | + this.image, | ||
| 106 | + this.is_weigh, | ||
| 107 | + this.desc, | ||
| 108 | + this.order_o, | ||
| 109 | + this.cdate, | ||
| 110 | + this.spec, | ||
| 111 | + this.isSpec, | ||
| 112 | + this.practice, | ||
| 113 | + }); | ||
| 114 | + | ||
| 115 | + MenuSunModel.fromJson(Map<String, dynamic> json) { | ||
| 116 | + id = json['id']; | ||
| 117 | + sellerid = json['sellerid']; | ||
| 118 | + mid = json['mid']; | ||
| 119 | + lid = json['lid']; | ||
| 120 | + unit = json['unit']; | ||
| 121 | + name = json['name']; | ||
| 122 | + price = json['price']; | ||
| 123 | + member_price = json['member_price']; | ||
| 124 | + first_name = json['first_name']; | ||
| 125 | + search_code = json['search_code']; | ||
| 126 | + channel = json['channel']; | ||
| 127 | + dishesvideo = json['dishesvideo']; | ||
| 128 | + dishesgif = json['dishesgif']; | ||
| 129 | + status = json['status']; | ||
| 130 | + setup = json['setup']; | ||
| 131 | + give = json['give']; | ||
| 132 | + clear_num = json['clear_num']; | ||
| 133 | + record_num = json['record_num']; | ||
| 134 | + image = json['image']; | ||
| 135 | + is_weigh = json['is_weigh']; | ||
| 136 | + desc = json['desc']; | ||
| 137 | + order_o = json['order_o']; | ||
| 138 | + cdate = json['cdate']; | ||
| 139 | + spec = json['spec']; | ||
| 140 | + isSpec = json['isSpec']; | ||
| 141 | + practice = json['practice']; | ||
| 142 | + } | ||
| 143 | + | ||
| 144 | + Map<String, dynamic> toJson() { | ||
| 145 | + final Map<String, dynamic> data = new Map<String, dynamic>(); | ||
| 146 | + data['id'] = this.id; | ||
| 147 | + data['sellerid'] = this.sellerid; | ||
| 148 | + data['mid'] = this.mid; | ||
| 149 | + data['lid'] = this.lid; | ||
| 150 | + data['unit'] = this.unit; | ||
| 151 | + data['name'] = this.name; | ||
| 152 | + data['price'] = this.price; | ||
| 153 | + data['member_price'] = this.member_price; | ||
| 154 | + data['first_name'] = this.first_name; | ||
| 155 | + data['search_code'] = this.search_code; | ||
| 156 | + data['channel'] = this.channel; | ||
| 157 | + data['dishesvideo'] = this.dishesvideo; | ||
| 158 | + data['dishesgif'] = this.dishesgif; | ||
| 159 | + data['status'] = this.status; | ||
| 160 | + data['setup'] = this.setup; | ||
| 161 | + data['give'] = this.give; | ||
| 162 | + data['clear_num'] = this.clear_num; | ||
| 163 | + | ||
| 164 | + data['record_num'] = this.record_num; | ||
| 165 | + data['image'] = this.image; | ||
| 166 | + data['is_weigh'] = this.is_weigh; | ||
| 167 | + data['desc'] = this.desc; | ||
| 168 | + data['order_o'] = this.order_o; | ||
| 169 | + data['cdate'] = this.cdate; | ||
| 170 | + data['spec'] = this.spec; | ||
| 171 | + data['isSpec'] = this.isSpec; | ||
| 172 | + data['practice'] = this.practice; | ||
| 173 | + return data; | ||
| 174 | + } | ||
| 175 | +} |
| @@ -139,5 +139,7 @@ class HttpUrl { | @@ -139,5 +139,7 @@ class HttpUrl { | ||
| 139 | "?service=App.Seller.GetTableClassById"; // 获取包间分类 | 139 | "?service=App.Seller.GetTableClassById"; // 获取包间分类 |
| 140 | static const String set_table_class = | 140 | static const String set_table_class = |
| 141 | "?service=App.Seller.SetTableClass"; // 添加/修改包间分类 | 141 | "?service=App.Seller.SetTableClass"; // 添加/修改包间分类 |
| 142 | + static const String get_cookbook_by_class = | ||
| 143 | + "?service=App.Cookbook.GetCookbookByClass"; //分类下所有菜品列表(1.传orderid顾客端获取带订单信息的 否则不传 | ||
| 142 | 144 | ||
| 143 | } | 145 | } |
lib/pages/my/menu_type/menu_manage_page.dart
0 → 100644
| 1 | +import 'package:amap_map_fluttify/amap_map_fluttify.dart'; | ||
| 2 | +import 'package:cached_network_image/cached_network_image.dart'; | ||
| 3 | +import 'package:flutter/material.dart'; | ||
| 4 | +import 'package:flutter_easyrefresh/easy_refresh.dart'; | ||
| 5 | +import 'package:flutter_screenutil/screenutil.dart'; | ||
| 6 | +import 'package:one_key/constant/state.dart'; | ||
| 7 | +import 'package:one_key/models/cookbook_model.dart'; | ||
| 8 | +import 'package:one_key/provider/menu_provider.dart'; | ||
| 9 | +import 'package:one_key/provider/user_model.dart'; | ||
| 10 | +import 'package:one_key/res/colors.dart'; | ||
| 11 | +import 'package:one_key/route/navigator_util.dart'; | ||
| 12 | +import 'package:one_key/utils/event_bus.dart'; | ||
| 13 | +import 'package:one_key/widgets/MyDivider.dart'; | ||
| 14 | +import 'package:one_key/widgets/h_empty_view.dart'; | ||
| 15 | +import 'package:one_key/widgets/page_exception.dart'; | ||
| 16 | +import 'package:one_key/widgets/round_button.dart'; | ||
| 17 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 18 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 19 | +import 'package:provider/provider.dart'; | ||
| 20 | + | ||
| 21 | +class MenuManagePage extends StatefulWidget { | ||
| 22 | + MenuManagePage({Key key}) : super(key: key); | ||
| 23 | + | ||
| 24 | + @override | ||
| 25 | + _MenuManagePageState createState() => _MenuManagePageState(); | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | +class _MenuManagePageState extends State<MenuManagePage> { | ||
| 29 | + ScrollController _controller = ScrollController(); | ||
| 30 | + MenuManageProvider menuManageProvider; | ||
| 31 | + @override | ||
| 32 | + void initState() { | ||
| 33 | + super.initState(); | ||
| 34 | + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { | ||
| 35 | + _getCookbookByClass(); | ||
| 36 | + }); | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + _getCookbookByClass() async { | ||
| 40 | + Map<String, String> params = { | ||
| 41 | + "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 42 | + }; | ||
| 43 | + | ||
| 44 | + await menuManageProvider.getCookbookByClass(context, params); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + @override | ||
| 48 | + Widget build(BuildContext context) { | ||
| 49 | + menuManageProvider = Provider.of<MenuManageProvider>(context, listen: true); | ||
| 50 | + return Scaffold( | ||
| 51 | + backgroundColor: MyColours.color_ffffff, | ||
| 52 | + appBar: SystemAppBar( | ||
| 53 | + '菜单管理', | ||
| 54 | + onTap: () { | ||
| 55 | + EventBus().emit('changeStatusColor'); | ||
| 56 | + Navigator.of(context).pop(); | ||
| 57 | + }, | ||
| 58 | + ), | ||
| 59 | + body: WillPopScope( | ||
| 60 | + onWillPop: () { | ||
| 61 | + EventBus().emit('changeStatusColor'); | ||
| 62 | + Navigator.of(context).pop(); | ||
| 63 | + }, | ||
| 64 | + child: Column( | ||
| 65 | + children: [ | ||
| 66 | + Expanded(child: Consumer<MenuManageProvider>( | ||
| 67 | + builder: (context, model, _) { | ||
| 68 | + if (model.pageState != PageState.Success) { | ||
| 69 | + return ExceptionPage( | ||
| 70 | + pageState: model.pageState, | ||
| 71 | + callback: () { | ||
| 72 | + // offset = 0; | ||
| 73 | + // getMessage(showLoading: true); | ||
| 74 | + // _couponNetworkData(); | ||
| 75 | + }, | ||
| 76 | + emptyMsg: "菜品是空哒,快点击分类管理添加分类和菜品吧", | ||
| 77 | + emptyImg: "empty_search", | ||
| 78 | + showMsg: "加载中,请稍后...", | ||
| 79 | + ); | ||
| 80 | + } else { | ||
| 81 | + return ListView.builder( | ||
| 82 | + padding: EdgeInsets.symmetric( | ||
| 83 | + horizontal: ScreenUtil().setWidth(40), | ||
| 84 | + vertical: ScreenUtil().setWidth(40)), | ||
| 85 | + itemCount: menuManageProvider.menuModel.length, | ||
| 86 | + shrinkWrap: true, | ||
| 87 | + controller: _controller, | ||
| 88 | + itemBuilder: (BuildContext context, int indexOut) { | ||
| 89 | + return Column( | ||
| 90 | + children: [ | ||
| 91 | + Row( | ||
| 92 | + mainAxisAlignment: MainAxisAlignment.center, | ||
| 93 | + children: [ | ||
| 94 | + Container( | ||
| 95 | + width: ScreenUtil().setWidth(10), | ||
| 96 | + height: ScreenUtil().setWidth(10), | ||
| 97 | + decoration: BoxDecoration( | ||
| 98 | + color: MyColours.color_0D0D0D, | ||
| 99 | + shape: BoxShape.circle), | ||
| 100 | + ), | ||
| 101 | + MyDivider(ScreenUtil().setWidth(80), | ||
| 102 | + ScreenUtil().setWidth(2), | ||
| 103 | + color: MyColours.color_0D0D0D), | ||
| 104 | + HEmptyView(20), | ||
| 105 | + Text( | ||
| 106 | + menuManageProvider | ||
| 107 | + .menuModel[indexOut].className, | ||
| 108 | + style: TextStyle( | ||
| 109 | + color: MyColours.color_333333, | ||
| 110 | + fontSize: ScreenUtil().setSp(28), | ||
| 111 | + ), | ||
| 112 | + ), | ||
| 113 | + HEmptyView(20), | ||
| 114 | + MyDivider(ScreenUtil().setWidth(80), | ||
| 115 | + ScreenUtil().setWidth(2), | ||
| 116 | + color: MyColours.color_0D0D0D), | ||
| 117 | + Container( | ||
| 118 | + width: ScreenUtil().setWidth(10), | ||
| 119 | + height: ScreenUtil().setWidth(10), | ||
| 120 | + decoration: BoxDecoration( | ||
| 121 | + color: MyColours.color_0D0D0D, | ||
| 122 | + shape: BoxShape.circle), | ||
| 123 | + ), | ||
| 124 | + ], | ||
| 125 | + ), | ||
| 126 | + GridView.builder( | ||
| 127 | + controller: _controller, | ||
| 128 | + physics: NeverScrollableScrollPhysics(), | ||
| 129 | + padding: EdgeInsets.symmetric( | ||
| 130 | + vertical: ScreenUtil().setWidth(40)), | ||
| 131 | + shrinkWrap: true, | ||
| 132 | + cacheExtent: ScreenUtil().setWidth(0), | ||
| 133 | + itemCount: menuManageProvider | ||
| 134 | + .menuModel[indexOut] | ||
| 135 | + .cookbooklist | ||
| 136 | + .length, | ||
| 137 | + gridDelegate: | ||
| 138 | + SliverGridDelegateWithFixedCrossAxisCount( | ||
| 139 | + crossAxisCount: 2, | ||
| 140 | + childAspectRatio: 80 / 56, | ||
| 141 | + mainAxisSpacing: | ||
| 142 | + ScreenUtil().setWidth(15 * 2), | ||
| 143 | + crossAxisSpacing: | ||
| 144 | + ScreenUtil().setWidth(15 * 2)), | ||
| 145 | + itemBuilder: | ||
| 146 | + (BuildContext context, int index) { | ||
| 147 | + MenuSunModel model = menuManageProvider | ||
| 148 | + .menuModel[indexOut] | ||
| 149 | + .cookbooklist[index]; | ||
| 150 | + return Container( | ||
| 151 | + decoration: BoxDecoration( | ||
| 152 | + color: index % 2 == 0 | ||
| 153 | + ? Color.fromRGBO( | ||
| 154 | + 247, 230, 230, 1) | ||
| 155 | + : Color.fromRGBO( | ||
| 156 | + 234, 236, 252, 1), | ||
| 157 | + borderRadius: BorderRadius.circular( | ||
| 158 | + ScreenUtil().setWidth(10))), | ||
| 159 | + child: model.image != null | ||
| 160 | + ? ClipRRect( | ||
| 161 | + borderRadius: | ||
| 162 | + BorderRadius.circular( | ||
| 163 | + ScreenUtil() | ||
| 164 | + .setWidth(10)), | ||
| 165 | + child: CachedNetworkImage( | ||
| 166 | + imageUrl: model.image, | ||
| 167 | + fit: BoxFit.cover, | ||
| 168 | + width: ScreenUtil() | ||
| 169 | + .setWidth(30 * 2), | ||
| 170 | + height: ScreenUtil() | ||
| 171 | + .setWidth(30 * 2), | ||
| 172 | + ), | ||
| 173 | + ) | ||
| 174 | + : Container( | ||
| 175 | + padding: EdgeInsets.symmetric( | ||
| 176 | + horizontal: ScreenUtil() | ||
| 177 | + .setWidth(20)), | ||
| 178 | + child: Column( | ||
| 179 | + crossAxisAlignment: | ||
| 180 | + CrossAxisAlignment.start, | ||
| 181 | + mainAxisAlignment: | ||
| 182 | + MainAxisAlignment.center, | ||
| 183 | + children: [ | ||
| 184 | + Text( | ||
| 185 | + model.name, | ||
| 186 | + style: TextStyle( | ||
| 187 | + color: MyColours | ||
| 188 | + .color_333333, | ||
| 189 | + fontSize: ScreenUtil() | ||
| 190 | + .setSp(34), | ||
| 191 | + fontWeight: | ||
| 192 | + FontWeight.bold), | ||
| 193 | + ), | ||
| 194 | + VEmptyView(40), | ||
| 195 | + Text( | ||
| 196 | + '${model.price}元/${model.unit}', | ||
| 197 | + style: TextStyle( | ||
| 198 | + color: MyColours | ||
| 199 | + .color_333333, | ||
| 200 | + fontSize: ScreenUtil() | ||
| 201 | + .setSp(28), | ||
| 202 | + )) | ||
| 203 | + ], | ||
| 204 | + ), | ||
| 205 | + ), | ||
| 206 | + ); | ||
| 207 | + }) | ||
| 208 | + ], | ||
| 209 | + // onRefresh: () async { | ||
| 210 | + // // offset = 0; | ||
| 211 | + // // getMessage(showLoading: false); | ||
| 212 | + // }, | ||
| 213 | + // onLoad: () async { | ||
| 214 | + // // offset++; | ||
| 215 | + // // getMessage(showLoading: false); | ||
| 216 | + // }, | ||
| 217 | + ); | ||
| 218 | + }); | ||
| 219 | + } | ||
| 220 | + }, | ||
| 221 | + )), | ||
| 222 | + // VEmptyView(20), | ||
| 223 | + Row( | ||
| 224 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 225 | + children: [ | ||
| 226 | + Padding( | ||
| 227 | + padding: EdgeInsets.fromLTRB( | ||
| 228 | + ScreenUtil().setWidth(40), | ||
| 229 | + 0, | ||
| 230 | + ScreenUtil().setWidth(40), | ||
| 231 | + ScreenUtil().setWidth(40)), | ||
| 232 | + child: RoundButton( | ||
| 233 | + onPressed: () async { | ||
| 234 | + bool needRefresh = | ||
| 235 | + await NavigatorUtil.goCouponEditPage(context); | ||
| 236 | + print(needRefresh); | ||
| 237 | + if (needRefresh != null && needRefresh) { | ||
| 238 | + //刷新页面数据 | ||
| 239 | + // _controller.callRefresh(); | ||
| 240 | + // _couponNetworkData(); | ||
| 241 | + } | ||
| 242 | + }, | ||
| 243 | + text: '添加\n菜品', | ||
| 244 | + fontSize: 26, | ||
| 245 | + isBold: false, | ||
| 246 | + height: ScreenUtil().setWidth(120), | ||
| 247 | + width: ScreenUtil().setWidth(120), | ||
| 248 | + radius: ScreenUtil().setWidth(60), | ||
| 249 | + )), | ||
| 250 | + Padding( | ||
| 251 | + padding: EdgeInsets.fromLTRB( | ||
| 252 | + ScreenUtil().setWidth(40), | ||
| 253 | + 0, | ||
| 254 | + ScreenUtil().setWidth(40), | ||
| 255 | + ScreenUtil().setWidth(40)), | ||
| 256 | + child: RoundButton( | ||
| 257 | + onPressed: () async { | ||
| 258 | + bool needRefresh = | ||
| 259 | + await NavigatorUtil.goCouponEditPage(context); | ||
| 260 | + print(needRefresh); | ||
| 261 | + if (needRefresh != null && needRefresh) { | ||
| 262 | + //刷新页面数据 | ||
| 263 | + // _controller.callRefresh(); | ||
| 264 | + // _couponNetworkData(); | ||
| 265 | + } | ||
| 266 | + }, | ||
| 267 | + text: '分类\n管理', | ||
| 268 | + fontSize: 26, | ||
| 269 | + isBold: false, | ||
| 270 | + height: ScreenUtil().setWidth(120), | ||
| 271 | + width: ScreenUtil().setWidth(120), | ||
| 272 | + radius: ScreenUtil().setWidth(60), | ||
| 273 | + )) | ||
| 274 | + ], | ||
| 275 | + ) | ||
| 276 | + ], | ||
| 277 | + ))); | ||
| 278 | + } | ||
| 279 | +} |
| @@ -338,6 +338,23 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | @@ -338,6 +338,23 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { | ||
| 338 | smsInfoData: smsInfoData); | 338 | smsInfoData: smsInfoData); |
| 339 | }, | 339 | }, |
| 340 | ), | 340 | ), |
| 341 | + MyDivider( | ||
| 342 | + double.infinity, | ||
| 343 | + ScreenUtil().setHeight(1), | ||
| 344 | + color: MyColours.color_f3f3f3, | ||
| 345 | + ), | ||
| 346 | + MyItem( | ||
| 347 | + title: "菜单管理", | ||
| 348 | + content: "", | ||
| 349 | + callback: () { | ||
| 350 | + NavigatorUtil.goMenuManagePage(context); | ||
| 351 | + }, | ||
| 352 | + ), | ||
| 353 | + MyDivider( | ||
| 354 | + double.infinity, | ||
| 355 | + ScreenUtil().setHeight(1), | ||
| 356 | + color: MyColours.color_f3f3f3, | ||
| 357 | + ), | ||
| 341 | MyDivider( | 358 | MyDivider( |
| 342 | double.infinity, | 359 | double.infinity, |
| 343 | ScreenUtil().setHeight(1), | 360 | ScreenUtil().setHeight(1), |
lib/provider/menu_provider.dart
0 → 100644
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:one_key/constant/constant.dart'; | ||
| 3 | +import 'package:one_key/constant/state.dart'; | ||
| 4 | +import 'package:one_key/models/cookbook_model.dart'; | ||
| 5 | +import 'package:one_key/net/base_resp.dart'; | ||
| 6 | +import 'package:one_key/net/dio_util.dart'; | ||
| 7 | +import 'package:one_key/net/http_url.dart'; | ||
| 8 | +import 'package:one_key/utils/utils.dart'; | ||
| 9 | + | ||
| 10 | +class MenuManageProvider extends ChangeNotifier { | ||
| 11 | + PageState pageState = PageState.Success; | ||
| 12 | + List<MenuModel> menuModel; //菜品数据 | ||
| 13 | + | ||
| 14 | + ///分类下所有菜品列表(1.传orderid顾客端获取带订单信息的 否则不传 | ||
| 15 | + | ||
| 16 | + getCookbookByClass(BuildContext context, Map<String, String> params) async { | ||
| 17 | + BaseResp<dynamic> baseResp = await DioUtil() | ||
| 18 | + .request<dynamic>(context, Method.get, HttpUrl.get_cookbook_by_class, | ||
| 19 | + data: params, showLoading: false) | ||
| 20 | + .catchError((error) { | ||
| 21 | + print(error.toString()); | ||
| 22 | + }); | ||
| 23 | + menuModel = []; | ||
| 24 | + | ||
| 25 | + if (baseResp != null && baseResp.code == Constant.status_success) { | ||
| 26 | + List menu = baseResp.data[0]['list']; | ||
| 27 | + for (int i = 0; i < menu.length; i++) { | ||
| 28 | + menuModel.add(MenuModel.fromJson(menu[i])); | ||
| 29 | + } | ||
| 30 | + print(menuModel); | ||
| 31 | + notifyListeners(); | ||
| 32 | + } else { | ||
| 33 | + Utils.showToast(baseResp.msg ?? ""); | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | +} |
| @@ -379,8 +379,8 @@ class NavigatorUtil { | @@ -379,8 +379,8 @@ class NavigatorUtil { | ||
| 379 | SmsInfoData smsInfoData, | 379 | SmsInfoData smsInfoData, |
| 380 | bool isNew = true, | 380 | bool isNew = true, |
| 381 | String tableClassId}) { | 381 | String tableClassId}) { |
| 382 | - return _navigateTo( | ||
| 383 | - context, "${Routes.room_type_create_page}?isnew=${isNew}&tableClassId=${tableClassId}", | 382 | + return _navigateTo(context, |
| 383 | + "${Routes.room_type_create_page}?isnew=${isNew}&tableClassId=${tableClassId}", | ||
| 384 | replace: replace); | 384 | replace: replace); |
| 385 | } | 385 | } |
| 386 | 386 | ||
| @@ -399,4 +399,10 @@ class NavigatorUtil { | @@ -399,4 +399,10 @@ class NavigatorUtil { | ||
| 399 | return _navigateTo(context, | 399 | return _navigateTo(context, |
| 400 | "${Routes.room_type_select_table_page}?rid=$rid&tid=$tid&dateTime=$dateTime&fromPage=$fromPage&ddate_slot=$ddate_slot&canChoose=$canChoose"); | 400 | "${Routes.room_type_select_table_page}?rid=$rid&tid=$tid&dateTime=$dateTime&fromPage=$fromPage&ddate_slot=$ddate_slot&canChoose=$canChoose"); |
| 401 | } | 401 | } |
| 402 | + | ||
| 403 | + /// 菜单管理 | ||
| 404 | + static Future<dynamic> goMenuManagePage(BuildContext context, | ||
| 405 | + {replace = false}) { | ||
| 406 | + return _navigateTo(context, "${Routes.menu_manage_page}", replace: replace); | ||
| 407 | + } | ||
| 402 | } | 408 | } |
| @@ -37,6 +37,7 @@ import 'package:one_key/pages/message/message_order_menu.dart'; | @@ -37,6 +37,7 @@ import 'package:one_key/pages/message/message_order_menu.dart'; | ||
| 37 | import 'package:one_key/pages/my/base_info.dart'; | 37 | import 'package:one_key/pages/my/base_info.dart'; |
| 38 | import 'package:one_key/pages/my/book_time_set.dart'; | 38 | import 'package:one_key/pages/my/book_time_set.dart'; |
| 39 | import 'package:one_key/pages/my/contant_page.dart'; | 39 | import 'package:one_key/pages/my/contant_page.dart'; |
| 40 | +import 'package:one_key/pages/my/menu_type/menu_manage_page.dart'; | ||
| 40 | import 'package:one_key/pages/my/my_integral_page.dart'; | 41 | import 'package:one_key/pages/my/my_integral_page.dart'; |
| 41 | import 'package:one_key/pages/my/receive_orders_time_set.dart'; | 42 | import 'package:one_key/pages/my/receive_orders_time_set.dart'; |
| 42 | import 'package:one_key/pages/my/remark_manager_page.dart'; | 43 | import 'package:one_key/pages/my/remark_manager_page.dart'; |
| @@ -61,6 +62,7 @@ import 'package:one_key/provider/book_set_time_model.dart'; | @@ -61,6 +62,7 @@ import 'package:one_key/provider/book_set_time_model.dart'; | ||
| 61 | import 'package:one_key/provider/choose_table_model.dart'; | 62 | import 'package:one_key/provider/choose_table_model.dart'; |
| 62 | import 'package:one_key/provider/contant_show_model.dart'; | 63 | import 'package:one_key/provider/contant_show_model.dart'; |
| 63 | import 'package:one_key/provider/create_store_model.dart'; | 64 | import 'package:one_key/provider/create_store_model.dart'; |
| 65 | +import 'package:one_key/provider/menu_provider.dart'; | ||
| 64 | import 'package:one_key/provider/my_model.dart'; | 66 | import 'package:one_key/provider/my_model.dart'; |
| 65 | import 'package:one_key/provider/notebook_detail_change_model.dart'; | 67 | import 'package:one_key/provider/notebook_detail_change_model.dart'; |
| 66 | import 'package:one_key/provider/notebook_detail_model.dart'; | 68 | import 'package:one_key/provider/notebook_detail_model.dart'; |
| @@ -615,3 +617,14 @@ var roomTypeSelectTablePageHandler = new Handler( | @@ -615,3 +617,14 @@ var roomTypeSelectTablePageHandler = new Handler( | ||
| 615 | fromPage: fromPage, | 617 | fromPage: fromPage, |
| 616 | tid: tid)); | 618 | tid: tid)); |
| 617 | }); | 619 | }); |
| 620 | + | ||
| 621 | +///菜单管理页面 | ||
| 622 | +var menuManagePageHandle = new Handler( | ||
| 623 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 624 | + // SmsInfoData data = SmsInfoData.fromJson(json.decode( | ||
| 625 | + // FluroConvertUtils.fluroCnParamsDecode(params["smsInfoData"].first))); | ||
| 626 | + return ChangeNotifierProvider<MenuManageProvider>( | ||
| 627 | + create: (_) => MenuManageProvider(), child: MenuManagePage()); | ||
| 628 | + // return ChangeNotifierProvider<UploadImageProvider>( | ||
| 629 | + // create: (_) => UploadImageProvider(), child: EnterStoreFrontPhotoPage()); | ||
| 630 | +}); |
| @@ -55,6 +55,7 @@ class Routes { | @@ -55,6 +55,7 @@ class Routes { | ||
| 55 | static String room_type_create_page = "/room_type_create_page"; //包间类型创建 | 55 | static String room_type_create_page = "/room_type_create_page"; //包间类型创建 |
| 56 | static String room_type_select_table_page = | 56 | static String room_type_select_table_page = |
| 57 | "/room_type_select_table_page"; //包间管理中桌位选择页面 | 57 | "/room_type_select_table_page"; //包间管理中桌位选择页面 |
| 58 | + static String menu_manage_page = "/menu_manage_page"; //菜单管理页面 | ||
| 58 | 59 | ||
| 59 | static void configureRoutes(FluroRouter router) { | 60 | static void configureRoutes(FluroRouter router) { |
| 60 | router.notFoundHandler = new Handler( | 61 | router.notFoundHandler = new Handler( |
| @@ -117,5 +118,6 @@ class Routes { | @@ -117,5 +118,6 @@ class Routes { | ||
| 117 | router.define(room_type_create_page, handler: roomTypeCreatePageHandler); | 118 | router.define(room_type_create_page, handler: roomTypeCreatePageHandler); |
| 118 | router.define(room_type_select_table_page, | 119 | router.define(room_type_select_table_page, |
| 119 | handler: roomTypeSelectTablePageHandler); | 120 | handler: roomTypeSelectTablePageHandler); |
| 121 | + router.define(menu_manage_page, handler: menuManagePageHandle); | ||
| 120 | } | 122 | } |
| 121 | } | 123 | } |
-
Please register or login to post a comment