Commit 4312fadf961d9749c9d17036de9428c426853097

Authored by wdn127929
1 parent 4511883a

合并

  1 +import 'package:json_annotation/json_annotation.dart';
  2 +
  3 +part 'created_order_model.g.dart';
  4 +
  5 +@JsonSerializable()
  6 +class CreatedOrderModel extends Object {
  7 + @JsonKey(name: 'ret')
  8 + int ret;
  9 +
  10 + @JsonKey(name: 'data')
  11 + CreatedOrderSunModel data;
  12 +
  13 + @JsonKey(name: 'msg')
  14 + String msg;
  15 +
  16 + CreatedOrderModel(
  17 + this.ret,
  18 + this.data,
  19 + this.msg,
  20 + );
  21 +
  22 + factory CreatedOrderModel.fromJson(Map<String, dynamic> srcJson) =>
  23 + _$CreatedOrderModelFromJson(srcJson);
  24 +
  25 + Map<String, dynamic> toJson() => _$CreatedOrderModelToJson(this);
  26 +}
  27 +
  28 +@JsonSerializable()
  29 +class CreatedOrderSunModel extends Object {
  30 + @JsonKey(name: 'id')
  31 + String id;
  32 +
  33 + @JsonKey(name: 'rid')
  34 + String rid;
  35 +
  36 + @JsonKey(name: 'no')
  37 + String no;
  38 +
  39 + @JsonKey(name: 'row_num')
  40 + String rowNum;
  41 +
  42 + @JsonKey(name: 'pnum')
  43 + String pnum;
  44 +
  45 + @JsonKey(name: 'sellerid')
  46 + String sellerid;
  47 +
  48 + @JsonKey(name: 'openid')
  49 + String openid;
  50 +
  51 + @JsonKey(name: 'price')
  52 + int price;
  53 +
  54 + @JsonKey(name: 'type')
  55 + String type;
  56 +
  57 + @JsonKey(name: 'behavior')
  58 + String behavior;
  59 +
  60 + @JsonKey(name: 'cdate')
  61 + String cdate;
  62 +
  63 + @JsonKey(name: 'cookbooklist')
  64 + List<Cookbooklist> cookbooklist;
  65 +
  66 + @JsonKey(name: 'seller')
  67 + Seller seller;
  68 +
  69 + CreatedOrderSunModel(
  70 + this.id,
  71 + this.rid,
  72 + this.no,
  73 + this.rowNum,
  74 + this.pnum,
  75 + this.sellerid,
  76 + this.openid,
  77 + this.price,
  78 + this.type,
  79 + this.behavior,
  80 + this.cdate,
  81 + this.cookbooklist,
  82 + this.seller,
  83 + );
  84 +
  85 + factory CreatedOrderSunModel.fromJson(Map<String, dynamic> srcJson) =>
  86 + _$CreatedOrderSunModelFromJson(srcJson);
  87 +
  88 + Map<String, dynamic> toJson() => _$CreatedOrderSunModelToJson(this);
  89 +}
  90 +
  91 +@JsonSerializable()
  92 +class Cookbooklist extends Object {
  93 + @JsonKey(name: 'id')
  94 + String id;
  95 +
  96 + @JsonKey(name: 'orderid')
  97 + String orderid;
  98 +
  99 + @JsonKey(name: 'openid')
  100 + String openid;
  101 +
  102 + @JsonKey(name: 'cookbookid')
  103 + String cookbookid;
  104 +
  105 + @JsonKey(name: 'total')
  106 + String total;
  107 +
  108 + @JsonKey(name: 'price')
  109 + String price;
  110 +
  111 + @JsonKey(name: 'cookname')
  112 + String cookname;
  113 +
  114 + @JsonKey(name: 'cookunit')
  115 + String cookunit;
  116 +
  117 + @JsonKey(name: 'cookimage')
  118 + String cookimage;
  119 +
  120 + @JsonKey(name: 'class_name')
  121 + String className;
  122 +
  123 + @JsonKey(name: 'classid')
  124 + String classid;
  125 +
  126 + @JsonKey(name: 'class_order')
  127 + String classOrder;
  128 +
  129 + @JsonKey(name: 'source')
  130 + String source;
  131 +
  132 + @JsonKey(name: 'status')
  133 + String status;
  134 +
  135 + @JsonKey(name: 'identity')
  136 + String identity;
  137 +
  138 + @JsonKey(name: 'cdate')
  139 + String cdate;
  140 +
  141 + @JsonKey(name: 'num')
  142 + String number;
  143 +
  144 + Cookbooklist(
  145 + this.id,
  146 + this.orderid,
  147 + this.openid,
  148 + this.cookbookid,
  149 + this.total,
  150 + this.price,
  151 + this.cookname,
  152 + this.cookunit,
  153 + this.cookimage,
  154 + this.className,
  155 + this.classid,
  156 + this.classOrder,
  157 + this.source,
  158 + this.status,
  159 + this.identity,
  160 + this.cdate,
  161 + this.number,
  162 + );
  163 +
  164 + factory Cookbooklist.fromJson(Map<String, dynamic> srcJson) =>
  165 + _$CookbooklistFromJson(srcJson);
  166 +
  167 + Map<String, dynamic> toJson() => _$CookbooklistToJson(this);
  168 +}
  169 +
  170 +@JsonSerializable()
  171 +class Seller extends Object {
  172 + @JsonKey(name: 'id')
  173 + String id;
  174 +
  175 + @JsonKey(name: 'sellername')
  176 + String sellername;
  177 +
  178 + @JsonKey(name: 'seller_image')
  179 + String sellerImage;
  180 +
  181 + @JsonKey(name: 'phone')
  182 + String phone;
  183 +
  184 + @JsonKey(name: 'map_address')
  185 + String mapAddress;
  186 +
  187 + @JsonKey(name: 'last_num')
  188 + String lastNum;
  189 +
  190 + @JsonKey(name: 'long')
  191 + String long;
  192 +
  193 + @JsonKey(name: 'lat')
  194 + String lat;
  195 +
  196 + @JsonKey(name: 'daily')
  197 + String daily;
  198 +
  199 + Seller(
  200 + this.id,
  201 + this.sellername,
  202 + this.sellerImage,
  203 + this.phone,
  204 + this.mapAddress,
  205 + this.lastNum,
  206 + this.long,
  207 + this.lat,
  208 + this.daily,
  209 + );
  210 +
  211 + factory Seller.fromJson(Map<String, dynamic> srcJson) =>
  212 + _$SellerFromJson(srcJson);
  213 +
  214 + Map<String, dynamic> toJson() => _$SellerToJson(this);
  215 +}
  1 +// GENERATED CODE - DO NOT MODIFY BY HAND
  2 +
  3 +part of 'created_order_model.dart';
  4 +
  5 +// **************************************************************************
  6 +// JsonSerializableGenerator
  7 +// **************************************************************************
  8 +
  9 +CreatedOrderModel _$CreatedOrderModelFromJson(Map<String, dynamic> json) {
  10 + return CreatedOrderModel(
  11 + json['ret'] as int,
  12 + json['data'] == null
  13 + ? null
  14 + : CreatedOrderSunModel.fromJson(json['data'] as Map<String, dynamic>),
  15 + json['msg'] as String);
  16 +}
  17 +
  18 +Map<String, dynamic> _$CreatedOrderModelToJson(CreatedOrderModel instance) =>
  19 + <String, dynamic>{
  20 + 'ret': instance.ret,
  21 + 'data': instance.data,
  22 + 'msg': instance.msg
  23 + };
  24 +
  25 +CreatedOrderSunModel _$CreatedOrderSunModelFromJson(Map<String, dynamic> json) {
  26 + return CreatedOrderSunModel(
  27 + json['id'] as String,
  28 + json['rid'] as String,
  29 + json['no'] as String,
  30 + json['row_num'] as String,
  31 + json['pnum'] as String,
  32 + json['sellerid'] as String,
  33 + json['openid'] as String,
  34 + json['price'] as int,
  35 + json['type'] as String,
  36 + json['behavior'] as String,
  37 + json['cdate'] as String,
  38 + (json['cookbooklist'] as List)
  39 + ?.map((e) => e == null
  40 + ? null
  41 + : Cookbooklist.fromJson(e as Map<String, dynamic>))
  42 + ?.toList(),
  43 + json['seller'] == null
  44 + ? null
  45 + : Seller.fromJson(json['seller'] as Map<String, dynamic>));
  46 +}
  47 +
  48 +Map<String, dynamic> _$CreatedOrderSunModelToJson(
  49 + CreatedOrderSunModel instance) =>
  50 + <String, dynamic>{
  51 + 'id': instance.id,
  52 + 'rid': instance.rid,
  53 + 'no': instance.no,
  54 + 'row_num': instance.rowNum,
  55 + 'pnum': instance.pnum,
  56 + 'sellerid': instance.sellerid,
  57 + 'openid': instance.openid,
  58 + 'price': instance.price,
  59 + 'type': instance.type,
  60 + 'behavior': instance.behavior,
  61 + 'cdate': instance.cdate,
  62 + 'cookbooklist': instance.cookbooklist,
  63 + 'seller': instance.seller
  64 + };
  65 +
  66 +Cookbooklist _$CookbooklistFromJson(Map<String, dynamic> json) {
  67 + return Cookbooklist(
  68 + json['id'] as String,
  69 + json['orderid'] as String,
  70 + json['openid'] as String,
  71 + json['cookbookid'] as String,
  72 + json['total'] as String,
  73 + json['price'] as String,
  74 + json['cookname'] as String,
  75 + json['cookunit'] as String,
  76 + json['cookimage'] as String,
  77 + json['class_name'] as String,
  78 + json['classid'] as String,
  79 + json['class_order'] as String,
  80 + json['source'] as String,
  81 + json['status'] as String,
  82 + json['identity'] as String,
  83 + json['cdate'] as String,
  84 + json['num'] as String);
  85 +}
  86 +
  87 +Map<String, dynamic> _$CookbooklistToJson(Cookbooklist instance) =>
  88 + <String, dynamic>{
  89 + 'id': instance.id,
  90 + 'orderid': instance.orderid,
  91 + 'openid': instance.openid,
  92 + 'cookbookid': instance.cookbookid,
  93 + 'total': instance.total,
  94 + 'price': instance.price,
  95 + 'cookname': instance.cookname,
  96 + 'cookunit': instance.cookunit,
  97 + 'cookimage': instance.cookimage,
  98 + 'class_name': instance.className,
  99 + 'classid': instance.classid,
  100 + 'class_order': instance.classOrder,
  101 + 'source': instance.source,
  102 + 'status': instance.status,
  103 + 'identity': instance.identity,
  104 + 'cdate': instance.cdate,
  105 + 'num': instance.number
  106 + };
  107 +
  108 +Seller _$SellerFromJson(Map<String, dynamic> json) {
  109 + return Seller(
  110 + json['id'] as String,
  111 + json['sellername'] as String,
  112 + json['seller_image'] as String,
  113 + json['phone'] as String,
  114 + json['map_address'] as String,
  115 + json['last_num'] as String,
  116 + json['long'] as String,
  117 + json['lat'] as String,
  118 + json['daily'] as String);
  119 +}
  120 +
  121 +Map<String, dynamic> _$SellerToJson(Seller instance) => <String, dynamic>{
  122 + 'id': instance.id,
  123 + 'sellername': instance.sellername,
  124 + 'seller_image': instance.sellerImage,
  125 + 'phone': instance.phone,
  126 + 'map_address': instance.mapAddress,
  127 + 'last_num': instance.lastNum,
  128 + 'long': instance.long,
  129 + 'lat': instance.lat,
  130 + 'daily': instance.daily
  131 + };
