Commit 71d6dd5fa729fed5b9d9c45ab38e3556db89a653

Authored by wdn127929
1 parent ead58bea

一键订1.8.0提测

@@ -12,6 +12,7 @@ import 'package:fluwx/fluwx.dart'; @@ -12,6 +12,7 @@ import 'package:fluwx/fluwx.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/provider/message_dialog_model.dart'; 13 import 'package:one_key/provider/message_dialog_model.dart';
14 import 'package:intl/date_symbol_data_local.dart'; 14 import 'package:intl/date_symbol_data_local.dart';
  15 +import 'package:one_key/provider/notebook_detail_model.dart';
15 import 'package:one_key/provider/online_check_edit_provider.dart'; 16 import 'package:one_key/provider/online_check_edit_provider.dart';
16 import 'package:one_key/provider/tools.dart'; 17 import 'package:one_key/provider/tools.dart';
17 import 'package:one_key/utils/navigator_util.dart'; 18 import 'package:one_key/utils/navigator_util.dart';
@@ -57,6 +58,9 @@ Future<void> main() async { @@ -57,6 +58,9 @@ Future<void> main() async {
57 ChangeNotifierProvider<OrderFoodProvider>( 58 ChangeNotifierProvider<OrderFoodProvider>(
58 create: (_) => OrderFoodProvider(), 59 create: (_) => OrderFoodProvider(),
59 ), 60 ),
  61 + ChangeNotifierProvider<NotebookDetailModel>(
  62 + create: (_) => NotebookDetailModel(),
  63 + ),
60 ], 64 ],
61 child: MyApp(), 65 child: MyApp(),
62 )); 66 ));
  1 +import 'package:json_annotation/json_annotation.dart';
  2 +
  3 +part 'new_reserve_list_model.g.dart';
  4 +
  5 +@JsonSerializable()
  6 +class NewReserveListModel extends Object {
  7 + @JsonKey(name: 'ret')
  8 + int ret;
  9 +
  10 + @JsonKey(name: 'data')
  11 + List<NewReserveListSunModel> data;
  12 +
  13 + @JsonKey(name: 'msg')
  14 + String msg;
  15 +
  16 + NewReserveListModel(
  17 + this.ret,
  18 + this.data,
  19 + this.msg,
  20 + );
  21 +
  22 + factory NewReserveListModel.fromJson(Map<String, dynamic> srcJson) =>
  23 + _$NewReserveListModelFromJson(srcJson);
  24 +
  25 + Map<String, dynamic> toJson() => _$NewReserveListModelToJson(this);
  26 +}
  27 +
  28 +@JsonSerializable()
  29 +class NewReserveListSunModel extends Object {
  30 + @JsonKey(name: 'id')
  31 + String id;
  32 +
  33 + @JsonKey(name: 'openid')
  34 + String openid;
  35 +
  36 + @JsonKey(name: 'sid')
  37 + String sid;
  38 +
  39 + @JsonKey(name: 'room_demand')
  40 + String roomDemand;
  41 +
  42 + @JsonKey(name: 'tid')
  43 + String tid;
  44 +
  45 + @JsonKey(name: 'tableinfo')
  46 + String tableinfo;
  47 +
  48 + @JsonKey(name: 'pnum')
  49 + String pnum;
  50 +
  51 + @JsonKey(name: 'rname')
  52 + String rname;
  53 +
  54 + @JsonKey(name: 'sex')
  55 + String sex;
  56 +
  57 + @JsonKey(name: 'phone')
  58 + String phone;
  59 +
  60 + @JsonKey(name: 'cusdem')
  61 + String cusdem;
  62 +
  63 + @JsonKey(name: 'cusman')
  64 + String cusman;
  65 +
  66 + @JsonKey(name: 'rdate')
  67 + String rdate;
  68 +
  69 + @JsonKey(name: 'edate')
  70 + String edate;
  71 +
  72 + @JsonKey(name: 'vdate')
  73 + String vdate;
  74 +
  75 + @JsonKey(name: 'ddate')
  76 + String ddate;
  77 +
  78 + @JsonKey(name: 'is_set_ddate')
  79 + String isSetDdate;
  80 +
  81 + @JsonKey(name: 'ddate_solt')
  82 + String ddateSolt;
  83 +
  84 + @JsonKey(name: 'status')
  85 + String status;
  86 +
  87 + @JsonKey(name: 'cause')
  88 + String cause;
  89 +
  90 + @JsonKey(name: 'abolition')
  91 + String abolition;
  92 +
  93 + @JsonKey(name: 'action')
  94 + String action;
  95 +
  96 + @JsonKey(name: 'type')
  97 + String type;
  98 +
  99 + @JsonKey(name: 'code')
  100 + String code;
  101 +
  102 + @JsonKey(name: 'operator_openid')
  103 + String operatorOpenid;
  104 +
  105 + @JsonKey(name: 'channel')
  106 + String channel;
  107 +
  108 + @JsonKey(name: 'cdate')
  109 + String cdate;
  110 +
  111 + @JsonKey(name: 'name')
  112 + String name;
  113 +
  114 + @JsonKey(name: 'order_info')
  115 + OrderInfo orderInfo;
  116 +
  117 + NewReserveListSunModel(
  118 + this.id,
  119 + this.openid,
  120 + this.sid,
  121 + this.roomDemand,
  122 + this.tid,
  123 + this.tableinfo,
  124 + this.pnum,
  125 + this.rname,
  126 + this.sex,
  127 + this.phone,
  128 + this.cusdem,
  129 + this.cusman,
  130 + this.rdate,
  131 + this.edate,
  132 + this.vdate,
  133 + this.ddate,
  134 + this.isSetDdate,
  135 + this.ddateSolt,
  136 + this.status,
  137 + this.cause,
  138 + this.abolition,
  139 + this.action,
  140 + this.type,
  141 + this.code,
  142 + this.operatorOpenid,
  143 + this.channel,
  144 + this.cdate,
  145 + this.name,
  146 + this.orderInfo,
  147 + );
  148 +
  149 + factory NewReserveListSunModel.fromJson(Map<String, dynamic> srcJson) =>
  150 + _$NewReserveListSunModelFromJson(srcJson);
  151 +
  152 + Map<String, dynamic> toJson() => _$NewReserveListSunModelToJson(this);
  153 +}
  154 +
  155 +@JsonSerializable()
  156 +class OrderInfo extends Object {
  157 + @JsonKey(name: 'id')
  158 + String id;
  159 +
  160 + @JsonKey(name: 'order_no')
  161 + String orderNo;
  162 +
  163 + @JsonKey(name: 'out_trade_no')
  164 + String outTradeNo;
  165 +
  166 + @JsonKey(name: 'openid')
  167 + String openid;
  168 +
  169 + @JsonKey(name: 'sid')
  170 + String sid;
  171 +
  172 + @JsonKey(name: 'rid')
  173 + String rid;
  174 +
  175 + @JsonKey(name: 'sellername')
  176 + String sellername;
  177 +
  178 + @JsonKey(name: 'tablename')
  179 + String tablename;
  180 +
  181 + @JsonKey(name: 'wechat_no')
  182 + String wechatNo;
  183 +
  184 + @JsonKey(name: 'bill_list')
  185 + List<dynamic> billList;
  186 +
  187 + @JsonKey(name: 'price')
  188 + String price;
  189 +
  190 + @JsonKey(name: 'should_price')
  191 + String shouldPrice;
  192 +
  193 + @JsonKey(name: 'subsidy_type')
  194 + String subsidyType;
  195 +
  196 + @JsonKey(name: 'subsidy_price')
  197 + String subsidyPrice;
  198 +
  199 + @JsonKey(name: 'is_wine')
  200 + String isWine;
  201 +
  202 + @JsonKey(name: 'is_pack')
  203 + String isPack;
  204 +
  205 + @JsonKey(name: 'status')
  206 + String status;
  207 +
  208 + @JsonKey(name: 'pay_time')
  209 + String payTime;
  210 +
  211 + @JsonKey(name: 'confirm_time')
  212 + String confirmTime;
  213 +
  214 + @JsonKey(name: 'remarks')
  215 + String remarks;
  216 +
  217 + @JsonKey(name: 'attach')
  218 + String attach;
  219 +
  220 + @JsonKey(name: 'currency')
  221 + String currency;
  222 +
  223 + @JsonKey(name: 'detail')
  224 + String detail;
  225 +
  226 + @JsonKey(name: 'description')
  227 + String description;
  228 +
  229 + @JsonKey(name: 'profit_sharing')
  230 + String profitSharing;
  231 +
  232 + @JsonKey(name: 'create_time')
  233 + String createTime;
  234 +
  235 + OrderInfo(
  236 + this.id,
  237 + this.orderNo,
  238 + this.outTradeNo,
  239 + this.openid,
  240 + this.sid,
  241 + this.rid,
  242 + this.sellername,
  243 + this.tablename,
  244 + this.wechatNo,
  245 + this.billList,
  246 + this.price,
  247 + this.shouldPrice,
  248 + this.subsidyType,
  249 + this.subsidyPrice,
  250 + this.isWine,
  251 + this.isPack,
  252 + this.status,
  253 + this.payTime,
  254 + this.confirmTime,
  255 + this.remarks,
  256 + this.attach,
  257 + this.currency,
  258 + this.detail,
  259 + this.description,
  260 + this.profitSharing,
  261 + this.createTime,
  262 + );
  263 +
  264 + factory OrderInfo.fromJson(Map<String, dynamic> srcJson) =>
  265 + _$OrderInfoFromJson(srcJson);
  266 +
  267 + Map<String, dynamic> toJson() => _$OrderInfoToJson(this);
  268 +}
  1 +// GENERATED CODE - DO NOT MODIFY BY HAND
  2 +
  3 +part of 'new_reserve_list_model.dart';
  4 +
  5 +// **************************************************************************
  6 +// JsonSerializableGenerator
  7 +// **************************************************************************
  8 +
  9 +NewReserveListModel _$NewReserveListModelFromJson(Map<String, dynamic> json) {
  10 + return NewReserveListModel(
  11 + json['ret'] as int,
  12 + (json['data'] as List)
  13 + ?.map((e) => e == null
  14 + ? null
  15 + : NewReserveListSunModel.fromJson(e as Map<String, dynamic>))
  16 + ?.toList(),
  17 + json['msg'] as String);
  18 +}
  19 +
  20 +Map<String, dynamic> _$NewReserveListModelToJson(
  21 + NewReserveListModel instance) =>
  22 + <String, dynamic>{
  23 + 'ret': instance.ret,
  24 + 'data': instance.data,
  25 + 'msg': instance.msg
  26 + };
  27 +
  28 +NewReserveListSunModel _$NewReserveListSunModelFromJson(
  29 + Map<String, dynamic> json) {
  30 + return NewReserveListSunModel(
  31 + json['id'] as String,
  32 + json['openid'] as String,
  33 + json['sid'] as String,
  34 + json['room_demand'] as String,
  35 + json['tid'] as String,
  36 + json['tableinfo'] as String,
  37 + json['pnum'] as String,
  38 + json['rname'] as String,
  39 + json['sex'] as String,
  40 + json['phone'] as String,
  41 + json['cusdem'] as String,
  42 + json['cusman'] as String,
  43 + json['rdate'] as String,
  44 + json['edate'] as String,
  45 + json['vdate'] as String,
  46 + json['ddate'] as String,
  47 + json['is_set_ddate'] as String,
  48 + json['ddate_solt'] as String,
  49 + json['status'] as String,
  50 + json['cause'] as String,
  51 + json['abolition'] as String,
  52 + json['action'] as String,
  53 + json['type'] as String,
  54 + json['code'] as String,
  55 + json['operator_openid'] as String,
  56 + json['channel'] as String,
  57 + json['cdate'] as String,
  58 + json['name'] as String,
  59 + json['order_info'] == null
  60 + ? null
  61 + : OrderInfo.fromJson(json['order_info'] as Map<String, dynamic>));
  62 +}
  63 +
  64 +Map<String, dynamic> _$NewReserveListSunModelToJson(
  65 + NewReserveListSunModel instance) =>
  66 + <String, dynamic>{
  67 + 'id': instance.id,
  68 + 'openid': instance.openid,
  69 + 'sid': instance.sid,
  70 + 'room_demand': instance.roomDemand,
  71 + 'tid': instance.tid,
  72 + 'tableinfo': instance.tableinfo,
  73 + 'pnum': instance.pnum,
  74 + 'rname': instance.rname,
  75 + 'sex': instance.sex,
  76 + 'phone': instance.phone,
  77 + 'cusdem': instance.cusdem,
  78 + 'cusman': instance.cusman,
  79 + 'rdate': instance.rdate,
  80 + 'edate': instance.edate,
  81 + 'vdate': instance.vdate,
  82 + 'ddate': instance.ddate,
  83 + 'is_set_ddate': instance.isSetDdate,
  84 + 'ddate_solt': instance.ddateSolt,
  85 + 'status': instance.status,
  86 + 'cause': instance.cause,
  87 + 'abolition': instance.abolition,
  88 + 'action': instance.action,
  89 + 'type': instance.type,
  90 + 'code': instance.code,
  91 + 'operator_openid': instance.operatorOpenid,
  92 + 'channel': instance.channel,
  93 + 'cdate': instance.cdate,
  94 + 'name': instance.name,
  95 + 'order_info': instance.orderInfo
  96 + };
  97 +
  98 +OrderInfo _$OrderInfoFromJson(Map<String, dynamic> json) {
  99 + return OrderInfo(
  100 + json['id'] as String,
  101 + json['order_no'] as String,
  102 + json['out_trade_no'] as String,
  103 + json['openid'] as String,
  104 + json['sid'] as String,
  105 + json['rid'] as String,
  106 + json['sellername'] as String,
  107 + json['tablename'] as String,
  108 + json['wechat_no'] as String,
  109 + json['bill_list'] as List,
  110 + json['price'] as String,
  111 + json['should_price'] as String,
  112 + json['subsidy_type'] as String,
  113 + json['subsidy_price'] as String,
  114 + json['is_wine'] as String,
  115 + json['is_pack'] as String,
  116 + json['status'] as String,
  117 + json['pay_time'] as String,
  118 + json['confirm_time'] as String,
  119 + json['remarks'] as String,
  120 + json['attach'] as String,
  121 + json['currency'] as String,
  122 + json['detail'] as String,
  123 + json['description'] as String,
  124 + json['profit_sharing'] as String,
  125 + json['create_time'] as String);
  126 +}
  127 +
  128 +Map<String, dynamic> _$OrderInfoToJson(OrderInfo instance) => <String, dynamic>{
  129 + 'id': instance.id,
  130 + 'order_no': instance.orderNo,
  131 + 'out_trade_no': instance.outTradeNo,
  132 + 'openid': instance.openid,
  133 + 'sid': instance.sid,
  134 + 'rid': instance.rid,
  135 + 'sellername': instance.sellername,
  136 + 'tablename': instance.tablename,
  137 + 'wechat_no': instance.wechatNo,
  138 + 'bill_list': instance.billList,
  139 + 'price': instance.price,
  140 + 'should_price': instance.shouldPrice,
  141 + 'subsidy_type': instance.subsidyType,
  142 + 'subsidy_price': instance.subsidyPrice,
  143 + 'is_wine': instance.isWine,
  144 + 'is_pack': instance.isPack,
  145 + 'status': instance.status,
  146 + 'pay_time': instance.payTime,
  147 + 'confirm_time': instance.confirmTime,
  148 + 'remarks': instance.remarks,
  149 + 'attach': instance.attach,
  150 + 'currency': instance.currency,
  151 + 'detail': instance.detail,
  152 + 'description': instance.description,
  153 + 'profit_sharing': instance.profitSharing,
  154 + 'create_time': instance.createTime
  155 + };
