Commit 9d2486dafeb8a343dfeab23aa6d20d7aff0a330b

Authored by wdn127929
1 parent cc0e1c16

客户自己点and排菜客情OK

... ... @@ -101,6 +101,7 @@ class NotebookDetail {
Order order;
OrderInfo orderInfo;
String con_amount;
String gid;
String get statuImgAssets {
switch (status) {
... ... @@ -296,7 +297,7 @@ class NotebookDetail {
@override
String toString() {
return 'NotebookDetail{id: $id, con_amount:$con_amount,abolition: $abolition, tableinfo: $tableinfo,actual_pum:$actual_pum, pnum: $pnum, rname: $rname, sex: $sex, phone: $phone, cusdem: $cusdem, cusman: $cusman, ddate: $ddate, is_set_ddate: $is_set_ddate, ddate_solt: $ddate_solt, status: $status, action: $action, type: $type, note_name: $note_name, seller_user_phone:$seller_user_phone, nick_name: $nick_name,channel: $channel, cdate: $cdate, demands: $demands, tables: $tables, cancel: $cancel}';
return 'NotebookDetail{id: $id, con_amount:$con_amount,abolition: $abolition, tableinfo: $tableinfo,actual_pum:$actual_pum, pnum: $pnum, rname: $rname, sex: $sex, phone: $phone, cusdem: $cusdem, cusman: $cusman, ddate: $ddate, is_set_ddate: $is_set_ddate, ddate_solt: $ddate_solt, status: $status, action: $action, type: $type, note_name: $note_name, seller_user_phone:$seller_user_phone, nick_name: $nick_name,channel: $channel, cdate: $cdate, demands: $demands, tables: $tables, cancel: $cancel, gid: $gid}';
}
}
... ...
... ... @@ -47,7 +47,8 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) {
: Order.fromJson(json['order'] as Map<String, dynamic>)
..orderInfo = json['order_info'] == null
? null
: OrderInfo.fromJson(json['order_info'] as Map<String, dynamic>);
: OrderInfo.fromJson(json['order_info'] as Map<String, dynamic>)
..gid = json['gid'] as String;
}
Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) =>
... ... @@ -78,7 +79,8 @@ Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) =>
'tables': instance.tables,
'cancel': instance.cancel,
'order': instance.order,
'order_info': instance.orderInfo
'order_info': instance.orderInfo,
'gid':instance.gid
};
OrderInfo _$OrderInfoFromJson(Map<String, dynamic> json) {
return OrderInfo(
... ...
... ... @@ -86,8 +86,8 @@ class _OrderCustomerDetailPageState extends State<OrderCustomerDetailPage> {
_getGuestInfo() async {
Map<String, String> params = {
"uid": Provider.of<UserModel>(context, listen: false).user.openid,
"id": '195',
'phone': '18049359922'
"id": widget.detailEntity.gid,
'phone': widget.detailEntity.phone
};
bool success = await customerProvider.getGuestInfo(context, params);
if (success) {
... ... @@ -149,7 +149,7 @@ class _OrderCustomerDetailPageState extends State<OrderCustomerDetailPage> {
}
}
Map<String, String> params = {
"id": '195',
"id": widget.detailEntity.gid,
'sex': sex,
'rname': nameStr,
'phone': phoneController.text
... ...
... ... @@ -70,7 +70,7 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> {
_setGuestInfo() async {
Map<String, String> params = {
"id": '195',
"id": widget.detailEntity.gid,
};
if (noFoodController.text.trim().length > 0) {
... ... @@ -793,25 +793,28 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> {
// .goOrderAdvanceHomePage(
// context,
// );
await _setGuestInfo();
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) {
await _setGuestInfo();
// 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.goMiniProgramOrderPage(
context,
widget.rid,
oid,
Provider.of<UserModel>(context, listen: false)
Utils.goShareOrderPageToWeChat(context,
title: '菜品已点好,快来看看都点了什么~',
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);
}
// }
},
child: Container(
margin:
... ... @@ -836,6 +839,7 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> {
flex: 2,
child: InkWell(
onTap: () async {
await _setGuestInfo();
//调用排菜信息提交接口
Map<String, String> params = {
'sellerid':
... ...
... ... @@ -1147,15 +1147,28 @@ class Utils {
miniProgramType: WXMiniProgramType.RELEASE);
}
//跳转小程序提前点餐
static goMiniProgramOrderPage(
BuildContext context, String rid, String oid, String sid) {
// UserModel model = Provider.of<UserModel>(context, listen: false);
launchWeChatMiniProgram(
username: "gh_487873d353b3",
path:
"pack-cookbook/pages/index?rid=$rid&oid=$oid&identity=1&sid=$sid",
miniProgramType: WXMiniProgramType.RELEASE);
//分享已点菜品----跳转小程序提前点餐
static goShareOrderPageToWeChat(BuildContext context,
{String title, String rid, String img, String oid, String sid}) async {
Loading.showLoading(context);
String _webPageUrl = "http://colorcun.com/";
String _thumbnail = img;
String _title = title;
String _userName = "gh_487873d353b3";
String _path = "pack-cookbook/pages/index?rid=$rid&identity=2&sid=$sid";
String _description = "OneKey";
var model = new WeChatShareMiniProgramModel(
webPageUrl: _webPageUrl,
userName: _userName,
title: _title,
path: _path,
thumbnail: WeChatImage.asset(Utils.getImgPath('mini_image')),
description: _description,
// thumbnail: WeChatImage.network(_thumbnail)
);
bool isShare = await shareToWeChat(model);
print(isShare);
Loading.hideLoading(context);
}
//分享已点菜品
... ...