@@ -85,6 +85,7 @@ class NotebookDetail { @@ -85,6 +85,7 @@ class NotebookDetail {
85 List<t.Table> demands; //需求桌位 85 List<t.Table> demands; //需求桌位
86 List<t.Table> tables; //预订桌位 86 List<t.Table> tables; //预订桌位
87 Cancel cancel; 87 Cancel cancel;
  88 + Order order;
88 89
89 String get statuImgAssets { 90 String get statuImgAssets {
90 switch (status) { 91 switch (status) {
@@ -229,3 +230,110 @@ class Cancel { @@ -229,3 +230,110 @@ class Cancel {
229 factory Cancel.fromJson(Map<String, dynamic> json) => _$CancelFromJson(json); 230 factory Cancel.fromJson(Map<String, dynamic> json) => _$CancelFromJson(json);
230 Map<String, dynamic> toJson() => _$CancelToJson(this); 231 Map<String, dynamic> toJson() => _$CancelToJson(this);
231 } 232 }
  233 +
  234 +@JsonSerializable()
  235 + class Order extends Object {
  236 +
  237 + @JsonKey(name: 'id')
  238 + String id;
  239 +
  240 + @JsonKey(name: 'rid')
  241 + String rid;
  242 +
  243 + @JsonKey(name: 'no')
  244 + String no;
  245 +
  246 + @JsonKey(name: 'row_num')
  247 + String rowNum;
  248 +
  249 + @JsonKey(name: 'pnum')
  250 + String pnum;
  251 +
  252 + @JsonKey(name: 'sellerid')
  253 + String sellerid;
  254 +
  255 + @JsonKey(name: 'openid')
  256 + String openid;
  257 +
  258 + @JsonKey(name: 'price')
  259 + int price;
  260 +
  261 + @JsonKey(name: 'type')
  262 + String type;
  263 +
  264 + @JsonKey(name: 'behavior')
  265 + String behavior;
  266 +
  267 + @JsonKey(name: 'cdate')
  268 + String cdate;
  269 +
  270 + @JsonKey(name: 'cookbooklist')
  271 + List<Cookbooklist> cookbooklist;
  272 +
  273 + Order(this.id,this.rid,this.no,this.rowNum,this.pnum,this.sellerid,this.openid,this.price,this.type,this.behavior,this.cdate,this.cookbooklist,);
  274 +
  275 + factory Order.fromJson(Map<String, dynamic> srcJson) => _$OrderFromJson(srcJson);
  276 +
  277 + Map<String, dynamic> toJson() => _$OrderToJson(this);
  278 +
  279 +}
  280 +
  281 +
  282 +@JsonSerializable()
  283 + class Cookbooklist extends Object {
  284 +
  285 + @JsonKey(name: 'id')
  286 + String id;
  287 +
  288 + @JsonKey(name: 'orderid')
  289 + String orderid;
  290 +
  291 + @JsonKey(name: 'openid')
  292 + String openid;
  293 +
  294 + @JsonKey(name: 'cookbookid')
  295 + String cookbookid;
  296 +
  297 + @JsonKey(name: 'price')
  298 + String price;
  299 +
  300 + @JsonKey(name: 'cookname')
  301 + String cookname;
  302 +
  303 + @JsonKey(name: 'cookunit')
  304 + String cookunit;
  305 +
  306 + @JsonKey(name: 'cookimage')
  307 + String cookimage;
  308 +
  309 + @JsonKey(name: 'class_name')
  310 + String className;
  311 +
  312 + @JsonKey(name: 'classid')
  313 + String classid;
  314 +
  315 + @JsonKey(name: 'class_order')
  316 + String classOrder;
  317 +
  318 + @JsonKey(name: 'fromSoucre')
  319 + String fromSoucre;
  320 +
  321 + @JsonKey(name: 'source')
  322 + String source;
  323 +
  324 + @JsonKey(name: 'status')
  325 + String status;
  326 +
  327 + @JsonKey(name: 'identity')
  328 + String identity;
  329 +
  330 + @JsonKey(name: 'cdate')
  331 + String cdate;
  332 +
  333 + Cookbooklist(this.id,this.orderid,this.openid,this.cookbookid,this.price,this.cookname,this.cookunit,this.cookimage,this.className,this.classid,this.classOrder,this.fromSoucre,this.source,this.status,this.identity,this.cdate,);
  334 +
  335 + factory Cookbooklist.fromJson(Map<String, dynamic> srcJson) => _$CookbooklistFromJson(srcJson);
  336 +
  337 + Map<String, dynamic> toJson() => _$CookbooklistToJson(this);
  338 +
  339 +}
1 // GENERATED CODE - DO NOT MODIFY BY HAND 1 // GENERATED CODE - DO NOT MODIFY BY HAND
2 2
3 -  
4 part of 'notebook_detail.dart'; 3 part of 'notebook_detail.dart';
5 4
6 -  
7 // ************************************************************************** 5 // **************************************************************************
8 // JsonSerializableGenerator 6 // JsonSerializableGenerator
9 // ************************************************************************** 7 // **************************************************************************
@@ -29,23 +27,26 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) { @@ -29,23 +27,26 @@ NotebookDetail _$NotebookDetailFromJson(Map<String, dynamic> json) {
29 ..channel = json['channel'] as String 27 ..channel = json['channel'] as String
30 ..cdate = json['cdate'] as String 28 ..cdate = json['cdate'] as String
31 ..demands = (json['demands'] as List) 29 ..demands = (json['demands'] as List)
32 - ?.map(  
33 - (e) => e == null ? null : t.Table.fromJson(e as Map<String, dynamic>)) 30 + ?.map((e) =>
  31 + e == null ? null : t.Table.fromJson(e as Map<String, dynamic>))
34 ?.toList() 32 ?.toList()
35 ..tables = (json['tables'] as List) 33 ..tables = (json['tables'] as List)
36 - ?.map(  
37 - (e) => e == null ? null : t.Table.fromJson(e as Map<String, dynamic>)) 34 + ?.map((e) =>
  35 + e == null ? null : t.Table.fromJson(e as Map<String, dynamic>))
38 ?.toList() 36 ?.toList()
39 ..cancel = json['cancel'] == null 37 ..cancel = json['cancel'] == null
40 ? null 38 ? null
41 - : Cancel.fromJson(json['cancel'] as Map<String, dynamic>); 39 + : Cancel.fromJson(json['cancel'] as Map<String, dynamic>)
  40 + ..order = json['order'] == null
  41 + ? null
  42 + : Order.fromJson(json['order'] as Map<String, dynamic>);
42 } 43 }
43 44
44 Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) => 45 Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) =>
45 <String, dynamic>{ 46 <String, dynamic>{
46 'id': instance.id, 47 'id': instance.id,
47 'tableinfo': instance.tableinfo, 48 'tableinfo': instance.tableinfo,
48 - 'abolition':instance.abolition, 49 + 'abolition': instance.abolition,
49 'pnum': instance.pnum, 50 'pnum': instance.pnum,
50 'rname': instance.rname, 51 'rname': instance.rname,
51 'sex': instance.sex, 52 'sex': instance.sex,
@@ -63,7 +64,8 @@ Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) => @@ -63,7 +64,8 @@ Map<String, dynamic> _$NotebookDetailToJson(NotebookDetail instance) =>
63 'cdate': instance.cdate, 64 'cdate': instance.cdate,
64 'demands': instance.demands, 65 'demands': instance.demands,
65 'tables': instance.tables, 66 'tables': instance.tables,
66 - 'cancel': instance.cancel 67 + 'cancel': instance.cancel,
  68 + 'order':instance.order
67 }; 69 };
68 70
69 Cancel _$CancelFromJson(Map<String, dynamic> json) { 71 Cancel _$CancelFromJson(Map<String, dynamic> json) {
@@ -78,3 +80,78 @@ Map<String, dynamic> _$CancelToJson(Cancel instance) => <String, dynamic>{ @@ -78,3 +80,78 @@ Map<String, dynamic> _$CancelToJson(Cancel instance) => <String, dynamic>{
78 'desc': instance.desc, 80 'desc': instance.desc,
79 'cdate': instance.cdate 81 'cdate': instance.cdate
80 }; 82 };
  83 +
  84 +Order _$OrderFromJson(Map<String, dynamic> json) {
  85 + return Order(
  86 + json['id'] as String,
  87 + json['rid'] as String,
  88 + json['no'] as String,
  89 + json['row_num'] as String,
  90 + json['pnum'] as String,
  91 + json['sellerid'] as String,
  92 + json['openid'] as String,
  93 + json['price'] as int,
  94 + json['type'] as String,
  95 + json['behavior'] as String,
  96 + json['cdate'] as String,
  97 + (json['cookbooklist'] as List)
  98 + ?.map((e) => e == null
  99 + ? null
  100 + : Cookbooklist.fromJson(e as Map<String, dynamic>))
  101 + ?.toList());
  102 +}
  103 +
  104 +Map<String, dynamic> _$OrderToJson(Order instance) => <String, dynamic>{
  105 + 'id': instance.id,
  106 + 'rid': instance.rid,
  107 + 'no': instance.no,
  108 + 'row_num': instance.rowNum,
  109 + 'pnum': instance.pnum,
  110 + 'sellerid': instance.sellerid,
  111 + 'openid': instance.openid,
  112 + 'price': instance.price,
  113 + 'type': instance.type,
  114 + 'behavior': instance.behavior,
  115 + 'cdate': instance.cdate,
  116 + 'cookbooklist': instance.cookbooklist
  117 + };
  118 +
  119 +Cookbooklist _$CookbooklistFromJson(Map<String, dynamic> json) {
  120 + return Cookbooklist(
  121 + json['id'] as String,
  122 + json['orderid'] as String,
  123 + json['openid'] as String,
  124 + json['cookbookid'] as String,
  125 + json['price'] as String,
  126 + json['cookname'] as String,
  127 + json['cookunit'] as String,
  128 + json['cookimage'] as String,
  129 + json['class_name'] as String,
  130 + json['classid'] as String,
  131 + json['class_order'] as String,
  132 + json['fromSoucre'] as String,
  133 + json['source'] as String,
  134 + json['status'] as String,
  135 + json['identity'] as String,
  136 + json['cdate'] as String);
  137 +}
  138 +
  139 +Map<String, dynamic> _$CookbooklistToJson(Cookbooklist instance) =>
  140 + <String, dynamic>{
  141 + 'id': instance.id,
  142 + 'orderid': instance.orderid,
  143 + 'openid': instance.openid,
  144 + 'cookbookid': instance.cookbookid,
  145 + 'price': instance.price,
  146 + 'cookname': instance.cookname,
  147 + 'cookunit': instance.cookunit,
  148 + 'cookimage': instance.cookimage,
  149 + 'class_name': instance.className,
  150 + 'classid': instance.classid,
  151 + 'class_order': instance.classOrder,
  152 + 'fromSoucre': instance.fromSoucre,
  153 + 'source': instance.source,
  154 + 'status': instance.status,
  155 + 'identity': instance.identity,
  156 + 'cdate': instance.cdate
  157 + };
  1 +import 'package:json_annotation/json_annotation.dart';
  2 +
  3 +part 'notebook_detail_new.g.dart';
  4 +
  5 +@JsonSerializable()
  6 +class notebook_detail_new extends Object {
  7 + @JsonKey(name: 'ret')
  8 + int ret;
  9 +
  10 + @JsonKey(name: 'data')
  11 + Data data;
  12 +
  13 + @JsonKey(name: 'msg')
  14 + String msg;
  15 +
  16 + notebook_detail_new(
  17 + this.ret,
  18 + this.data,
  19 + this.msg,
  20 + );
  21 +
  22 + factory notebook_detail_new.fromJson(Map<String, dynamic> srcJson) =>
  23 + _$notebook_detail_newFromJson(srcJson);
  24 +
  25 + Map<String, dynamic> toJson() => _$notebook_detail_newToJson(this);
  26 +}
  27 +
  28 +@JsonSerializable()
  29 +class Data extends Object {
  30 + @JsonKey(name: 'id')
  31 + String id;
  32 +
  33 + @JsonKey(name: 'orderid')
  34 + String orderid;
  35 +
  36 + @JsonKey(name: 'openid')
  37 + String openid;
  38 +
  39 + @JsonKey(name: 'sid')
  40 + String sid;
  41 +
  42 + @JsonKey(name: 'room_demand')
  43 + String roomDemand;
  44 +
  45 + @JsonKey(name: 'tid')
  46 + String tid;
  47 +
  48 + @JsonKey(name: 'tableinfo')
  49 + String tableinfo;
  50 +
  51 + @JsonKey(name: 'pnum')
  52 + String pnum;
  53 +
  54 + @JsonKey(name: 'rname')
  55 + String rname;
  56 +
  57 + @JsonKey(name: 'sex')
  58 + String sex;
  59 +
  60 + @JsonKey(name: 'phone')
  61 + String phone;
  62 +
  63 + @JsonKey(name: 'cusdem')
  64 + String cusdem;
  65 +
  66 + @JsonKey(name: 'cusman')
  67 + String cusman;
  68 +
  69 + @JsonKey(name: 'rdate')
  70 + String rdate;
  71 +
  72 + @JsonKey(name: 'edate')
  73 + String edate;
  74 +
  75 + @JsonKey(name: 'vdate')
  76 + String vdate;
  77 +
  78 + @JsonKey(name: 'ddate')
  79 + String ddate;
  80 +
  81 + @JsonKey(name: 'is_set_ddate')
  82 + String isSetDdate;
  83 +
  84 + @JsonKey(name: 'ddate_solt')
  85 + String ddateSolt;
  86 +
  87 + @JsonKey(name: 'status')
  88 + String status;
  89 +
  90 + @JsonKey(name: 'cause')
  91 + String cause;
  92 +
  93 + @JsonKey(name: 'abolition')
  94 + String abolition;
  95 +
  96 + @JsonKey(name: 'action')
  97 + String action;
  98 +
  99 + @JsonKey(name: 'type')
  100 + String type;
  101 +
  102 + @JsonKey(name: 'code')
  103 + String code;
  104 +
  105 + @JsonKey(name: 'note_name')
  106 + String noteName;
  107 +
  108 + @JsonKey(name: 'operator_openid')
  109 + String operatorOpenid;
  110 +
  111 + @JsonKey(name: 'channel')
  112 + String channel;
  113 +
  114 + @JsonKey(name: 'cdate')
  115 + String cdate;
  116 +
  117 + @JsonKey(name: 'seller')
  118 + Seller seller;
  119 +
  120 + @JsonKey(name: 'tables')
  121 + List<Tables> tables;
  122 +
  123 + @JsonKey(name: 'customers')
  124 + List<Customers> customers;
  125 +
  126 + @JsonKey(name: 'cancel')
  127 + Cancel cancel;
  128 +
  129 + @JsonKey(name: 'order')
  130 + Order order;
  131 +
  132 + @JsonKey(name: 'demands')
  133 + List<Demands> demands;
  134 +
  135 + Data(
  136 + this.id,
  137 + this.orderid,
  138 + this.openid,
  139 + this.sid,
  140 + this.roomDemand,
  141 + this.tid,
  142 + this.tableinfo,
  143 + this.pnum,
  144 + this.rname,
  145 + this.sex,
  146 + this.phone,
  147 + this.cusdem,
  148 + this.cusman,
  149 + this.rdate,
  150 + this.edate,
  151 + this.vdate,
  152 + this.ddate,
  153 + this.isSetDdate,
  154 + this.ddateSolt,
  155 + this.status,
  156 + this.cause,
  157 + this.abolition,
  158 + this.action,
  159 + this.type,
  160 + this.code,
  161 + this.noteName,
  162 + this.operatorOpenid,
  163 + this.channel,
  164 + this.cdate,
  165 + this.seller,
  166 + this.tables,
  167 + this.customers,
  168 + this.cancel,
  169 + this.order,
  170 + this.demands,
  171 + );
  172 +
  173 + factory Data.fromJson(Map<String, dynamic> srcJson) =>
  174 + _$DataFromJson(srcJson);
  175 +
  176 + Map<String, dynamic> toJson() => _$DataToJson(this);
  177 +}
  178 +
  179 +@JsonSerializable()
  180 +class Seller extends Object {
  181 + @JsonKey(name: 'id')
  182 + String id;
  183 +
  184 + @JsonKey(name: 'sellername')
  185 + String sellername;
  186 +
  187 + @JsonKey(name: 'seller_image')
  188 + String sellerImage;
  189 +
  190 + @JsonKey(name: 'phone')
  191 + String phone;
  192 +
  193 + @JsonKey(name: 'map_address')
  194 + String mapAddress;
  195 +
  196 + @JsonKey(name: 'isopen_md')
  197 + String isopenMd;
  198 +
  199 + @JsonKey(name: 'lat')
  200 + String lat;
  201 +
  202 + @JsonKey(name: 'long')
  203 + String long;
  204 +
  205 + Seller(
  206 + this.id,
  207 + this.sellername,
  208 + this.sellerImage,
  209 + this.phone,
  210 + this.mapAddress,
  211 + this.isopenMd,
  212 + this.lat,
  213 + this.long,
  214 + );
  215 +
  216 + factory Seller.fromJson(Map<String, dynamic> srcJson) =>
  217 + _$SellerFromJson(srcJson);
  218 +
  219 + Map<String, dynamic> toJson() => _$SellerToJson(this);
  220 +}
  221 +
  222 +@JsonSerializable()
  223 +class Tables extends Object {
  224 + @JsonKey(name: 'id')
  225 + String id;
  226 +
  227 + @JsonKey(name: 'name')
  228 + String name;
  229 +
  230 + @JsonKey(name: 'tid')
  231 + String tid;
  232 +
  233 + @JsonKey(name: 'table_pnum')
  234 + String tablePnum;
  235 +
  236 + @JsonKey(name: 'most_pnum')
  237 + String mostPnum;
  238 +
  239 + @JsonKey(name: 'rid')
  240 + String rid;
  241 +
  242 + @JsonKey(name: 'rname')
  243 + String rname;
  244 +
  245 + Tables(
  246 + this.id,
  247 + this.name,
  248 + this.tid,
  249 + this.tablePnum,
  250 + this.mostPnum,
  251 + this.rid,
  252 + this.rname,
  253 + );
  254 +
  255 + factory Tables.fromJson(Map<String, dynamic> srcJson) =>
  256 + _$TablesFromJson(srcJson);
  257 +
  258 + Map<String, dynamic> toJson() => _$TablesToJson(this);
  259 +}
  260 +
  261 +@JsonSerializable()
  262 +class Customers extends Object {
  263 + @JsonKey(name: 'openid')
  264 + String openid;
  265 +
  266 + @JsonKey(name: 'nickname')
  267 + String nickname;
  268 +
  269 + @JsonKey(name: 'headimgurl')
  270 + String headimgurl;
  271 +
  272 + @JsonKey(name: 'remind_date')
  273 + String remindDate;
  274 +
  275 + Customers(
  276 + this.openid,
  277 + this.nickname,
  278 + this.headimgurl,
  279 + this.remindDate,
  280 + );
  281 +
  282 + factory Customers.fromJson(Map<String, dynamic> srcJson) =>
  283 + _$CustomersFromJson(srcJson);
  284 +
  285 + Map<String, dynamic> toJson() => _$CustomersToJson(this);
  286 +}
  287 +
  288 +@JsonSerializable()
  289 +class Cancel extends Object {
  290 + @JsonKey(name: 'id')
  291 + String id;
  292 +
  293 + @JsonKey(name: 'uid')
  294 + String uid;
  295 +
  296 + @JsonKey(name: 'uname')
  297 + String uname;
  298 +
  299 + @JsonKey(name: 'openid')
  300 + String openid;
  301 +
  302 + @JsonKey(name: 'desc')
  303 + String desc;
  304 +
  305 + @JsonKey(name: 'up_rid')
  306 + String upRid;
  307 +
  308 + @JsonKey(name: 'action_type')
  309 + String actionType;
  310 +
  311 + @JsonKey(name: 'cdate')
  312 + String cdate;
  313 +
  314 + Cancel(
  315 + this.id,
  316 + this.uid,
  317 + this.uname,
  318 + this.openid,
  319 + this.desc,
  320 + this.upRid,
  321 + this.actionType,
  322 + this.cdate,
  323 + );
  324 +
  325 + factory Cancel.fromJson(Map<String, dynamic> srcJson) =>
  326 + _$CancelFromJson(srcJson);
  327 +
  328 + Map<String, dynamic> toJson() => _$CancelToJson(this);
  329 +}
  330 +
  331 +@JsonSerializable()
  332 +class Order extends Object {
  333 + @JsonKey(name: 'id')
  334 + String id;
  335 +
  336 + @JsonKey(name: 'rid')
  337 + String rid;
  338 +
  339 + @JsonKey(name: 'no')
  340 + String no;
  341 +
  342 + @JsonKey(name: 'row_num')
  343 + String rowNum;
  344 +
  345 + @JsonKey(name: 'pnum')
  346 + String pnum;
  347 +
  348 + @JsonKey(name: 'sellerid')
  349 + String sellerid;
  350 +
  351 + @JsonKey(name: 'openid')
  352 + String openid;
  353 +
  354 + @JsonKey(name: 'price')
  355 + int price;
  356 +
  357 + @JsonKey(name: 'type')
  358 + String type;
  359 +
  360 + @JsonKey(name: 'behavior')
  361 + String behavior;
  362 +
  363 + @JsonKey(name: 'cdate')
  364 + String cdate;
  365 +
  366 + @JsonKey(name: 'cookbooklist')
  367 + List<Cookbooklist> cookbooklist;
  368 +
  369 + Order(
  370 + this.id,
  371 + this.rid,
  372 + this.no,
  373 + this.rowNum,
  374 + this.pnum,
  375 + this.sellerid,
  376 + this.openid,
  377 + this.price,
  378 + this.type,
  379 + this.behavior,
  380 + this.cdate,
  381 + this.cookbooklist,
  382 + );
  383 +
  384 + factory Order.fromJson(Map<String, dynamic> srcJson) =>
  385 + _$OrderFromJson(srcJson);
  386 +
  387 + Map<String, dynamic> toJson() => _$OrderToJson(this);
  388 +}
  389 +
  390 +@JsonSerializable()
  391 +class Cookbooklist extends Object {
  392 + @JsonKey(name: 'id')
  393 + String id;
  394 +
  395 + @JsonKey(name: 'orderid')
  396 + String orderid;
  397 +
  398 + @JsonKey(name: 'openid')
  399 + String openid;
  400 +
  401 + @JsonKey(name: 'cookbookid')
  402 + String cookbookid;
  403 +
  404 + @JsonKey(name: 'price')
  405 + String price;
  406 +
  407 + @JsonKey(name: 'cookname')
  408 + String cookname;
  409 +
  410 + @JsonKey(name: 'cookunit')
  411 + String cookunit;
  412 +
  413 + @JsonKey(name: 'cookimage')
  414 + String cookimage;
  415 +
  416 + @JsonKey(name: 'class_name')
  417 + String className;
  418 +
  419 + @JsonKey(name: 'classid')
  420 + String classid;
  421 +
  422 + @JsonKey(name: 'class_order')
  423 + String classOrder;
  424 +
  425 + @JsonKey(name: 'fromSoucre')
  426 + String fromSoucre;
  427 +
  428 + @JsonKey(name: 'source')
  429 + String source;
  430 +
  431 + @JsonKey(name: 'status')
  432 + String status;
  433 +
  434 + @JsonKey(name: 'identity')
  435 + String identity;
  436 +
  437 + @JsonKey(name: 'cdate')
  438 + String cdate;
  439 +
  440 + Cookbooklist(
  441 + this.id,
  442 + this.orderid,
  443 + this.openid,
  444 + this.cookbookid,
  445 + this.price,
  446 + this.cookname,
  447 + this.cookunit,
  448 + this.cookimage,
  449 + this.className,
  450 + this.classid,
  451 + this.classOrder,
  452 + this.fromSoucre,
  453 + this.source,
  454 + this.status,
  455 + this.identity,
  456 + this.cdate,
  457 + );
  458 +
  459 + factory Cookbooklist.fromJson(Map<String, dynamic> srcJson) =>
  460 + _$CookbooklistFromJson(srcJson);
  461 +
  462 + Map<String, dynamic> toJson() => _$CookbooklistToJson(this);
  463 +}
  464 +
  465 +@JsonSerializable()
  466 +class Demands extends Object {
  467 + @JsonKey(name: 'id')
  468 + String id;
  469 +
  470 + @JsonKey(name: 'sellerid')
  471 + String sellerid;
  472 +
  473 + @JsonKey(name: 'name')
  474 + String name;
  475 +
  476 + @JsonKey(name: 'standard')
  477 + String standard;
  478 +
  479 + @JsonKey(name: 'status')
  480 + String status;
  481 +
  482 + @JsonKey(name: 'cdate')
  483 + String cdate;
  484 +
  485 + Demands(
  486 + this.id,
  487 + this.sellerid,
  488 + this.name,
  489 + this.standard,
  490 + this.status,
  491 + this.cdate,
  492 + );
  493 +
  494 + factory Demands.fromJson(Map<String, dynamic> srcJson) =>
  495 + _$DemandsFromJson(srcJson);
  496 +
  497 + Map<String, dynamic> toJson() => _$DemandsToJson(this);
  498 +}
  1 +// GENERATED CODE - DO NOT MODIFY BY HAND
  2 +
  3 +part of 'notebook_detail_new.dart';
  4 +
  5 +// **************************************************************************
  6 +// JsonSerializableGenerator
  7 +// **************************************************************************
  8 +
  9 +notebook_detail_new _$notebook_detail_newFromJson(Map<String, dynamic> json) {
  10 + return notebook_detail_new(
  11 + json['ret'] as int,
  12 + json['data'] == null
  13 + ? null
  14 + : Data.fromJson(json['data'] as Map<String, dynamic>),
  15 + json['msg'] as String);
  16 +}
  17 +
  18 +Map<String, dynamic> _$notebook_detail_newToJson(
  19 + notebook_detail_new instance) =>
  20 + <String, dynamic>{
  21 + 'ret': instance.ret,
  22 + 'data': instance.data,
  23 + 'msg': instance.msg
  24 + };
  25 +
  26 +Data _$DataFromJson(Map<String, dynamic> json) {
  27 + return Data(
  28 + json['id'] as String,
  29 + json['orderid'] as String,
  30 + json['openid'] as String,
  31 + json['sid'] as String,
  32 + json['room_demand'] as String,
  33 + json['tid'] as String,
  34 + json['tableinfo'] as String,
  35 + json['pnum'] as String,
  36 + json['rname'] as String,
  37 + json['sex'] as String,
  38 + json['phone'] as String,
  39 + json['cusdem'] as String,
  40 + json['cusman'] as String,
  41 + json['rdate'] as String,
  42 + json['edate'] as String,
  43 + json['vdate'] as String,
  44 + json['ddate'] as String,
  45 + json['is_set_ddate'] as String,
  46 + json['ddate_solt'] as String,
  47 + json['status'] as String,
  48 + json['cause'] as String,
  49 + json['abolition'] as String,
  50 + json['action'] as String,
  51 + json['type'] as String,
  52 + json['code'] as String,
  53 + json['note_name'] as String,
  54 + json['operator_openid'] as String,
  55 + json['channel'] as String,
  56 + json['cdate'] as String,
  57 + json['seller'] == null
  58 + ? null
  59 + : Seller.fromJson(json['seller'] as Map<String, dynamic>),
  60 + (json['tables'] as List)
  61 + ?.map((e) =>
  62 + e == null ? null : Tables.fromJson(e as Map<String, dynamic>))
  63 + ?.toList(),
  64 + (json['customers'] as List)
  65 + ?.map((e) =>
  66 + e == null ? null : Customers.fromJson(e as Map<String, dynamic>))
  67 + ?.toList(),
  68 + json['cancel'] == null
  69 + ? null
  70 + : Cancel.fromJson(json['cancel'] as Map<String, dynamic>),
  71 + json['order'] == null
  72 + ? null
  73 + : Order.fromJson(json['order'] as Map<String, dynamic>),
  74 + (json['demands'] as List)
  75 + ?.map((e) =>
  76 + e == null ? null : Demands.fromJson(e as Map<String, dynamic>))
  77 + ?.toList());
  78 +}
  79 +
  80 +Map<String, dynamic> _$DataToJson(Data instance) => <String, dynamic>{
  81 + 'id': instance.id,
  82 + 'orderid': instance.orderid,
  83 + 'openid': instance.openid,
  84 + 'sid': instance.sid,
  85 + 'room_demand': instance.roomDemand,
  86 + 'tid': instance.tid,
  87 + 'tableinfo': instance.tableinfo,
  88 + 'pnum': instance.pnum,
  89 + 'rname': instance.rname,
  90 + 'sex': instance.sex,
  91 + 'phone': instance.phone,
  92 + 'cusdem': instance.cusdem,
  93 + 'cusman': instance.cusman,
  94 + 'rdate': instance.rdate,
  95 + 'edate': instance.edate,
  96 + 'vdate': instance.vdate,
  97 + 'ddate': instance.ddate,
  98 + 'is_set_ddate': instance.isSetDdate,
  99 + 'ddate_solt': instance.ddateSolt,
  100 + 'status': instance.status,
  101 + 'cause': instance.cause,
  102 + 'abolition': instance.abolition,
  103 + 'action': instance.action,
  104 + 'type': instance.type,
  105 + 'code': instance.code,
  106 + 'note_name': instance.noteName,
  107 + 'operator_openid': instance.operatorOpenid,
  108 + 'channel': instance.channel,
  109 + 'cdate': instance.cdate,
  110 + 'seller': instance.seller,
  111 + 'tables': instance.tables,
  112 + 'customers': instance.customers,
  113 + 'cancel': instance.cancel,
  114 + 'order': instance.order,
  115 + 'demands': instance.demands
  116 + };
  117 +
  118 +Seller _$SellerFromJson(Map<String, dynamic> json) {
  119 + return Seller(
  120 + json['id'] as String,
  121 + json['sellername'] as String,
  122 + json['seller_image'] as String,
  123 + json['phone'] as String,
  124 + json['map_address'] as String,
  125 + json['isopen_md'] as String,
  126 + json['lat'] as String,
  127 + json['long'] as String);
  128 +}
  129 +
  130 +Map<String, dynamic> _$SellerToJson(Seller instance) => <String, dynamic>{
  131 + 'id': instance.id,
  132 + 'sellername': instance.sellername,
  133 + 'seller_image': instance.sellerImage,
  134 + 'phone': instance.phone,
  135 + 'map_address': instance.mapAddress,
  136 + 'isopen_md': instance.isopenMd,
  137 + 'lat': instance.lat,
  138 + 'long': instance.long
  139 + };
  140 +
  141 +Tables _$TablesFromJson(Map<String, dynamic> json) {
  142 + return Tables(
  143 + json['id'] as String,
  144 + json['name'] as String,
  145 + json['tid'] as String,
  146 + json['table_pnum'] as String,
  147 + json['most_pnum'] as String,
  148 + json['rid'] as String,
  149 + json['rname'] as String);
  150 +}
  151 +
  152 +Map<String, dynamic> _$TablesToJson(Tables instance) => <String, dynamic>{
  153 + 'id': instance.id,
  154 + 'name': instance.name,
  155 + 'tid': instance.tid,
  156 + 'table_pnum': instance.tablePnum,
  157 + 'most_pnum': instance.mostPnum,
  158 + 'rid': instance.rid,
  159 + 'rname': instance.rname
  160 + };
  161 +
  162 +Customers _$CustomersFromJson(Map<String, dynamic> json) {
  163 + return Customers(json['openid'] as String, json['nickname'] as String,
  164 + json['headimgurl'] as String, json['remind_date'] as String);
  165 +}
  166 +
  167 +Map<String, dynamic> _$CustomersToJson(Customers instance) => <String, dynamic>{
  168 + 'openid': instance.openid,
  169 + 'nickname': instance.nickname,
  170 + 'headimgurl': instance.headimgurl,
  171 + 'remind_date': instance.remindDate
  172 + };
  173 +
  174 +Cancel _$CancelFromJson(Map<String, dynamic> json) {
  175 + return Cancel(
  176 + json['id'] as String,
  177 + json['uid'] as String,
  178 + json['uname'] as String,
  179 + json['openid'] as String,
  180 + json['desc'] as String,
  181 + json['up_rid'] as String,
  182 + json['action_type'] as String,
  183 + json['cdate'] as String);
  184 +}
  185 +
  186 +Map<String, dynamic> _$CancelToJson(Cancel instance) => <String, dynamic>{
  187 + 'id': instance.id,
  188 + 'uid': instance.uid,
  189 + 'uname': instance.uname,
  190 + 'openid': instance.openid,
  191 + 'desc': instance.desc,
  192 + 'up_rid': instance.upRid,
  193 + 'action_type': instance.actionType,
  194 + 'cdate': instance.cdate
  195 + };
  196 +
  197 +Order _$OrderFromJson(Map<String, dynamic> json) {
  198 + return Order(
  199 + json['id'] as String,
  200 + json['rid'] as String,
  201 + json['no'] as String,
  202 + json['row_num'] as String,
  203 + json['pnum'] as String,
  204 + json['sellerid'] as String,
  205 + json['openid'] as String,
  206 + json['price'] as int,
  207 + json['type'] as String,
  208 + json['behavior'] as String,
  209 + json['cdate'] as String,
  210 + (json['cookbooklist'] as List)
  211 + ?.map((e) => e == null
  212 + ? null
  213 + : Cookbooklist.fromJson(e as Map<String, dynamic>))
  214 + ?.toList());
  215 +}
  216 +
  217 +Map<String, dynamic> _$OrderToJson(Order instance) => <String, dynamic>{
  218 + 'id': instance.id,
  219 + 'rid': instance.rid,
  220 + 'no': instance.no,
  221 + 'row_num': instance.rowNum,
  222 + 'pnum': instance.pnum,
  223 + 'sellerid': instance.sellerid,
  224 + 'openid': instance.openid,
  225 + 'price': instance.price,
  226 + 'type': instance.type,
  227 + 'behavior': instance.behavior,
  228 + 'cdate': instance.cdate,
  229 + 'cookbooklist': instance.cookbooklist
  230 + };
  231 +
  232 +Cookbooklist _$CookbooklistFromJson(Map<String, dynamic> json) {
  233 + return Cookbooklist(
  234 + json['id'] as String,
  235 + json['orderid'] as String,
  236 + json['openid'] as String,
  237 + json['cookbookid'] as String,
  238 + json['price'] as String,
  239 + json['cookname'] as String,
  240 + json['cookunit'] as String,
  241 + json['cookimage'] as String,
  242 + json['class_name'] as String,
  243 + json['classid'] as String,
  244 + json['class_order'] as String,
  245 + json['fromSoucre'] as String,
  246 + json['source'] as String,
  247 + json['status'] as String,
  248 + json['identity'] as String,
  249 + json['cdate'] as String);
  250 +}
  251 +
  252 +Map<String, dynamic> _$CookbooklistToJson(Cookbooklist instance) =>
  253 + <String, dynamic>{
  254 + 'id': instance.id,
  255 + 'orderid': instance.orderid,
  256 + 'openid': instance.openid,
  257 + 'cookbookid': instance.cookbookid,
  258 + 'price': instance.price,
  259 + 'cookname': instance.cookname,
  260 + 'cookunit': instance.cookunit,
  261 + 'cookimage': instance.cookimage,
  262 + 'class_name': instance.className,
  263 + 'classid': instance.classid,
  264 + 'class_order': instance.classOrder,
  265 + 'fromSoucre': instance.fromSoucre,
  266 + 'source': instance.source,
  267 + 'status': instance.status,
  268 + 'identity': instance.identity,
  269 + 'cdate': instance.cdate
  270 + };
  271 +
  272 +Demands _$DemandsFromJson(Map<String, dynamic> json) {
  273 + return Demands(
  274 + json['id'] as String,
  275 + json['sellerid'] as String,
  276 + json['name'] as String,
  277 + json['standard'] as String,
  278 + json['status'] as String,
  279 + json['cdate'] as String);
  280 +}
  281 +
  282 +Map<String, dynamic> _$DemandsToJson(Demands instance) => <String, dynamic>{
  283 + 'id': instance.id,
  284 + 'sellerid': instance.sellerid,
  285 + 'name': instance.name,
  286 + 'standard': instance.standard,
  287 + 'status': instance.status,
  288 + 'cdate': instance.cdate
  289 + };
@@ -47,15 +47,20 @@ class HttpUrl { @@ -47,15 +47,20 @@ class HttpUrl {
47 static const String set_order_time = 47 static const String set_order_time =
48 "?service=App.Seller.SetReOrderTime"; //在线预订配置-接单时间 48 "?service=App.Seller.SetReOrderTime"; //在线预订配置-接单时间
49 49
50 - static const String get_custom_remark= 50 + static const String get_custom_remark =
51 "?service=App.User.GetCustomRemark"; //获取常用备注 51 "?service=App.User.GetCustomRemark"; //获取常用备注
52 52
53 - static const String del_custom_remark= 53 + static const String del_custom_remark =
54 "?service=App.User.DelCustomRemark"; //删除常用备注 54 "?service=App.User.DelCustomRemark"; //删除常用备注
55 55
56 - static const String add_custom_remark= 56 + static const String add_custom_remark =
57 "?service=App.User.AddCustomRemark"; //添加常用备注 57 "?service=App.User.AddCustomRemark"; //添加常用备注
58 58
59 - static const String get_reserve_user= 59 + static const String get_reserve_user =
60 "?service=App.Reserve.GetReserveUser"; //获取历史录入联系人 60 "?service=App.Reserve.GetReserveUser"; //获取历史录入联系人
  61 +
  62 + static const String get_order_food =
  63 + "?service=App.Advance.CreateOrder"; //顾客扫桌码点餐-扫码创建订单
  64 + static const String get_reserve_detail =
  65 + "?service=App.Reserve.Detail"; //订座详情页面
61 } 66 }
@@ -184,7 +184,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -184,7 +184,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
184 await detailModel.setReserveStatus(context, params, ifPush: false); 184 await detailModel.setReserveStatus(context, params, ifPush: false);
185 if (success) { 185 if (success) {
186 bus.emit("refresh_book_list"); 186 bus.emit("refresh_book_list");
187 - if(status=="4"){//取消预订 187 + if (status == "4") {
  188 + //取消预订
188 bus.emit("refresh_tablemanager"); //刷新桌位 189 bus.emit("refresh_tablemanager"); //刷新桌位
189 } 190 }
190 _getReserveDetail(); 191 _getReserveDetail();
@@ -192,15 +193,26 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -192,15 +193,26 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
192 } 193 }
193 194
194 /// 取消预订, 变更预订按钮 195 /// 取消预订, 变更预订按钮
195 - Widget _cancelAndChangeBtn(GestureTapCallback onTap, String title) { 196 + Widget _cancelAndChangeBtn(GestureTapCallback onTap, String title,
  197 + {Color bgColor = MyColours.color_ffffff,
  198 + double width,
  199 + Color fontColor = MyColours.color_199095}) {
196 return InkWell( 200 return InkWell(
197 onTap: onTap, 201 onTap: onTap,
198 - child: Align(  
199 - alignment: Alignment.center,  
200 - child: Text(title,  
201 - style: TextStyle(  
202 - color: MyColours.color_199095,  
203 - fontSize: ScreenUtil().setSp(34))), 202 + child: Container(
  203 + width: width,
  204 + decoration: BoxDecoration(
  205 + color: bgColor,
  206 + border: Border.all(
  207 + color: Colors.transparent, width: ScreenUtil().setWidth(2)),
  208 + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)),
  209 + ),
  210 + child: Align(
  211 + alignment: Alignment.center,
  212 + child: Text(title,
  213 + style: TextStyle(
  214 + color: fontColor, fontSize: ScreenUtil().setSp(34))),
  215 + ),
204 ), 216 ),
205 ); 217 );
206 } 218 }
@@ -681,68 +693,108 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -681,68 +693,108 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
681 )), 693 )),
682 ), 694 ),
683 Offstage( 695 Offstage(
684 - offstage: (detailEntity.status == "3" ||  
685 - detailEntity.status == "4" ||  
686 - detailEntity.status == "6")  
687 - ? true  
688 - : false,  
689 - child: Container(  
690 - width: double.infinity,  
691 - decoration: BoxDecoration(  
692 - color: MyColours.color_ffffff,  
693 - border: Border(  
694 - top: BorderSide(  
695 - color: MyColours.color_dbe3e3,  
696 - width: ScreenUtil().setWidth(1)))),  
697 - padding: EdgeInsets.fromLTRB(  
698 - ScreenUtil().setHeight(40),  
699 - ScreenUtil().setHeight(40),  
700 - ScreenUtil().setHeight(40),  
701 - ScreenUtil().setHeight(0)),  
702 - margin: EdgeInsets.symmetric(  
703 - vertical: ScreenUtil().setHeight(20)),  
704 - child: CommonButton(  
705 - content: "通知客户",  
706 - width: 669,  
707 - height: 84,  
708 - fontSize: 34,  
709 - onPress: () {  
710 - DialogUtil.showShareDialog(context)  
711 - ?.then((value) {  
712 - switch (value) {  
713 - case 1: //微信  
714 - NavigatorUtil.goInvicationPage(  
715 - context,  
716 - detailEntity.id,  
717 - detailEntity.tableinfoStr,  
718 - detailEntity.ddate,  
719 - detailEntity.ddateStr,  
720 - detailEntity.phone  
721 - );  
722 - break;  
723 - case 2: //短信  
724 - if(detailEntity.phone == null ||  
725 - detailEntity.phone.isEmpty){  
726 - Utils.showToast("没有预订人电话信息");  
727 - return;  
728 - }  
729 - NavigatorUtil.goSmsPage(  
730 - context, detailEntity.id);  
731 - break;  
732 - case 3: //电话  
733 - if (detailEntity.phone != null &&  
734 - detailEntity.phone.isNotEmpty) {  
735 - Utils.goPhone(detailEntity.phone);  
736 - } else {  
737 - Utils.showToast("没有预订人电话信息");  
738 - }  
739 - break;  
740 - }  
741 - });  
742 - },  
743 - ),  
744 - ),  
745 - ), 696 + offstage: (detailEntity.status == "3" ||
  697 + detailEntity.status == "4" ||
  698 + detailEntity.status == "6"),
  699 + child: Container(
  700 + width: double.infinity,
  701 + height: ScreenUtil().setWidth(84),
  702 + decoration: BoxDecoration(
  703 + color: MyColours.color_199095,
  704 + borderRadius: BorderRadius.circular(
  705 + ScreenUtil().setWidth(10)),
  706 + ),
  707 + margin: EdgeInsets.symmetric(
  708 + vertical: ScreenUtil().setHeight(20),
  709 + horizontal: ScreenUtil().setHeight(40)),
  710 + child: Row(
  711 + children: [
  712 + Offstage(
  713 + offstage: (detailEntity.status == "3" ||
  714 + detailEntity.status == "4" ||
  715 + detailEntity.status == "6")
  716 + ? true
  717 + : false,
  718 + child: _cancelAndChangeBtn(() {
  719 + DialogUtil.showShareDialog(context)
  720 + ?.then((value) {
  721 + switch (value) {
  722 + case 1: //微信
  723 + NavigatorUtil.goInvicationPage(
  724 + context,
  725 + detailEntity.id,
  726 + detailEntity.tableinfoStr,
  727 + detailEntity.ddate,
  728 + detailEntity.ddateStr,
  729 + detailEntity.phone);
  730 + break;
  731 + case 2: //短信
  732 + if (detailEntity.phone == null ||
  733 + detailEntity.phone.isEmpty) {
  734 + Utils.showToast("没有预订人电话信息");
  735 + return;
  736 + }
  737 + NavigatorUtil.goSmsPage(
  738 + context, detailEntity.id);
  739 + break;
  740 + case 3: //电话
  741 + if (detailEntity.phone != null &&
  742 + detailEntity
  743 + .phone.isNotEmpty) {
  744 + Utils.goPhone(
  745 + detailEntity.phone);
  746 + } else {
  747 + Utils.showToast("没有预订人电话信息");
  748 + }
  749 + break;
  750 + }
  751 + });
  752 + }, "通知客户",
  753 + bgColor: MyColours.color_199095,
  754 + width: detailEntity.order.cookbooklist
  755 + .length ==
  756 + 0
  757 + ? ScreenUtil.screenWidthDp -
  758 + ScreenUtil().setWidth(91)
  759 + : (ScreenUtil.screenWidthDp -
  760 + ScreenUtil()
  761 + .setWidth(91)) /
  762 + 2,
  763 + fontColor: MyColours.color_ffffff)),
  764 + Offstage(
  765 + offstage: !(detailEntity
  766 + .order.cookbooklist.length >
  767 + 0 &&
  768 + (detailEntity.status != "3" &&
  769 + detailEntity.status != "4" &&
  770 + detailEntity.status != "6")),
  771 + child: MyDivider(ScreenUtil().setWidth(2),
  772 + ScreenUtil().setWidth(50),
  773 + color: MyColours.color_ffffff)),
  774 + Offstage(
  775 + offstage: detailEntity
  776 + .order.cookbooklist.length ==
  777 + 0
  778 + ? true
  779 + : false,
  780 + child: _cancelAndChangeBtn(() {
  781 + NavigatorUtil.goHasOrderFoodPage(
  782 + context,
  783 + rid: detailEntity.id);
  784 + }, '查看菜品',
  785 + bgColor: MyColours.color_199095,
  786 + width: (detailEntity.status == "3" ||
  787 + detailEntity.status == "4" ||
  788 + detailEntity.status == "6")
  789 + ? ScreenUtil.screenWidthDp -
  790 + ScreenUtil().setWidth(91)
  791 + : (ScreenUtil.screenWidthDp -
  792 + ScreenUtil()
  793 + .setWidth(91)) /
  794 + 2,
  795 + fontColor: MyColours.color_ffffff))
  796 + ],
  797 + ))),
