Commit 9d2486dafeb8a343dfeab23aa6d20d7aff0a330b

Authored by wdn127929
1 parent cc0e1c16

客户自己点and排菜客情OK

@@ -101,6 +101,7 @@ class NotebookDetail { @@ -101,6 +101,7 @@ class NotebookDetail {
101 Order order; 101 Order order;
102 OrderInfo orderInfo; 102 OrderInfo orderInfo;
103 String con_amount; 103 String con_amount;
  104 + String gid;
104 105
105 String get statuImgAssets { 106 String get statuImgAssets {
106 switch (status) { 107 switch (status) {
@@ -296,7 +297,7 @@ class NotebookDetail { @@ -296,7 +297,7 @@ class NotebookDetail {
296 297
297 @override 298 @override
298 String toString() { 299 String toString() {
299 - 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}'; 300 + 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}';
300 } 301 }
301 } 302 }
302 303
@@ -47,7 +47,8 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) { @@ -47,7 +47,8 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) {
47 : Order.fromJson(json['order'] as Map<String, dynamic>) 47 : Order.fromJson(json['order'] as Map<String, dynamic>)
48 ..orderInfo = json['order_info'] == null 48 ..orderInfo = json['order_info'] == null
49 ? null 49 ? null
50 - : OrderInfo.fromJson(json['order_info'] as Map<String, dynamic>); 50 + : OrderInfo.fromJson(json['order_info'] as Map<String, dynamic>)
  51 + ..gid = json['gid'] as String;
51 } 52 }
52 53
53 Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) => 54 Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) =>
@@ -78,7 +79,8 @@ Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) => @@ -78,7 +79,8 @@ Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) =>
78 'tables': instance.tables, 79 'tables': instance.tables,
79 'cancel': instance.cancel, 80 'cancel': instance.cancel,
80 'order': instance.order, 81 'order': instance.order,
81 - 'order_info': instance.orderInfo 82 + 'order_info': instance.orderInfo,
  83 + 'gid':instance.gid
