Commit 0c64b88a6b07524aabfa065395f3bfc232373f9b

Authored by wdn127929
1 parent 0aef7187

请客人点菜+保存当前页面信息

... ... @@ -804,37 +804,86 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> {
flex: 1,
child: InkWell(
onTap: () async {
// NavigatorUtil
// .goOrderAdvanceHomePage(
// context,
// );
if (widget.detailEntity.gid != null) {
await _setGuestInfo();
}
//调用排菜信息提交接口
Map<String, String> params = {
'sellerid':
Provider.of<UserModel>(context, listen: false)
.user
.sellerid,
'uid':
Provider.of<UserModel>(context, listen: false)
.user
.openid,
'rid': widget.rid,
};
if (_planDishProvider.planId != null &&
_planDishProvider.planId != '') {
//已经存在id,则修改
params['id'] = _planDishProvider.planId;
}
if (isTotal &&
totalController.text.trim().length > 0) {
//预计总价
params['total_price'] = totalController.text;
params['per_price'] = '0';
}
if (!isTotal &&
perController.text.trim().length > 0) {
//预计人均
params['per_price'] = perController.text;
params['total_price'] = '0';
}
if (likeController.text.trim().length > 0) {
//喜好
params['like'] = likeController.text;
}
if (noFoodController.text.trim().length > 0) {
//忌口
params['taboos'] = noFoodController.text;
}
if (serviceController.text.trim().length > 0) {
//服务
params['serve'] = serviceController.text;
}
if (pnumController.text.trim().length > 0) {
params['pnum'] = pnumController.text;
}
params['plan_name'] = name ?? '';
// Map<String, String> params = {
// "rid": widget.rid
// // 'is_time': '0'
// // "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
// };
// String oid = await _planDishProvider.getCreateOrder(
// context, params,
// showLoading: true);
// if (oid != null) {
//获取成功
Utils.goShareOrderPageToWeChat(context,
title:
'${Provider.of<UserModel>(context, listen: false).user.nickName ?? Provider.of<UserModel>(context, listen: false).user.sellername}经理邀请您点餐了',
img:
'http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148571.jpg',
rid: widget.rid,
// oid: oid,
sid:
Provider.of<UserModel>(context, listen: false)
.user
.sellerid);
// }
// cooklist 字符串 可选 单点菜品列表
// package_list 字符串 可选 选中套餐数据,[{"id":1,"num":2},{"id":2,"num":1}]
// often_list 字符串 可选 选中店内常点数据,[{"id":1,"num":2},{"id":2,"num":1}]
// temporary_list 字符串 可选 临时加菜,[{"cook_name":"炒土豆丝","price":20,"num",1,"unit":"份","practice":"香辣"},{"cook_name":"麻婆豆腐","price":18,"num",1,"unit":"份","practice":"香辣"}]
// plan_list 字符串 可选 选中排菜数据,[{"id":1,"num":2},{"id":2,"num":1}]
// menu_price 浮点型 可选 菜单总价
// member_price 浮点型 可选 会员总价
// plan_price 浮点型 可选 排菜总价
// remark
bool success = await _planDishProvider
.setPlanCookByReserve(context, params);
if (success) {
// bus.emit("refresh_detail");
//获取成功
Utils.goShareOrderPageToWeChat(context,
title:
'${Provider.of<UserModel>(context, listen: false).user.nickName ?? Provider.of<UserModel>(context, listen: false).user.sellername}经理邀请您点餐了',
img:
'http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148571.jpg',
rid: widget.rid,
// oid: oid,
sid: Provider.of<UserModel>(context,
listen: false)
.user
.sellerid);
} else {
Utils.showToast('信息提交失败,请重试');
}
},
child: Container(
margin:
... ... @@ -923,6 +972,7 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> {
bool success = await _planDishProvider
.setPlanCookByReserve(context, params);
if (success) {
// bus.emit("refresh_detail");
NavigatorUtil.goOrderAdvanceEditPage(context,
planId: _planDishProvider.planId,
rid: widget.rid,
... ...