746 Offstage( 798 Offstage(
747 offstage: (detailEntity.status == "3" || 799 offstage: (detailEntity.status == "3" ||
748 detailEntity.status == "4" || 800 detailEntity.status == "4" ||
1 import 'package:cached_network_image/cached_network_image.dart'; 1 import 'package:cached_network_image/cached_network_image.dart';
  2 +import 'package:common_utils/common_utils.dart';
2 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
3 import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 import 'package:flutter_screenutil/flutter_screenutil.dart';
  5 +import 'package:one_key/constant/state.dart';
  6 +import 'package:one_key/provider/order_food_provider.dart';
  7 +import 'package:one_key/provider/user_model.dart';
4 import 'package:one_key/res/colors.dart'; 8 import 'package:one_key/res/colors.dart';
5 import 'package:one_key/utils/utils.dart'; 9 import 'package:one_key/utils/utils.dart';
  10 +import 'package:one_key/widgets/MyDivider.dart';
6 import 'package:one_key/widgets/h_empty_view.dart'; 11 import 'package:one_key/widgets/h_empty_view.dart';
  12 +import 'package:one_key/widgets/page_exception.dart';
  13 +import 'package:one_key/widgets/round_button.dart';
7 import 'package:one_key/widgets/system_app_bar.dart'; 14 import 'package:one_key/widgets/system_app_bar.dart';
  15 +import 'package:one_key/widgets/v_empty_view.dart';
  16 +import 'package:provider/provider.dart';
8 import 'package:scrollable_positioned_list/scrollable_positioned_list.dart'; 17 import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
9 18
10 -class MessageOrderMenuPage extends StatefulWidget {  
11 - MessageOrderMenuPage({Key key}) : super(key: key); 19 +class MessageHasOrderFoodPage extends StatefulWidget {
  20 + final String rid;
  21 + MessageHasOrderFoodPage({Key key, this.rid}) : super(key: key);
12 22
13 @override 23 @override
14 - _MessageOrderMenuPageState createState() => _MessageOrderMenuPageState(); 24 + _MessageHasOrderFoodPageState createState() =>
  25 + _MessageHasOrderFoodPageState();
15 } 26 }
16 27
17 -class _MessageOrderMenuPageState extends State<MessageOrderMenuPage> { 28 +class _MessageHasOrderFoodPageState extends State<MessageHasOrderFoodPage> {
18 final ItemScrollController itemScrollController = ItemScrollController(); 29 final ItemScrollController itemScrollController = ItemScrollController();
19 final ItemPositionsListener itemPositionsListener = 30 final ItemPositionsListener itemPositionsListener =
20 ItemPositionsListener.create(); 31 ItemPositionsListener.create();
  32 + OrderFoodProvider _orderFoodProvider;
  33 + @override
  34 + void initState() {
  35 + super.initState();
  36 + WidgetsBinding.instance.addPostFrameCallback((_) {
  37 + _getOrderFoodData();
  38 + });
  39 + }
  40 +
  41 + ///接口获取菜单信息
  42 + _getOrderFoodData() async {
  43 + Map<String, String> params = {
  44 + 'rid': widget.rid,
  45 + 'status': '1',
  46 + 'identity': '2'
  47 + };
  48 + await _orderFoodProvider.getOrderFoodData(context, params);
  49 + }
  50 +
  51 + ///接口获取桌位信息
  52 + _getTableInfoData() async {
  53 + UserModel userModel = Provider.of<UserModel>(context, listen: false);
  54 + Map<String, String> params = {
  55 + "uid": userModel.user.openid,
  56 + "rid": widget.rid
  57 + };
  58 + //明天完成 桌位名称信息
  59 + await _orderFoodProvider.getTableInfoData(context, params);
  60 + }
  61 +
  62 +//人数、桌位、订单编号、下单时间
  63 + Widget _getRow(String leftTitle, String rightTitle) {
  64 + return Row(
  65 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  66 + children: [
  67 + Text(leftTitle,
  68 + style: TextStyle(
  69 + color: MyColours.color_999999,
  70 + fontSize: ScreenUtil().setSp(30))),
  71 + Text(rightTitle,
  72 + style: TextStyle(
  73 + color: MyColours.color_333333,
  74 + fontSize: ScreenUtil().setSp(30))),
  75 + ],
  76 + );
  77 + }
  78 +
21 Widget list(List data) => ScrollablePositionedList.builder( 79 Widget list(List data) => ScrollablePositionedList.builder(
22 - itemCount: data.length,  
23 - itemBuilder: (context, index) => item(index), 80 + itemCount: data.length + 1,
  81 + itemBuilder: (context, index) {
  82 + if (index == data.length) {
  83 + return Column(
  84 + crossAxisAlignment: CrossAxisAlignment.end,
  85 + children: [
  86 + VEmptyView(40),
  87 + Padding(
  88 + padding: EdgeInsets.symmetric(
  89 + horizontal: ScreenUtil().setWidth(40)),
  90 + child: MyDivider(
  91 + double.infinity,
  92 + ScreenUtil().setWidth(2),
  93 + color: MyColours.color_F0F0F0,
  94 + ),
  95 + ),
  96 + VEmptyView(40),
  97 + Padding(
  98 + padding: EdgeInsets.symmetric(
  99 + horizontal: ScreenUtil().setWidth(40)),
  100 + child: Text(
  101 + '共计: ¥${_orderFoodProvider.createdOrderSunModel.price}',
  102 + textAlign: TextAlign.right,
  103 + style: TextStyle(
  104 + fontSize: ScreenUtil().setSp(34),
  105 + color: MyColours.color_333333,
  106 + fontWeight: FontWeight.bold),
  107 + )),
  108 + VEmptyView(40),
  109 + Container(
  110 + width: double.infinity,
  111 + height: ScreenUtil().setWidth(20),
  112 + color: MyColours.color_f5f5f5),
  113 + Container(
  114 + padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
  115 + child: Column(
  116 + children: [
  117 + _getRow(
  118 + '人数', _orderFoodProvider.createdOrderSunModel.pnum),
  119 + VEmptyView(30),
  120 + _getRow('桌位', 'ffff')
  121 + ],
  122 + ),
  123 + ),
  124 + Container(
  125 + width: double.infinity,
  126 + height: ScreenUtil().setWidth(20),
  127 + color: MyColours.color_f5f5f5),
  128 + Container(
  129 + padding: EdgeInsets.all(ScreenUtil().setWidth(40)),
  130 + child: Column(
  131 + children: [
  132 + _getRow(
  133 + '订单编号', _orderFoodProvider.createdOrderSunModel.no),
  134 + VEmptyView(30),
  135 + _getRow(
  136 + '下单时间',
  137 + DateUtil.formatDate(
  138 + DateTime.fromMillisecondsSinceEpoch(int.parse(
  139 + _orderFoodProvider
  140 + .createdOrderSunModel.cdate) *
  141 + 1000),
  142 + format: DateFormats.y_mo_d))
  143 + ],
  144 + ),
  145 + ),
  146 + ],
  147 + );
  148 + }
  149 + return Padding(
  150 + padding:
  151 + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(40)),
  152 + child: item(index));
  153 + },
24 itemScrollController: itemScrollController, 154 itemScrollController: itemScrollController,
25 itemPositionsListener: itemPositionsListener, 155 itemPositionsListener: itemPositionsListener,
26 reverse: false, 156 reverse: false,
27 scrollDirection: Axis.vertical, 157 scrollDirection: Axis.vertical,
28 ); 158 );
  159 +
29 Widget item(int i) { 160 Widget item(int i) {
30 return Container( 161 return Container(
31 - // height: ScreenUtil().setWidth(30 * 2) *  
32 - // _storeMenuProvider.menulist[i].cookbooklist.length +  
33 - // ScreenUtil().setWidth(20 * 2),  
34 - height: ScreenUtil().setWidth(50 * 2), 162 + color: MyColours.color_ffffff,
  163 + height: ScreenUtil().setWidth(50 * 2) *
  164 + _orderFoodProvider
  165 + .orderList[i][_orderFoodProvider.orderList[i].keys.first]
  166 + .length +
  167 + ScreenUtil().setWidth(40 * 2 + 20),
35 child: Column( 168 child: Column(
36 children: [ 169 children: [
37 Container( 170 Container(
38 alignment: Alignment.centerLeft, 171 alignment: Alignment.centerLeft,
  172 + margin: EdgeInsets.only(top: ScreenUtil().setWidth(20)),
39 height: ScreenUtil().setWidth(40 * 2), 173 height: ScreenUtil().setWidth(40 * 2),
40 - child: Text('10道必点菜', 174 + child: Text(_orderFoodProvider.orderList[i].keys.first,
41 style: TextStyle( 175 style: TextStyle(
42 fontSize: ScreenUtil().setWidth(30), 176 fontSize: ScreenUtil().setWidth(30),
43 color: MyColours.color_999999)), 177 color: MyColours.color_999999)),
44 ), 178 ),
45 Container( 179 Container(
46 - height: ScreenUtil().setWidth(50 * 2) * 2, 180 + height: ScreenUtil().setWidth(50 * 2) *
  181 + _orderFoodProvider
  182 + .orderList[i]
  183 + [_orderFoodProvider.orderList[i].keys.first]
  184 + .length,
47 child: ListView.builder( 185 child: ListView.builder(
48 shrinkWrap: true, 186 shrinkWrap: true,
49 physics: NeverScrollableScrollPhysics(), 187 physics: NeverScrollableScrollPhysics(),
50 - itemCount: 2, 188 + itemCount: _orderFoodProvider
  189 + .orderList[i]
  190 + [_orderFoodProvider.orderList[i].keys.first]
  191 + .length,
51 itemBuilder: (BuildContext context, int index) { 192 itemBuilder: (BuildContext context, int index) {
52 - return Row(  
53 - children: [  
54 - ClipRRect(  
55 - borderRadius: BorderRadius.circular(  
56 - ScreenUtil().setWidth(30)),  
57 - child: CachedNetworkImage(  
58 - // placeholder: (context, url) =>  
59 - // new CircularProgressIndicator(),  
60 - // errorWidget: (context, url, error) => new Icon(Icons.error),  
61 - imageUrl:  
62 - 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=1091405991,859863778&fm=26&gp=0.jpg',  
63 - fit: BoxFit.cover,  
64 - width: ScreenUtil().setWidth(30 * 2),  
65 - height: ScreenUtil().setWidth(30 * 2), 193 + return Container(
  194 + height: ScreenUtil().setWidth(50 * 2),
  195 + child: Row(
  196 + children: [
  197 + ClipRRect(
  198 + borderRadius: BorderRadius.circular(
  199 + ScreenUtil().setWidth(30)),
  200 + child: _orderFoodProvider
  201 + .orderList[i][_orderFoodProvider
  202 + .orderList[i]
  203 + .keys
  204 + .first][index]
  205 + .cookimage ==
  206 + null ||
  207 + _orderFoodProvider
  208 + .orderList[i][_orderFoodProvider
  209 + .orderList[i]
  210 + .keys
  211 + .first][index]
  212 + .cookimage ==
  213 + ''
  214 + ? Image.asset(Utils.getImgPath('menu_place'),
  215 + width: ScreenUtil().setWidth(30 * 2),
  216 + height: ScreenUtil().setWidth(30 * 2))
  217 + : CachedNetworkImage(
  218 + // placeholder: (context, url) =>
  219 + // new CircularProgressIndicator(),
  220 + // errorWidget: (context, url, error) => new Icon(Icons.error),
  221 + imageUrl: _orderFoodProvider
  222 + .orderList[i][_orderFoodProvider
  223 + .orderList[i].keys.first][index]
  224 + .cookimage,
  225 + fit: BoxFit.cover,
  226 + width: ScreenUtil().setWidth(30 * 2),
  227 + height: ScreenUtil().setWidth(30 * 2),
  228 + ),
  229 + ),
  230 + HEmptyView(20),
  231 + Container(
  232 + width: ScreenUtil().setWidth(150 * 2),
  233 + child: Text(
  234 + _orderFoodProvider
  235 + .orderList[i][_orderFoodProvider
  236 + .orderList[i].keys.first][index]
  237 + .cookname,
  238 + style: TextStyle(
  239 + color: MyColours.color_333333,
  240 + fontSize: ScreenUtil().setWidth(30)),
  241 + )),
  242 + HEmptyView(20),
  243 + Spacer(),
  244 + Text(
  245 + '¥' +
  246 + _orderFoodProvider
  247 + .orderList[i][_orderFoodProvider
  248 + .orderList[i].keys.first][index]
  249 + .price +
  250 + '/' +
  251 + _orderFoodProvider
  252 + .orderList[i][_orderFoodProvider
  253 + .orderList[i].keys.first][index]
  254 + .cookunit,
  255 + style: TextStyle(
  256 + color: MyColours.color_333333,
  257 + fontSize: ScreenUtil().setWidth(30)),
  258 + ),
  259 + HEmptyView(40),
  260 + Text(
  261 + 'x' +
  262 + _orderFoodProvider
  263 + .orderList[i][_orderFoodProvider
  264 + .orderList[i].keys.first][index]
  265 + .number,
  266 + style: TextStyle(
  267 + color: MyColours.color_333333,
  268 + fontSize: ScreenUtil().setWidth(30)),
66 ), 269 ),
67 - ),  
68 - HEmptyView(20),  
69 - Expanded(  
70 - child: Text(  
71 - '红烧狮子头',  
72 - style: TextStyle(  
73 - color: MyColours.color_333333,  
74 - fontSize: ScreenUtil().setWidth(30)),  
75 - )),  
76 - HEmptyView(20),  
77 - ], 270 + ],
  271 + ),
78 ); 272 );
79 })), 273 })),
80 ], 274 ],
@@ -83,9 +277,48 @@ class _MessageOrderMenuPageState extends State<MessageOrderMenuPage> { @@ -83,9 +277,48 @@ class _MessageOrderMenuPageState extends State<MessageOrderMenuPage> {
83 277
84 @override 278 @override
85 Widget build(BuildContext context) { 279 Widget build(BuildContext context) {
  280 + _orderFoodProvider = Provider.of<OrderFoodProvider>(context, listen: true);
86 return Scaffold( 281 return Scaffold(
  282 + backgroundColor: MyColours.color_ffffff,
87 appBar: SystemAppBar('已点菜品'), 283 appBar: SystemAppBar('已点菜品'),
88 - // body: list(data), 284 + body: Consumer<OrderFoodProvider>(
  285 + builder: (context, model, _) {
  286 + if (model.pageState != PageState.Success) {
  287 + return ExceptionPage(
  288 + pageState: model.pageState,
  289 + callback: () {
  290 + _getOrderFoodData();
  291 + },
  292 + emptyMsg: "暂时没有已选菜品哦",
  293 + emptyImg: "empty_search",
  294 + showMsg: "加载中,请稍后...",
  295 + );
  296 + } else {
  297 + return Padding(
  298 + padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(40)),
  299 + child: Column(
  300 + children: [
  301 + Expanded(
  302 + child: list(_orderFoodProvider.orderList),
  303 + ),
  304 + RoundButton(
  305 + text: '分享',
  306 + margin: EdgeInsets.symmetric(
  307 + horizontal: ScreenUtil().setWidth(40)),
  308 + width: double.infinity,
  309 + height: 50,
  310 + fontSize: 34,
  311 + isBold: false,
  312 + gradientStart: MyColours.color_199095,
  313 + gradientEnd: MyColours.color_199095,
  314 + radius: ScreenUtil().setWidth(10),
  315 + )
  316 + ],
  317 + ),
  318 + );
  319 + }
  320 + },
  321 + ),
89 ); 322 );
90 } 323 }
91 } 324 }
  1 +import 'package:flutter/material.dart';
  2 +import 'package:one_key/constant/constant.dart';
  3 +import 'package:one_key/constant/error.dart';
  4 +import 'package:one_key/constant/state.dart';
  5 +import 'package:one_key/models/created_order_model.dart';
  6 +import 'package:one_key/net/base_resp.dart';
  7 +import 'package:one_key/net/dio_util.dart';
  8 +import 'package:one_key/net/http_url.dart';
  9 +import 'package:one_key/provider/user_model.dart';
  10 +import 'package:one_key/utils/utils.dart';
  11 +import 'package:provider/provider.dart';
  12 +
  13 +///已选菜品页面
  14 +class OrderFoodProvider extends ChangeNotifier {
  15 + PageState pageState = PageState.Loading;
  16 + List<Map<String, List<Cookbooklist>>> orderList = []; //已点菜单信息
  17 + CreatedOrderSunModel createdOrderSunModel;
  18 +
  19 + ///顾客扫桌码点餐-扫码创建订单
  20 + getOrderFoodData(BuildContext context, Map<String, String> params,
  21 + {isShowLoading = true}) async {
  22 + if (isShowLoading) {
  23 + pageState = PageState.Loading;
  24 + notifyListeners();
  25 + }
  26 + BaseResp<Map<String, dynamic>> baseResp = await DioUtil()
  27 + .request<Map<String, dynamic>>(
  28 + context, Method.get, HttpUrl.get_order_food,
  29 + data: params, showLoading: false)
  30 + .catchError((error) {
  31 + print(error.toString());
  32 + if (error is MyError) {
  33 + switch (error.type) {
  34 + case 1:
  35 + pageState = PageState.ConnectivityError;
  36 + break;
  37 + case 2:
  38 + pageState = PageState.ConnectivityTimeOut;
  39 + break;
  40 + default:
  41 + pageState = PageState.ConnectivityError;
  42 + break;
  43 + }
  44 + }
  45 + notifyListeners();
  46 + });
  47 + if (baseResp.code == Constant.status_success) {
  48 + if (baseResp.data.isEmpty) {
  49 + pageState = PageState.ConnectivityError;
  50 + } else {
  51 + pageState = PageState.Success;
  52 + createdOrderSunModel =
  53 + CreatedOrderModel.fromJson(baseResp.responseData).data;
  54 + List<Cookbooklist> cookbooklist =
  55 + CreatedOrderModel.fromJson(baseResp.responseData).data.cookbooklist;
  56 + Set keysSet = Set();
  57 + for (Cookbooklist item in cookbooklist) {
  58 + keysSet.add(item.className);
  59 + }
  60 + List keysList = [];
  61 + keysList.addAll(keysSet);
  62 +
  63 + for (int i = 0; i < keysList.length; i++) {
  64 + Map<String, List<Cookbooklist>> father = {};
  65 + List<Cookbooklist> sun = [];
  66 + for (int j = 0; j < cookbooklist.length; j++) {
  67 + if (keysList[i] == cookbooklist[j].className) {
  68 + sun.add(cookbooklist[j]);
  69 + }
  70 + }
  71 + if (sun.length > 0) {
  72 + father[keysList[i]] = sun;
  73 + orderList.add(father);
  74 + }
  75 + }
  76 + }
  77 + notifyListeners();
  78 + } else {
  79 + pageState = PageState.ConnectivityError;
  80 + notifyListeners();
  81 + if (baseResp != null) {
  82 + Utils.showToast(baseResp.msg ?? "");
  83 + }
  84 + }
  85 + }
  86 +
  87 + ///订座详情页面
  88 + getTableInfoData(BuildContext context, Map<String, String> params,
  89 + {isShowLoading = true}) async {
  90 + BaseResp<Map<String, dynamic>> baseResp = await DioUtil()
  91 + .request<Map<String, dynamic>>(
  92 + context, Method.get, HttpUrl.get_reserve_detail,
  93 + data: params, showLoading: false)
  94 + .catchError((error) {});
  95 + if (baseResp.code == Constant.status_success) {
  96 + if (baseResp.data.isEmpty) {
  97 + } else {
  98 + //解析解析
  99 + }
  100 + notifyListeners();
  101 + } else {
  102 + if (baseResp != null) {
  103 + Utils.showToast(baseResp.msg ?? "");
  104 + }
  105 + }
  106 + }
  107 +}
@@ -51,4 +51,5 @@ class MyColours { @@ -51,4 +51,5 @@ class MyColours {
51 static const Color color_efefef = Color(0xffefefef); 51 static const Color color_efefef = Color(0xffefefef);
52 static const Color color_0A0A0A = Color(0xff0A0A0A); 52 static const Color color_0A0A0A = Color(0xff0A0A0A);
53 static const Color color_fa5151 = Color(0xfffa5151); 53 static const Color color_fa5151 = Color(0xfffa5151);
  54 + static const Color color_F0F0F0 = Color(0xffF0F0F0);
54 } 55 }
@@ -12,6 +12,7 @@ import 'package:one_key/pages/login/login_page.dart'; @@ -12,6 +12,7 @@ import 'package:one_key/pages/login/login_page.dart';
12 import 'package:one_key/pages/detail/handle_online_page.dart'; 12 import 'package:one_key/pages/detail/handle_online_page.dart';
13 import 'package:one_key/pages/detail/notebook_detail_page.dart'; 13 import 'package:one_key/pages/detail/notebook_detail_page.dart';
14 import 'package:one_key/pages/login/web_page.dart'; 14 import 'package:one_key/pages/login/web_page.dart';
  15 +import 'package:one_key/pages/message/message_order_menu.dart';
15 import 'package:one_key/pages/my/book_time_set.dart'; 16 import 'package:one_key/pages/my/book_time_set.dart';
16 import 'package:one_key/pages/my/receive_orders_time_set.dart'; 17 import 'package:one_key/pages/my/receive_orders_time_set.dart';
17 import 'package:one_key/pages/my/remark_manager_page.dart'; 18 import 'package:one_key/pages/my/remark_manager_page.dart';
@@ -22,6 +23,7 @@ import 'package:one_key/provider/book_set_time_model.dart'; @@ -22,6 +23,7 @@ import 'package:one_key/provider/book_set_time_model.dart';
22 import 'package:one_key/provider/choose_table_model.dart'; 23 import 'package:one_key/provider/choose_table_model.dart';
23 import 'package:one_key/provider/notebook_detail_change_model.dart'; 24 import 'package:one_key/provider/notebook_detail_change_model.dart';
24 import 'package:one_key/provider/notebook_detail_model.dart'; 25 import 'package:one_key/provider/notebook_detail_model.dart';
  26 +import 'package:one_key/provider/order_food_provider.dart';
25 import 'package:one_key/provider/remark_manager_model.dart'; 27 import 'package:one_key/provider/remark_manager_model.dart';
26 import 'package:one_key/utils/fluro_convert_utils.dart'; 28 import 'package:one_key/utils/fluro_convert_utils.dart';
27 import 'package:provider/provider.dart'; 29 import 'package:provider/provider.dart';
@@ -162,3 +164,12 @@ var handleRemarkManagerHandler = new Handler( @@ -162,3 +164,12 @@ var handleRemarkManagerHandler = new Handler(
162 return ChangeNotifierProvider<RemarkManagerModel>( 164 return ChangeNotifierProvider<RemarkManagerModel>(
163 create: (_) => RemarkManagerModel(), child: RemarkManagerPage()); 165 create: (_) => RemarkManagerModel(), child: RemarkManagerPage());
164 }); 166 });
  167 +
  168 +///已点菜品
  169 +var handleHasOrderFoodHandler = new Handler(
  170 + handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
  171 + String rid = params["rid"].first;
  172 + return ChangeNotifierProvider<OrderFoodProvider>(
  173 + create: (_) => OrderFoodProvider(),
  174 + child: MessageHasOrderFoodPage(rid: rid));
  175 +});
@@ -18,6 +18,7 @@ class Routes { @@ -18,6 +18,7 @@ class Routes {
18 static String book_time_set = "/book_time_set"; //可订时段管理 18 static String book_time_set = "/book_time_set"; //可订时段管理
19 static String receive_orders_time_set = "/receive_orders_time_set"; //接单时间管理 19 static String receive_orders_time_set = "/receive_orders_time_set"; //接单时间管理
20 static String remark_manager = "/remark_manager"; //常用备注管理 20 static String remark_manager = "/remark_manager"; //常用备注管理
  21 + static String has_order_food = "/has_order_food"; //已点菜品
21 22
22 static void configureRoutes(Router router) { 23 static void configureRoutes(Router router) {
23 router.notFoundHandler = new Handler( 24 router.notFoundHandler = new Handler(
@@ -38,7 +39,8 @@ class Routes { @@ -38,7 +39,8 @@ class Routes {
38 router.define(book_time_set, handler: handleBookTimeSetHandler); 39 router.define(book_time_set, handler: handleBookTimeSetHandler);
39 router.define(receive_orders_time_set, 40 router.define(receive_orders_time_set,
40 handler: handleReceiveOrdersTimeSetHandler); 41 handler: handleReceiveOrdersTimeSetHandler);
41 - router.define(remark_manager,  
42 - handler: handleRemarkManagerHandler); 42 + router.define(remark_manager, handler: handleRemarkManagerHandler);
  43 + router.define(has_order_food, handler: handleHasOrderFoodHandler);
  44 +
43 } 45 }
44 } 46 }
@@ -120,4 +120,9 @@ class NavigatorUtil { @@ -120,4 +120,9 @@ class NavigatorUtil {
120 static void goRemarkManagerPage(BuildContext context) { 120 static void goRemarkManagerPage(BuildContext context) {
121 _navigateTo(context, "${Routes.remark_manager}"); 121 _navigateTo(context, "${Routes.remark_manager}");
122 } 122 }
  123 +
  124 + /// 已选菜品
  125 + static void goHasOrderFoodPage(BuildContext context, {String rid}) {
  126 + _navigateTo(context, "${Routes.has_order_food}?rid=${rid}");
  127 + }
123 } 128 }