@@ -44,6 +44,7 @@ class Notebook { @@ -44,6 +44,7 @@ class Notebook {
44 String channel; 44 String channel;
45 String cdate; 45 String cdate;
46 String name; 46 String name;
  47 + OrderInfo orderInfo;
47 48
48 String get tableinfoStr { 49 String get tableinfoStr {
49 return name + 50 return name +
@@ -121,3 +122,118 @@ class Notebook { @@ -121,3 +122,118 @@ class Notebook {
121 _$NotebookFromJson(json); 122 _$NotebookFromJson(json);
122 Map<String, dynamic> toJson() => _$NotebookToJson(this); 123 Map<String, dynamic> toJson() => _$NotebookToJson(this);
123 } 124 }
  125 +
  126 +@JsonSerializable()
  127 +class OrderInfo extends Object {
  128 + @JsonKey(name: 'id')
  129 + String id;
  130 +
  131 + @JsonKey(name: 'order_no')
  132 + String orderNo;
  133 +
  134 + @JsonKey(name: 'out_trade_no')
  135 + String outTradeNo;
  136 +
  137 + @JsonKey(name: 'openid')
  138 + String openid;
  139 +
  140 + @JsonKey(name: 'sid')
  141 + String sid;
  142 +
  143 + @JsonKey(name: 'rid')
  144 + String rid;
  145 +
  146 + @JsonKey(name: 'sellername')
  147 + String sellername;
  148 +
  149 + @JsonKey(name: 'tablename')
  150 + String tablename;
  151 +
  152 + @JsonKey(name: 'wechat_no')
  153 + String wechatNo;
  154 +
  155 + @JsonKey(name: 'bill_list')
  156 + List<dynamic> billList;
  157 +
  158 + @JsonKey(name: 'price')
  159 + String price;
  160 +
  161 + @JsonKey(name: 'should_price')
  162 + String shouldPrice;
  163 +
  164 + @JsonKey(name: 'subsidy_type')
  165 + String subsidyType;
  166 +
  167 + @JsonKey(name: 'subsidy_price')
  168 + String subsidyPrice;
  169 +
  170 + @JsonKey(name: 'is_wine')
  171 + String isWine;
  172 +
  173 + @JsonKey(name: 'is_pack')
  174 + String isPack;
  175 +
  176 + @JsonKey(name: 'status')
  177 + String status;
  178 +
  179 + @JsonKey(name: 'pay_time')
  180 + String payTime;
  181 +
  182 + @JsonKey(name: 'confirm_time')
  183 + String confirmTime;
  184 +
  185 + @JsonKey(name: 'remarks')
  186 + String remarks;
  187 +
  188 + @JsonKey(name: 'attach')
  189 + String attach;
  190 +
  191 + @JsonKey(name: 'currency')
  192 + String currency;
  193 +
  194 + @JsonKey(name: 'detail')
  195 + String detail;
  196 +
  197 + @JsonKey(name: 'description')
  198 + String description;
  199 +
  200 + @JsonKey(name: 'profit_sharing')
  201 + String profitSharing;
  202 +
  203 + @JsonKey(name: 'create_time')
  204 + String createTime;
  205 +
  206 + OrderInfo(
  207 + this.id,
  208 + this.orderNo,
  209 + this.outTradeNo,
  210 + this.openid,
  211 + this.sid,
  212 + this.rid,
  213 + this.sellername,
  214 + this.tablename,
  215 + this.wechatNo,
  216 + this.billList,
  217 + this.price,
  218 + this.shouldPrice,
  219 + this.subsidyType,
  220 + this.subsidyPrice,
  221 + this.isWine,
  222 + this.isPack,
  223 + this.status,
  224 + this.payTime,
  225 + this.confirmTime,
  226 + this.remarks,
  227 + this.attach,
  228 + this.currency,
  229 + this.detail,
  230 + this.description,
  231 + this.profitSharing,
  232 + this.createTime,
  233 + );
  234 +
  235 + factory OrderInfo.fromJson(Map<String, dynamic> srcJson) =>
  236 + _$OrderInfoFromJson(srcJson);
  237 +
  238 + Map<String, dynamic> toJson() => _$OrderInfoToJson(this);
  239 +}
@@ -43,7 +43,10 @@ Notebook _$NotebookFromJson(Map<String, dynamic> json) { @@ -43,7 +43,10 @@ Notebook _$NotebookFromJson(Map<String, dynamic> json) {
43 ..operator_openid = json['operator_openid'] as String 43 ..operator_openid = json['operator_openid'] as String
44 ..channel = json['channel'] as String 44 ..channel = json['channel'] as String
45 ..cdate = json['cdate'] as String 45 ..cdate = json['cdate'] as String
46 - ..name = json['name'] as String; 46 + ..name = json['name'] as String
  47 + ..orderInfo = json['order_info'] == null
  48 + ? null
  49 + : OrderInfo.fromJson(json['order_info'] as Map<String, dynamic>);
47 } 50 }
48 51
49 Map<String, dynamic> _$NotebookToJson(Notebook instance) => <String, dynamic>{ 52 Map<String, dynamic> _$NotebookToJson(Notebook instance) => <String, dynamic>{
@@ -82,5 +85,65 @@ Map<String, dynamic> _$NotebookToJson(Notebook instance) => <String, dynamic>{ @@ -82,5 +85,65 @@ Map<String, dynamic> _$NotebookToJson(Notebook instance) => <String, dynamic>{
82 'operator_openid': instance.operator_openid, 85 'operator_openid': instance.operator_openid,
83 'channel': instance.channel, 86 'channel': instance.channel,
84 'cdate': instance.cdate, 87 'cdate': instance.cdate,
85 - 'name': instance.name 88 + 'name': instance.name,
  89 + 'order_info': instance.orderInfo
  90 + };
  91 +
  92 +OrderInfo _$OrderInfoFromJson(Map<String, dynamic> json) {
  93 + return OrderInfo(
  94 + json['id'] as String,
  95 + json['order_no'] as String,
  96 + json['out_trade_no'] as String,
  97 + json['openid'] as String,
  98 + json['sid'] as String,
  99 + json['rid'] as String,
  100 + json['sellername'] as String,
  101 + json['tablename'] as String,
  102 + json['wechat_no'] as String,
  103 + json['bill_list'] as List,
  104 + json['price'] as String,
  105 + json['should_price'] as String,
  106 + json['subsidy_type'] as String,
  107 + json['subsidy_price'] as String,
  108 + json['is_wine'] as String,
  109 + json['is_pack'] as String,
  110 + json['status'] as String,
  111 + json['pay_time'] as String,
  112 + json['confirm_time'] as String,
  113 + json['remarks'] as String,
  114 + json['attach'] as String,
  115 + json['currency'] as String,
  116 + json['detail'] as String,
  117 + json['description'] as String,
  118 + json['profit_sharing'] as String,
  119 + json['create_time'] as String);
  120 +}
  121 +
  122 +Map<String, dynamic> _$OrderInfoToJson(OrderInfo instance) => <String, dynamic>{
  123 + 'id': instance.id,
  124 + 'order_no': instance.orderNo,
  125 + 'out_trade_no': instance.outTradeNo,
  126 + 'openid': instance.openid,
  127 + 'sid': instance.sid,
  128 + 'rid': instance.rid,
  129 + 'sellername': instance.sellername,
  130 + 'tablename': instance.tablename,
  131 + 'wechat_no': instance.wechatNo,
  132 + 'bill_list': instance.billList,
  133 + 'price': instance.price,
  134 + 'should_price': instance.shouldPrice,
  135 + 'subsidy_type': instance.subsidyType,
  136 + 'subsidy_price': instance.subsidyPrice,
  137 + 'is_wine': instance.isWine,
  138 + 'is_pack': instance.isPack,
  139 + 'status': instance.status,
  140 + 'pay_time': instance.payTime,
  141 + 'confirm_time': instance.confirmTime,
  142 + 'remarks': instance.remarks,
  143 + 'attach': instance.attach,
  144 + 'currency': instance.currency,
  145 + 'detail': instance.detail,
  146 + 'description': instance.description,
  147 + 'profit_sharing': instance.profitSharing,
  148 + 'create_time': instance.createTime
86 }; 149 };
1 import 'package:json_annotation/json_annotation.dart'; 1 import 'package:json_annotation/json_annotation.dart';
  2 +import 'package:one_key/utils/utils.dart';
2 3
3 part 'order_info_model.g.dart'; 4 part 'order_info_model.g.dart';
4 5
@@ -105,6 +106,9 @@ class OrderInfoSunModel extends Object { @@ -105,6 +106,9 @@ class OrderInfoSunModel extends Object {
105 @JsonKey(name: 'create_time') 106 @JsonKey(name: 'create_time')
106 String createTime; 107 String createTime;
107 108
  109 + @JsonKey(name: 'invoice')
  110 + Invoice invoice;
  111 +
108 @JsonKey(name: 'discount') 112 @JsonKey(name: 'discount')
109 List<dynamic> discount; 113 List<dynamic> discount;
110 114
@@ -157,8 +161,78 @@ class OrderInfoSunModel extends Object { @@ -157,8 +161,78 @@ class OrderInfoSunModel extends Object {
157 this.discount, 161 this.discount,
158 ); 162 );
159 163
  164 + // 买单时间
  165 + String get payTimeStr {
  166 + DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
  167 + int.parse(payTime.toString()) * 1000);
  168 + return dateTime.year.toString() +
  169 + "/" +
  170 + Utils.addZeroNumber(dateTime.month) +
  171 + "/" +
  172 + Utils.addZeroNumber(dateTime.day) +
  173 + " " +
  174 + Utils.addZeroNumber(dateTime.hour) +
  175 + ":" +
  176 + Utils.addZeroNumber(dateTime.minute);
  177 + }
  178 +
160 factory OrderInfoSunModel.fromJson(Map<String, dynamic> srcJson) => 179 factory OrderInfoSunModel.fromJson(Map<String, dynamic> srcJson) =>
161 _$OrderInfoSunModelFromJson(srcJson); 180 _$OrderInfoSunModelFromJson(srcJson);
162 181
163 Map<String, dynamic> toJson() => _$OrderInfoSunModelToJson(this); 182 Map<String, dynamic> toJson() => _$OrderInfoSunModelToJson(this);
164 } 183 }
  184 +
  185 +@JsonSerializable()
  186 +class Invoice extends Object {
  187 + @JsonKey(name: 'id')
  188 + String id;
  189 +
  190 + @JsonKey(name: 'rid')
  191 + String rid;
  192 +
  193 + @JsonKey(name: 'openid')
  194 + String openid;
  195 +
  196 + @JsonKey(name: 'type')
  197 + String type;
  198 +
  199 + @JsonKey(name: 'title')
  200 + String title;
  201 +
  202 + @JsonKey(name: 'taxnumber')
  203 + String taxnumber;
  204 +
  205 + @JsonKey(name: 'companyaddress')
  206 + String companyaddress;
  207 +
  208 + @JsonKey(name: 'telephone')
  209 + String telephone;
  210 +
  211 + @JsonKey(name: 'bankname')
  212 + String bankname;
  213 +
  214 + @JsonKey(name: 'bankaccount')
  215 + String bankaccount;
  216 +
  217 + @JsonKey(name: 'cdate')
  218 + String cdate;
  219 +
  220 + Invoice(
  221 + this.id,
  222 + this.rid,
  223 + this.openid,
  224 + this.type,
  225 + this.title,
  226 + this.taxnumber,
  227 + this.companyaddress,
  228 + this.telephone,
  229 + this.bankname,
  230 + this.bankaccount,
  231 + this.cdate,
  232 + );
  233 +
  234 + factory Invoice.fromJson(Map<String, dynamic> srcJson) =>
  235 + _$InvoiceFromJson(srcJson);
  236 +
  237 + Map<String, dynamic> toJson() => _$InvoiceToJson(this);
  238 +}
@@ -50,7 +50,10 @@ OrderInfoSunModel _$OrderInfoSunModelFromJson(Map<String, dynamic> json) { @@ -50,7 +50,10 @@ OrderInfoSunModel _$OrderInfoSunModelFromJson(Map<String, dynamic> json) {
50 json['description'] as String, 50 json['description'] as String,
51 json['profit_sharing'] as String, 51 json['profit_sharing'] as String,
52 json['create_time'] as String, 52 json['create_time'] as String,
53 - json['discount'] as List); 53 + json['discount'] as List)
  54 + ..invoice = json['invoice'] == null
  55 + ? null
  56 + : Invoice.fromJson(json['invoice'] as Map<String, dynamic>);
54 } 57 }
55 58
56 Map<String, dynamic> _$OrderInfoSunModelToJson(OrderInfoSunModel instance) => 59 Map<String, dynamic> _$OrderInfoSunModelToJson(OrderInfoSunModel instance) =>
@@ -81,5 +84,35 @@ Map<String, dynamic> _$OrderInfoSunModelToJson(OrderInfoSunModel instance) => @@ -81,5 +84,35 @@ Map<String, dynamic> _$OrderInfoSunModelToJson(OrderInfoSunModel instance) =>
81 'description': instance.description, 84 'description': instance.description,
82 'profit_sharing': instance.profitSharing, 85 'profit_sharing': instance.profitSharing,
83 'create_time': instance.createTime, 86 'create_time': instance.createTime,
  87 + 'invoice': instance.invoice,
84 'discount': instance.discount 88 'discount': instance.discount
85 }; 89 };
  90 +
  91 +Invoice _$InvoiceFromJson(Map<String, dynamic> json) {
  92 + return Invoice(
  93 + json['id'] as String,
  94 + json['rid'] as String,
  95 + json['openid'] as String,
  96 + json['type'] as String,
  97 + json['title'] as String,
  98 + json['taxnumber'] as String,
  99 + json['companyaddress'] as String,
  100 + json['telephone'] as String,
  101 + json['bankname'] as String,
  102 + json['bankaccount'] as String,
  103 + json['cdate'] as String);
  104 +}
  105 +
  106 +Map<String, dynamic> _$InvoiceToJson(Invoice instance) => <String, dynamic>{
  107 + 'id': instance.id,
  108 + 'rid': instance.rid,
  109 + 'openid': instance.openid,
  110 + 'type': instance.type,
  111 + 'title': instance.title,
  112 + 'taxnumber': instance.taxnumber,
  113 + 'companyaddress': instance.companyaddress,
  114 + 'telephone': instance.telephone,
  115 + 'bankname': instance.bankname,
  116 + 'bankaccount': instance.bankaccount,
  117 + 'cdate': instance.cdate
  118 + };
@@ -127,6 +127,27 @@ class ReserveDetailSunModel extends Object { @@ -127,6 +127,27 @@ class ReserveDetailSunModel extends Object {
127 @JsonKey(name: 'order') 127 @JsonKey(name: 'order')
128 Order order; 128 Order order;
129 129
  130 + // if(entity.getDiscount()!=null){
  131 + // double platform=0.0;
  132 + // double store=0.0;
  133 + // for (Discount discount:entity.getDiscount()){
  134 + // if(discount.getOwner().equals("1")){//平台
  135 + // platform+=Double.parseDouble(discount.getPrice());
  136 + // }else if(discount.getOwner().equals("2")){//店铺
  137 + // store+=Double.parseDouble(discount.getPrice());
  138 + // }
  139 + // }
  140 + // observablePlatformSubsidyPrice.set("¥"+String.format("%.2f",platform));
  141 + // observableStoreSubsidyPrice.set("-¥"+String.format("%.2f",store));
  142 + // observableStoreSubsidyVisibility.set(View.VISIBLE);
  143 + // observableRealPrice.set("¥"+(String.format("%.2f",(Double.parseDouble(entity.getOrder_info().getPrice())-store)>0.01?(Double.parseDouble(entity.getOrder_info().getPrice())-store):0.01)));
  144 + // }else{
  145 + // observablePlatformSubsidyPrice.set("¥0.00");
  146 + // observableStoreSubsidyPrice.set("-¥0.00");
  147 + // observableStoreSubsidyVisibility.set(View.GONE);
  148 + // observableRealPrice.set("¥"+entity.getOrder_info().getPrice());
  149 + // }
  150 +
130 ///年月日 餐段 151 ///年月日 餐段
131 String get ddateStr { 152 String get ddateStr {
132 String ymd = ""; 153 String ymd = "";
@@ -69,10 +69,20 @@ class Table { @@ -69,10 +69,20 @@ class Table {
69 } 69 }
70 70
71 String get signStr { 71 String get signStr {
72 - if (sign != null&&sign.isNotEmpty) { 72 + if (sign != null && sign.isNotEmpty) {
73 switch (sign) { 73 switch (sign) {
74 case "1": //已预订 74 case "1": //已预订
75 case "5": //已安排包间 75 case "5": //已安排包间
  76 + // itemRv.setBackgroundResource(R.drawable.table_white);
  77 + // if(item.getOrder_status()==3){
  78 + // status.setBackgroundResource(R.drawable.table_bg_bottom_yellow);
  79 + // status.setText("已买单");
  80 + // }else{
  81 + // status.setBackgroundResource(R.drawable.table_bg_bottom_red);
  82 + // status.setText("已预订");
  83 + // }
  84 + // status.setVisibility(View.VISIBLE);
  85 + // pnum.setText(item.getNoteName());
76 return "已预订"; 86 return "已预订";
77 case "2": //用餐中 87 case "2": //用餐中
78 return "用餐中"; 88 return "用餐中";
@@ -91,5 +101,4 @@ class Table { @@ -91,5 +101,4 @@ class Table {
91 String toString() { 101 String toString() {
92 return 'Table{id: $id, rid: $rid, tid: $tid, name: $name, table_pnum: $table_pnum, most_pnum: $most_pnum, order_o: $order_o, status: $status, tablestatus: $tablestatus, enable: $enable, spell: $spell, rname: $rname, max: $max, low: $low}'; 102 return 'Table{id: $id, rid: $rid, tid: $tid, name: $name, table_pnum: $table_pnum, most_pnum: $most_pnum, order_o: $order_o, status: $status, tablestatus: $tablestatus, enable: $enable, spell: $spell, rname: $rname, max: $max, low: $low}';
93 } 103 }
94 -  
95 } 104 }
@@ -69,5 +69,7 @@ class HttpUrl { @@ -69,5 +69,7 @@ class HttpUrl {
69 "?service=App.Customer.GetOrderInfo"; //获取账单详情 69 "?service=App.Customer.GetOrderInfo"; //获取账单详情
70 static const String update_order_info = 70 static const String update_order_info =
71 "?service=App.Customer.UpdateOrderInfo"; // 商家确认账单 71 "?service=App.Customer.UpdateOrderInfo"; // 商家确认账单
  72 + static const String new_get_reserve_list =
  73 + "?service=App.Reserve.NewGetReserveList"; //商家预订本列表【2019-11-26】
72 74
73 } 75 }
@@ -8,6 +8,7 @@ import 'package:one_key/models/manager.dart'; @@ -8,6 +8,7 @@ import 'package:one_key/models/manager.dart';
8 import 'package:one_key/models/notebook_detail.dart'; 8 import 'package:one_key/models/notebook_detail.dart';
9 import 'package:one_key/provider/message_dialog_model.dart'; 9 import 'package:one_key/provider/message_dialog_model.dart';
10 import 'package:one_key/provider/notebook_detail_model.dart'; 10 import 'package:one_key/provider/notebook_detail_model.dart';
  11 +import 'package:one_key/provider/online_check_edit_provider.dart';
11 import 'package:one_key/provider/user_model.dart'; 12 import 'package:one_key/provider/user_model.dart';
12 import 'package:one_key/res/colors.dart'; 13 import 'package:one_key/res/colors.dart';
13 import 'package:one_key/utils/dialog_util.dart'; 14 import 'package:one_key/utils/dialog_util.dart';
@@ -66,6 +67,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -66,6 +67,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
66 ScrollController _scrollController; 67 ScrollController _scrollController;
67 68
68 String formatPhone = ""; 69 String formatPhone = "";
  70 + OnlineCheckEditProvider _onlineCheckEditProvider;
69 71
70 @override 72 @override
71 void initState() { 73 void initState() {
@@ -74,6 +76,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -74,6 +76,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
74 WidgetsBinding.instance.addPostFrameCallback((_) async { 76 WidgetsBinding.instance.addPostFrameCallback((_) async {
75 _initCancel(); 77 _initCancel();
76 _getReserveDetail(); 78 _getReserveDetail();
  79 + _getOrderInfo();
77 managers = await detailModel.getManagers(context); 80 managers = await detailModel.getManagers(context);
78 //添加listener监听 81 //添加listener监听
79 //对应的TextField失去或者获取焦点都会回调此监听 82 //对应的TextField失去或者获取焦点都会回调此监听
@@ -114,6 +117,15 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -114,6 +117,15 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
114 bus.off("refresh_detail"); 117 bus.off("refresh_detail");
115 } 118 }
116 119
  120 + ///获取订单详情
  121 + _getOrderInfo() async {
  122 + UserModel userModel = Provider.of<UserModel>(context, listen: false);
  123 + Map<String, String> params = {"rid": widget.rid};
  124 + //remark信息获取
  125 + await _onlineCheckEditProvider.getOrderInfo(context, params);
  126 + }
  127 +
  128 + ///订座详情
117 _getReserveDetail() async { 129 _getReserveDetail() async {
118 detailEntity = await detailModel.getReserveDetail(context, { 130 detailEntity = await detailModel.getReserveDetail(context, {
119 "rid": widget.rid, 131 "rid": widget.rid,
@@ -431,6 +443,9 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -431,6 +443,9 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
431 _cancelNode.unfocus(); 443 _cancelNode.unfocus();
432 } 444 }
433 detailModel = Provider.of<NotebookDetailModel>(context, listen: true); 445 detailModel = Provider.of<NotebookDetailModel>(context, listen: true);
  446 + _onlineCheckEditProvider =
  447 + Provider.of<OnlineCheckEditProvider>(context, listen: true);
  448 +
434 return Scaffold( 449 return Scaffold(
435 body: SafeArea( 450 body: SafeArea(
436 child: WillPopScope( 451 child: WillPopScope(
@@ -687,6 +702,187 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -687,6 +702,187 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
687 ], 702 ],
688 ), 703 ),
689 ), 704 ),
  705 + _onlineCheckEditProvider
  706 + .orderInfoSunModel !=
  707 + null &&
  708 + _onlineCheckEditProvider
  709 + .orderInfoSunModel
  710 + .invoice !=
  711 + null &&
  712 + detailEntity.status != "4"
  713 + ? MyDivider(double.infinity,
  714 + ScreenUtil().setHeight(1))
  715 + : Container(),
  716 + _onlineCheckEditProvider
  717 + .orderInfoSunModel !=
  718 + null &&
  719 + _onlineCheckEditProvider
  720 + .orderInfoSunModel
  721 + .invoice !=
  722 + null &&
  723 + detailEntity.status != "4"
  724 + ? InkWell(
  725 + onTap: () {
  726 + NavigatorUtil
  727 + .goInvoiceDetailPage(
  728 + context,
  729 + fromNotify: false,
  730 + rid: widget.rid);
  731 + },
  732 + child: Container(
  733 + height: ScreenUtil()
  734 + .setWidth(87 * 2),
  735 + child: Row(
  736 + mainAxisAlignment:
  737 + MainAxisAlignment
  738 + .spaceBetween,
  739 + children: [
  740 + Text(
  741 + "发票抬头",
  742 + style: TextStyle(
  743 + color: MyColours
  744 + .color_828282,
  745 + fontSize:
  746 + ScreenUtil()
  747 + .setSp(30)),
  748 + ),
  749 + Spacer(),
  750 + Column(
  751 + mainAxisAlignment:
  752 + MainAxisAlignment
  753 + .center,
  754 + children: [
  755 + Text(
  756 + _onlineCheckEditProvider
  757 + .orderInfoSunModel
  758 + .invoice
  759 + .title,
  760 + style: TextStyle(
  761 + color: MyColours
  762 + .color_353535,
  763 + fontWeight:
  764 + FontWeight
  765 + .bold,
  766 + fontSize:
  767 + ScreenUtil()
  768 + .setSp(
  769 + 33))),
  770 + _onlineCheckEditProvider
  771 + .orderInfoSunModel
  772 + .invoice
  773 + .taxnumber ==
  774 + null ||
  775 + _onlineCheckEditProvider
  776 + .orderInfoSunModel
  777 + .invoice
  778 + .taxnumber ==
  779 + ''
  780 + ? Container()
  781 + : Column(
  782 + children: [
  783 + VEmptyView(
  784 + 10),
  785 + Text(
  786 + '税号:${_onlineCheckEditProvider.orderInfoSunModel.invoice.taxnumber}',
  787 + style: TextStyle(
  788 + color:
  789 + MyColours.color_707070,
  790 + fontSize: ScreenUtil().setSp(28)))
  791 + ],
  792 + )
  793 + ],
  794 + ),
  795 + HEmptyView(20),
  796 + Image.asset(
  797 + Utils.getImgPath(
  798 + 'arr_right_gray'),
  799 + width: ScreenUtil()
  800 + .setWidth(12),
  801 + height: ScreenUtil()
  802 + .setWidth(22),
  803 + )
  804 + ],
  805 + ),
  806 + ),
  807 + )
  808 + : Container(),
  809 + _onlineCheckEditProvider
  810 + .orderInfoSunModel !=
  811 + null &&
  812 + _onlineCheckEditProvider
  813 + .orderInfoSunModel
  814 + .price !=
  815 + null &&
  816 + detailEntity.status != "4"
  817 + ? MyDivider(double.infinity,
  818 + ScreenUtil().setHeight(1))
  819 + : Container(),
  820 + _onlineCheckEditProvider
  821 + .orderInfoSunModel !=
  822 + null &&
  823 + _onlineCheckEditProvider
  824 + .orderInfoSunModel
  825 + .price !=
  826 + null &&
  827 + detailEntity.status != "4"
  828 + ? InkWell(
  829 + onTap: () {
  830 + //在线买单消息 去查看 跳转在线买单详情页面
  831 + NavigatorUtil
  832 + .goOnlineCheckDetailPage(
  833 + context,
  834 + rid: '${widget.rid}');
  835 + },
  836 + child: Container(
  837 + height: ScreenUtil()
  838 + .setWidth(87 * 2),
  839 + child: Row(
  840 + mainAxisAlignment:
  841 + MainAxisAlignment
  842 + .spaceBetween,
  843 + children: [
  844 + Text(
  845 + "实收金额:",
  846 + style: TextStyle(
  847 + color: MyColours
  848 + .color_707070,
  849 + fontSize:
  850 + ScreenUtil()
  851 + .setSp(30)),
  852 + ),
  853 + HEmptyView(20),
  854 + Text(
  855 + '¥ ${_onlineCheckEditProvider.orderInfoSunModel.price}',
  856 + style: TextStyle(
  857 + color: MyColours
  858 + .color_353535,
  859 + fontSize:
  860 + ScreenUtil()
  861 + .setSp(32)),
  862 + ),
  863 + Spacer(),
  864 + Text('查看明细',
  865 + style: TextStyle(
  866 + color: MyColours
  867 + .color_707070,
  868 + fontSize:
  869 + ScreenUtil()
  870 + .setSp(
  871 + 28))),
  872 + HEmptyView(20),
  873 + Image.asset(
  874 + Utils.getImgPath(
  875 + 'arr_right_gray'),
  876 + width: ScreenUtil()
  877 + .setWidth(12),
  878 + height: ScreenUtil()
  879 + .setWidth(22),
  880 + )
  881 + ],
  882 + ),
  883 + ),
  884 + )
  885 + : Container(),
690 ], 886 ],
691 )), 887 )),
692 ), 888 ),
@@ -5,21 +5,15 @@ import 'package:common_utils/common_utils.dart'; @@ -5,21 +5,15 @@ import 'package:common_utils/common_utils.dart';
5 import 'package:flutter/cupertino.dart'; 5 import 'package:flutter/cupertino.dart';
6 import 'package:flutter/material.dart'; 6 import 'package:flutter/material.dart';
7 import 'package:flutter_screenutil/flutter_screenutil.dart'; 7 import 'package:flutter_screenutil/flutter_screenutil.dart';
8 -import 'package:one_key/app.dart';  
9 -import 'package:one_key/models/notebook_detail.dart';  
10 -import 'package:one_key/pages/detail/notebook_detail_change_page.dart';  
11 -import 'package:one_key/pages/detail/notebook_detail_page.dart';  
12 -import 'package:one_key/pages/enter/enter_page.dart'; 8 +
13 import 'package:one_key/pages/message/message_page.dart'; 9 import 'package:one_key/pages/message/message_page.dart';
14 import 'package:one_key/pages/my/my_page.dart'; 10 import 'package:one_key/pages/my/my_page.dart';
15 import 'package:one_key/pages/notebook/notebook_page.dart'; 11 import 'package:one_key/pages/notebook/notebook_page.dart';
16 import 'package:one_key/pages/table/table_manager_page.dart'; 12 import 'package:one_key/pages/table/table_manager_page.dart';
17 import 'package:one_key/provider/contact_model.dart'; 13 import 'package:one_key/provider/contact_model.dart';
18 -import 'package:one_key/provider/enter_model.dart';  
19 import 'package:one_key/provider/message_dialog_model.dart'; 14 import 'package:one_key/provider/message_dialog_model.dart';
20 import 'package:one_key/provider/message_model.dart'; 15 import 'package:one_key/provider/message_model.dart';
21 import 'package:one_key/provider/my_model.dart'; 16 import 'package:one_key/provider/my_model.dart';
22 -import 'package:one_key/provider/notebook_detail_change_model.dart';  
23 import 'package:one_key/provider/notebook_model.dart'; 17 import 'package:one_key/provider/notebook_model.dart';
24 import 'package:one_key/provider/table_manager_model.dart'; 18 import 'package:one_key/provider/table_manager_model.dart';
25 import 'package:one_key/provider/tools.dart'; 19 import 'package:one_key/provider/tools.dart';
@@ -27,13 +21,10 @@ import 'package:one_key/provider/update_model.dart'; @@ -27,13 +21,10 @@ import 'package:one_key/provider/update_model.dart';
27 import 'package:one_key/provider/user_model.dart'; 21 import 'package:one_key/provider/user_model.dart';
28 import 'package:one_key/res/colors.dart'; 22 import 'package:one_key/res/colors.dart';
29 import 'package:one_key/utils/dialog_util.dart'; 23 import 'package:one_key/utils/dialog_util.dart';
30 -import 'package:one_key/utils/event_bus.dart';  
31 -import 'package:one_key/utils/misc.dart'; 24 +
32 import 'package:one_key/utils/navigator_util.dart'; 25 import 'package:one_key/utils/navigator_util.dart';
33 import 'package:one_key/utils/utils.dart'; 26 import 'package:one_key/utils/utils.dart';
34 -import 'package:permission_handler/permission_handler.dart';  
35 import 'package:provider/provider.dart'; 27 import 'package:provider/provider.dart';
36 -import 'package:shared_preferences/shared_preferences.dart';  
37 import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; 28 import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
38 import 'package:flutter_app_badger/flutter_app_badger.dart'; 29 import 'package:flutter_app_badger/flutter_app_badger.dart';
39 import 'package:one_key/models/message.dart'; 30 import 'package:one_key/models/message.dart';
@@ -131,6 +122,11 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -131,6 +122,11 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
131 NavigatorUtil.goOnlineCheckEditPage(context, 122 NavigatorUtil.goOnlineCheckEditPage(context,
132 rid: notifyParam["rid"], fromNotify: true); 123 rid: notifyParam["rid"], fromNotify: true);
133 break; 124 break;
  125 + case "13":
  126 + //在线买单消息 去查看 跳转在线买单详情页面
  127 + NavigatorUtil.goOnlineCheckDetailPage(context,
  128 + rid: notifyParam["rid"], fromNotify: true);
  129 + break;
134 case "1": 130 case "1":
135 NavigatorUtil.goHasOrderFoodPage(context, 131 NavigatorUtil.goHasOrderFoodPage(context,
136 rid: notifyParam["rid"], fromNotify: true); 132 rid: notifyParam["rid"], fromNotify: true);
@@ -226,6 +222,16 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -226,6 +222,16 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
226 context, custom['rid'].toString(), 222 context, custom['rid'].toString(),
227 mid: custom['mid'].toString(), fromNotify: true); 223 mid: custom['mid'].toString(), fromNotify: true);
228 break; 224 break;
  225 + case "12":
  226 + //在线买单消息 去处理 跳转在线买单处理页面
  227 + NavigatorUtil.goOnlineCheckEditPage(context,
  228 + rid: custom["rid"], fromNotify: true);
  229 + break;
  230 + case "13":
  231 + //在线买单消息 去查看 跳转在线买单详情页面
  232 + NavigatorUtil.goOnlineCheckDetailPage(context,
  233 + rid: custom["rid"], fromNotify: true);
  234 + break;
229 case "1": 235 case "1":
230 NavigatorUtil.goHasOrderFoodPage(context, 236 NavigatorUtil.goHasOrderFoodPage(context,
231 rid: custom["rid"], fromNotify: true); 237 rid: custom["rid"], fromNotify: true);
@@ -352,27 +358,25 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -352,27 +358,25 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
352 ///获取全部未读消息 358 ///获取全部未读消息
353 /// 359 ///
354 _getAllUnMessages() { 360 _getAllUnMessages() {
355 - getUntreatedMessage('1', () {  
356 - getUntreatedMessage('10', () {  
357 - MessageDialogModel messageModel =  
358 - Provider.of<MessageDialogModel>(context, listen: false);  
359 - if (messageModel.messages.isNotEmpty) {  
360 - //底部弹出布局  
361 - if (!messageModel.showMessageDialog) {  
362 - DialogUtil.showMessageDialog(context);  
363 - } else {  
364 - messageModel.notifyListeners();  
365 - }  
366 - //播放声音  
367 - if (messageModel.messages.length > 1) {  
368 - messageModel.play("-1");  
369 - } else {  
370 - for (Message message in messageModel.messages) {  
371 - messageModel.play(message.message_type);  
372 - } 361 + getUntreatedMessage('11,10,1,12,13,14', () {
  362 + MessageDialogModel messageModel =
  363 + Provider.of<MessageDialogModel>(context, listen: false);
  364 + if (messageModel.messages.isNotEmpty) {
  365 + //底部弹出布局
  366 + if (!messageModel.showMessageDialog) {
  367 + DialogUtil.showMessageDialog(context);
  368 + } else {
  369 + messageModel.notifyListeners();
  370 + }
  371 + //播放声音
  372 + if (messageModel.messages.length > 1) {
  373 + messageModel.play("-1");
  374 + } else {
  375 + for (Message message in messageModel.messages) {
  376 + messageModel.play(message.message_type);
373 } 377 }
374 } 378 }
375 - }); 379 + }
376 }); 380 });
377 } 381 }
378 382
@@ -41,7 +41,23 @@ class MessageDialogItem extends StatelessWidget { @@ -41,7 +41,23 @@ class MessageDialogItem extends StatelessWidget {
41 subTitleFir = '桌位信息'; 41 subTitleFir = '桌位信息';
42 subTitleSec = '就餐时间'; 42 subTitleSec = '就餐时间';
43 subTitleThr = '预订人'; 43 subTitleThr = '预订人';
  44 + } else if (message.message_type == "12") {
  45 + title = "在线买单";
  46 + subTitleFir = '桌位信息';
  47 + subTitleSec = '申请时间';
  48 + subTitleThr = '预订人';
  49 + } else if (message.message_type == "13") {
  50 + title = "买单通知";
  51 + subTitleFir = '桌位信息';
  52 + subTitleSec = '申请时间';
  53 + subTitleThr = '预订人';
  54 + } else if (message.message_type == "14") {
  55 + title = "发票申请";
  56 + subTitleFir = '桌位信息';
  57 + subTitleSec = '申请时间';
  58 + subTitleThr = '预订人';
44 } 59 }
  60 +
45 Color textColor = 61 Color textColor =
46 isTreated ? MyColours.color_999999 : MyColours.color_353535; 62 isTreated ? MyColours.color_999999 : MyColours.color_353535;
47 MessageDialogModel messageDialogModel = 63 MessageDialogModel messageDialogModel =
@@ -49,7 +65,26 @@ class MessageDialogItem extends StatelessWidget { @@ -49,7 +65,26 @@ class MessageDialogItem extends StatelessWidget {
49 return GestureDetector( 65 return GestureDetector(
50 onTap: () { 66 onTap: () {
51 if (isTreated) { 67 if (isTreated) {
52 - NavigatorUtil.goNotebookDetailPage(context, message.rid.toString()); 68 + if (message.message_type == "10") {
  69 + NavigatorUtil.goNotebookDetailPage(
  70 + context, message.rid.toString());
  71 + } else if (message.message_type == "1") {
  72 + NavigatorUtil.goHasOrderFoodPage(context, rid: message.rid);
  73 + } else if (message.message_type == "11") {
  74 + NavigatorUtil.goNotebookDetailPage(
  75 + context, message.rid.toString());
  76 + } else if (message.message_type == "12") {
  77 + //在线买单消息查看
  78 + NavigatorUtil.goOnlineCheckDetailPage(context,
  79 + rid: '${message.rid}');
  80 + } else if (message.message_type == "13") {
  81 + //买单通知,跳转至买单详情查看
  82 + NavigatorUtil.goOnlineCheckDetailPage(context,
  83 + rid: '${message.rid}');
  84 + } else if (message.message_type == "14") {
  85 + //发票详情页面跳转
  86 + NavigatorUtil.goInvoiceDetailPage(context, rid: '${message.rid}');
  87 + }
53 } 88 }
54 }, 89 },
55 child: Stack( 90 child: Stack(
@@ -135,7 +170,10 @@ class MessageDialogItem extends StatelessWidget { @@ -135,7 +170,10 @@ class MessageDialogItem extends StatelessWidget {
135 width: 160, 170 width: 160,
136 height: 48, 171 height: 48,
137 fontSize: 28, 172 fontSize: 28,
138 - content: message.message_type == "10" ? "立即处理" : "立即查看", 173 + content: message.message_type == "10" ||
  174 + message.message_type == "12"
  175 + ? "立即处理"
  176 + : "立即查看",
139 state: 1, 177 state: 1,
140 onPress: () async { 178 onPress: () async {
141 messageDialogModel.removeMessage(message.id); 179 messageDialogModel.removeMessage(message.id);
@@ -181,6 +219,46 @@ class MessageDialogItem extends StatelessWidget { @@ -181,6 +219,46 @@ class MessageDialogItem extends StatelessWidget {
181 await messageDialogModel.setMessageStatus( 219 await messageDialogModel.setMessageStatus(
182 context, params); 220 context, params);
183 bus.emit("refresh_untreated_num"); //刷新未读消息数目 221 bus.emit("refresh_untreated_num"); //刷新未读消息数目
  222 + } else if ('${message.message_type}' == "12") {
  223 + //在线买单消息 去处理 跳转在线买单处理页面
  224 + NavigatorUtil.goOnlineCheckEditPage(context,
  225 + rid: '${message.rid}', mid: message.id);
  226 + } else if ('${message.message_type}' == "13") {
  227 + //在线买单消息 去查看 跳转在线买单详情页面
  228 + NavigatorUtil.goOnlineCheckDetailPage(context,
  229 + rid: '${message.rid}');
  230 + bus.emit("remove_untreated_message", message.id);
  231 +
  232 + Map<String, String> params = {
  233 + "sid": Provider.of<UserModel>(context, listen: false)
  234 + .user
  235 + .sellerid,
  236 + "id": message.id,
  237 + "status": message.message_type == "1"
  238 + ? "is_read"
  239 + : "is_handle"
  240 + };
  241 + await messageDialogModel.setMessageStatus(
  242 + context, params);
  243 + bus.emit("refresh_untreated_num"); //刷新未读消息数目
  244 + } else if (message.message_type == "14") {
  245 + //发票详情页面跳转
  246 + NavigatorUtil.goInvoiceDetailPage(context,
  247 + rid: '${message.rid}');
  248 + bus.emit("remove_untreated_message", message.id);
  249 +
  250 + Map<String, String> params = {
  251 + "sid": Provider.of<UserModel>(context, listen: false)
  252 + .user
  253 + .sellerid,
  254 + "id": message.id,
  255 + "status": message.message_type == "1"
  256 + ? "is_read"
  257 + : "is_handle"
  258 + };
  259 + await messageDialogModel.setMessageStatus(
  260 + context, params);
  261 + bus.emit("refresh_untreated_num"); //刷新未读消息数目
184 } 262 }
185 }, 263 },
186 ), 264 ),
@@ -39,6 +39,14 @@ class MessageItem extends StatelessWidget { @@ -39,6 +39,14 @@ class MessageItem extends StatelessWidget {
39 titleText = "在线买单"; 39 titleText = "在线买单";
40 subTitleTextFir = '桌位信息'; 40 subTitleTextFir = '桌位信息';
41 subTitleTextSec = '申请时间'; 41 subTitleTextSec = '申请时间';
  42 + } else if (message.message_type == "13") {
  43 + titleText = "买单通知";
  44 + subTitleTextFir = '桌位信息';
  45 + subTitleTextSec = '申请时间';
  46 + } else if (message.message_type == "14") {
  47 + titleText = "发票申请";
  48 + subTitleTextFir = '桌位信息';
  49 + subTitleTextSec = '申请时间';
42 } 50 }
43 51
44 MessageDialogModel messageDialogModel = 52 MessageDialogModel messageDialogModel =
@@ -57,8 +65,15 @@ class MessageItem extends StatelessWidget { @@ -57,8 +65,15 @@ class MessageItem extends StatelessWidget {
57 context, message.rid.toString()); 65 context, message.rid.toString());
58 } else if (message.message_type == "12") { 66 } else if (message.message_type == "12") {
59 //在线买单消息查看 67 //在线买单消息查看
60 - NavigatorUtil.goOnlineCheckEditPage(context, 68 + NavigatorUtil.goOnlineCheckDetailPage(context,
  69 + rid: '${message.rid}');
  70 + } else if (message.message_type == "13") {
  71 + //买单通知,跳转至买单详情查看
  72 + NavigatorUtil.goOnlineCheckDetailPage(context,
61 rid: '${message.rid}'); 73 rid: '${message.rid}');
  74 + } else if (message.message_type == "14") {
  75 + //发票详情页面跳转
  76 + NavigatorUtil.goInvoiceDetailPage(context, rid: '${message.rid}');
62 } 77 }
63 } 78 }
64 }, 79 },
@@ -194,7 +209,43 @@ class MessageItem extends StatelessWidget { @@ -194,7 +209,43 @@ class MessageItem extends StatelessWidget {
194 } else if ('${message.message_type}' == "12") { 209 } else if ('${message.message_type}' == "12") {
195 //在线买单消息 去处理 跳转在线买单处理页面 210 //在线买单消息 去处理 跳转在线买单处理页面
196 NavigatorUtil.goOnlineCheckEditPage(context, 211 NavigatorUtil.goOnlineCheckEditPage(context,
  212 + rid: '${message.rid}', mid: message.id);
  213 + } else if ('${message.message_type}' == "13") {
  214 + //在线买单消息 去查看 跳转在线买单详情页面
  215 + NavigatorUtil.goOnlineCheckDetailPage(context,
  216 + rid: '${message.rid}');
  217 + bus.emit("remove_untreated_message", message.id);
  218 +
  219 + Map<String, String> params = {
  220 + "sid": Provider.of<UserModel>(context, listen: false)
  221 + .user
  222 + .sellerid,
  223 + "id": message.id,
  224 + "status": message.message_type == "1"
  225 + ? "is_read"
  226 + : "is_handle"
  227 + };
  228 + await messageDialogModel.setMessageStatus(
  229 + context, params);
  230 + bus.emit("refresh_untreated_num"); //刷新未读消息数目
  231 + } else if (message.message_type == "14") {
  232 + //发票详情页面跳转
  233 + NavigatorUtil.goInvoiceDetailPage(context,
197 rid: '${message.rid}'); 234 rid: '${message.rid}');
  235 + bus.emit("remove_untreated_message", message.id);
  236 +
  237 + Map<String, String> params = {
  238 + "sid": Provider.of<UserModel>(context, listen: false)
  239 + .user
  240 + .sellerid,
  241 + "id": message.id,
  242 + "status": message.message_type == "1"
  243 + ? "is_read"
  244 + : "is_handle"
  245 + };
  246 + await messageDialogModel.setMessageStatus(
  247 + context, params);
  248 + bus.emit("refresh_untreated_num"); //刷新未读消息数目
198 } 249 }
199 }, 250 },
200 ), 251 ),
@@ -43,115 +43,137 @@ class NotebookItemState extends State<NoteBookItem> { @@ -43,115 +43,137 @@ class NotebookItemState extends State<NoteBookItem> {
43 ? MyColours.color_bfbfbf 43 ? MyColours.color_bfbfbf
44 : MyColours.color_353535; 44 : MyColours.color_353535;
45 45
46 - return Container(  
47 - width: double.infinity,  
48 - // height: ScreenUtil().setWidth(120),  
49 - color: (widget.index % 2 == 0)  
50 - ? MyColours.color_f7fdfd  
51 - : MyColours.color_ffffff,  
52 - child: Row(  
53 - children: <Widget>[  
54 - GestureDetector(  
55 - behavior: HitTestBehavior.translucent,  
56 - onTap: () {  
57 - NavigatorUtil.goNotebookDetailPage(context, notebook.id);  
58 - },  
59 - child: Row(  
60 - children: <Widget>[  
61 - Container(  
62 - width: ScreenUtil().setWidth(171),  
63 - padding: EdgeInsets.symmetric(  
64 - horizontal: ScreenUtil().setWidth(24),  
65 - vertical: ScreenUtil().setWidth(20)),  
66 - alignment: Alignment.center,  
67 - child: Text(  
68 - notebook.tableinfoStr?.trim(),  
69 - maxLines: 30,  
70 - overflow: TextOverflow.ellipsis,  
71 - style: TextStyle(  
72 - color: textColor,  
73 - // fontWeight: FontWeight.bold,  
74 - fontSize: ScreenUtil().setSp(30)),  
75 - ),  
76 - ),  
77 - MyDivider(  
78 - ScreenUtil().setWidth(1),  
79 - ScreenUtil().setHeight(90),  
80 - color: MyColours.color_ededed,  
81 - ),  
82 - Container(  
83 - width: ScreenUtil().setWidth(230),  
84 - alignment: Alignment.center,  
85 - child: Column(  
86 - mainAxisSize: MainAxisSize.min,  
87 - children: <Widget>[  
88 - Text(  
89 - notebook.rnameStr,  
90 - // 'nnnnnnnnnnnnnn',  
91 - maxLines: 1, 46 + return Stack(
  47 + children: [
  48 + Container(
  49 + width: double.infinity,
  50 + // height: ScreenUtil().setWidth(120),
  51 + color: (widget.index % 2 == 0)
  52 + ? MyColours.color_f7fdfd
  53 + : MyColours.color_ffffff,
  54 + child: Row(
  55 + children: <Widget>[
  56 + GestureDetector(
  57 + behavior: HitTestBehavior.translucent,
  58 + onTap: () {
  59 + NavigatorUtil.goNotebookDetailPage(context, notebook.id);
  60 + },
  61 + child: Row(
  62 + children: <Widget>[
  63 + Container(
  64 + width: ScreenUtil().setWidth(86 * 2),
  65 + padding: EdgeInsets.symmetric(
  66 + horizontal: ScreenUtil().setWidth(14),
  67 + vertical: ScreenUtil().setWidth(40)),
  68 + alignment: Alignment.center,
  69 + child: Text(
  70 + notebook.tableinfoStr?.trim(),
  71 + maxLines: 30,
92 overflow: TextOverflow.ellipsis, 72 overflow: TextOverflow.ellipsis,
93 style: TextStyle( 73 style: TextStyle(
94 color: textColor, 74 color: textColor,
95 // fontWeight: FontWeight.bold, 75 // fontWeight: FontWeight.bold,
96 fontSize: ScreenUtil().setSp(30)), 76 fontSize: ScreenUtil().setSp(30)),
97 ), 77 ),
98 - VEmptyView(10),  
99 - Text(  
100 - notebook.phoneStr,  
101 - maxLines: 1,  
102 - overflow: TextOverflow.ellipsis, 78 + ),
  79 + MyDivider(
  80 + ScreenUtil().setWidth(1),
  81 + ScreenUtil().setHeight(90),
  82 + color: MyColours.color_ededed,
  83 + ),
  84 + Container(
  85 + width: ScreenUtil().setWidth(230),
  86 + alignment: Alignment.center,
  87 + child: Column(
  88 + mainAxisSize: MainAxisSize.min,
  89 + children: <Widget>[
  90 + Text(
  91 + notebook.rnameStr,
  92 + // 'nnnnnnnnnnnnnn',
  93 + maxLines: 1,
  94 + overflow: TextOverflow.ellipsis,
  95 + style: TextStyle(
  96 + color: textColor,
  97 + // fontWeight: FontWeight.bold,
  98 + fontSize: ScreenUtil().setSp(30)),
  99 + ),
  100 + VEmptyView(10),
  101 + Text(
  102 + notebook.phoneStr,
  103 + maxLines: 1,
  104 + overflow: TextOverflow.ellipsis,
  105 + style: TextStyle(
  106 + color: textColor,
  107 + // fontWeight: FontWeight.bold,
  108 + fontSize: ScreenUtil().setSp(26)),
  109 + )
  110 + ],
  111 + ),
  112 + ),
  113 + MyDivider(
  114 + ScreenUtil().setWidth(1),
  115 + ScreenUtil().setHeight(90),
  116 + color: MyColours.color_ededed,
  117 + ),
  118 + Container(
  119 + width: ScreenUtil().setWidth(159),
  120 + alignment: Alignment.center,
  121 + child: Text(
  122 + notebook.ddateStr,
103 style: TextStyle( 123 style: TextStyle(
104 color: textColor, 124 color: textColor,
105 // fontWeight: FontWeight.bold, 125 // fontWeight: FontWeight.bold,
106 - fontSize: ScreenUtil().setSp(26)),  
107 - )  
108 - ],  
109 - ),  
110 - ),  
111 - MyDivider(  
112 - ScreenUtil().setWidth(1),  
113 - ScreenUtil().setHeight(90),  
114 - color: MyColours.color_ededed, 126 + fontSize: ScreenUtil().setSp(30)),
  127 + ),
  128 + ),
  129 + ],
115 ), 130 ),
116 - Container(  
117 - width: ScreenUtil().setWidth(159), 131 + ),
  132 + MyDivider(
  133 + ScreenUtil().setWidth(1),
  134 + ScreenUtil().setHeight(90),
  135 + color: MyColours.color_ededed,
  136 + ),
  137 + GestureDetector(
  138 + onTap: _onOperateClick,
  139 + child: Container(
  140 + width: ScreenUtil().setWidth(184),
118 alignment: Alignment.center, 141 alignment: Alignment.center,
119 child: Text( 142 child: Text(
120 - notebook.ddateStr, 143 + notebook.operationText,
121 style: TextStyle( 144 style: TextStyle(
122 - color: textColor, 145 + color: (notebook.status == "3" ||
  146 + notebook.status == "4" ||
  147 + notebook.status == "6")
  148 + ? MyColours.color_bfbfbf
  149 + : MyColours.color_2bb5b7,
123 // fontWeight: FontWeight.bold, 150 // fontWeight: FontWeight.bold,
124 fontSize: ScreenUtil().setSp(30)), 151 fontSize: ScreenUtil().setSp(30)),
125 ), 152 ),
126 ), 153 ),
127 - ],  
128 - ),  
129 - ),  
130 - MyDivider(  
131 - ScreenUtil().setWidth(1),  
132 - ScreenUtil().setHeight(90),  
133 - color: MyColours.color_ededed,  
134 - ),  
135 - GestureDetector(  
136 - onTap: _onOperateClick,  
137 - child: Container(  
138 - width: ScreenUtil().setWidth(184),  
139 - alignment: Alignment.center,  
140 - child: Text(  
141 - notebook.operationText,  
142 - style: TextStyle(  
143 - color: (notebook.status == "3" ||  
144 - notebook.status == "4" ||  
145 - notebook.status == "6")  
146 - ? MyColours.color_bfbfbf  
147 - : MyColours.color_2bb5b7,  
148 - // fontWeight: FontWeight.bold,  
149 - fontSize: ScreenUtil().setSp(30)),  
150 ), 154 ),
151 - ), 155 + ],
152 ), 156 ),
153 - ],  
154 - ), 157 + ),
  158 + notebook.orderInfo != null && notebook.orderInfo.status == '3'
  159 + ? Container(
  160 + alignment: Alignment.center,
  161 + width: ScreenUtil().setWidth(52 * 2),
  162 + height: ScreenUtil().setWidth(19 * 2),
  163 + decoration: BoxDecoration(
  164 + color: MyColours.color_F59A23,
  165 + borderRadius: BorderRadius.only(
  166 + bottomRight: Radius.circular(ScreenUtil().setWidth(10))),
  167 + ),
  168 + child: Text(
  169 + '已买单',
  170 + style: TextStyle(
  171 + fontSize: ScreenUtil().setSp(24),
  172 + color: MyColours.color_ffffff,
  173 + fontWeight: FontWeight.bold),
  174 + ))
  175 + : Container()
  176 + ],
155 ); 177 );
156 } 178 }
157 } 179 }
@@ -469,19 +469,22 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> { @@ -469,19 +469,22 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
469 ? Text('') 469 ? Text('')
470 : InkWell( 470 : InkWell(
471 onTap: () { 471 onTap: () {
472 - _onlineCheckEditProvider.imageQiniuUrlList = [];  
473 - if (_onlineCheckEditProvider.imageList[index].qiniuUrl !=  
474 - null) {  
475 - for (int i = 0;  
476 - i < _onlineCheckEditProvider.imageList.length;  
477 - i++) {  
478 - _onlineCheckEditProvider.imageQiniuUrlList.add(  
479 - _onlineCheckEditProvider.imageList[i].qiniuUrl);  
480 - } 472 + if (_onlineCheckEditProvider.imageList[index].process ==
  473 + 1) {
  474 + _onlineCheckEditProvider.imageQiniuUrlList = [];
  475 + if (_onlineCheckEditProvider.imageList[index].qiniuUrl !=
  476 + null) {
  477 + for (int i = 0;
  478 + i < _onlineCheckEditProvider.imageList.length;
  479 + i++) {
  480 + _onlineCheckEditProvider.imageQiniuUrlList.add(
  481 + _onlineCheckEditProvider.imageList[i].qiniuUrl);
  482 + }
481 483
482 - ///没有上传完成的不可以点击  
483 - _showPhotoView(  
484 - context, index, _provider.imageQiniuUrlList); 484 + ///没有上传完成的不可以点击
  485 + _showPhotoView(
  486 + context, index, _provider.imageQiniuUrlList);
  487 + }
485 } 488 }
486 }, 489 },
487 child: Stack( 490 child: Stack(
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_screenutil/flutter_screenutil.dart';
  3 +import 'package:one_key/provider/online_check_edit_provider.dart';
  4 +import 'package:one_key/provider/order_food_provider.dart';
  5 +import 'package:one_key/provider/user_model.dart';
  6 +import 'package:one_key/res/colors.dart';
  7 +import 'package:one_key/utils/navigator_util.dart';
  8 +import 'package:one_key/utils/utils.dart';
  9 +import 'package:one_key/widgets/h_empty_view.dart';
  10 +import 'package:one_key/widgets/system_app_bar.dart';
  11 +import 'package:one_key/widgets/v_empty_view.dart';
  12 +import 'package:provider/provider.dart';
  13 +
  14 +class InvoiceDetailPage extends StatefulWidget {
  15 + final bool fromNotify;
  16 + final String rid;
  17 + InvoiceDetailPage({Key key, this.fromNotify, this.rid}) : super(key: key);
  18 +
  19 + @override
  20 + _InvoiceDetailPageState createState() => _InvoiceDetailPageState();
  21 +}
  22 +
  23 +class _InvoiceDetailPageState extends State<InvoiceDetailPage> {
  24 + OnlineCheckEditProvider _onlineCheckEditProvider;
  25 + OrderFoodProvider _orderFoodProvider;
  26 + bool arrowStatus = true; // true合住 false展开
  27 +
  28 + @override
  29 + void initState() {
  30 + super.initState();
  31 + WidgetsBinding.instance.addPostFrameCallback((_) {
  32 + _getTableInfoData();
  33 + _getOrderInfo();
  34 + });
  35 + }
  36 +
  37 + ///获取订单详情
  38 + _getOrderInfo() async {
  39 + UserModel userModel = Provider.of<UserModel>(context, listen: false);
  40 + Map<String, String> params = {"rid": widget.rid};
  41 + //remark信息获取
  42 + await _onlineCheckEditProvider.getOrderInfo(context, params);
  43 + }
  44 +
  45 + ///接口获取桌位信息
  46 + _getTableInfoData() async {
  47 + UserModel userModel = Provider.of<UserModel>(context, listen: false);
  48 + Map<String, String> params = {
  49 + "openid": userModel.user.openid,
  50 + "rid": widget.rid
  51 + };
  52 + //明天完成 桌位名称信息
  53 + await _orderFoodProvider.getTableInfoData(context, params);
  54 + }
  55 +
  56 + ///桌位信息
  57 + Widget _tableInfoWidget() {
  58 + bool showArrow = false;
  59 + //1散座 2包间 3卡座
  60 + List<String> tableNameSunList1 = []; //单个类型包含的所有桌子名称
  61 + List<String> tableNameSunList2 = []; //单个类型包含的所有桌子名称
  62 + List<String> tableNameSunList3 = []; //单个类型包含的所有桌子名称
  63 + if (_orderFoodProvider.reserveDetailSunModel != null) {
  64 + tableNameSunList1 =
  65 + _orderFoodProvider.reserveDetailSunModel.tableNameList[0]['散座'];
  66 + tableNameSunList2 =
  67 + _orderFoodProvider.reserveDetailSunModel.tableNameList[1]['包间'];
  68 + tableNameSunList3 =
  69 + _orderFoodProvider.reserveDetailSunModel.tableNameList[2]['卡座'];
  70 + if (tableNameSunList2.length > 0) {
  71 + if (arrowStatus) {
  72 + _orderFoodProvider.showTable = '【包间】${tableNameSunList2[0]}';
  73 + } else {
  74 + _orderFoodProvider.showTable = '';
  75 + }
  76 + } else if (tableNameSunList3.length > 0) {
  77 + if (arrowStatus) {
  78 + _orderFoodProvider.showTable = '【卡座】${tableNameSunList3[0]}';
  79 + } else {
  80 + _orderFoodProvider.showTable = '';
  81 + }
  82 + } else if (tableNameSunList1.length > 0) {
  83 + if (arrowStatus) {
  84 + _orderFoodProvider.showTable = '【散座】${tableNameSunList1[0]}';
  85 + } else {
  86 + _orderFoodProvider.showTable = '';
  87 + }
  88 + }
  89 + if (tableNameSunList1.length > 1 ||
  90 + tableNameSunList2.length > 1 ||
  91 + tableNameSunList3.length > 1) {
  92 + showArrow = true;
  93 + } else {
  94 + showArrow = false;
  95 + }
  96 + }
  97 + return Container(
  98 + height: ScreenUtil().setWidth(57 * 2),
  99 + decoration: BoxDecoration(
  100 + color: Colors.white,
  101 + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))),
  102 + padding: EdgeInsets.symmetric(
  103 + horizontal: ScreenUtil().setWidth(40),
  104 + vertical: ScreenUtil().setWidth(18 * 2)),
  105 + child: Column(children: [
  106 + InkWell(
  107 + onTap: () {
  108 + if (showArrow) {
  109 + //有arrow
  110 + arrowStatus = !arrowStatus;
  111 + _orderFoodProvider.notifyListeners();
  112 + }
  113 + },
  114 + child: Container(
  115 + child: Row(
  116 + children: [
  117 + Text('桌位信息',
  118 + style: TextStyle(
  119 + fontSize: ScreenUtil().setSp(30),
  120 + color: MyColours.color_707070,
  121 + fontWeight: FontWeight.bold)),
  122 + Spacer(),
  123 + Text(
  124 + _orderFoodProvider.showTable,
  125 + style: TextStyle(
  126 + fontSize: ScreenUtil().setSp(30),
  127 + fontWeight: FontWeight.bold,
  128 + color: MyColours.color_353535),
  129 + ),
  130 + Offstage(
  131 + offstage: !showArrow,
  132 + child: Row(
  133 + children: [
  134 + HEmptyView(20),
  135 + Image.asset(
  136 + arrowStatus
  137 + ? Utils.getImgPath('down')
  138 + : Utils.getImgPath('up'),
  139 + width: ScreenUtil().setWidth(24),
  140 + height: ScreenUtil().setWidth(12))
  141 + ],
  142 + ),
  143 + )
  144 + ],
  145 + ),
  146 + ),
  147 + ),
  148 + Offstage(
  149 + offstage: arrowStatus,
  150 + child: Column(
  151 + crossAxisAlignment: CrossAxisAlignment.start,
  152 + children: [
  153 + VEmptyView(14),
  154 + tableNameSunList2.length > 0
  155 + ? Padding(
  156 + padding: EdgeInsets.fromLTRB(
  157 + ScreenUtil().setWidth(0),
  158 + ScreenUtil().setWidth(10),
  159 + ScreenUtil().setWidth(60),
  160 + ScreenUtil().setWidth(10)),
  161 + child: Text(
  162 + '【包间】${Utils.listToString(tableNameSunList2)}',
  163 + style: TextStyle(
  164 + fontSize: ScreenUtil().setSp(30),
  165 + color: MyColours.color_353535,
  166 + fontWeight: FontWeight.bold),
  167 + ),
  168 + )
  169 + : Container(),
  170 + tableNameSunList3.length > 0
  171 + ? Padding(
  172 + padding: EdgeInsets.fromLTRB(
  173 + ScreenUtil().setWidth(0),
  174 + ScreenUtil().setWidth(10),
  175 + ScreenUtil().setWidth(60),
  176 + ScreenUtil().setWidth(10)),
  177 + child: Text(
  178 + '【卡座】${Utils.listToString(tableNameSunList3)}',
  179 + style: TextStyle(
  180 + fontSize: ScreenUtil().setSp(30),
  181 + color: MyColours.color_353535),
  182 + ),
  183 + )
  184 + : Container(),
  185 + tableNameSunList1.length > 0
  186 + ? Padding(
  187 + padding: EdgeInsets.fromLTRB(
  188 + ScreenUtil().setWidth(0),
  189 + ScreenUtil().setWidth(10),
  190 + ScreenUtil().setWidth(60),
  191 + ScreenUtil().setWidth(10)),
  192 + child: Text(
  193 + '【散座】${Utils.listToString(tableNameSunList1)}',
  194 + style: TextStyle(
  195 + fontSize: ScreenUtil().setSp(30),
  196 + color: MyColours.color_353535),
  197 + ),
  198 + )
  199 + : Container(),
  200 + ],
  201 + ),
  202 + ),
  203 + ]));
  204 + }
  205 +
  206 + ///发票信息
  207 + Widget _invoiceInfoWidget() {
  208 + return Container(
  209 + width: double.infinity,
  210 + decoration: BoxDecoration(
  211 + color: Colors.white, borderRadius: BorderRadius.circular(10)),
  212 + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <
  213 + Widget>[
  214 + Container(
  215 + height: ScreenUtil().setWidth(53 * 2),
  216 + width: double.infinity,
  217 + decoration: BoxDecoration(
  218 + color: MyColours.color_FAFAFA,
  219 + borderRadius: BorderRadius.only(
  220 + topLeft: Radius.circular(10),
  221 + topRight: Radius.circular(10)),
  222 + ),
  223 + child: Padding(
  224 + padding: EdgeInsets.fromLTRB(
  225 + ScreenUtil().setWidth(20),
  226 + ScreenUtil().setWidth(36),
  227 + ScreenUtil().setWidth(20),
  228 + ScreenUtil().setWidth(26)),
  229 + child: Text(
  230 + '发票信息',
  231 + style: TextStyle(
  232 + fontSize: ScreenUtil().setSp(32),
  233 + color: MyColours.color_353535,
  234 + fontWeight: FontWeight.bold),
  235 + ),
  236 + )),
  237 + Container(
  238 + color: Colors.white,
  239 + padding: EdgeInsets.fromLTRB(
  240 + ScreenUtil().setWidth(40),
  241 + ScreenUtil().setWidth(24),
  242 + ScreenUtil().setWidth(40),
  243 + ScreenUtil().setWidth(36)),
  244 + child: Column(children: [
  245 + _customInfoItemWidget(
  246 + '名称',
  247 + _onlineCheckEditProvider.orderInfoSunModel != null
  248 + ? _onlineCheckEditProvider
  249 + .orderInfoSunModel.invoice.title
  250 + : ''),
  251 + Offstage(
  252 + offstage: _onlineCheckEditProvider.orderInfoSunModel != null
  253 + ? _onlineCheckEditProvider
  254 + .orderInfoSunModel.invoice.taxnumber ==
  255 + ''
  256 + : true,
  257 + child: Padding(
  258 + padding: EdgeInsets.only(top: ScreenUtil().setWidth(24)),
  259 + child: _customInfoItemWidget(
  260 + '税号',
  261 + _onlineCheckEditProvider.orderInfoSunModel != null
  262 + ? _onlineCheckEditProvider
  263 + .orderInfoSunModel.invoice.taxnumber
  264 + : ''),
  265 + ),
  266 + ),
  267 + Offstage(
  268 + offstage: _onlineCheckEditProvider.orderInfoSunModel != null
  269 + ? _onlineCheckEditProvider
  270 + .orderInfoSunModel.invoice.companyaddress ==
  271 + ''
  272 + : true,
  273 + child: Padding(
  274 + padding: EdgeInsets.only(top: ScreenUtil().setWidth(24)),
  275 + child: _customInfoItemWidget(
  276 + '单位地址',
  277 + _onlineCheckEditProvider.orderInfoSunModel != null
  278 + ? _onlineCheckEditProvider
  279 + .orderInfoSunModel.invoice.companyaddress
  280 + : ''),
  281 + ),
  282 + ),
  283 + Offstage(
  284 + offstage: _onlineCheckEditProvider.orderInfoSunModel != null
  285 + ? _onlineCheckEditProvider
  286 + .orderInfoSunModel.invoice.telephone ==
  287 + ''
  288 + : true,
  289 + child: Padding(
  290 + padding: EdgeInsets.only(top: ScreenUtil().setWidth(24)),
  291 + child: _customInfoItemWidget(
  292 + '电话号码',
  293 + _onlineCheckEditProvider.orderInfoSunModel != null
  294 + ? _onlineCheckEditProvider
  295 + .orderInfoSunModel.invoice.telephone
  296 + : ''),
  297 + ),
  298 + ),
  299 + Offstage(
  300 + offstage: _onlineCheckEditProvider.orderInfoSunModel != null
  301 + ? _onlineCheckEditProvider
  302 + .orderInfoSunModel.invoice.bankname ==
  303 + ''
  304 + : true,
  305 + child: Padding(
  306 + padding: EdgeInsets.only(top: ScreenUtil().setWidth(24)),
  307 + child: _customInfoItemWidget(
  308 + '开户银行',
  309 + _onlineCheckEditProvider.orderInfoSunModel != null
  310 + ? _onlineCheckEditProvider
  311 + .orderInfoSunModel.invoice.bankname
  312 + : ''),
  313 + ),
  314 + ),
  315 + Offstage(
  316 + offstage: _onlineCheckEditProvider.orderInfoSunModel != null
  317 + ? _onlineCheckEditProvider
  318 + .orderInfoSunModel.invoice.bankaccount ==
  319 + ''
  320 + : true,
  321 + child: Padding(
  322 + padding: EdgeInsets.only(top: ScreenUtil().setWidth(24)),
  323 + child: _customInfoItemWidget(
  324 + '银行账号',
  325 + _onlineCheckEditProvider.orderInfoSunModel != null
  326 + ? _onlineCheckEditProvider
  327 + .orderInfoSunModel.invoice.bankaccount
  328 + : ''),
  329 + ),
  330 + )
  331 + ]))
  332 + ]));
  333 + }
  334 +
  335 + ///顾客信息
  336 + Widget _customInfoWidget() {
  337 + return Container(
  338 + width: double.infinity,
  339 + decoration: BoxDecoration(
  340 + color: Colors.white, borderRadius: BorderRadius.circular(10)),
  341 + child: Column(
  342 + crossAxisAlignment: CrossAxisAlignment.start,
  343 + children: <Widget>[
  344 + Container(
  345 + height: ScreenUtil().setWidth(53 * 2),
  346 + width: double.infinity,
  347 + decoration: BoxDecoration(
  348 + color: MyColours.color_FAFAFA,
  349 + borderRadius: BorderRadius.only(
  350 + topLeft: Radius.circular(10),
  351 + topRight: Radius.circular(10)),
  352 + ),
  353 + child: Padding(
  354 + padding: EdgeInsets.fromLTRB(
  355 + ScreenUtil().setWidth(20),
  356 + ScreenUtil().setWidth(36),
  357 + ScreenUtil().setWidth(20),
  358 + ScreenUtil().setWidth(26)),
  359 + child: Text(
  360 + '顾客信息',
  361 + style: TextStyle(
  362 + fontSize: ScreenUtil().setSp(32),
  363 + color: MyColours.color_353535,
  364 + fontWeight: FontWeight.bold),
  365 + ),
  366 + )),
  367 + Container(
  368 + color: Colors.white,
  369 + padding: EdgeInsets.fromLTRB(
  370 + ScreenUtil().setWidth(40),
  371 + ScreenUtil().setWidth(24),
  372 + ScreenUtil().setWidth(40),
  373 + ScreenUtil().setWidth(36)),
  374 + child: Column(
  375 + children: [
  376 + _customInfoItemWidget(
  377 + '买单顾客',
  378 + _orderFoodProvider.reserveDetailSunModel != null
  379 + ? _orderFoodProvider.reserveDetailSunModel.rnameStr
  380 + : ''),
  381 + VEmptyView(24),
  382 + _customInfoItemWidget(
  383 + '顾客电话',
  384 + _orderFoodProvider.reserveDetailSunModel != null
  385 + ? _orderFoodProvider.reserveDetailSunModel.phone
  386 + : ''),
  387 + VEmptyView(24),
  388 + _customInfoItemWidget(
  389 + '到店时间',
  390 + _orderFoodProvider.reserveDetailSunModel != null
  391 + ? _orderFoodProvider.reserveDetailSunModel.ddateStr
  392 + : ''),
  393 + VEmptyView(24),
  394 + _customInfoItemWidget(
  395 + '申请时间',
  396 + _orderFoodProvider.reserveDetailSunModel != null
  397 + ? _orderFoodProvider.reserveDetailSunModel.cdateStr
  398 + : '')
  399 + ],
  400 + ),
  401 + )
  402 + // _getGridImg(1, context)
  403 + ],
  404 + ),
  405 + );
  406 + }
  407 +
  408 + ///顾客信息
  409 + Widget _customInfoItemWidget(String title, String subTitle) {
  410 + return Row(
  411 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  412 + children: [
  413 + Text(
  414 + title,
  415 + style: TextStyle(
  416 + fontSize: ScreenUtil().setSp(28), color: MyColours.color_707070),
  417 + ),
  418 + HEmptyView(176),
  419 + Text(
  420 + subTitle,
  421 + maxLines: 3,
  422 + style: TextStyle(
  423 + fontSize: ScreenUtil().setSp(28),
  424 + color: MyColours.color_707070,
  425 + fontWeight: FontWeight.bold),
  426 + )
  427 + ],
  428 + );
  429 + }
  430 +
  431 + @override
  432 + Widget build(BuildContext context) {
  433 + _onlineCheckEditProvider =
  434 + Provider.of<OnlineCheckEditProvider>(context, listen: true);
  435 + _orderFoodProvider = Provider.of<OrderFoodProvider>(context, listen: true);
  436 + return Scaffold(
  437 + backgroundColor: MyColours.color_f5f5f5,
  438 + appBar: SystemAppBar(
  439 + '发票详情',
  440 + onTap: () {
  441 + if (widget.fromNotify) {
  442 + NavigatorUtil.goHomePage(context, initialIndex: 0);
  443 + } else {
  444 + Navigator.of(context).pop();
  445 + }
  446 + },
  447 + ),
  448 + body: SingleChildScrollView(
  449 + child: Padding(
  450 + padding: EdgeInsets.all(ScreenUtil().setWidth(20)),
  451 + child: Column(children: [
  452 + _tableInfoWidget(),
  453 + VEmptyView(20),
  454 + _invoiceInfoWidget(),
  455 + VEmptyView(20),
  456 + _customInfoWidget()
  457 + ]))));
  458 + }
  459 +}
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_screenutil/screenutil.dart';
  3 +import 'package:one_key/pages/online_check/photo_view_wiget.dart';
  4 +import 'package:one_key/provider/online_check_edit_provider.dart';
  5 +import 'package:one_key/provider/order_food_provider.dart';
  6 +import 'package:one_key/provider/user_model.dart';
  7 +import 'package:one_key/res/colors.dart';
  8 +import 'package:one_key/utils/navigator_util.dart';
  9 +import 'package:one_key/utils/utils.dart';
  10 +import 'package:one_key/widgets/h_empty_view.dart';
  11 +import 'package:one_key/widgets/system_app_bar.dart';
  12 +import 'package:one_key/widgets/v_empty_view.dart';
  13 +import 'package:provider/provider.dart';
  14 +
  15 +class OnlineCheckDetailPage extends StatefulWidget {
  16 + final String rid;
  17 + final bool fromNotify;
  18 + OnlineCheckDetailPage({Key key, this.rid, this.fromNotify}) : super(key: key);
  19 +
  20 + @override
  21 + _OnlineCheckDetailPageState createState() => _OnlineCheckDetailPageState();
  22 +}
  23 +
  24 +class _OnlineCheckDetailPageState extends State<OnlineCheckDetailPage> {
  25 + OnlineCheckEditProvider _onlineCheckEditProvider;
  26 + OrderFoodProvider _orderFoodProvider;
  27 + bool arrowStatus = true; // true合住 false展开
  28 +
  29 + @override
  30 + void initState() {
  31 + super.initState();
  32 + WidgetsBinding.instance.addPostFrameCallback((_) {
  33 + _getQiniuInfo();
  34 + _getTableInfoData();
  35 + _getOrderInfo();
  36 + });
  37 + }
  38 +
  39 + @override
  40 + void dispose() {
  41 + _onlineCheckEditProvider.orderInfoSunModel = null;
  42 + _orderFoodProvider.reserveDetailSunModel = null;
  43 + super.dispose();
  44 + }
  45 +
  46 + ///获取七牛云token
  47 + ///
  48 + _getQiniuInfo() async {
  49 + await _onlineCheckEditProvider.getQiniuInfo(context, {});
  50 + }
  51 +
  52 + ///接口获取桌位信息
  53 + _getTableInfoData() async {
  54 + UserModel userModel = Provider.of<UserModel>(context, listen: false);
  55 + Map<String, String> params = {
  56 + "openid": userModel.user.openid,
  57 + "rid": widget.rid
  58 + };
  59 + //明天完成 桌位名称信息
  60 + await _orderFoodProvider.getTableInfoData(context, params);
  61 + }
  62 +
  63 + ///获取订单详情
  64 + _getOrderInfo() async {
  65 + UserModel userModel = Provider.of<UserModel>(context, listen: false);
  66 + Map<String, String> params = {"rid": widget.rid};
  67 + //remark信息获取
  68 + await _onlineCheckEditProvider.getOrderInfo(context, params);
  69 + }
  70 +
  71 + ///顾客信息
  72 + Widget _customInfoItemWidget(String title, String subTitle,
  73 + {Color textColor = MyColours.color_707070, bool isBold = false}) {
  74 + return Row(
  75 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  76 + children: [
  77 + Text(
  78 + title,
  79 + style: TextStyle(
  80 + fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
  81 + fontSize: ScreenUtil().setSp(28),
  82 + color: textColor),
  83 + ),
  84 + Text(
  85 + subTitle,
  86 + style: TextStyle(
  87 + fontSize: ScreenUtil().setSp(28),
  88 + color: textColor,
  89 + fontWeight: FontWeight.bold),
  90 + )
  91 + ],
  92 + );
  93 + }
  94 +
  95 + //查看大图
  96 + _showPhotoView(BuildContext context, int index, List imgs,
  97 + {isShow = false, List<String> dashName}) async {
  98 + Utils.setBarStatus(false, color: Colors.black);
  99 + dynamic result = await showGeneralDialog(
  100 + context: context,
  101 + barrierDismissible: false,
  102 + // barrierColor: Colors.red,
  103 + barrierLabel:
  104 + MaterialLocalizations.of(context).modalBarrierDismissLabel,
  105 + transitionDuration: const Duration(milliseconds: 150),
  106 + pageBuilder: (BuildContext context, Animation animation,
  107 + Animation secondaryAnimation) {
  108 + Widget child = Stack(
  109 + children: <Widget>[
  110 + PhotoPreview(
  111 + initialIndex: index,
  112 + photoList: imgs,
  113 + isShow: isShow,
  114 + dashName: dashName)
  115 + ],
  116 + );
  117 + return child;
  118 + });
  119 + Utils.setBarStatus(true, color: Colors.white);
  120 + }
  121 +
  122 + ///消费信息
  123 + Widget _consumptionInfoWidget() {
  124 + return Container(
  125 + width: double.infinity,
  126 + decoration: BoxDecoration(
  127 + color: Colors.white, borderRadius: BorderRadius.circular(10)),
  128 + child: Column(
  129 + crossAxisAlignment: CrossAxisAlignment.start,
  130 + children: <Widget>[
  131 + Container(
  132 + height: ScreenUtil().setWidth(58 * 2),
  133 + width: double.infinity,
  134 + decoration: BoxDecoration(
  135 + color: MyColours.color_FAFAFA,
  136 + borderRadius: BorderRadius.only(
  137 + topLeft: Radius.circular(10),
  138 + topRight: Radius.circular(10)),
  139 + ),
  140 + child: Padding(
  141 + padding: EdgeInsets.fromLTRB(
  142 + ScreenUtil().setWidth(20),
  143 + ScreenUtil().setWidth(36),
  144 + ScreenUtil().setWidth(20),
  145 + ScreenUtil().setWidth(26)),
  146 + child: Text(
  147 + '消费信息',
  148 + style: TextStyle(
  149 + fontSize: ScreenUtil().setSp(32),
  150 + color: MyColours.color_353535,
  151 + fontWeight: FontWeight.bold),
  152 + ),
  153 + )),
  154 + Stack(
  155 + alignment: Alignment.center,
  156 + children: [
  157 + Container(
  158 + color: Colors.white,
  159 + padding: EdgeInsets.fromLTRB(
  160 + ScreenUtil().setWidth(40),
  161 + ScreenUtil().setWidth(24),
  162 + ScreenUtil().setWidth(40),
  163 + ScreenUtil().setWidth(36)),
  164 + child: Column(
  165 + children: [
  166 + _customInfoItemWidget(
  167 + '应收金额',
  168 + _onlineCheckEditProvider.orderInfoSunModel != null
  169 + ? '¥ ${_onlineCheckEditProvider.orderInfoSunModel.shouldPrice}'
  170 + : ''),
  171 + Offstage(
  172 + offstage:
  173 + _onlineCheckEditProvider.orderInfoSunModel != null
  174 + ? _onlineCheckEditProvider
  175 + .orderInfoSunModel.billList.length ==
  176 + 0
  177 + : true,
  178 + child: Padding(
  179 + padding:
  180 + EdgeInsets.only(top: ScreenUtil().setWidth(24)),
  181 + child: InkWell(
  182 + onTap: () {
  183 + List<String> temp = [];
  184 + for (int i = 0;
  185 + i <
  186 + _onlineCheckEditProvider
  187 + .orderInfoSunModel.billList.length;
  188 + i++) {
  189 + temp.add(_onlineCheckEditProvider
  190 + .orderInfoSunModel.billList[i]);
  191 + }
  192 +
  193 + _showPhotoView(
  194 + context,
  195 + 0,
  196 + temp,
  197 + );
  198 + },
  199 + child: Row(
  200 + mainAxisAlignment:
  201 + MainAxisAlignment.spaceBetween,
  202 + crossAxisAlignment: CrossAxisAlignment.center,
  203 + children: [
  204 + Text(
  205 + '消费清单',
  206 + style: TextStyle(
  207 + fontSize: ScreenUtil().setSp(28),
  208 + color: MyColours.color_707070),
  209 + ),
  210 + Text(
  211 + '查看消费清单',
  212 + style: TextStyle(
  213 + fontSize: ScreenUtil().setSp(24),
  214 + color: MyColours.color_24A4A8,
  215 + decoration: TextDecoration.underline,
  216 + fontWeight: FontWeight.bold),
  217 + ),
  218 + ],
  219 + ),
  220 + )))
  221 + ],
  222 + ),
  223 + ),
  224 + //2待支付 wait_pay 3已买单 has_pay
  225 + _onlineCheckEditProvider.orderInfoSunModel != null
  226 + ? Align(
  227 + child: Image.asset(
  228 + Utils.getImgPath(
  229 + _onlineCheckEditProvider.orderInfoSunModel.status ==
  230 + '2'
  231 + ? 'wait_pay'
  232 + : 'has_pay'),
  233 + width: ScreenUtil().setWidth(56 * 2),
  234 + height: ScreenUtil().setWidth(28 * 2),
  235 + ),
  236 + )
  237 + : Container(),
  238 + ],
  239 + )
  240 + ],
  241 + ),
  242 + );
  243 + }
  244 +
  245 + ///顾客信息
  246 + Widget _customerInfoWidget() {
  247 + bool showArrow = false;
  248 + //1散座 2包间 3卡座
  249 + List<String> tableNameSunList1 = []; //单个类型包含的所有桌子名称
  250 + List<String> tableNameSunList2 = []; //单个类型包含的所有桌子名称
  251 + List<String> tableNameSunList3 = []; //单个类型包含的所有桌子名称
  252 + if (_orderFoodProvider.reserveDetailSunModel != null) {
  253 + tableNameSunList1 =
  254 + _orderFoodProvider.reserveDetailSunModel.tableNameList[0]['散座'];
  255 + tableNameSunList2 =
  256 + _orderFoodProvider.reserveDetailSunModel.tableNameList[1]['包间'];
  257 + tableNameSunList3 =
  258 + _orderFoodProvider.reserveDetailSunModel.tableNameList[2]['卡座'];
  259 + if (tableNameSunList2.length > 0) {
  260 + if (arrowStatus) {
  261 + _orderFoodProvider.showTable = '【包间】${tableNameSunList2[0]}';
  262 + } else {
  263 + _orderFoodProvider.showTable = '';
  264 + }
  265 + } else if (tableNameSunList3.length > 0) {
  266 + if (arrowStatus) {
  267 + _orderFoodProvider.showTable = '【卡座】${tableNameSunList3[0]}';
  268 + } else {
  269 + _orderFoodProvider.showTable = '';
  270 + }
  271 + } else if (tableNameSunList1.length > 0) {
  272 + if (arrowStatus) {
  273 + _orderFoodProvider.showTable = '【散座】${tableNameSunList1[0]}';
  274 + } else {
  275 + _orderFoodProvider.showTable = '';
  276 + }
  277 + }
  278 + if (tableNameSunList1.length > 1 ||
  279 + tableNameSunList2.length > 1 ||
  280 + tableNameSunList3.length > 1) {
  281 + showArrow = true;
  282 + } else {
  283 + showArrow = false;
  284 + }
  285 + }
  286 + return Container(
  287 + width: double.infinity,
  288 + decoration: BoxDecoration(
  289 + color: Colors.white, borderRadius: BorderRadius.circular(10)),
  290 + child: Column(
  291 + crossAxisAlignment: CrossAxisAlignment.start,
  292 + children: <Widget>[
  293 + Container(
  294 + height: ScreenUtil().setWidth(58 * 2),
  295 + width: double.infinity,
  296 + padding: EdgeInsets.fromLTRB(
  297 + ScreenUtil().setWidth(20),
  298 + ScreenUtil().setWidth(36),
  299 + ScreenUtil().setWidth(20),
  300 + ScreenUtil().setWidth(26)),
  301 + decoration: BoxDecoration(
  302 + color: MyColours.color_FAFAFA,
  303 + borderRadius: BorderRadius.only(
  304 + topLeft: Radius.circular(10),
  305 + topRight: Radius.circular(10)),
  306 + ),
  307 + child: Row(
  308 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  309 + children: [
  310 + Text(
  311 + '顾客信息',
  312 + style: TextStyle(
  313 + fontSize: ScreenUtil().setSp(32),
  314 + color: MyColours.color_353535,
  315 + fontWeight: FontWeight.bold),
  316 + ),
  317 + // 备注信息
  318 + Offstage(
  319 + offstage: _onlineCheckEditProvider.orderInfoSunModel != null
  320 + ? _onlineCheckEditProvider
  321 + .orderInfoSunModel.orderRemark ==
  322 + ''
  323 + : true,
  324 + child: Container(
  325 + child: Text(
  326 + _onlineCheckEditProvider.orderInfoSunModel != null
  327 + ? _onlineCheckEditProvider
  328 + .orderInfoSunModel.orderRemark
  329 + : '',
  330 + style: TextStyle(
  331 + fontSize: ScreenUtil().setSp(28),
  332 + color: MyColours.color_FD5656),
  333 + ),
  334 + ),
  335 + ),
  336 + ],
  337 + )),
  338 + Padding(
  339 + padding: EdgeInsets.fromLTRB(
  340 + ScreenUtil().setWidth(40),
  341 + ScreenUtil().setWidth(24),
  342 + ScreenUtil().setWidth(40),
  343 + ScreenUtil().setWidth(36)),
  344 + child: Column(
  345 + children: [
  346 + InkWell(
  347 + onTap: () {
  348 + if (showArrow) {
  349 + //有arrow
  350 + arrowStatus = !arrowStatus;
  351 + _orderFoodProvider.notifyListeners();
  352 + }
  353 + },
  354 + child: Container(
  355 + child: Row(
  356 + children: [
  357 + Text(
  358 + '桌位信息',
  359 + style: TextStyle(
  360 + fontSize: ScreenUtil().setSp(28),
  361 + color: MyColours.color_707070),
  362 + ),
  363 + Spacer(),
  364 + Text(
  365 + _orderFoodProvider.showTable,
  366 + style: TextStyle(
  367 + fontSize: ScreenUtil().setSp(28),
  368 + fontWeight: FontWeight.bold,
  369 + color: MyColours.color_707070),
  370 + ),
  371 + Offstage(
  372 + offstage: !showArrow,
  373 + child: Row(
  374 + children: [
  375 + HEmptyView(20),
  376 + Image.asset(
  377 + arrowStatus
  378 + ? Utils.getImgPath('down')
  379 + : Utils.getImgPath('up'),
  380 + width: ScreenUtil().setWidth(24),
  381 + height: ScreenUtil().setWidth(12))
  382 + ],
  383 + ),
  384 + )
  385 + ],
  386 + ),
  387 + ),
  388 + ),
  389 + Offstage(
  390 + offstage: arrowStatus,
  391 + child: Column(
  392 + crossAxisAlignment: CrossAxisAlignment.start,
  393 + children: [
  394 + VEmptyView(14),
  395 + tableNameSunList2.length > 0
  396 + ? Padding(
  397 + padding: EdgeInsets.fromLTRB(
  398 + ScreenUtil().setWidth(0),
  399 + ScreenUtil().setWidth(10),
  400 + ScreenUtil().setWidth(60),
  401 + ScreenUtil().setWidth(10)),
  402 + child: Text(
  403 + '【包间】${Utils.listToString(tableNameSunList2)}',
  404 + style: TextStyle(
  405 + fontSize: ScreenUtil().setSp(30),
  406 + color: MyColours.color_353535,
  407 + fontWeight: FontWeight.bold),
  408 + ),
  409 + )
  410 + : Container(),
  411 + tableNameSunList3.length > 0
  412 + ? Padding(
  413 + padding: EdgeInsets.fromLTRB(
  414 + ScreenUtil().setWidth(0),
  415 + ScreenUtil().setWidth(10),
  416 + ScreenUtil().setWidth(60),
  417 + ScreenUtil().setWidth(10)),
  418 + child: Text(
  419 + '【卡座】${Utils.listToString(tableNameSunList3)}',
  420 + style: TextStyle(
  421 + fontSize: ScreenUtil().setSp(30),
  422 + color: MyColours.color_353535),
  423 + ),
  424 + )
  425 + : Container(),
  426 + tableNameSunList1.length > 0
  427 + ? Padding(
  428 + padding: EdgeInsets.fromLTRB(
  429 + ScreenUtil().setWidth(0),
  430 + ScreenUtil().setWidth(10),
  431 + ScreenUtil().setWidth(60),
  432 + ScreenUtil().setWidth(10)),
  433 + child: Text(
  434 + '【散座】${Utils.listToString(tableNameSunList1)}',
  435 + style: TextStyle(
  436 + fontSize: ScreenUtil().setSp(30),
  437 + color: MyColours.color_353535),
  438 + ),
  439 + )
  440 + : Container(),
  441 + VEmptyView(36),
  442 + ],
  443 + ),
  444 + ),
  445 + VEmptyView(24),
  446 + _customInfoItemWidget(
  447 + '买单顾客',
  448 + _orderFoodProvider.reserveDetailSunModel != null
  449 + ? _orderFoodProvider.reserveDetailSunModel.rnameStr
  450 + : ''),
  451 + VEmptyView(24),
  452 + _customInfoItemWidget(
  453 + '顾客电话',
  454 + _orderFoodProvider.reserveDetailSunModel != null
  455 + ? _orderFoodProvider.reserveDetailSunModel.phone
  456 + : ''),
  457 + VEmptyView(24),
  458 + _customInfoItemWidget(
  459 + '到店时间',
  460 + _orderFoodProvider.reserveDetailSunModel != null
  461 + ? _orderFoodProvider.reserveDetailSunModel.ddateStr
  462 + : ''),
  463 + VEmptyView(24),
  464 + _customInfoItemWidget(
  465 + '申请时间',
  466 + _orderFoodProvider.reserveDetailSunModel != null
  467 + ? _orderFoodProvider.reserveDetailSunModel.cdateStr
  468 + : '')
  469 + ],
  470 + ),
  471 + )
  472 + ],
  473 + ),
  474 + );
  475 + }
  476 +
  477 + ///买单信息
  478 + Widget _orderInfoWidget() {
  479 + return Container(
  480 + width: double.infinity,
  481 + decoration: BoxDecoration(
  482 + color: Colors.white, borderRadius: BorderRadius.circular(10)),
  483 + child: Column(
  484 + crossAxisAlignment: CrossAxisAlignment.start,
  485 + children: <Widget>[
  486 + Container(
  487 + height: ScreenUtil().setWidth(58 * 2),
  488 + width: double.infinity,
  489 + padding: EdgeInsets.fromLTRB(
  490 + ScreenUtil().setWidth(20),
  491 + ScreenUtil().setWidth(36),
  492 + ScreenUtil().setWidth(20),
  493 + ScreenUtil().setWidth(26)),
  494 + decoration: BoxDecoration(
  495 + color: MyColours.color_FAFAFA,
  496 + borderRadius: BorderRadius.only(
  497 + topLeft: Radius.circular(10),
  498 + topRight: Radius.circular(10)),
  499 + ),
  500 + child: Text(
  501 + '买单信息',
  502 + style: TextStyle(
  503 + fontSize: ScreenUtil().setSp(32),
  504 + color: MyColours.color_353535,
  505 + fontWeight: FontWeight.bold),
  506 + )),
  507 + Padding(
  508 + padding: EdgeInsets.fromLTRB(
  509 + ScreenUtil().setWidth(40),
  510 + ScreenUtil().setWidth(24),
  511 + ScreenUtil().setWidth(40),
  512 + ScreenUtil().setWidth(36)),
  513 + child: Column(children: [
  514 + _customInfoItemWidget(
  515 + '应收金额',
  516 + _onlineCheckEditProvider.orderInfoSunModel != null
  517 + ? '¥ ${_onlineCheckEditProvider.orderInfoSunModel.shouldPrice}'
  518 + : ''),
  519 + VEmptyView(24),
  520 + _customInfoItemWidget(
  521 + '实收金额',
  522 + _onlineCheckEditProvider.orderInfoSunModel != null
  523 + ? '¥ ${_onlineCheckEditProvider.orderInfoSunModel.price}'
  524 + : '',
  525 + textColor: MyColours.color_353535,
  526 + isBold: true),
  527 + VEmptyView(24),
  528 + _customInfoItemWidget('支付方式', '微信支付'),
  529 + VEmptyView(24),
  530 + _customInfoItemWidget(
  531 + '买单时间',
  532 + _onlineCheckEditProvider.orderInfoSunModel != null
  533 + ? _onlineCheckEditProvider
  534 + .orderInfoSunModel?.payTimeStr
  535 + : ''),
  536 + VEmptyView(24),
  537 + ]))
  538 + ]));
  539 + }
  540 +
  541 + @override
  542 + Widget build(BuildContext context) {
  543 + _onlineCheckEditProvider =
  544 + Provider.of<OnlineCheckEditProvider>(context, listen: true);
  545 + _orderFoodProvider = Provider.of<OrderFoodProvider>(context, listen: true);
  546 + return Scaffold(
  547 + backgroundColor: MyColours.color_f5f5f5,
  548 + appBar: SystemAppBar(
  549 + '买单申请详情',
  550 + onTap: () {
  551 + if (widget.fromNotify) {
  552 + NavigatorUtil.goHomePage(context, initialIndex: 0);
  553 + } else {
  554 + Navigator.of(context).pop();
  555 + }
  556 + },
  557 + ),
  558 + body: SingleChildScrollView(
  559 + child: Padding(
  560 + padding: EdgeInsets.all(ScreenUtil().setWidth(20)),
  561 + child: Column(
  562 + children: [
  563 + _consumptionInfoWidget(),
  564 + VEmptyView(20),
  565 + _customerInfoWidget(),
  566 + VEmptyView(20),
  567 + Offstage(
  568 + offstage: _onlineCheckEditProvider.orderInfoSunModel != null
  569 + ? _onlineCheckEditProvider.orderInfoSunModel.status == '2'
  570 + : true,
  571 + child: _orderInfoWidget(),
  572 + )
  573 + ],
  574 + ),
  575 + ),
  576 + ),
  577 + );
  578 + }
  579 +}
@@ -3,17 +3,18 @@ import 'dart:convert'; @@ -3,17 +3,18 @@ import 'dart:convert';
3 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
4 import 'package:flutter_screenutil/screenutil.dart'; 4 import 'package:flutter_screenutil/screenutil.dart';
5 import 'package:one_key/pages/online_check/img_picker_widget.dart'; 5 import 'package:one_key/pages/online_check/img_picker_widget.dart';
  6 +import 'package:one_key/provider/notebook_detail_model.dart';
6 import 'package:one_key/provider/online_check_edit_provider.dart'; 7 import 'package:one_key/provider/online_check_edit_provider.dart';
7 import 'package:one_key/provider/order_food_provider.dart'; 8 import 'package:one_key/provider/order_food_provider.dart';
8 import 'package:one_key/provider/user_model.dart'; 9 import 'package:one_key/provider/user_model.dart';
9 import 'package:one_key/res/colors.dart'; 10 import 'package:one_key/res/colors.dart';
10 import 'package:one_key/utils/dialog_util.dart'; 11 import 'package:one_key/utils/dialog_util.dart';
  12 +import 'package:one_key/utils/event_bus.dart';
11 import 'package:one_key/utils/navigator_util.dart'; 13 import 'package:one_key/utils/navigator_util.dart';
12 import 'package:one_key/utils/utils.dart'; 14 import 'package:one_key/utils/utils.dart';
13 import 'package:one_key/widgets/MyDivider.dart'; 15 import 'package:one_key/widgets/MyDivider.dart';
14 import 'package:one_key/widgets/common_button.dart'; 16 import 'package:one_key/widgets/common_button.dart';
15 import 'package:one_key/widgets/h_empty_view.dart'; 17 import 'package:one_key/widgets/h_empty_view.dart';
16 -import 'package:one_key/widgets/my_item.dart';  
17 import 'package:one_key/widgets/system_app_bar.dart'; 18 import 'package:one_key/widgets/system_app_bar.dart';
18 import 'package:one_key/widgets/v_empty_view.dart'; 19 import 'package:one_key/widgets/v_empty_view.dart';
19 import 'package:provider/provider.dart'; 20 import 'package:provider/provider.dart';
@@ -21,7 +22,8 @@ import 'package:provider/provider.dart'; @@ -21,7 +22,8 @@ import 'package:provider/provider.dart';
21 class OnlineCheckEditPage extends StatefulWidget { 22 class OnlineCheckEditPage extends StatefulWidget {
22 final bool fromNotify; 23 final bool fromNotify;
23 final String rid; 24 final String rid;
24 - OnlineCheckEditPage({Key key, this.fromNotify = false, this.rid}) 25 + final String mid;
  26 + OnlineCheckEditPage({Key key, this.fromNotify = false, this.rid, this.mid})
25 : super(key: key); 27 : super(key: key);
26 28
27 @override 29 @override
@@ -36,6 +38,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { @@ -36,6 +38,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
36 OrderFoodProvider _orderFoodProvider; 38 OrderFoodProvider _orderFoodProvider;
37 int btnState = -1; 39 int btnState = -1;
38 bool arrowStatus = true; // true合住 false展开 40 bool arrowStatus = true; // true合住 false展开
  41 + NotebookDetailModel detailModel;
39 42
40 @override 43 @override
41 void initState() { 44 void initState() {
@@ -64,6 +67,18 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { @@ -64,6 +67,18 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
64 super.dispose(); 67 super.dispose();
65 } 68 }
66 69
  70 + //处理在线预订
  71 + setMessageStatus() {
  72 + bus.emit("remove_untreated_message", widget.mid);
  73 + bus.emit("refresh_untreated_num"); //刷新未读消息数目
  74 + Map<String, String> params = {
  75 + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  76 + "id": widget.mid,
  77 + "status": "is_handle"
  78 + };
  79 + detailModel.setMessageStatus(context, params);
  80 + }
  81 +
67 ///接口获取桌位信息 82 ///接口获取桌位信息
68 _getTableInfoData() async { 83 _getTableInfoData() async {
69 UserModel userModel = Provider.of<UserModel>(context, listen: false); 84 UserModel userModel = Provider.of<UserModel>(context, listen: false);
@@ -75,6 +90,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { @@ -75,6 +90,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
75 await _orderFoodProvider.getTableInfoData(context, params); 90 await _orderFoodProvider.getTableInfoData(context, params);
76 } 91 }
77 92
  93 + ///获取订单详情
78 _getOrderInfo() async { 94 _getOrderInfo() async {
79 UserModel userModel = Provider.of<UserModel>(context, listen: false); 95 UserModel userModel = Provider.of<UserModel>(context, listen: false);
80 Map<String, String> params = {"rid": widget.rid}; 96 Map<String, String> params = {"rid": widget.rid};
@@ -84,22 +100,31 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { @@ -84,22 +100,31 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
84 100
85 ///商家确认账单操作 101 ///商家确认账单操作
86 _updateOrderInfo() async { 102 _updateOrderInfo() async {
  103 + String price = _editingController.text;
  104 + if (_editingController.text.startsWith('¥')) {
  105 + price = _editingController.text
  106 + .substring(1, _editingController.text.length)
  107 + .trim();
  108 + }
87 for (int i = 0; i < _onlineCheckEditProvider.imageList.length; i++) { 109 for (int i = 0; i < _onlineCheckEditProvider.imageList.length; i++) {
88 _onlineCheckEditProvider.imageQiniuUrlList 110 _onlineCheckEditProvider.imageQiniuUrlList
89 .add(_onlineCheckEditProvider.imageList[i].qiniuUrl); 111 .add(_onlineCheckEditProvider.imageList[i].qiniuUrl);
90 } 112 }
91 UserModel userModel = Provider.of<UserModel>(context, listen: false); 113 UserModel userModel = Provider.of<UserModel>(context, listen: false);
92 Map<String, String> params = { 114 Map<String, String> params = {
93 - "price": _editingController.text, 115 + "price": price,
94 "rid": widget.rid, 116 "rid": widget.rid,
95 'bill_list': json.encode(_onlineCheckEditProvider.imageQiniuUrlList) 117 'bill_list': json.encode(_onlineCheckEditProvider.imageQiniuUrlList)
96 }; 118 };
97 - print(pragma); 119 + print(params);
98 //明天完成 桌位名称信息 120 //明天完成 桌位名称信息
99 bool result = 121 bool result =
100 await _onlineCheckEditProvider.updateOrderInfo(context, params); 122 await _onlineCheckEditProvider.updateOrderInfo(context, params);
101 if (result) { 123 if (result) {
102 - //跳转至在线买单处理完的详情页面 124 + // 跳转至在线买单处理完的详情页面
  125 + NavigatorUtil.goOnlineCheckDetailPage(context,
  126 + rid: '${widget.rid}', replace: true);
  127 + setMessageStatus();
103 } 128 }
104 } 129 }
105 130
@@ -136,7 +161,6 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { @@ -136,7 +161,6 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
136 161
137 ///桌位信息、应收金额 162 ///桌位信息、应收金额
138 Widget _getTabAndMoneyInfoWidget() { 163 Widget _getTabAndMoneyInfoWidget() {
139 - String showTable = '';  
140 bool showArrow = false; 164 bool showArrow = false;
141 //1散座 2包间 3卡座 165 //1散座 2包间 3卡座
142 List<String> tableNameSunList1 = []; //单个类型包含的所有桌子名称 166 List<String> tableNameSunList1 = []; //单个类型包含的所有桌子名称
@@ -150,14 +174,30 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { @@ -150,14 +174,30 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
150 tableNameSunList3 = 174 tableNameSunList3 =
151 _orderFoodProvider.reserveDetailSunModel.tableNameList[2]['卡座']; 175 _orderFoodProvider.reserveDetailSunModel.tableNameList[2]['卡座'];
152 if (tableNameSunList2.length > 0) { 176 if (tableNameSunList2.length > 0) {
153 - showTable = '【包间】${tableNameSunList2[0]}';  
154 - showArrow = true; 177 + if (arrowStatus) {
  178 + _orderFoodProvider.showTable = '【包间】${tableNameSunList2[0]}';
  179 + } else {
  180 + _orderFoodProvider.showTable = '';
  181 + }
155 } else if (tableNameSunList3.length > 0) { 182 } else if (tableNameSunList3.length > 0) {
156 - showTable = '【卡座】${tableNameSunList3[0]}';  
157 - showArrow = true; 183 + if (arrowStatus) {
  184 + _orderFoodProvider.showTable = '【卡座】${tableNameSunList3[0]}';
  185 + } else {
  186 + _orderFoodProvider.showTable = '';
  187 + }
158 } else if (tableNameSunList1.length > 0) { 188 } else if (tableNameSunList1.length > 0) {
159 - showTable = '【散座】${tableNameSunList1[0]}'; 189 + if (arrowStatus) {
  190 + _orderFoodProvider.showTable = '【散座】${tableNameSunList1[0]}';
  191 + } else {
  192 + _orderFoodProvider.showTable = '';
  193 + }
  194 + }
  195 + if (tableNameSunList1.length > 1 ||
  196 + tableNameSunList2.length > 1 ||
  197 + tableNameSunList3.length > 1) {
160 showArrow = true; 198 showArrow = true;
  199 + } else {
  200 + showArrow = false;
161 } 201 }
162 } 202 }
163 203
@@ -190,7 +230,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { @@ -190,7 +230,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
190 Spacer(), 230 Spacer(),
191 Text( 231 Text(
192 _orderFoodProvider.reserveDetailSunModel != null 232 _orderFoodProvider.reserveDetailSunModel != null
193 - ? showTable 233 + ? _orderFoodProvider.showTable
194 : '', 234 : '',
195 style: TextStyle( 235 style: TextStyle(
196 fontSize: ScreenUtil().setSp(32), 236 fontSize: ScreenUtil().setSp(32),
@@ -229,7 +269,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { @@ -229,7 +269,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
229 child: Text( 269 child: Text(
230 '【包间】${Utils.listToString(tableNameSunList2)}', 270 '【包间】${Utils.listToString(tableNameSunList2)}',
231 style: TextStyle( 271 style: TextStyle(
232 - fontSize: ScreenUtil().setSp(32), 272 + fontSize: ScreenUtil().setSp(30),
233 color: MyColours.color_353535), 273 color: MyColours.color_353535),
234 ), 274 ),
235 ) 275 )
@@ -244,7 +284,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { @@ -244,7 +284,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
244 child: Text( 284 child: Text(
245 '【卡座】${Utils.listToString(tableNameSunList3)}', 285 '【卡座】${Utils.listToString(tableNameSunList3)}',
246 style: TextStyle( 286 style: TextStyle(
247 - fontSize: ScreenUtil().setSp(32), 287 + fontSize: ScreenUtil().setSp(30),
248 color: MyColours.color_353535), 288 color: MyColours.color_353535),
249 ), 289 ),
250 ) 290 )
@@ -259,7 +299,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { @@ -259,7 +299,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
259 child: Text( 299 child: Text(
260 '【散座】${Utils.listToString(tableNameSunList1)}', 300 '【散座】${Utils.listToString(tableNameSunList1)}',
261 style: TextStyle( 301 style: TextStyle(
262 - fontSize: ScreenUtil().setSp(32), 302 + fontSize: ScreenUtil().setSp(30),
263 color: MyColours.color_353535), 303 color: MyColours.color_353535),
264 ), 304 ),
265 ) 305 )
@@ -328,6 +368,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { @@ -328,6 +368,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
328 onEditingComplete: () { 368 onEditingComplete: () {
329 print('fff'); 369 print('fff');
330 _focusNode.unfocus(); 370 _focusNode.unfocus();
  371 +
331 // _editingController.text = ''; 372 // _editingController.text = '';
332 // _needNode.unfocus(); 373 // _needNode.unfocus();
333 }, 374 },
@@ -438,6 +479,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { @@ -438,6 +479,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
438 479
439 @override 480 @override
440 Widget build(BuildContext context) { 481 Widget build(BuildContext context) {
  482 + detailModel = Provider.of<NotebookDetailModel>(context, listen: true);
441 _onlineCheckEditProvider = 483 _onlineCheckEditProvider =
442 Provider.of<OnlineCheckEditProvider>(context, listen: true); 484 Provider.of<OnlineCheckEditProvider>(context, listen: true);
443 _orderFoodProvider = Provider.of<OrderFoodProvider>(context, listen: true); 485 _orderFoodProvider = Provider.of<OrderFoodProvider>(context, listen: true);
@@ -509,8 +551,17 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> { @@ -509,8 +551,17 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
509 content: '发送给顾客', 551 content: '发送给顾客',
510 state: btnState, 552 state: btnState,
511 onPress: () async { 553 onPress: () async {
  554 + if (_editingController.text.startsWith('¥') &&
  555 + _editingController.text.length == 1) {
  556 + Utils.showToast('请输入金额');
  557 + setState(() {
  558 + btnState = -1;
  559 + });
  560 + return;
  561 + }
512 DialogUtil.confirmDialog( 562 DialogUtil.confirmDialog(
513 context, _editingController.text, 426, onTap: () { 563 context, _editingController.text, 426, onTap: () {
  564 + Navigator.pop(context);
514 _updateOrderInfo(); 565 _updateOrderInfo();
515 }); 566 });
516 }, 567 },
@@ -86,14 +86,14 @@ class MessageDialogModel extends ChangeNotifier { @@ -86,14 +86,14 @@ class MessageDialogModel extends ChangeNotifier {
86 } 86 }
87 return true; 87 return true;
88 }); 88 });
89 - if (params["type_id"] == '10') {  
90 - unMessagesOnline = messagesTemp;  
91 - } else if (params["type_id"] == '1') {  
92 - unMessagesOrder = messagesTemp;  
93 - }  
94 - messages = [];  
95 - messages.addAll(unMessagesOnline);  
96 - messages.addAll(unMessagesOrder); 89 + // if (params["type_id"] == '10') {
  90 + // unMessagesOnline = messagesTemp;
  91 + // } else if (params["type_id"] == '1') {
  92 + // unMessagesOrder = messagesTemp;
  93 + // }
  94 + messages.addAll(messagesTemp);
  95 + // messages.addAll(unMessagesOnline);
  96 + // messages.addAll(unMessagesOrder);
97 callback(); 97 callback();
98 // if (messages.isNotEmpty) { 98 // if (messages.isNotEmpty) {
99 // //播放声音 99 // //播放声音
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 import 'package:one_key/constant/constant.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/new_reserve_list_model.dart';
3 import 'package:one_key/models/order_info_model.dart'; 6 import 'package:one_key/models/order_info_model.dart';
4 import 'package:one_key/models/qiniu_info_model.dart'; 7 import 'package:one_key/models/qiniu_info_model.dart';
5 import 'package:one_key/models/upload_img_model.dart'; 8 import 'package:one_key/models/upload_img_model.dart';
@@ -13,6 +16,7 @@ class OnlineCheckEditProvider extends ChangeNotifier { @@ -13,6 +16,7 @@ class OnlineCheckEditProvider extends ChangeNotifier {
13 List<String> imageQiniuUrlList = []; //七牛云地址列表 16 List<String> imageQiniuUrlList = []; //七牛云地址列表
14 QiniuInfoSunModel qiniuInfoSunModel; 17 QiniuInfoSunModel qiniuInfoSunModel;
15 OrderInfoSunModel orderInfoSunModel; 18 OrderInfoSunModel orderInfoSunModel;
  19 + List<NewReserveListSunModel> reserveList = [];
16 20
17 /// 获取七牛上传token信息 21 /// 获取七牛上传token信息
18 Future<QiniuInfoSunModel> getQiniuInfo( 22 Future<QiniuInfoSunModel> getQiniuInfo(
@@ -46,7 +50,7 @@ class OnlineCheckEditProvider extends ChangeNotifier { @@ -46,7 +50,7 @@ class OnlineCheckEditProvider extends ChangeNotifier {
46 data: params, showLoading: false) 50 data: params, showLoading: false)
47 .catchError((error) {}); 51 .catchError((error) {});
48 if (baseResp.code == Constant.status_success) { 52 if (baseResp.code == Constant.status_success) {
49 - if (baseResp.data.isEmpty) { 53 + if (baseResp.data == null) {
50 } else { 54 } else {
51 //解析解析 55 //解析解析
52 orderInfoSunModel = OrderInfoModel.fromJson(baseResp.responseData).data; 56 orderInfoSunModel = OrderInfoModel.fromJson(baseResp.responseData).data;
@@ -64,7 +68,7 @@ class OnlineCheckEditProvider extends ChangeNotifier { @@ -64,7 +68,7 @@ class OnlineCheckEditProvider extends ChangeNotifier {
64 {isShowLoading = true}) async { 68 {isShowLoading = true}) async {
65 BaseResp<dynamic> baseResp = await DioUtil() 69 BaseResp<dynamic> baseResp = await DioUtil()
66 .request<dynamic>(context, Method.get, HttpUrl.update_order_info, 70 .request<dynamic>(context, Method.get, HttpUrl.update_order_info,
67 - data: params, showLoading: false) 71 + data: params, showLoading: isShowLoading)
68 .catchError((error) {}); 72 .catchError((error) {});
69 if (baseResp.code == Constant.status_success) { 73 if (baseResp.code == Constant.status_success) {
70 //解析解析 74 //解析解析
@@ -81,4 +85,40 @@ class OnlineCheckEditProvider extends ChangeNotifier { @@ -81,4 +85,40 @@ class OnlineCheckEditProvider extends ChangeNotifier {
81 } 85 }
82 return false; 86 return false;
83 } 87 }
  88 +
  89 + //商家预订本列表【2019-11-26】
  90 + getNewReserveList(BuildContext context, Map<String, String> params) async {
  91 + BaseResp<List> baseResp = await DioUtil()
  92 + .request<List>(context, Method.get, HttpUrl.new_get_reserve_list,
  93 + data: params, showLoading: false)
  94 + .catchError((error) {
  95 + print(error.toString());
  96 + if (error is MyError) {
  97 + // switch (error.type) {
  98 + // case 1:
  99 + // pageState = PageState.ConnectivityError;
  100 + // break;
  101 + // case 2:
  102 + // pageState = PageState.ConnectivityTimeOut;
  103 + // break;
  104 + // default:
  105 + // pageState = PageState.ConnectivityError;
  106 + // break;
  107 + // }
  108 + }
  109 + notifyListeners();
  110 + });
  111 + if (baseResp.code == Constant.status_success) {
  112 + if (baseResp.data.isEmpty) {
  113 + } else {
  114 + //解析解析
  115 + reserveList = NewReserveListModel.fromJson(baseResp.responseData).data;
  116 + }
  117 + notifyListeners();
  118 + } else {
  119 + if (baseResp != null) {
  120 + Utils.showToast(baseResp.msg ?? "");
  121 + }
  122 + }
  123 + }
84 } 124 }
@@ -15,6 +15,7 @@ class OrderFoodProvider extends ChangeNotifier { @@ -15,6 +15,7 @@ class OrderFoodProvider extends ChangeNotifier {
15 List<Map<String, List<Cookbooklist>>> orderList = []; //已点菜单信息 15 List<Map<String, List<Cookbooklist>>> orderList = []; //已点菜单信息
16 CreatedOrderSunModel createdOrderSunModel; 16 CreatedOrderSunModel createdOrderSunModel;
17 ReserveDetailSunModel reserveDetailSunModel; 17 ReserveDetailSunModel reserveDetailSunModel;
  18 + String showTable = '';
18 19
19 ///顾客扫桌码点餐-扫码创建订单 20 ///顾客扫桌码点餐-扫码创建订单
20 getOrderFoodData(BuildContext context, Map<String, String> params, 21 getOrderFoodData(BuildContext context, Map<String, String> params,
@@ -58,4 +58,6 @@ class MyColours { @@ -58,4 +58,6 @@ class MyColours {
58 static const Color color_FD5656 = Color(0xffFD5656); 58 static const Color color_FD5656 = Color(0xffFD5656);
59 static const Color color_FAFAFA = Color(0xffFAFAFA); 59 static const Color color_FAFAFA = Color(0xffFAFAFA);
60 static const Color color_0D0D0D = Color(0xff0D0D0D); 60 static const Color color_0D0D0D = Color(0xff0D0D0D);
  61 + static const Color color_24A4A8 = Color(0xff24A4A8);
  62 + static const Color color_F59A23 = Color(0xffF59A23);
61 } 63 }
@@ -16,6 +16,8 @@ import 'package:one_key/pages/message/message_order_menu.dart'; @@ -16,6 +16,8 @@ import 'package:one_key/pages/message/message_order_menu.dart';
16 import 'package:one_key/pages/my/book_time_set.dart'; 16 import 'package:one_key/pages/my/book_time_set.dart';
17 import 'package:one_key/pages/my/receive_orders_time_set.dart'; 17 import 'package:one_key/pages/my/receive_orders_time_set.dart';
18 import 'package:one_key/pages/my/remark_manager_page.dart'; 18 import 'package:one_key/pages/my/remark_manager_page.dart';
  19 +import 'package:one_key/pages/online_check/invoice_detail_page.dart';
  20 +import 'package:one_key/pages/online_check/online_check_detail_page.dart';
19 import 'package:one_key/pages/online_check/online_check_edit_page.dart'; 21 import 'package:one_key/pages/online_check/online_check_edit_page.dart';
20 import 'package:one_key/pages/sms/sms_page.dart'; 22 import 'package:one_key/pages/sms/sms_page.dart';
21 import 'package:one_key/pages/table/select_table_page.dart'; 23 import 'package:one_key/pages/table/select_table_page.dart';
@@ -180,8 +182,33 @@ var handleHasOrderFoodHandler = new Handler( @@ -180,8 +182,33 @@ var handleHasOrderFoodHandler = new Handler(
180 var handleOnlineCheckEditHandler = new Handler( 182 var handleOnlineCheckEditHandler = new Handler(
181 handlerFunc: (BuildContext context, Map<String, List<Object>> params) { 183 handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
182 String rid = params["rid"].first; 184 String rid = params["rid"].first;
  185 + String mid = params["mid"].first;
  186 + bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first);
  187 + return ChangeNotifierProvider<OrderFoodProvider>(
  188 + create: (_) => OrderFoodProvider(),
  189 + child: OnlineCheckEditPage(
  190 + fromNotify: fromNotify,
  191 + rid: rid,
  192 + mid: mid,
  193 + ));
  194 +});
  195 +
  196 +///提前买单查看页面
  197 +var handleOnlineCheckDetailPageHandler = new Handler(
  198 + handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
  199 + String rid = params["rid"].first;
  200 + bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first);
  201 + return ChangeNotifierProvider<OrderFoodProvider>(
  202 + create: (_) => OrderFoodProvider(),
  203 + child: OnlineCheckDetailPage(fromNotify: fromNotify, rid: rid));
  204 +});
  205 +
  206 +///发票详情
  207 +var handleInvoiceDetailPageHandler = new Handler(
  208 + handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
  209 + String rid = params["rid"].first;
183 bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first); 210 bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first);
184 return ChangeNotifierProvider<OrderFoodProvider>( 211 return ChangeNotifierProvider<OrderFoodProvider>(
185 create: (_) => OrderFoodProvider(), 212 create: (_) => OrderFoodProvider(),
186 - child: OnlineCheckEditPage(fromNotify: fromNotify,rid:rid)); 213 + child: InvoiceDetailPage(fromNotify: fromNotify, rid: rid));
187 }); 214 });
@@ -19,7 +19,9 @@ class Routes { @@ -19,7 +19,9 @@ class Routes {
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 static String has_order_food = "/has_order_food"; //已点菜品
22 - static String online_check_edit = "/online_check_edit"; //提前买单 22 + static String online_check_edit = "/online_check_edit"; //提前买单处理
  23 + static String online_check_detail = "/online_check_detail"; //提前买单查看
  24 + static String invoice_detail = "/invoice_detail"; //查看发票详情
23 25
24 static void configureRoutes(FluroRouter router) { 26 static void configureRoutes(FluroRouter router) {
25 router.notFoundHandler = new Handler( 27 router.notFoundHandler = new Handler(
@@ -43,5 +45,10 @@ class Routes { @@ -43,5 +45,10 @@ class Routes {
43 router.define(remark_manager, handler: handleRemarkManagerHandler); 45 router.define(remark_manager, handler: handleRemarkManagerHandler);
44 router.define(has_order_food, handler: handleHasOrderFoodHandler); 46 router.define(has_order_food, handler: handleHasOrderFoodHandler);
45 router.define(online_check_edit, handler: handleOnlineCheckEditHandler); 47 router.define(online_check_edit, handler: handleOnlineCheckEditHandler);
  48 + router.define(online_check_detail,
  49 + handler: handleOnlineCheckDetailPageHandler);
  50 + router.define(invoice_detail,
  51 + handler: handleInvoiceDetailPageHandler);
  52 +
46 } 53 }
47 } 54 }
@@ -131,9 +131,25 @@ class NavigatorUtil { @@ -131,9 +131,25 @@ class NavigatorUtil {
131 131
132 /// 提前买单编辑页面 132 /// 提前买单编辑页面
133 static void goOnlineCheckEditPage(BuildContext context, 133 static void goOnlineCheckEditPage(BuildContext context,
  134 + {String rid, String mid, fromNotify = false, replace = false}) {
  135 + _navigateTo(context,
  136 + "${Routes.online_check_edit}?fromNotify=${fromNotify}&rid=${rid}&mid=$mid",
  137 + replace: replace);
  138 + }
  139 +
  140 + /// 提前买单查看页面
  141 + static void goOnlineCheckDetailPage(BuildContext context,
134 {String rid, fromNotify = false, replace = false}) { 142 {String rid, fromNotify = false, replace = false}) {
135 _navigateTo(context, 143 _navigateTo(context,
136 - "${Routes.online_check_edit}?fromNotify=${fromNotify}&rid=${rid}", 144 + "${Routes.online_check_detail}?fromNotify=${fromNotify}&rid=${rid}",
  145 + replace: replace);
  146 + }
  147 +
  148 + /// 发票详情
  149 + static void goInvoiceDetailPage(BuildContext context,
  150 + {String rid, fromNotify = false, replace = false}) {
  151 + _navigateTo(
  152 + context, "${Routes.invoice_detail}?fromNotify=${fromNotify}&rid=${rid}",
137 replace: replace); 153 replace: replace);
138 } 154 }
139 } 155 }
@@ -36,11 +36,18 @@ class TableItemState extends State<TableItem> { @@ -36,11 +36,18 @@ class TableItemState extends State<TableItem> {
36 Widget build(BuildContext context) { 36 Widget build(BuildContext context) {
37 t.Table table = widget.table; 37 t.Table table = widget.table;
38 38
  39 + String signStr = table.signStr;
  40 + if (table.sign == '5' && widget.tableMap[table.id].orderInfo != null) {
  41 + if (widget.tableMap[table.id].orderInfo.status == '3') {
  42 + signStr = '已买单';
  43 + }
  44 + }
  45 +
39 return GestureDetector( 46 return GestureDetector(
40 onTap: () { 47 onTap: () {
41 if (widget.canSelected && widget.canChoose) { 48 if (widget.canSelected && widget.canChoose) {
42 //从变更页面进来 canChoose = true 49 //从变更页面进来 canChoose = true
43 - if (widget.canSelected && table.signStr.isEmpty) { 50 + if (widget.canSelected && signStr.isEmpty) {
44 setState(() { 51 setState(() {
45 table.selected = !(table.selected ?? false); 52 table.selected = !(table.selected ?? false);
46 }); 53 });
@@ -64,12 +71,13 @@ class TableItemState extends State<TableItem> { @@ -64,12 +71,13 @@ class TableItemState extends State<TableItem> {
64 } 71 }
65 } 72 }
66 } 73 }
67 - } else if (widget.canSelected && table.signStr.isEmpty){//从安排桌位进来 74 + } else if (widget.canSelected && signStr.isEmpty) {
  75 + //从安排桌位进来
68 setState(() { 76 setState(() {
69 table.selected = !(table.selected ?? false); 77 table.selected = !(table.selected ?? false);
70 }); 78 });
71 widget.onSelected(table); 79 widget.onSelected(table);
72 - }else{ 80 + } else {
73 table.selected = !(table.selected ?? false); 81 table.selected = !(table.selected ?? false);
74 widget.onSelected(table); 82 widget.onSelected(table);
75 } 83 }
@@ -143,10 +151,10 @@ class TableItemState extends State<TableItem> { @@ -143,10 +151,10 @@ class TableItemState extends State<TableItem> {
143 fontWeight: FontWeight.normal), 151 fontWeight: FontWeight.normal),
144 overflow: TextOverflow.ellipsis, 152 overflow: TextOverflow.ellipsis,
145 strutStyle: StrutStyle( 153 strutStyle: StrutStyle(
146 - forceStrutHeight: true,  
147 - height: ScreenUtil().setWidth(2),  
148 - // leading: ScreenUtil().setWidth(0.4)  
149 - ), 154 + forceStrutHeight: true,
  155 + height: ScreenUtil().setWidth(2),
  156 + // leading: ScreenUtil().setWidth(0.4)
  157 + ),
150 ), 158 ),
151 ) 159 )
152 // Text( 160 // Text(
@@ -169,7 +177,7 @@ class TableItemState extends State<TableItem> { @@ -169,7 +177,7 @@ class TableItemState extends State<TableItem> {
169 ? table.tableNum 177 ? table.tableNum
170 : table.reserver, 178 : table.reserver,
171 style: TextStyle( 179 style: TextStyle(
172 - color: table.signStr == '已停用' 180 + color: signStr == '已停用'
173 ? MyColours.color_999999 181 ? MyColours.color_999999
174 : (table.reserver == null || 182 : (table.reserver == null ||
175 table.reserver.isEmpty) 183 table.reserver.isEmpty)
@@ -197,23 +205,25 @@ class TableItemState extends State<TableItem> { @@ -197,23 +205,25 @@ class TableItemState extends State<TableItem> {
197 bottom: 0, 205 bottom: 0,
198 left: 0, 206 left: 0,
199 right: 0, 207 right: 0,
200 - child: table.signStr.isEmpty 208 + child: signStr.isEmpty
201 ? Container() 209 ? Container()
202 : Container( 210 : Container(
203 width: ScreenUtil().setWidth(160), 211 width: ScreenUtil().setWidth(160),
204 height: ScreenUtil().setHeight(36), 212 height: ScreenUtil().setHeight(36),
205 alignment: Alignment.center, 213 alignment: Alignment.center,
206 decoration: BoxDecoration( 214 decoration: BoxDecoration(
207 - color: table.signStr == '已停用' 215 + color: signStr == '已停用'
208 ? MyColours.color_777777 216 ? MyColours.color_777777
209 - : MyColours.color_E95750, 217 + : signStr == '已买单'
  218 + ? MyColours.color_F59A23
  219 + : MyColours.color_E95750,
210 borderRadius: BorderRadius.only( 220 borderRadius: BorderRadius.only(
211 bottomLeft: 221 bottomLeft:
212 Radius.circular(ScreenUtil().setWidth(8)), 222 Radius.circular(ScreenUtil().setWidth(8)),
213 bottomRight: Radius.circular( 223 bottomRight: Radius.circular(
214 ScreenUtil().setWidth(8)))), 224 ScreenUtil().setWidth(8)))),
215 child: Text( 225 child: Text(
216 - table.signStr, 226 + signStr,
217 style: TextStyle( 227 style: TextStyle(
218 color: MyColours.color_ffffff, 228 color: MyColours.color_ffffff,
219 fontSize: ScreenUtil().setSp(24), 229 fontSize: ScreenUtil().setSp(24),
@@ -228,12 +238,13 @@ class TableItemState extends State<TableItem> { @@ -228,12 +238,13 @@ class TableItemState extends State<TableItem> {
228 Positioned( 238 Positioned(
229 top: 3, 239 top: 3,
230 right: 5, 240 right: 5,
231 - child: widget.canSelected&&(table.selected ?? false) 241 + child: widget.canSelected && (table.selected ?? false)
232 ? Image.asset( 242 ? Image.asset(
233 - "assets/icon_selected.png",  
234 - width: ScreenUtil().setWidth(40),  
235 - height: ScreenUtil().setWidth(40),  
236 - ):Container()) 243 + "assets/icon_selected.png",
  244 + width: ScreenUtil().setWidth(40),
  245 + height: ScreenUtil().setWidth(40),
  246 + )
  247 + : Container())
237 ], 248 ],
238 ), 249 ),
239 ); 250 );