|
|
|
1
|
+import 'dart:convert';
|
|
|
|
2
|
+
|
|
1
|
import 'package:amap_map_fluttify/amap_map_fluttify.dart';
|
3
|
import 'package:amap_map_fluttify/amap_map_fluttify.dart';
|
|
2
|
import 'package:cached_network_image/cached_network_image.dart';
|
4
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
3
|
import 'package:flutter/material.dart';
|
5
|
import 'package:flutter/material.dart';
|
|
@@ -137,6 +139,21 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
@@ -137,6 +139,21 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
137
|
_handleData();
|
139
|
_handleData();
|
|
138
|
}
|
140
|
}
|
|
139
|
|
141
|
|
|
|
|
142
|
+ ///修改菜品样式
|
|
|
|
143
|
+ _setCookbookById(String mid, Map cookStyle) async {
|
|
|
|
144
|
+ Map<String, String> params = {
|
|
|
|
145
|
+ "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
146
|
+ "id": mid,
|
|
|
|
147
|
+ 'cook_style': json.encode(cookStyle)
|
|
|
|
148
|
+ };
|
|
|
|
149
|
+ print(params);
|
|
|
|
150
|
+ bool sucess = await menuManageProvider.setCookbookById(context, params,
|
|
|
|
151
|
+ showLoading: true);
|
|
|
|
152
|
+ if (sucess) {
|
|
|
|
153
|
+ Utils.showToast('修改成功!');
|
|
|
|
154
|
+ }
|
|
|
|
155
|
+ }
|
|
|
|
156
|
+
|
|
140
|
///处理数据
|
157
|
///处理数据
|
|
141
|
_handleData({isMove = false}) {
|
158
|
_handleData({isMove = false}) {
|
|
142
|
if (menuManageProvider.menuModel != null) {
|
159
|
if (menuManageProvider.menuModel != null) {
|
|
@@ -220,40 +237,112 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
@@ -220,40 +237,112 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
220
|
spreadRadius: w(20))
|
237
|
spreadRadius: w(20))
|
|
221
|
]),
|
238
|
]),
|
|
222
|
),
|
239
|
),
|
|
|
|
240
|
+ if ((model.taste != null &&
|
|
|
|
241
|
+ model.taste != '' &&
|
|
|
|
242
|
+ model.cooks != null &&
|
|
|
|
243
|
+ model.cooks != '') ||
|
|
|
|
244
|
+ (model.taste != null && model.taste != '') ||
|
|
|
|
245
|
+ (model.cooks != null && model.cooks != ''))
|
|
|
|
246
|
+ VEmptyView(20),
|
|
|
|
247
|
+ if ((model.taste != null &&
|
|
|
|
248
|
+ model.taste != '' &&
|
|
|
|
249
|
+ model.cooks != null &&
|
|
|
|
250
|
+ model.cooks != '') ||
|
|
|
|
251
|
+ (model.taste != null && model.taste != '') ||
|
|
|
|
252
|
+ (model.cooks != null && model.cooks != ''))
|
|
|
|
253
|
+ VEmptyView(20),
|
|
|
|
254
|
+ if ((model.taste != null &&
|
|
|
|
255
|
+ model.taste != '' &&
|
|
|
|
256
|
+ model.cooks != null &&
|
|
|
|
257
|
+ model.cooks != '') ||
|
|
|
|
258
|
+ (model.taste != null && model.taste != '') ||
|
|
|
|
259
|
+ (model.cooks != null && model.cooks != ''))
|
|
|
|
260
|
+ VEmptyView(20),
|
|
|
|
261
|
+ if ((model.taste != null &&
|
|
|
|
262
|
+ model.taste != '' &&
|
|
|
|
263
|
+ model.cooks != null &&
|
|
|
|
264
|
+ model.cooks != '') ||
|
|
|
|
265
|
+ (model.taste != null && model.taste != '') ||
|
|
|
|
266
|
+ (model.cooks != null && model.cooks != ''))
|
|
|
|
267
|
+ Text(
|
|
|
|
268
|
+ model.taste != null &&
|
|
|
|
269
|
+ model.taste != '' &&
|
|
|
|
270
|
+ model.cooks != null &&
|
|
|
|
271
|
+ model.cooks != ''
|
|
|
|
272
|
+ ? '味型:${model.taste} 烹调:${model.cooks}'
|
|
|
|
273
|
+ : model.taste != null && model.taste != ''
|
|
|
|
274
|
+ ? '味型:${model.taste}'
|
|
|
|
275
|
+ : model.cooks != null && model.cooks != ''
|
|
|
|
276
|
+ ? '味型:${model.taste} 烹调:${model.cooks}'
|
|
|
|
277
|
+ : '',
|
|
|
|
278
|
+ style: TextStyle(
|
|
|
|
279
|
+ fontWeight: FontWeight.bold,
|
|
|
|
280
|
+ fontSize: font(12),
|
|
|
|
281
|
+ color: MyColours.color_515151,
|
|
|
|
282
|
+ shadows: [
|
|
|
|
283
|
+ BoxShadow(
|
|
|
|
284
|
+ color: MyColours.color_FBF6F1,
|
|
|
|
285
|
+ offset: Offset(0, 1),
|
|
|
|
286
|
+ blurRadius: w(2),
|
|
|
|
287
|
+ spreadRadius: w(20))
|
|
|
|
288
|
+ ])),
|
|
223
|
VEmptyView(20),
|
289
|
VEmptyView(20),
|
|
224
|
- Text('味型:咸鲜 烹调:熬煮',
|
|
|
|
225
|
- style: TextStyle(
|
|
|
|
226
|
- fontWeight: FontWeight.bold,
|
|
|
|
227
|
- fontSize: font(12),
|
|
|
|
228
|
- color: MyColours.color_515151,
|
|
|
|
229
|
- shadows: [
|
|
|
|
230
|
- BoxShadow(
|
|
|
|
231
|
- color: MyColours.color_FBF6F1,
|
|
|
|
232
|
- offset: Offset(0, 1),
|
|
|
|
233
|
- blurRadius: w(2),
|
|
|
|
234
|
- spreadRadius: w(20))
|
|
|
|
235
|
- ])),
|
|
|
|
236
|
- VEmptyView(20),
|
|
|
|
237
|
- Text(
|
|
|
|
238
|
- '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
|
|
|
|
239
|
- textAlign: TextAlign.right,
|
|
|
|
240
|
- style: TextStyle(
|
|
|
|
241
|
- fontWeight: FontWeight.bold,
|
|
|
|
242
|
- fontSize: font(14),
|
|
|
|
243
|
- color: MyColours.color_515151,
|
|
|
|
244
|
- shadows: [
|
|
|
|
245
|
- BoxShadow(
|
|
|
|
246
|
- color: MyColours.color_FBF6F1,
|
|
|
|
247
|
- offset: Offset(0, 1),
|
|
|
|
248
|
- blurRadius: w(2),
|
|
|
|
249
|
- spreadRadius: w(20))
|
|
|
|
250
|
- ]),
|
|
|
|
251
|
- ),
|
290
|
+ model.price == null
|
|
|
|
291
|
+ ? Column(children: _priceWidget(model))
|
|
|
|
292
|
+ : Text(
|
|
|
|
293
|
+ '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
|
|
|
|
294
|
+ textAlign: TextAlign.right,
|
|
|
|
295
|
+ style: TextStyle(
|
|
|
|
296
|
+ fontWeight: FontWeight.bold,
|
|
|
|
297
|
+ fontSize: font(14),
|
|
|
|
298
|
+ color: MyColours.color_515151,
|
|
|
|
299
|
+ shadows: [
|
|
|
|
300
|
+ BoxShadow(
|
|
|
|
301
|
+ color: MyColours.color_FBF6F1,
|
|
|
|
302
|
+ offset: Offset(0, 1),
|
|
|
|
303
|
+ blurRadius: w(2),
|
|
|
|
304
|
+ spreadRadius: w(20))
|
|
|
|
305
|
+ ]),
|
|
|
|
306
|
+ ),
|
|
252
|
],
|
307
|
],
|
|
253
|
),
|
308
|
),
|
|
254
|
);
|
309
|
);
|
|
255
|
}
|
310
|
}
|
|
256
|
|
311
|
|
|
|
|
312
|
+ List<Widget> _priceWidget(MenuSunModel model) {
|
|
|
|
313
|
+ List<SpecModel> tempPrice = [];
|
|
|
|
314
|
+ if (model.price == null) {
|
|
|
|
315
|
+ //新添加菜品
|
|
|
|
316
|
+ model.spec.forEach((element) {
|
|
|
|
317
|
+ if (element.status == '1') {
|
|
|
|
318
|
+ //规格启用状态
|
|
|
|
319
|
+ tempPrice.add(element);
|
|
|
|
320
|
+ }
|
|
|
|
321
|
+ });
|
|
|
|
322
|
+ }
|
|
|
|
323
|
+ List<Widget> textWidgetList = [];
|
|
|
|
324
|
+ tempPrice.forEach((element) {
|
|
|
|
325
|
+ textWidgetList.add(
|
|
|
|
326
|
+ Text(
|
|
|
|
327
|
+ '¥${element.price}/${element.specs} 会员 ¥${element.memberPrice ?? ''}/${element.specs} ',
|
|
|
|
328
|
+ textAlign: TextAlign.right,
|
|
|
|
329
|
+ style: TextStyle(
|
|
|
|
330
|
+ fontWeight: FontWeight.bold,
|
|
|
|
331
|
+ fontSize: font(14),
|
|
|
|
332
|
+ color: MyColours.color_515151,
|
|
|
|
333
|
+ shadows: [
|
|
|
|
334
|
+ BoxShadow(
|
|
|
|
335
|
+ color: MyColours.color_FBF6F1,
|
|
|
|
336
|
+ offset: Offset(0, 1),
|
|
|
|
337
|
+ blurRadius: w(2),
|
|
|
|
338
|
+ spreadRadius: w(20))
|
|
|
|
339
|
+ ]),
|
|
|
|
340
|
+ ),
|
|
|
|
341
|
+ );
|
|
|
|
342
|
+ });
|
|
|
|
343
|
+ return textWidgetList;
|
|
|
|
344
|
+ }
|
|
|
|
345
|
+
|
|
257
|
//右边
|
346
|
//右边
|
|
258
|
Widget _topRight(MenuSunModel model) {
|
347
|
Widget _topRight(MenuSunModel model) {
|
|
259
|
return Container(
|
348
|
return Container(
|
|
@@ -274,36 +363,59 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
@@ -274,36 +363,59 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
274
|
spreadRadius: w(20))
|
363
|
spreadRadius: w(20))
|
|
275
|
]),
|
364
|
]),
|
|
276
|
),
|
365
|
),
|
|
|
|
366
|
+ if ((model.taste != null &&
|
|
|
|
367
|
+ model.taste != '' &&
|
|
|
|
368
|
+ model.cooks != null &&
|
|
|
|
369
|
+ model.cooks != '') ||
|
|
|
|
370
|
+ (model.taste != null && model.taste != '') ||
|
|
|
|
371
|
+ (model.cooks != null && model.cooks != ''))
|
|
|
|
372
|
+ VEmptyView(20),
|
|
|
|
373
|
+ if ((model.taste != null &&
|
|
|
|
374
|
+ model.taste != '' &&
|
|
|
|
375
|
+ model.cooks != null &&
|
|
|
|
376
|
+ model.cooks != '') ||
|
|
|
|
377
|
+ (model.taste != null && model.taste != '') ||
|
|
|
|
378
|
+ (model.cooks != null && model.cooks != ''))
|
|
|
|
379
|
+ Text(
|
|
|
|
380
|
+ model.taste != null &&
|
|
|
|
381
|
+ model.taste != '' &&
|
|
|
|
382
|
+ model.cooks != null &&
|
|
|
|
383
|
+ model.cooks != ''
|
|
|
|
384
|
+ ? '味型:${model.taste} 烹调:${model.cooks}'
|
|
|
|
385
|
+ : model.taste != null && model.taste != ''
|
|
|
|
386
|
+ ? '味型:${model.taste}'
|
|
|
|
387
|
+ : model.cooks != null && model.cooks != ''
|
|
|
|
388
|
+ ? '味型:${model.taste} 烹调:${model.cooks}'
|
|
|
|
389
|
+ : '',
|
|
|
|
390
|
+ style: TextStyle(
|
|
|
|
391
|
+ fontWeight: FontWeight.bold,
|
|
|
|
392
|
+ fontSize: font(12),
|
|
|
|
393
|
+ color: MyColours.color_515151,
|
|
|
|
394
|
+ shadows: [
|
|
|
|
395
|
+ BoxShadow(
|
|
|
|
396
|
+ color: MyColours.color_FBF6F1,
|
|
|
|
397
|
+ offset: Offset(0, 1),
|
|
|
|
398
|
+ blurRadius: w(2),
|
|
|
|
399
|
+ spreadRadius: w(20))
|
|
|
|
400
|
+ ])),
|
|
277
|
VEmptyView(20),
|
401
|
VEmptyView(20),
|
|
278
|
- Text('味型:咸鲜 烹调:熬煮',
|
|
|
|
279
|
- style:
|
|
|
|
280
|
- TextStyle(
|
|
|
|
281
|
- fontWeight: FontWeight.bold,
|
|
|
|
282
|
- fontSize: font(12),
|
|
|
|
283
|
- color: MyColours.color_515151,
|
|
|
|
284
|
- shadows: [
|
|
|
|
285
|
- BoxShadow(
|
|
|
|
286
|
- color: MyColours.color_FBF6F1,
|
|
|
|
287
|
- offset: Offset(0, 1),
|
|
|
|
288
|
- blurRadius: w(2),
|
|
|
|
289
|
- spreadRadius: w(20))
|
|
|
|
290
|
- ])),
|
|
|
|
291
|
- VEmptyView(20),
|
|
|
|
292
|
- Text(
|
|
|
|
293
|
- '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
|
|
|
|
294
|
- textAlign: TextAlign.right,
|
|
|
|
295
|
- style: TextStyle(
|
|
|
|
296
|
- fontWeight: FontWeight.bold,
|
|
|
|
297
|
- fontSize: font(14),
|
|
|
|
298
|
- color: MyColours.color_515151,
|
|
|
|
299
|
- shadows: [
|
|
|
|
300
|
- BoxShadow(
|
|
|
|
301
|
- color: MyColours.color_FBF6F1,
|
|
|
|
302
|
- offset: Offset(0, 1),
|
|
|
|
303
|
- blurRadius: w(2),
|
|
|
|
304
|
- spreadRadius: w(20))
|
|
|
|
305
|
- ]),
|
|
|
|
306
|
- ),
|
402
|
+ model.price == null
|
|
|
|
403
|
+ ? Column(children: _priceWidget(model))
|
|
|
|
404
|
+ : Text(
|
|
|
|
405
|
+ '¥${model.price}/${model.unit} 会员 ¥${model.member_price ?? ''}/${model.unit} ',
|
|
|
|
406
|
+ textAlign: TextAlign.right,
|
|
|
|
407
|
+ style: TextStyle(
|
|
|
|
408
|
+ fontWeight: FontWeight.bold,
|
|
|
|
409
|
+ fontSize: font(14),
|
|
|
|
410
|
+ color: MyColours.color_515151,
|
|
|
|
411
|
+ shadows: [
|
|
|
|
412
|
+ BoxShadow(
|
|
|
|
413
|
+ color: MyColours.color_FBF6F1,
|
|
|
|
414
|
+ offset: Offset(0, 1),
|
|
|
|
415
|
+ blurRadius: w(2),
|
|
|
|
416
|
+ spreadRadius: w(20))
|
|
|
|
417
|
+ ]),
|
|
|
|
418
|
+ ),
|
|
307
|
],
|
419
|
],
|
|
308
|
),
|
420
|
),
|
|
309
|
);
|
421
|
);
|
|
@@ -334,38 +446,76 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
@@ -334,38 +446,76 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
334
|
spreadRadius: w(20))
|
446
|
spreadRadius: w(20))
|
|
335
|
]),
|
447
|
]),
|
|
336
|
),
|
448
|
),
|
|
337
|
- VEmptyView(20),
|
|
|
|
338
|
- Text('味型:咸鲜 烹调:熬煮',
|
|
|
|
339
|
- style: TextStyle(
|
|
|
|
340
|
- fontWeight: FontWeight.bold,
|
|
|
|
341
|
- fontSize: font(12),
|
|
|
|
342
|
- color: MyColours.color_515151,
|
|
|
|
343
|
- shadows: [
|
|
|
|
344
|
- BoxShadow(
|
|
|
|
345
|
- color: MyColours.color_FBF6F1,
|
|
|
|
346
|
- offset: Offset(0, 1),
|
|
|
|
347
|
- blurRadius: w(2),
|
|
|
|
348
|
- spreadRadius: w(20))
|
|
|
|
349
|
- ]))
|
449
|
+ if ((model.taste != null &&
|
|
|
|
450
|
+ model.taste != '' &&
|
|
|
|
451
|
+ model.cooks != null &&
|
|
|
|
452
|
+ model.cooks != '') ||
|
|
|
|
453
|
+ (model.taste != null && model.taste != '') ||
|
|
|
|
454
|
+ (model.cooks != null && model.cooks != ''))
|
|
|
|
455
|
+ VEmptyView(20),
|
|
|
|
456
|
+ if ((model.taste != null &&
|
|
|
|
457
|
+ model.taste != '' &&
|
|
|
|
458
|
+ model.cooks != null &&
|
|
|
|
459
|
+ model.cooks != '') ||
|
|
|
|
460
|
+ (model.taste != null && model.taste != '') ||
|
|
|
|
461
|
+ (model.cooks != null && model.cooks != ''))
|
|
|
|
462
|
+ VEmptyView(20),
|
|
|
|
463
|
+ if ((model.taste != null &&
|
|
|
|
464
|
+ model.taste != '' &&
|
|
|
|
465
|
+ model.cooks != null &&
|
|
|
|
466
|
+ model.cooks != '') ||
|
|
|
|
467
|
+ (model.taste != null && model.taste != '') ||
|
|
|
|
468
|
+ (model.cooks != null && model.cooks != ''))
|
|
|
|
469
|
+ VEmptyView(20),
|
|
|
|
470
|
+ if ((model.taste != null &&
|
|
|
|
471
|
+ model.taste != '' &&
|
|
|
|
472
|
+ model.cooks != null &&
|
|
|
|
473
|
+ model.cooks != '') ||
|
|
|
|
474
|
+ (model.taste != null && model.taste != '') ||
|
|
|
|
475
|
+ (model.cooks != null && model.cooks != ''))
|
|
|
|
476
|
+ Text(
|
|
|
|
477
|
+ model.taste != null &&
|
|
|
|
478
|
+ model.taste != '' &&
|
|
|
|
479
|
+ model.cooks != null &&
|
|
|
|
480
|
+ model.cooks != ''
|
|
|
|
481
|
+ ? '味型:${model.taste} 烹调:${model.cooks}'
|
|
|
|
482
|
+ : model.taste != null && model.taste != ''
|
|
|
|
483
|
+ ? '味型:${model.taste}'
|
|
|
|
484
|
+ : model.cooks != null && model.cooks != ''
|
|
|
|
485
|
+ ? '味型:${model.taste} 烹调:${model.cooks}'
|
|
|
|
486
|
+ : '',
|
|
|
|
487
|
+ style: TextStyle(
|
|
|
|
488
|
+ fontWeight: FontWeight.bold,
|
|
|
|
489
|
+ fontSize: font(12),
|
|
|
|
490
|
+ color: MyColours.color_515151,
|
|
|
|
491
|
+ shadows: [
|
|
|
|
492
|
+ BoxShadow(
|
|
|
|
493
|
+ color: MyColours.color_FBF6F1,
|
|
|
|
494
|
+ offset: Offset(0, 1),
|
|
|
|
495
|
+ blurRadius: w(2),
|
|
|
|
496
|
+ spreadRadius: w(20))
|
|
|
|
497
|
+ ]))
|
|
350
|
],
|
498
|
],
|
|
351
|
),
|
499
|
),
|
|
352
|
),
|
500
|
),
|
|
353
|
HEmptyView(10),
|
501
|
HEmptyView(10),
|
|
354
|
- Text(
|
|
|
|
355
|
- '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
|
|
|
|
356
|
- textAlign: TextAlign.right,
|
|
|
|
357
|
- style: TextStyle(
|
|
|
|
358
|
- fontWeight: FontWeight.bold,
|
|
|
|
359
|
- fontSize: font(14),
|
|
|
|
360
|
- color: MyColours.color_515151,
|
|
|
|
361
|
- shadows: [
|
|
|
|
362
|
- BoxShadow(
|
|
|
|
363
|
- color: MyColours.color_FBF6F1,
|
|
|
|
364
|
- offset: Offset(0, 1),
|
|
|
|
365
|
- blurRadius: w(2),
|
|
|
|
366
|
- spreadRadius: w(20))
|
|
|
|
367
|
- ]),
|
|
|
|
368
|
- ),
|
502
|
+ model.price == null
|
|
|
|
503
|
+ ? Column(children: _priceWidget(model))
|
|
|
|
504
|
+ : Text(
|
|
|
|
505
|
+ '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
|
|
|
|
506
|
+ textAlign: TextAlign.right,
|
|
|
|
507
|
+ style: TextStyle(
|
|
|
|
508
|
+ fontWeight: FontWeight.bold,
|
|
|
|
509
|
+ fontSize: font(14),
|
|
|
|
510
|
+ color: MyColours.color_515151,
|
|
|
|
511
|
+ shadows: [
|
|
|
|
512
|
+ BoxShadow(
|
|
|
|
513
|
+ color: MyColours.color_FBF6F1,
|
|
|
|
514
|
+ offset: Offset(0, 1),
|
|
|
|
515
|
+ blurRadius: w(2),
|
|
|
|
516
|
+ spreadRadius: w(20))
|
|
|
|
517
|
+ ]),
|
|
|
|
518
|
+ ),
|
|
369
|
],
|
519
|
],
|
|
370
|
);
|
520
|
);
|
|
371
|
}
|
521
|
}
|
|
@@ -394,41 +544,64 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
@@ -394,41 +544,64 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
394
|
spreadRadius: w(20))
|
544
|
spreadRadius: w(20))
|
|
395
|
]),
|
545
|
]),
|
|
396
|
)),
|
546
|
)),
|
|
|
|
547
|
+ if ((model.taste != null &&
|
|
|
|
548
|
+ model.taste != '' &&
|
|
|
|
549
|
+ model.cooks != null &&
|
|
|
|
550
|
+ model.cooks != '') ||
|
|
|
|
551
|
+ (model.taste != null && model.taste != '') ||
|
|
|
|
552
|
+ (model.cooks != null && model.cooks != ''))
|
|
|
|
553
|
+ VEmptyView(20),
|
|
|
|
554
|
+ if ((model.taste != null &&
|
|
|
|
555
|
+ model.taste != '' &&
|
|
|
|
556
|
+ model.cooks != null &&
|
|
|
|
557
|
+ model.cooks != '') ||
|
|
|
|
558
|
+ (model.taste != null && model.taste != '') ||
|
|
|
|
559
|
+ (model.cooks != null && model.cooks != ''))
|
|
|
|
560
|
+ Padding(
|
|
|
|
561
|
+ padding: EdgeInsets.symmetric(horizontal: w(10)),
|
|
|
|
562
|
+ child: Text(
|
|
|
|
563
|
+ model.taste != null &&
|
|
|
|
564
|
+ model.taste != '' &&
|
|
|
|
565
|
+ model.cooks != null &&
|
|
|
|
566
|
+ model.cooks != ''
|
|
|
|
567
|
+ ? '味型:${model.taste} 烹调:${model.cooks}'
|
|
|
|
568
|
+ : model.taste != null && model.taste != ''
|
|
|
|
569
|
+ ? '味型:${model.taste}'
|
|
|
|
570
|
+ : model.cooks != null && model.cooks != ''
|
|
|
|
571
|
+ ? '味型:${model.taste} 烹调:${model.cooks}'
|
|
|
|
572
|
+ : '',
|
|
|
|
573
|
+ style: TextStyle(
|
|
|
|
574
|
+ fontWeight: FontWeight.bold,
|
|
|
|
575
|
+ fontSize: font(12),
|
|
|
|
576
|
+ color: MyColours.color_515151,
|
|
|
|
577
|
+ shadows: [
|
|
|
|
578
|
+ BoxShadow(
|
|
|
|
579
|
+ color: MyColours.color_FBF6F1,
|
|
|
|
580
|
+ offset: Offset(0, 1),
|
|
|
|
581
|
+ blurRadius: w(2),
|
|
|
|
582
|
+ spreadRadius: w(20))
|
|
|
|
583
|
+ ]),
|
|
|
|
584
|
+ )),
|
|
397
|
VEmptyView(20),
|
585
|
VEmptyView(20),
|
|
398
|
Padding(
|
586
|
Padding(
|
|
399
|
padding: EdgeInsets.symmetric(horizontal: w(10)),
|
587
|
padding: EdgeInsets.symmetric(horizontal: w(10)),
|
|
400
|
- child: Text(
|
|
|
|
401
|
- '味型:咸鲜 烹调:熬煮',
|
|
|
|
402
|
- style: TextStyle(
|
|
|
|
403
|
- fontWeight: FontWeight.bold,
|
|
|
|
404
|
- fontSize: font(12),
|
|
|
|
405
|
- color: MyColours.color_515151,
|
|
|
|
406
|
- shadows: [
|
|
|
|
407
|
- BoxShadow(
|
|
|
|
408
|
- color: MyColours.color_FBF6F1,
|
|
|
|
409
|
- offset: Offset(0, 1),
|
|
|
|
410
|
- blurRadius: w(2),
|
|
|
|
411
|
- spreadRadius: w(20))
|
|
|
|
412
|
- ]),
|
|
|
|
413
|
- )),
|
|
|
|
414
|
- VEmptyView(20),
|
|
|
|
415
|
- Padding(
|
|
|
|
416
|
- padding: EdgeInsets.symmetric(horizontal: w(10)),
|
|
|
|
417
|
- child: Text(
|
|
|
|
418
|
- '¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
|
|
|
|
419
|
- textAlign: TextAlign.right,
|
|
|
|
420
|
- style: TextStyle(
|
|
|
|
421
|
- fontWeight: FontWeight.bold,
|
|
|
|
422
|
- fontSize: font(14),
|
|
|
|
423
|
- color: MyColours.color_515151,
|
|
|
|
424
|
- shadows: [
|
|
|
|
425
|
- BoxShadow(
|
|
|
|
426
|
- color: MyColours.color_FBF6F1,
|
|
|
|
427
|
- offset: Offset(0, 1),
|
|
|
|
428
|
- blurRadius: w(2),
|
|
|
|
429
|
- spreadRadius: w(20))
|
|
|
|
430
|
- ]),
|
|
|
|
431
|
- )),
|
588
|
+ child: model.price == null
|
|
|
|
589
|
+ ? Column(children: _priceWidget(model))
|
|
|
|
590
|
+ : Text(
|
|
|
|
591
|
+ '¥${model.price}/${model.unit} 会员 ¥${model.member_price}/${model.unit} ',
|
|
|
|
592
|
+ textAlign: TextAlign.right,
|
|
|
|
593
|
+ style: TextStyle(
|
|
|
|
594
|
+ fontWeight: FontWeight.bold,
|
|
|
|
595
|
+ fontSize: font(14),
|
|
|
|
596
|
+ color: MyColours.color_515151,
|
|
|
|
597
|
+ shadows: [
|
|
|
|
598
|
+ BoxShadow(
|
|
|
|
599
|
+ color: MyColours.color_FBF6F1,
|
|
|
|
600
|
+ offset: Offset(0, 1),
|
|
|
|
601
|
+ blurRadius: w(2),
|
|
|
|
602
|
+ spreadRadius: w(20))
|
|
|
|
603
|
+ ]),
|
|
|
|
604
|
+ )),
|
|
432
|
VEmptyView(30),
|
605
|
VEmptyView(30),
|
|
433
|
if (model.image != null)
|
606
|
if (model.image != null)
|
|
434
|
CachedNetworkImage(
|
607
|
CachedNetworkImage(
|
|
@@ -437,11 +610,11 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
@@ -437,11 +610,11 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
437
|
width: ScreenUtil().screenWidth / 2,
|
610
|
width: ScreenUtil().screenWidth / 2,
|
|
438
|
height: w(125),
|
611
|
height: w(125),
|
|
439
|
),
|
612
|
),
|
|
440
|
- if (true)
|
613
|
+ if (model.desc != null && model.desc != '')
|
|
441
|
Padding(
|
614
|
Padding(
|
|
442
|
padding: EdgeInsets.symmetric(horizontal: w(10), vertical: w(10)),
|
615
|
padding: EdgeInsets.symmetric(horizontal: w(10), vertical: w(10)),
|
|
443
|
child: Text(
|
616
|
child: Text(
|
|
444
|
- '江南传统名菜,口味咸鲜,汤白汁浓,肉质酥肥,笋清香脆嫩,鲜味浓厚。',
|
617
|
+ model.desc ?? "",
|
|
445
|
style: TextStyle(
|
618
|
style: TextStyle(
|
|
446
|
color: themeColerModel.name == '珍珠白'
|
619
|
color: themeColerModel.name == '珍珠白'
|
|
447
|
? MyColours.color_515151
|
620
|
? MyColours.color_515151
|
|
@@ -509,6 +682,13 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
@@ -509,6 +682,13 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
509
|
} else {
|
682
|
} else {
|
|
510
|
_handleData();
|
683
|
_handleData();
|
|
511
|
}
|
684
|
}
|
|
|
|
685
|
+
|
|
|
|
686
|
+ Map cookStyle = {
|
|
|
|
687
|
+ 'name_type': object['name_type'],
|
|
|
|
688
|
+ 'image_type': '',
|
|
|
|
689
|
+ 'sort': ''
|
|
|
|
690
|
+ };
|
|
|
|
691
|
+ _setCookbookById(model.id, cookStyle);
|
|
512
|
}
|
692
|
}
|
|
513
|
}
|
693
|
}
|
|
514
|
|
694
|
|
|
@@ -580,57 +760,59 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
@@ -580,57 +760,59 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
580
|
],
|
760
|
],
|
|
581
|
),
|
761
|
),
|
|
582
|
)),
|
762
|
)),
|
|
583
|
- Container(
|
|
|
|
584
|
- padding: EdgeInsets.symmetric(horizontal: w(23)),
|
|
|
|
585
|
- // height: w(80),
|
|
|
|
586
|
- child: Row(
|
|
|
|
587
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
588
|
- children: [
|
|
|
|
589
|
- Padding(
|
|
|
|
590
|
- padding:
|
|
|
|
591
|
- EdgeInsets.only(top: w(12), bottom: w(25)),
|
|
|
|
592
|
- child: RoundButton(
|
|
|
|
593
|
- onPressed: () async {
|
|
|
|
594
|
- bool needRefresh =
|
|
|
|
595
|
- await NavigatorUtil.goMenuCategoryPage(
|
|
|
|
596
|
- context);
|
|
|
|
597
|
- print(needRefresh);
|
|
|
|
598
|
- if (needRefresh != null && needRefresh) {
|
|
|
|
599
|
- //刷新页面数据
|
|
|
|
600
|
- // _controller.callRefresh();
|
|
|
|
601
|
- // _couponNetworkData();
|
|
|
|
602
|
- }
|
|
|
|
603
|
- },
|
|
|
|
604
|
- text: '分类管理',
|
|
|
|
605
|
- fontSize: 32,
|
|
|
|
606
|
- gradientStart: MyColours.color_ffffff,
|
|
|
|
607
|
- gradientEnd: MyColours.color_ffffff,
|
|
|
|
608
|
- borderColor: MyColours.color_438E93,
|
|
|
|
609
|
- textColor: MyColours.color_438E93,
|
|
|
|
610
|
- isBold: true,
|
|
|
|
611
|
- height: w(43),
|
|
|
|
612
|
- width: w(100),
|
|
|
|
613
|
- radius: r(5),
|
|
|
|
614
|
- )),
|
|
|
|
615
|
- !isShow
|
|
|
|
616
|
- ? SizedBox()
|
|
|
|
617
|
- : Padding(
|
|
|
|
618
|
- padding: EdgeInsets.only(
|
|
|
|
619
|
- top: w(12), bottom: w(25)),
|
|
|
|
620
|
- child: RoundButton(
|
|
|
|
621
|
- onPressed: () async {
|
|
|
|
622
|
- await NavigatorUtil.goMenuAddDishesPage(
|
|
|
|
623
|
- context);
|
|
|
|
624
|
- },
|
|
|
|
625
|
- text: '添加菜品',
|
|
|
|
626
|
- fontSize: 32,
|
|
|
|
627
|
- isBold: true,
|
|
|
|
628
|
- width: w(218),
|
|
|
|
629
|
- height: w(43),
|
|
|
|
630
|
- radius: r(5),
|
|
|
|
631
|
- ))
|
|
|
|
632
|
- ],
|
|
|
|
633
|
- ))
|
763
|
+ if (model.pageState == PageState.Empty ||
|
|
|
|
764
|
+ model.pageState == PageState.Success)
|
|
|
|
765
|
+ Container(
|
|
|
|
766
|
+ padding: EdgeInsets.symmetric(horizontal: w(23)),
|
|
|
|
767
|
+ // height: w(80),
|
|
|
|
768
|
+ child: Row(
|
|
|
|
769
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
770
|
+ children: [
|
|
|
|
771
|
+ Padding(
|
|
|
|
772
|
+ padding:
|
|
|
|
773
|
+ EdgeInsets.only(top: w(12), bottom: w(25)),
|
|
|
|
774
|
+ child: RoundButton(
|
|
|
|
775
|
+ onPressed: () async {
|
|
|
|
776
|
+ bool needRefresh =
|
|
|
|
777
|
+ await NavigatorUtil.goMenuCategoryPage(
|
|
|
|
778
|
+ context);
|
|
|
|
779
|
+ print(needRefresh);
|
|
|
|
780
|
+ if (needRefresh != null && needRefresh) {
|
|
|
|
781
|
+ //刷新页面数据
|
|
|
|
782
|
+ // _controller.callRefresh();
|
|
|
|
783
|
+ // _couponNetworkData();
|
|
|
|
784
|
+ }
|
|
|
|
785
|
+ },
|
|
|
|
786
|
+ text: '分类管理',
|
|
|
|
787
|
+ fontSize: 32,
|
|
|
|
788
|
+ gradientStart: MyColours.color_ffffff,
|
|
|
|
789
|
+ gradientEnd: MyColours.color_ffffff,
|
|
|
|
790
|
+ borderColor: MyColours.color_438E93,
|
|
|
|
791
|
+ textColor: MyColours.color_438E93,
|
|
|
|
792
|
+ isBold: true,
|
|
|
|
793
|
+ height: w(43),
|
|
|
|
794
|
+ width: w(100),
|
|
|
|
795
|
+ radius: r(5),
|
|
|
|
796
|
+ )),
|
|
|
|
797
|
+ !isShow
|
|
|
|
798
|
+ ? SizedBox()
|
|
|
|
799
|
+ : Padding(
|
|
|
|
800
|
+ padding: EdgeInsets.only(
|
|
|
|
801
|
+ top: w(12), bottom: w(25)),
|
|
|
|
802
|
+ child: RoundButton(
|
|
|
|
803
|
+ onPressed: () async {
|
|
|
|
804
|
+ await NavigatorUtil.goMenuAddDishesPage(
|
|
|
|
805
|
+ context);
|
|
|
|
806
|
+ },
|
|
|
|
807
|
+ text: '添加菜品',
|
|
|
|
808
|
+ fontSize: 32,
|
|
|
|
809
|
+ isBold: true,
|
|
|
|
810
|
+ width: w(218),
|
|
|
|
811
|
+ height: w(43),
|
|
|
|
812
|
+ radius: r(5),
|
|
|
|
813
|
+ ))
|
|
|
|
814
|
+ ],
|
|
|
|
815
|
+ ))
|
|
634
|
]);
|
816
|
]);
|
|
635
|
} else {
|
817
|
} else {
|
|
636
|
// double cellWidth = (MediaQuery.of(context).size.width -
|
818
|
// double cellWidth = (MediaQuery.of(context).size.width -
|
|
@@ -811,7 +993,8 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
@@ -811,7 +993,8 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
811
|
width: double.infinity,
|
993
|
width: double.infinity,
|
|
812
|
height: w(250),
|
994
|
height: w(250),
|
|
813
|
),
|
995
|
),
|
|
814
|
- if (true)
|
996
|
+ if (model.desc != null &&
|
|
|
|
997
|
+ model.desc != '')
|
|
815
|
Padding(
|
998
|
Padding(
|
|
816
|
padding: EdgeInsets
|
999
|
padding: EdgeInsets
|
|
817
|
.symmetric(
|
1000
|
.symmetric(
|
|
@@ -820,7 +1003,7 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
@@ -820,7 +1003,7 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
820
|
vertical:
|
1003
|
vertical:
|
|
821
|
w(10)),
|
1004
|
w(10)),
|
|
822
|
child: Text(
|
1005
|
child: Text(
|
|
823
|
- '江南传统名菜,口味咸鲜,汤白汁浓,肉质酥肥,笋清香脆嫩,鲜味浓厚。',
|
1006
|
+ model.desc,
|
|
824
|
style: TextStyle(
|
1007
|
style: TextStyle(
|
|
825
|
color: themeColerModel1
|
1008
|
color: themeColerModel1
|
|
826
|
.name ==
|
1009
|
.name ==
|
|
@@ -973,58 +1156,60 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
@@ -973,58 +1156,60 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
973
|
],
|
1156
|
],
|
|
974
|
);
|
1157
|
);
|
|
975
|
})),
|
1158
|
})),
|
|
976
|
- Container(
|
|
|
|
977
|
- padding: EdgeInsets.symmetric(horizontal: w(23)),
|
|
|
|
978
|
- // height: w(80),
|
|
|
|
979
|
- color: MyColours.color_FAFAFA,
|
|
|
|
980
|
- child: Row(
|
|
|
|
981
|
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
982
|
- children: [
|
|
|
|
983
|
- Padding(
|
|
|
|
984
|
- padding:
|
|
|
|
985
|
- EdgeInsets.only(top: w(12), bottom: w(25)),
|
|
|
|
986
|
- child: RoundButton(
|
|
|
|
987
|
- onPressed: () async {
|
|
|
|
988
|
- bool needRefresh =
|
|
|
|
989
|
- await NavigatorUtil.goMenuCategoryPage(
|
|
|
|
990
|
- context);
|
|
|
|
991
|
- print(needRefresh);
|
|
|
|
992
|
- if (needRefresh != null && needRefresh) {
|
|
|
|
993
|
- //刷新页面数据
|
|
|
|
994
|
- // _controller.callRefresh();
|
|
|
|
995
|
- // _couponNetworkData();
|
|
|
|
996
|
- }
|
|
|
|
997
|
- },
|
|
|
|
998
|
- text: '分类管理',
|
|
|
|
999
|
- fontSize: 32,
|
|
|
|
1000
|
- gradientStart: MyColours.color_ffffff,
|
|
|
|
1001
|
- gradientEnd: MyColours.color_ffffff,
|
|
|
|
1002
|
- borderColor: MyColours.color_438E93,
|
|
|
|
1003
|
- textColor: MyColours.color_438E93,
|
|
|
|
1004
|
- isBold: true,
|
|
|
|
1005
|
- height: w(43),
|
|
|
|
1006
|
- width: w(100),
|
|
|
|
1007
|
- radius: r(5),
|
|
|
|
1008
|
- )),
|
|
|
|
1009
|
- !isShow
|
|
|
|
1010
|
- ? SizedBox()
|
|
|
|
1011
|
- : Padding(
|
|
|
|
1012
|
- padding: EdgeInsets.only(
|
|
|
|
1013
|
- top: w(12), bottom: w(25)),
|
|
|
|
1014
|
- child: RoundButton(
|
|
|
|
1015
|
- onPressed: () async {
|
|
|
|
1016
|
- await NavigatorUtil.goMenuAddDishesPage(
|
|
|
|
1017
|
- context);
|
|
|
|
1018
|
- },
|
|
|
|
1019
|
- text: '添加菜品',
|
|
|
|
1020
|
- fontSize: 32,
|
|
|
|
1021
|
- isBold: true,
|
|
|
|
1022
|
- width: w(218),
|
|
|
|
1023
|
- height: w(43),
|
|
|
|
1024
|
- radius: r(5),
|
|
|
|
1025
|
- ))
|
|
|
|
1026
|
- ],
|
|
|
|
1027
|
- ))
|
1159
|
+ if (model.pageState == PageState.Success ||
|
|
|
|
1160
|
+ model.pageState == PageState.Empty)
|
|
|
|
1161
|
+ Container(
|
|
|
|
1162
|
+ padding: EdgeInsets.symmetric(horizontal: w(23)),
|
|
|
|
1163
|
+ // height: w(80),
|
|
|
|
1164
|
+ color: MyColours.color_FAFAFA,
|
|
|
|
1165
|
+ child: Row(
|
|
|
|
1166
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
1167
|
+ children: [
|
|
|
|
1168
|
+ Padding(
|
|
|
|
1169
|
+ padding:
|
|
|
|
1170
|
+ EdgeInsets.only(top: w(12), bottom: w(25)),
|
|
|
|
1171
|
+ child: RoundButton(
|
|
|
|
1172
|
+ onPressed: () async {
|
|
|
|
1173
|
+ bool needRefresh =
|
|
|
|
1174
|
+ await NavigatorUtil.goMenuCategoryPage(
|
|
|
|
1175
|
+ context);
|
|
|
|
1176
|
+ print(needRefresh);
|
|
|
|
1177
|
+ if (needRefresh != null && needRefresh) {
|
|
|
|
1178
|
+ //刷新页面数据
|
|
|
|
1179
|
+ // _controller.callRefresh();
|
|
|
|
1180
|
+ // _couponNetworkData();
|
|
|
|
1181
|
+ }
|
|
|
|
1182
|
+ },
|
|
|
|
1183
|
+ text: '分类管理',
|
|
|
|
1184
|
+ fontSize: 32,
|
|
|
|
1185
|
+ gradientStart: MyColours.color_ffffff,
|
|
|
|
1186
|
+ gradientEnd: MyColours.color_ffffff,
|
|
|
|
1187
|
+ borderColor: MyColours.color_438E93,
|
|
|
|
1188
|
+ textColor: MyColours.color_438E93,
|
|
|
|
1189
|
+ isBold: true,
|
|
|
|
1190
|
+ height: w(43),
|
|
|
|
1191
|
+ width: w(100),
|
|
|
|
1192
|
+ radius: r(5),
|
|
|
|
1193
|
+ )),
|
|
|
|
1194
|
+ !isShow
|
|
|
|
1195
|
+ ? SizedBox()
|
|
|
|
1196
|
+ : Padding(
|
|
|
|
1197
|
+ padding: EdgeInsets.only(
|
|
|
|
1198
|
+ top: w(12), bottom: w(25)),
|
|
|
|
1199
|
+ child: RoundButton(
|
|
|
|
1200
|
+ onPressed: () async {
|
|
|
|
1201
|
+ await NavigatorUtil.goMenuAddDishesPage(
|
|
|
|
1202
|
+ context);
|
|
|
|
1203
|
+ },
|
|
|
|
1204
|
+ text: '添加菜品',
|
|
|
|
1205
|
+ fontSize: 32,
|
|
|
|
1206
|
+ isBold: true,
|
|
|
|
1207
|
+ width: w(218),
|
|
|
|
1208
|
+ height: w(43),
|
|
|
|
1209
|
+ radius: r(5),
|
|
|
|
1210
|
+ ))
|
|
|
|
1211
|
+ ],
|
|
|
|
1212
|
+ ))
|
|
1028
|
]);
|
1213
|
]);
|
|
1029
|
}
|
1214
|
}
|
|
1030
|
},
|
1215
|
},
|