Commit fb5a1aaf5c91d44c7e267ce421e764c08d576a81

Authored by wdn127929
1 parent 72089486

列表数据

... ... @@ -105,9 +105,9 @@ class MenuSunModel {
String desc;
String order_o;
String cdate;
List spec;
List<SpecModel> spec;
int isSpec;
List practice;
List<PracticeModel> practice;
List<MenuModel> cookList;
int amount; //菜品数量
... ... @@ -120,6 +120,10 @@ class MenuSunModel {
int sort;
int indexNew;
String taste;
String cooks;
String cookStyle;
//名称样式选择数组
List<RadioModel> get nameTypeList {
RadioModel radioModel1 = RadioModel();
... ... @@ -198,7 +202,10 @@ class MenuSunModel {
this.amountC,
this.nameType,
this.imageType,
this.sort});
this.sort,
this.taste,
this.cooks,
this.cookStyle});
MenuSunModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
... ... @@ -224,9 +231,28 @@ class MenuSunModel {
desc = json['desc'];
order_o = json['order_o'];
cdate = json['cdate'];
spec = json['spec'];
// spec = json['spec'];
if (json['spec'] != null) {
spec = [];
json['spec'].forEach((v) {
spec.add(new SpecModel.fromJson(v));
});
}
isSpec = json['isSpec'];
practice = json['practice'];
// practice = json['practice'];
if (json['practice'] != null) {
practice = [];
// if (json['practice'].length > 0 && json['practice'][0] is String) {
// } else {
json['practice'].forEach((v) {
if (v is Map) {
practice.add(new PracticeModel.fromJson(v));
} else if (v is PracticeModel) {
practice.add(v);
}
});
// }
}
amount = 0;
amountC.text = '0';
if (json['cookList'] != null) {
... ... @@ -241,6 +267,10 @@ class MenuSunModel {
nameType = '1';
sort = json['sort'];
taste = json['taste'];
cooks = json['cooks'];
cookStyle = json['cook_style'];
}
MenuSunModel.fromJson3(Map<String, dynamic> json) {
... ... @@ -267,9 +297,27 @@ class MenuSunModel {
desc = json['desc'];
order_o = json['order_o'];
cdate = json['cdate'];
spec = json['spec'];
if (json['spec'] != null) {
spec = [];
json['spec'].forEach((v) {
spec.add(new SpecModel.fromJson(v));
});
}
isSpec = json['isSpec'];
practice = json['practice'];
// practice = json['practice'];
if (json['practice'] != null) {
practice = [];
// if (json['practice'].length > 0 && json['practice'][0] is String) {
// } else {
json['practice'].forEach((v) {
if (v is Map) {
practice.add(new PracticeModel.fromJson(v));
} else if (v is PracticeModel) {
practice.add(v);
}
});
// }
}
amount = 0;
amountC.text = '0';
if (json['cookList'] != null) {
... ... @@ -278,6 +326,9 @@ class MenuSunModel {
cookList.add(v);
});
}
taste = json['taste'];
cooks = json['cooks'];
cookStyle = json['cook_style'];
}
MenuSunModel.fromJson2(Map<String, dynamic> json) {
... ... @@ -304,9 +355,27 @@ class MenuSunModel {
desc = json['desc'];
order_o = json['order_o'];
cdate = json['cdate'];
spec = json['spec'];
if (json['spec'] != null) {
spec = [];
json['spec'].forEach((v) {
spec.add(new SpecModel.fromJson(v));
});
}
isSpec = json['isSpec'];
practice = json['practice'];
// practice = json['practice'];
if (json['practice'] != null) {
practice = [];
// if (json['practice'].length > 0 && json['practice'][0] is String) {
// } else {
json['practice'].forEach((v) {
if (v is Map) {
practice.add(new PracticeModel.fromJson(v));
} else if (v is PracticeModel) {
practice.add(v);
}
});
// }
}
amount = json['amount'] ?? 0;
amountC.text = amount.toString();
if (json['cookList'] != null) {
... ... @@ -315,6 +384,9 @@ class MenuSunModel {
cookList.add(new MenuModel.fromJson2(v));
});
}
taste = json['taste'];
cooks = json['cooks'];
cookStyle = json['cook_style'];
}
Map<String, dynamic> toJson() {
... ... @@ -349,6 +421,93 @@ class MenuSunModel {
data['amount'] = this.amount;
data['cookList'] = this.cookList;
data['sort'] = this.sort;
data['taste'] = this.taste;
data['cooks'] = this.cooks;
data['cook_style'] = this.cookStyle;
return data;
}
}
class SpecModel {
String id;
String cid;
String specid;
String specs;
String price;
String memberPrice;
Null clearNum;
String status;
SpecModel(
{this.id,
this.cid,
this.specid,
this.specs,
this.price,
this.memberPrice,
this.clearNum,
this.status});
SpecModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
cid = json['cid'];
specid = json['specid'];
specs = json['specs'];
price = json['price'];
memberPrice = json['member_price'];
clearNum = json['clear_num'];
status = json['status'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['cid'] = this.cid;
data['specid'] = this.specid;
data['specs'] = this.specs;
data['price'] = this.price;
data['member_price'] = this.memberPrice;
data['clear_num'] = this.clearNum;
data['status'] = this.status;
return data;
}
}
class PracticeModel {
String id;
String cid;
String practice;
String name;
String price;
String memberPrice;
PracticeModel(
{this.id,
this.cid,
this.practice,
this.name,
this.price,
this.memberPrice});
PracticeModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
cid = json['cid'];
practice = json['practice'];
name = json['name'];
price = json['price'];
memberPrice = json['member_price'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['cid'] = this.cid;
data['practice'] = this.practice;
data['name'] = this.name;
data['price'] = this.price;
data['member_price'] = this.memberPrice;
return data;
}
}
... ...
import 'package:json_annotation/json_annotation.dart';
import 'package:one_key/models/cookbook_model.dart';
part 'cookbook_one_model.g.dart';
... ... @@ -91,14 +92,26 @@ class CookbookOneSunModel extends Object {
List<dynamic> attr;
@JsonKey(name: 'spec')
List<dynamic> spec;
List<SpecModel> spec;
@JsonKey(name: 'practice')
List<dynamic> practice;
List<PracticeModel> practice;
// @JsonKey(name: 'template')
// Template template;
@JsonKey(name: 'taste')
String taste;
@JsonKey(name: 'cooks')
String cooks;
@JsonKey(name: 'cook_style')
String cookStyle;
@JsonKey(name: 'desc')
String desc;
CookbookOneSunModel(
this.id,
this.sellerid,
... ... @@ -118,6 +131,10 @@ class CookbookOneSunModel extends Object {
this.attr,
this.spec,
this.practice,
this.taste,
this.cooks,
this.cookStyle,
this.desc
// this.template,
);
... ...
... ... @@ -53,13 +53,19 @@ CookbookOneSunModel _$CookbookOneSunModelFromJson(Map<String, dynamic> json) {
json['class_name'] as String,
json['class_order'] as String,
json['attr'] as List,
json['spec'] as List,
json['practice'] as List,
// json['template'] == null
// ? null
// : (json['template'] is Map)
// ? Template.fromJson(json['template'] as Map<String, dynamic>)
// : '',
(json['spec'] as List)
?.map((e) =>
e == null ? null : SpecModel.fromJson(e as Map<String, dynamic>))
?.toList(),
(json['practice'] as List)
?.map((e) => e == null
? null
: PracticeModel.fromJson(e as Map<String, dynamic>))
?.toList(),
json['taste'] as String,
json['cooks'] as String,
json['cook_style'] as String,
json['desc'] as String,
);
}
... ... @@ -84,6 +90,11 @@ Map<String, dynamic> _$CookbookOneSunModelToJson(
'attr': instance.attr,
'spec': instance.spec,
'practice': instance.practice,
'taste': instance.taste,
'cooks': instance.cooks,
'cook_style': instance.cookStyle,
'desc': instance.desc
// 'template': instance.template,
};
... ...
... ... @@ -43,6 +43,11 @@ class CookbookPracticeSunModel {
cdate = json['cdate'];
}
CookbookPracticeSunModel.fromJson2(Map<String, dynamic> json) {
id = json['practice'];
name = json['name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
... ... @@ -52,7 +57,7 @@ class CookbookPracticeSunModel {
return data;
}
Map<String, dynamic> toJson2() {
Map<String, dynamic> toJson2() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
... ...
... ... @@ -30,4 +30,12 @@ class MenuUnitModel {
'member_price': memberPrice,
'status': select ? '1' : '0'
};
Map<String, dynamic> toJson1() => <String, dynamic>{
"specs": specs,
"id": specid,
'price': price,
'member_price': memberPrice,
'status': select ? '1' : '0'
};
}
... ...
... ... @@ -85,6 +85,25 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> {
});
}
_getSelectPractice() {
selectPracticeShow = '';
selectPracticeIds = '';
selectPractice.forEach((element) {
// if (element.select) {
selectPracticeShow += '${element.name}、';
selectPracticeIds += '${element.id},';
// }
});
if (selectPracticeShow.endsWith('、')) {
selectPracticeShow =
selectPracticeShow.substring(0, selectPracticeShow.length - 1);
}
if (selectPracticeIds.endsWith(',')) {
selectPracticeIds =
selectPracticeIds.substring(0, selectPracticeIds.length - 1);
}
}
///获取单个菜品信息
_getCookbookById({bool showLoading = false}) async {
Map<String, String> params = {
... ... @@ -96,9 +115,9 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> {
_nameController.text = menuManageProvider.cookbookOneSunModel.name;
swichState =
menuManageProvider.cookbookOneSunModel.status == '1' ? true : false;
_priceController.text = menuManageProvider.cookbookOneSunModel.price;
// _priceController.text = menuManageProvider.cookbookOneSunModel.price;
categoryStr = menuManageProvider.cookbookOneSunModel.className;
specStr = menuManageProvider.cookbookOneSunModel.unit;
// specStr = menuManageProvider.cookbookOneSunModel.unit;
mid = menuManageProvider.cookbookOneSunModel.id;
if (menuManageProvider.cookbookOneSunModel.image != null &&
menuManageProvider.cookbookOneSunModel.image != 'null' &&
... ... @@ -106,6 +125,37 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> {
uploadImageProvider.dish.qiniuUrl =
menuManageProvider.cookbookOneSunModel.image;
}
if (menuManageProvider.cookbookOneSunModel.spec.length > 0) {
data = [];
}
menuManageProvider.cookbookOneSunModel.spec.forEach((element) {
data.add(MenuUnitModel.fromJson(element.toJson()));
});
outerloop:
for (int i = 0; i < data.length; i++) {
MenuUnitModel menumodel = data[i];
if (menumodel.select) {
showPrice = menumodel.priceC.text;
break outerloop;
}
}
// String selectPracticeShow;
// String selectPracticeIds;
// List<CookbookPracticeSunModel> selectPractice;
//
selectPractice = [];
menuManageProvider.cookbookOneSunModel.practice.forEach((element) {
selectPractice
.add(CookbookPracticeSunModel.fromJson2(element.toJson()));
});
_getSelectPractice();
introduceC.text = menuManageProvider.cookbookOneSunModel.desc;
tasteC.text = menuManageProvider.cookbookOneSunModel.taste; //味型
cooksC.text = menuManageProvider.cookbookOneSunModel.cooks; //烹调
setState(() {});
}
... ... @@ -157,6 +207,10 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> {
// unit = element.id;
// }
// });
List temp = [];
data.forEach((element) {
temp.add(element.toJson1());
});
Map<String, String> params = {
"sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
'cid': cid,
... ... @@ -164,7 +218,7 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> {
'name': _nameController.text,
'status': swichState ? '1' : '0',
// 'price': _priceController.text
'dishSkuList': json.encode(data)
'dishSkuList': json.encode(temp)
};
if (mid != '') {
... ... @@ -733,25 +787,26 @@ class _MenuAddDishesPageState extends State<MenuAddDishesPage> {
context, selectPracticeIds);
if (object != null) {
selectPractice = object['select_practice'];
selectPracticeShow = '';
selectPracticeIds = '';
selectPractice.forEach((element) {
if (element.select) {
selectPracticeShow +=
'${element.name}、';
selectPracticeIds += '${element.id},';
}
});
if (selectPracticeShow.endsWith('、')) {
selectPracticeShow =
selectPracticeShow.substring(
0, selectPracticeShow.length - 1);
}
if (selectPracticeIds.endsWith(',')) {
selectPracticeIds =
selectPracticeIds.substring(
0, selectPracticeIds.length - 1);
}
_getSelectPractice();
// selectPracticeShow = '';
// selectPracticeIds = '';
// selectPractice.forEach((element) {
// if (element.select) {
// selectPracticeShow +=
// '${element.name}、';
// selectPracticeIds += '${element.id},';
// }
// });
// if (selectPracticeShow.endsWith('、')) {
// selectPracticeShow =
// selectPracticeShow.substring(
// 0, selectPracticeShow.length - 1);
// }
// if (selectPracticeIds.endsWith(',')) {
// selectPracticeIds =
// selectPracticeIds.substring(
// 0, selectPracticeIds.length - 1);
// }
setState(() {});
}
}, needStar: false)),
... ...
import 'dart:convert';
import 'package:amap_map_fluttify/amap_map_fluttify.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
... ... @@ -137,6 +139,21 @@ class _MenuManagePageState extends State<MenuManagePage> {
_handleData();
}
///修改菜品样式
_setCookbookById(String mid, Map cookStyle) async {
Map<String, String> params = {
"sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
"id": mid,
'cook_style': json.encode(cookStyle)
};
print(params);
bool sucess = await menuManageProvider.setCookbookById(context, params,
showLoading: true);
if (sucess) {
Utils.showToast('修改成功!');
}
}
///处理数据
_handleData({isMove = false}) {
if (menuManageProvider.menuModel != null) {
... ... @@ -220,40 +237,112 @@ class _MenuManagePageState extends State<MenuManagePage> {
spreadRadius: w(20))
]),
),
if ((model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != '') ||
(model.taste != null && model.taste != '') ||
(model.cooks != null && model.cooks != ''))
VEmptyView(20),
if ((model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != '') ||
(model.taste != null && model.taste != '') ||
(model.cooks != null && model.cooks != ''))
VEmptyView(20),
if ((model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != '') ||
(model.taste != null && model.taste != '') ||
(model.cooks != null && model.cooks != ''))
VEmptyView(20),
if ((model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != '') ||
(model.taste != null && model.taste != '') ||
(model.cooks != null && model.cooks != ''))
Text(
model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != ''
? '味型:${model.taste} 烹调:${model.cooks}'
: model.taste != null && model.taste != ''
? '味型:${model.taste}'
: model.cooks != null && model.cooks != ''
? '味型:${model.taste} 烹调:${model.cooks}'
: '',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(12),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
])),
VEmptyView(20),
Text('味型:咸鲜 烹调:熬煮',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(12),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
])),
VEmptyView(20),
Text(
'¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
textAlign: TextAlign.right,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(14),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
]),
),
model.price == null
? Column(children: _priceWidget(model))
: Text(
'¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
textAlign: TextAlign.right,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(14),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
]),
),
],
),
);
}
List<Widget> _priceWidget(MenuSunModel model) {
List<SpecModel> tempPrice = [];
if (model.price == null) {
//新添加菜品
model.spec.forEach((element) {
if (element.status == '1') {
//规格启用状态
tempPrice.add(element);
}
});
}
List<Widget> textWidgetList = [];
tempPrice.forEach((element) {
textWidgetList.add(
Text(
'¥${element.price}/${element.specs} 会员 ¥${element.memberPrice ?? ''}/${element.specs} ',
textAlign: TextAlign.right,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(14),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
]),
),
);
});
return textWidgetList;
}
//右边
Widget _topRight(MenuSunModel model) {
return Container(
... ... @@ -274,36 +363,59 @@ class _MenuManagePageState extends State<MenuManagePage> {
spreadRadius: w(20))
]),
),
if ((model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != '') ||
(model.taste != null && model.taste != '') ||
(model.cooks != null && model.cooks != ''))
VEmptyView(20),
if ((model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != '') ||
(model.taste != null && model.taste != '') ||
(model.cooks != null && model.cooks != ''))
Text(
model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != ''
? '味型:${model.taste} 烹调:${model.cooks}'
: model.taste != null && model.taste != ''
? '味型:${model.taste}'
: model.cooks != null && model.cooks != ''
? '味型:${model.taste} 烹调:${model.cooks}'
: '',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(12),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
])),
VEmptyView(20),
Text('味型:咸鲜 烹调:熬煮',
style:
TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(12),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
])),
VEmptyView(20),
Text(
'¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
textAlign: TextAlign.right,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(14),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
]),
),
model.price == null
? Column(children: _priceWidget(model))
: Text(
'¥${model.price}/${model.unit} 会员 ¥${model.member_price ?? ''}/${model.unit} ',
textAlign: TextAlign.right,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(14),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
]),
),
],
),
);
... ... @@ -334,38 +446,76 @@ class _MenuManagePageState extends State<MenuManagePage> {
spreadRadius: w(20))
]),
),
VEmptyView(20),
Text('味型:咸鲜 烹调:熬煮',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(12),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
]))
if ((model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != '') ||
(model.taste != null && model.taste != '') ||
(model.cooks != null && model.cooks != ''))
VEmptyView(20),
if ((model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != '') ||
(model.taste != null && model.taste != '') ||
(model.cooks != null && model.cooks != ''))
VEmptyView(20),
if ((model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != '') ||
(model.taste != null && model.taste != '') ||
(model.cooks != null && model.cooks != ''))
VEmptyView(20),
if ((model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != '') ||
(model.taste != null && model.taste != '') ||
(model.cooks != null && model.cooks != ''))
Text(
model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != ''
? '味型:${model.taste} 烹调:${model.cooks}'
: model.taste != null && model.taste != ''
? '味型:${model.taste}'
: model.cooks != null && model.cooks != ''
? '味型:${model.taste} 烹调:${model.cooks}'
: '',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(12),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
]))
],
),
),
HEmptyView(10),
Text(
'¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
textAlign: TextAlign.right,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(14),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
]),
),
model.price == null
? Column(children: _priceWidget(model))
: Text(
'¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
textAlign: TextAlign.right,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(14),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
]),
),
],
);
}
... ... @@ -394,41 +544,64 @@ class _MenuManagePageState extends State<MenuManagePage> {
spreadRadius: w(20))
]),
)),
if ((model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != '') ||
(model.taste != null && model.taste != '') ||
(model.cooks != null && model.cooks != ''))
VEmptyView(20),
if ((model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != '') ||
(model.taste != null && model.taste != '') ||
(model.cooks != null && model.cooks != ''))
Padding(
padding: EdgeInsets.symmetric(horizontal: w(10)),
child: Text(
model.taste != null &&
model.taste != '' &&
model.cooks != null &&
model.cooks != ''
? '味型:${model.taste} 烹调:${model.cooks}'
: model.taste != null && model.taste != ''
? '味型:${model.taste}'
: model.cooks != null && model.cooks != ''
? '味型:${model.taste} 烹调:${model.cooks}'
: '',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(12),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
]),
)),
VEmptyView(20),
Padding(
padding: EdgeInsets.symmetric(horizontal: w(10)),
child: Text(
'味型:咸鲜 烹调:熬煮',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(12),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
]),
)),
VEmptyView(20),
Padding(
padding: EdgeInsets.symmetric(horizontal: w(10)),
child: Text(
'¥${model.price}/${model.unit} 会员 ¥${model.price}/${model.unit} ',
textAlign: TextAlign.right,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(14),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
]),
)),
child: model.price == null
? Column(children: _priceWidget(model))
: Text(
'¥${model.price}/${model.unit} 会员 ¥${model.member_price}/${model.unit} ',
textAlign: TextAlign.right,
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: font(14),
color: MyColours.color_515151,
shadows: [
BoxShadow(
color: MyColours.color_FBF6F1,
offset: Offset(0, 1),
blurRadius: w(2),
spreadRadius: w(20))
]),
)),
VEmptyView(30),
if (model.image != null)
CachedNetworkImage(
... ... @@ -437,11 +610,11 @@ class _MenuManagePageState extends State<MenuManagePage> {
width: ScreenUtil().screenWidth / 2,
height: w(125),
),
if (true)
if (model.desc != null && model.desc != '')
Padding(
padding: EdgeInsets.symmetric(horizontal: w(10), vertical: w(10)),
child: Text(
'江南传统名菜,口味咸鲜,汤白汁浓,肉质酥肥,笋清香脆嫩,鲜味浓厚。',
model.desc ?? "",
style: TextStyle(
color: themeColerModel.name == '珍珠白'
? MyColours.color_515151
... ... @@ -509,6 +682,13 @@ class _MenuManagePageState extends State<MenuManagePage> {
} else {
_handleData();
}
Map cookStyle = {
'name_type': object['name_type'],
'image_type': '',
'sort': ''
};
_setCookbookById(model.id, cookStyle);
}
}
... ... @@ -580,57 +760,59 @@ class _MenuManagePageState extends State<MenuManagePage> {
],
),
)),
Container(
padding: EdgeInsets.symmetric(horizontal: w(23)),
// height: w(80),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding:
EdgeInsets.only(top: w(12), bottom: w(25)),
child: RoundButton(
onPressed: () async {
bool needRefresh =
await NavigatorUtil.goMenuCategoryPage(
context);
print(needRefresh);
if (needRefresh != null && needRefresh) {
//刷新页面数据
// _controller.callRefresh();
// _couponNetworkData();
}
},
text: '分类管理',
fontSize: 32,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_438E93,
isBold: true,
height: w(43),
width: w(100),
radius: r(5),
)),
!isShow
? SizedBox()
: Padding(
padding: EdgeInsets.only(
top: w(12), bottom: w(25)),
child: RoundButton(
onPressed: () async {
await NavigatorUtil.goMenuAddDishesPage(
context);
},
text: '添加菜品',
fontSize: 32,
isBold: true,
width: w(218),
height: w(43),
radius: r(5),
))
],
))
if (model.pageState == PageState.Empty ||
model.pageState == PageState.Success)
Container(
padding: EdgeInsets.symmetric(horizontal: w(23)),
// height: w(80),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding:
EdgeInsets.only(top: w(12), bottom: w(25)),
child: RoundButton(
onPressed: () async {
bool needRefresh =
await NavigatorUtil.goMenuCategoryPage(
context);
print(needRefresh);
if (needRefresh != null && needRefresh) {
//刷新页面数据
// _controller.callRefresh();
// _couponNetworkData();
}
},
text: '分类管理',
fontSize: 32,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_438E93,
isBold: true,
height: w(43),
width: w(100),
radius: r(5),
)),
!isShow
? SizedBox()
: Padding(
padding: EdgeInsets.only(
top: w(12), bottom: w(25)),
child: RoundButton(
onPressed: () async {
await NavigatorUtil.goMenuAddDishesPage(
context);
},
text: '添加菜品',
fontSize: 32,
isBold: true,
width: w(218),
height: w(43),
radius: r(5),
))
],
))
]);
} else {
// double cellWidth = (MediaQuery.of(context).size.width -
... ... @@ -811,7 +993,8 @@ class _MenuManagePageState extends State<MenuManagePage> {
width: double.infinity,
height: w(250),
),
if (true)
if (model.desc != null &&
model.desc != '')
Padding(
padding: EdgeInsets
.symmetric(
... ... @@ -820,7 +1003,7 @@ class _MenuManagePageState extends State<MenuManagePage> {
vertical:
w(10)),
child: Text(
'江南传统名菜,口味咸鲜,汤白汁浓,肉质酥肥,笋清香脆嫩,鲜味浓厚。',
model.desc,
style: TextStyle(
color: themeColerModel1
.name ==
... ... @@ -973,58 +1156,60 @@ class _MenuManagePageState extends State<MenuManagePage> {
],
);
})),
Container(
padding: EdgeInsets.symmetric(horizontal: w(23)),
// height: w(80),
color: MyColours.color_FAFAFA,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding:
EdgeInsets.only(top: w(12), bottom: w(25)),
child: RoundButton(
onPressed: () async {
bool needRefresh =
await NavigatorUtil.goMenuCategoryPage(
context);
print(needRefresh);
if (needRefresh != null && needRefresh) {
//刷新页面数据
// _controller.callRefresh();
// _couponNetworkData();
}
},
text: '分类管理',
fontSize: 32,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_438E93,
isBold: true,
height: w(43),
width: w(100),
radius: r(5),
)),
!isShow
? SizedBox()
: Padding(
padding: EdgeInsets.only(
top: w(12), bottom: w(25)),
child: RoundButton(
onPressed: () async {
await NavigatorUtil.goMenuAddDishesPage(
context);
},
text: '添加菜品',
fontSize: 32,
isBold: true,
width: w(218),
height: w(43),
radius: r(5),
))
],
))
if (model.pageState == PageState.Success ||
model.pageState == PageState.Empty)
Container(
padding: EdgeInsets.symmetric(horizontal: w(23)),
// height: w(80),
color: MyColours.color_FAFAFA,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding:
EdgeInsets.only(top: w(12), bottom: w(25)),
child: RoundButton(
onPressed: () async {
bool needRefresh =
await NavigatorUtil.goMenuCategoryPage(
context);
print(needRefresh);
if (needRefresh != null && needRefresh) {
//刷新页面数据
// _controller.callRefresh();
// _couponNetworkData();
}
},
text: '分类管理',
fontSize: 32,
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
borderColor: MyColours.color_438E93,
textColor: MyColours.color_438E93,
isBold: true,
height: w(43),
width: w(100),
radius: r(5),
)),
!isShow
? SizedBox()
: Padding(
padding: EdgeInsets.only(
top: w(12), bottom: w(25)),
child: RoundButton(
onPressed: () async {
await NavigatorUtil.goMenuAddDishesPage(
context);
},
text: '添加菜品',
fontSize: 32,
isBold: true,
width: w(218),
height: w(43),
radius: r(5),
))
],
))
]);
}
},
... ...
... ... @@ -36,6 +36,12 @@ class _MenuSetPricePageState extends State<MenuSetPricePage> {
MenuUnitModel menuUnitModel = MenuUnitModel();
// menuUnitModel.status = '1';
menuUnitModel.select = true;
String specid = App.sp.getString('specid');
String specs = App.sp.getString('specs');
if (specid != null) {
menuUnitModel.specs = specs;
menuUnitModel.specid = specid;
}
data.add(menuUnitModel);
} else {
data = widget.data;
... ...
... ... @@ -120,9 +120,12 @@ class _OrderCreateTemporaryPageState extends State<OrderCreateTemporaryPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: SystemAppBar('临时菜', onTap: () {
appBar: SystemAppBar(
'临时菜',
onTap: () {
Navigator.pop(context);
},),
},
),
body: Container(
color: MyColours.color_ffffff,
child: Column(
... ... @@ -301,7 +304,9 @@ class _OrderCreateTemporaryPageState extends State<OrderCreateTemporaryPage> {
menuSunModel.amount.toString();
allSum += menuSunModel.amount;
menuSunModel.unit = unit.text;
menuSunModel.practice = [practice.text];
PracticeModel practiceModel = PracticeModel();
practiceModel.name = practice.text;
menuSunModel.practice = [practiceModel];
menuSunShort.add(menuSunModel);
... ...