82 }; 84 };
83 OrderInfo _$OrderInfoFromJson(Map<String, dynamic> json) { 85 OrderInfo _$OrderInfoFromJson(Map<String, dynamic> json) {
84 return OrderInfo( 86 return OrderInfo(
@@ -86,8 +86,8 @@ class _OrderCustomerDetailPageState extends State<OrderCustomerDetailPage> { @@ -86,8 +86,8 @@ class _OrderCustomerDetailPageState extends State<OrderCustomerDetailPage> {
86 _getGuestInfo() async { 86 _getGuestInfo() async {
87 Map<String, String> params = { 87 Map<String, String> params = {
88 "uid": Provider.of<UserModel>(context, listen: false).user.openid, 88 "uid": Provider.of<UserModel>(context, listen: false).user.openid,
89 - "id": '195',  
90 - 'phone': '18049359922' 89 + "id": widget.detailEntity.gid,
  90 + 'phone': widget.detailEntity.phone
91 }; 91 };
92 bool success = await customerProvider.getGuestInfo(context, params); 92 bool success = await customerProvider.getGuestInfo(context, params);
93 if (success) { 93 if (success) {
@@ -149,7 +149,7 @@ class _OrderCustomerDetailPageState extends State<OrderCustomerDetailPage> { @@ -149,7 +149,7 @@ class _OrderCustomerDetailPageState extends State<OrderCustomerDetailPage> {
149 } 149 }
150 } 150 }
151 Map<String, String> params = { 151 Map<String, String> params = {
152 - "id": '195', 152 + "id": widget.detailEntity.gid,
153 'sex': sex, 153 'sex': sex,
154 'rname': nameStr, 154 'rname': nameStr,
155 'phone': phoneController.text 155 'phone': phoneController.text
@@ -70,7 +70,7 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> { @@ -70,7 +70,7 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> {
70 70
71 _setGuestInfo() async { 71 _setGuestInfo() async {
72 Map<String, String> params = { 72 Map<String, String> params = {
73 - "id": '195', 73 + "id": widget.detailEntity.gid,
74 }; 74 };
75 75
76 if (noFoodController.text.trim().length > 0) { 76 if (noFoodController.text.trim().length > 0) {
@@ -793,25 +793,28 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> { @@ -793,25 +793,28 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> {
793 // .goOrderAdvanceHomePage( 793 // .goOrderAdvanceHomePage(
794 // context, 794 // context,
795 // ); 795 // );
796 - await _setGuestInfo();  
797 - Map<String, String> params = {  
798 - "rid": widget.rid  
799 - // 'is_time': '0'  
800 - // "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,  
801 - };  
802 - String oid = await _planDishProvider.getCreateOrder(  
803 - context, params,  
804 - showLoading: true);  
805 - if (oid != null) { 796 + await _setGuestInfo();
  797 + // Map<String, String> params = {
  798 + // "rid": widget.rid
  799 + // // 'is_time': '0'
  800 + // // "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  801 + // };
  802 + // String oid = await _planDishProvider.getCreateOrder(
  803 + // context, params,
  804 + // showLoading: true);
  805 + // if (oid != null) {
806 //获取成功 806 //获取成功
807 - Utils.goMiniProgramOrderPage(  
808 - context,  
809 - widget.rid,  
810 - oid,  
811 - Provider.of<UserModel>(context, listen: false) 807 + Utils.goShareOrderPageToWeChat(context,
  808 + title: '菜品已点好,快来看看都点了什么~',
  809 + img:
  810 + 'http://nosqn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148571.jpg',
  811 + rid: widget.rid,
  812 + // oid: oid,
  813 + sid: Provider.of<UserModel>(context,
  814 + listen: false)
812 .user 815 .user
813 .sellerid); 816 .sellerid);
814 - } 817 + // }
815 }, 818 },
816 child: Container( 819 child: Container(
817 margin: 820 margin:
@@ -836,6 +839,7 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> { @@ -836,6 +839,7 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> {
836 flex: 2, 839 flex: 2,
837 child: InkWell( 840 child: InkWell(
838 onTap: () async { 841 onTap: () async {
  842 + await _setGuestInfo();
839 //调用排菜信息提交接口 843 //调用排菜信息提交接口
840 Map<String, String> params = { 844 Map<String, String> params = {
841 'sellerid': 845 'sellerid':
@@ -1147,15 +1147,28 @@ class Utils { @@ -1147,15 +1147,28 @@ class Utils {
1147 miniProgramType: WXMiniProgramType.RELEASE); 1147 miniProgramType: WXMiniProgramType.RELEASE);
1148 } 1148 }
1149 1149
1150 - //跳转小程序提前点餐  
1151 - static goMiniProgramOrderPage(  
1152 - BuildContext context, String rid, String oid, String sid) {  
1153 - // UserModel model = Provider.of<UserModel>(context, listen: false);  
1154 - launchWeChatMiniProgram(  
1155 - username: "gh_487873d353b3",  
1156 - path:  
1157 - "pack-cookbook/pages/index?rid=$rid&oid=$oid&identity=1&sid=$sid",  
1158 - miniProgramType: WXMiniProgramType.RELEASE); 1150 + //分享已点菜品----跳转小程序提前点餐
  1151 + static goShareOrderPageToWeChat(BuildContext context,
  1152 + {String title, String rid, String img, String oid, String sid}) async {
  1153 + Loading.showLoading(context);
  1154 + String _webPageUrl = "http://colorcun.com/";
  1155 + String _thumbnail = img;
  1156 + String _title = title;
  1157 + String _userName = "gh_487873d353b3";
  1158 + String _path = "pack-cookbook/pages/index?rid=$rid&identity=2&sid=$sid";
  1159 + String _description = "OneKey";
  1160 + var model = new WeChatShareMiniProgramModel(
  1161 + webPageUrl: _webPageUrl,
  1162 + userName: _userName,
  1163 + title: _title,
  1164 + path: _path,
  1165 + thumbnail: WeChatImage.asset(Utils.getImgPath('mini_image')),
  1166 + description: _description,
  1167 + // thumbnail: WeChatImage.network(_thumbnail)
  1168 + );
  1169 + bool isShare = await shareToWeChat(model);
  1170 + print(isShare);
  1171 + Loading.hideLoading(context);
1159 } 1172 }
1160 1173
1161 //分享已点菜品 1174 //分享已点菜品