Commit 71d6dd5fa729fed5b9d9c45ab38e3556db89a653

Authored by wdn127929
1 parent ead58bea

一键订1.8.0提测

... ... @@ -12,6 +12,7 @@ import 'package:fluwx/fluwx.dart';
import 'package:one_key/pages/detail/handle_online_page.dart';
import 'package:one_key/provider/message_dialog_model.dart';
import 'package:intl/date_symbol_data_local.dart';
import 'package:one_key/provider/notebook_detail_model.dart';
import 'package:one_key/provider/online_check_edit_provider.dart';
import 'package:one_key/provider/tools.dart';
import 'package:one_key/utils/navigator_util.dart';
... ... @@ -57,6 +58,9 @@ Future<void> main() async {
ChangeNotifierProvider<OrderFoodProvider>(
create: (_) => OrderFoodProvider(),
),
ChangeNotifierProvider<NotebookDetailModel>(
create: (_) => NotebookDetailModel(),
),
],
child: MyApp(),
));
... ...
import 'package:json_annotation/json_annotation.dart';
part 'new_reserve_list_model.g.dart';
@JsonSerializable()
class NewReserveListModel extends Object {
@JsonKey(name: 'ret')
int ret;
@JsonKey(name: 'data')
List<NewReserveListSunModel> data;
@JsonKey(name: 'msg')
String msg;
NewReserveListModel(
this.ret,
this.data,
this.msg,
);
factory NewReserveListModel.fromJson(Map<String, dynamic> srcJson) =>
_$NewReserveListModelFromJson(srcJson);
Map<String, dynamic> toJson() => _$NewReserveListModelToJson(this);
}
@JsonSerializable()
class NewReserveListSunModel extends Object {
@JsonKey(name: 'id')
String id;
@JsonKey(name: 'openid')
String openid;
@JsonKey(name: 'sid')
String sid;
@JsonKey(name: 'room_demand')
String roomDemand;
@JsonKey(name: 'tid')
String tid;
@JsonKey(name: 'tableinfo')
String tableinfo;
@JsonKey(name: 'pnum')
String pnum;
@JsonKey(name: 'rname')
String rname;
@JsonKey(name: 'sex')
String sex;
@JsonKey(name: 'phone')
String phone;
@JsonKey(name: 'cusdem')
String cusdem;
@JsonKey(name: 'cusman')
String cusman;
@JsonKey(name: 'rdate')
String rdate;
@JsonKey(name: 'edate')
String edate;
@JsonKey(name: 'vdate')
String vdate;
@JsonKey(name: 'ddate')
String ddate;
@JsonKey(name: 'is_set_ddate')
String isSetDdate;
@JsonKey(name: 'ddate_solt')
String ddateSolt;
@JsonKey(name: 'status')
String status;
@JsonKey(name: 'cause')
String cause;
@JsonKey(name: 'abolition')
String abolition;
@JsonKey(name: 'action')
String action;
@JsonKey(name: 'type')
String type;
@JsonKey(name: 'code')
String code;
@JsonKey(name: 'operator_openid')
String operatorOpenid;
@JsonKey(name: 'channel')
String channel;
@JsonKey(name: 'cdate')
String cdate;
@JsonKey(name: 'name')
String name;
@JsonKey(name: 'order_info')
OrderInfo orderInfo;
NewReserveListSunModel(
this.id,
this.openid,
this.sid,
this.roomDemand,
this.tid,
this.tableinfo,
this.pnum,
this.rname,
this.sex,
this.phone,
this.cusdem,
this.cusman,
this.rdate,
this.edate,
this.vdate,
this.ddate,
this.isSetDdate,
this.ddateSolt,
this.status,
this.cause,
this.abolition,
this.action,
this.type,
this.code,
this.operatorOpenid,
this.channel,
this.cdate,
this.name,
this.orderInfo,
);
factory NewReserveListSunModel.fromJson(Map<String, dynamic> srcJson) =>
_$NewReserveListSunModelFromJson(srcJson);
Map<String, dynamic> toJson() => _$NewReserveListSunModelToJson(this);
}
@JsonSerializable()
class OrderInfo extends Object {
@JsonKey(name: 'id')
String id;
@JsonKey(name: 'order_no')
String orderNo;
@JsonKey(name: 'out_trade_no')
String outTradeNo;
@JsonKey(name: 'openid')
String openid;
@JsonKey(name: 'sid')
String sid;
@JsonKey(name: 'rid')
String rid;
@JsonKey(name: 'sellername')
String sellername;
@JsonKey(name: 'tablename')
String tablename;
@JsonKey(name: 'wechat_no')
String wechatNo;
@JsonKey(name: 'bill_list')
List<dynamic> billList;
@JsonKey(name: 'price')
String price;
@JsonKey(name: 'should_price')
String shouldPrice;
@JsonKey(name: 'subsidy_type')
String subsidyType;
@JsonKey(name: 'subsidy_price')
String subsidyPrice;
@JsonKey(name: 'is_wine')
String isWine;
@JsonKey(name: 'is_pack')
String isPack;
@JsonKey(name: 'status')
String status;
@JsonKey(name: 'pay_time')
String payTime;
@JsonKey(name: 'confirm_time')
String confirmTime;
@JsonKey(name: 'remarks')
String remarks;
@JsonKey(name: 'attach')
String attach;
@JsonKey(name: 'currency')
String currency;
@JsonKey(name: 'detail')
String detail;
@JsonKey(name: 'description')
String description;
@JsonKey(name: 'profit_sharing')
String profitSharing;
@JsonKey(name: 'create_time')
String createTime;
OrderInfo(
this.id,
this.orderNo,
this.outTradeNo,
this.openid,
this.sid,
this.rid,
this.sellername,
this.tablename,
this.wechatNo,
this.billList,
this.price,
this.shouldPrice,
this.subsidyType,
this.subsidyPrice,
this.isWine,
this.isPack,
this.status,
this.payTime,
this.confirmTime,
this.remarks,
this.attach,
this.currency,
this.detail,
this.description,
this.profitSharing,
this.createTime,
);
factory OrderInfo.fromJson(Map<String, dynamic> srcJson) =>
_$OrderInfoFromJson(srcJson);
Map<String, dynamic> toJson() => _$OrderInfoToJson(this);
}
... ...
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'new_reserve_list_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
NewReserveListModel _$NewReserveListModelFromJson(Map<String, dynamic> json) {
return NewReserveListModel(
json['ret'] as int,
(json['data'] as List)
?.map((e) => e == null
? null
: NewReserveListSunModel.fromJson(e as Map<String, dynamic>))
?.toList(),
json['msg'] as String);
}
Map<String, dynamic> _$NewReserveListModelToJson(
NewReserveListModel instance) =>
<String, dynamic>{
'ret': instance.ret,
'data': instance.data,
'msg': instance.msg
};
NewReserveListSunModel _$NewReserveListSunModelFromJson(
Map<String, dynamic> json) {
return NewReserveListSunModel(
json['id'] as String,
json['openid'] as String,
json['sid'] as String,
json['room_demand'] as String,
json['tid'] as String,
json['tableinfo'] as String,
json['pnum'] as String,
json['rname'] as String,
json['sex'] as String,
json['phone'] as String,
json['cusdem'] as String,
json['cusman'] as String,
json['rdate'] as String,
json['edate'] as String,
json['vdate'] as String,
json['ddate'] as String,
json['is_set_ddate'] as String,
json['ddate_solt'] as String,
json['status'] as String,
json['cause'] as String,
json['abolition'] as String,
json['action'] as String,
json['type'] as String,
json['code'] as String,
json['operator_openid'] as String,
json['channel'] as String,
json['cdate'] as String,
json['name'] as String,
json['order_info'] == null
? null
: OrderInfo.fromJson(json['order_info'] as Map<String, dynamic>));
}
Map<String, dynamic> _$NewReserveListSunModelToJson(
NewReserveListSunModel instance) =>
<String, dynamic>{
'id': instance.id,
'openid': instance.openid,
'sid': instance.sid,
'room_demand': instance.roomDemand,
'tid': instance.tid,
'tableinfo': instance.tableinfo,
'pnum': instance.pnum,
'rname': instance.rname,
'sex': instance.sex,
'phone': instance.phone,
'cusdem': instance.cusdem,
'cusman': instance.cusman,
'rdate': instance.rdate,
'edate': instance.edate,
'vdate': instance.vdate,
'ddate': instance.ddate,
'is_set_ddate': instance.isSetDdate,
'ddate_solt': instance.ddateSolt,
'status': instance.status,
'cause': instance.cause,
'abolition': instance.abolition,
'action': instance.action,
'type': instance.type,
'code': instance.code,
'operator_openid': instance.operatorOpenid,
'channel': instance.channel,
'cdate': instance.cdate,
'name': instance.name,
'order_info': instance.orderInfo
};
OrderInfo _$OrderInfoFromJson(Map<String, dynamic> json) {
return OrderInfo(
json['id'] as String,
json['order_no'] as String,
json['out_trade_no'] as String,
json['openid'] as String,
json['sid'] as String,
json['rid'] as String,
json['sellername'] as String,
json['tablename'] as String,
json['wechat_no'] as String,
json['bill_list'] as List,
json['price'] as String,
json['should_price'] as String,
json['subsidy_type'] as String,
json['subsidy_price'] as String,
json['is_wine'] as String,
json['is_pack'] as String,
json['status'] as String,
json['pay_time'] as String,
json['confirm_time'] as String,
json['remarks'] as String,
json['attach'] as String,
json['currency'] as String,
json['detail'] as String,
json['description'] as String,
json['profit_sharing'] as String,
json['create_time'] as String);
}
Map<String, dynamic> _$OrderInfoToJson(OrderInfo instance) => <String, dynamic>{
'id': instance.id,
'order_no': instance.orderNo,
'out_trade_no': instance.outTradeNo,
'openid': instance.openid,
'sid': instance.sid,
'rid': instance.rid,
'sellername': instance.sellername,
'tablename': instance.tablename,
'wechat_no': instance.wechatNo,
'bill_list': instance.billList,
'price': instance.price,
'should_price': instance.shouldPrice,
'subsidy_type': instance.subsidyType,
'subsidy_price': instance.subsidyPrice,
'is_wine': instance.isWine,
'is_pack': instance.isPack,
'status': instance.status,
'pay_time': instance.payTime,
'confirm_time': instance.confirmTime,
'remarks': instance.remarks,
'attach': instance.attach,
'currency': instance.currency,
'detail': instance.detail,
'description': instance.description,
'profit_sharing': instance.profitSharing,
'create_time': instance.createTime
};
... ...
... ... @@ -44,6 +44,7 @@ class Notebook {
String channel;
String cdate;
String name;
OrderInfo orderInfo;
String get tableinfoStr {
return name +
... ... @@ -121,3 +122,118 @@ class Notebook {
_$NotebookFromJson(json);
Map<String, dynamic> toJson() => _$NotebookToJson(this);
}
@JsonSerializable()
class OrderInfo extends Object {
@JsonKey(name: 'id')
String id;
@JsonKey(name: 'order_no')
String orderNo;
@JsonKey(name: 'out_trade_no')
String outTradeNo;
@JsonKey(name: 'openid')
String openid;
@JsonKey(name: 'sid')
String sid;
@JsonKey(name: 'rid')
String rid;
@JsonKey(name: 'sellername')
String sellername;
@JsonKey(name: 'tablename')
String tablename;
@JsonKey(name: 'wechat_no')
String wechatNo;
@JsonKey(name: 'bill_list')
List<dynamic> billList;
@JsonKey(name: 'price')
String price;
@JsonKey(name: 'should_price')
String shouldPrice;
@JsonKey(name: 'subsidy_type')
String subsidyType;
@JsonKey(name: 'subsidy_price')
String subsidyPrice;
@JsonKey(name: 'is_wine')
String isWine;
@JsonKey(name: 'is_pack')
String isPack;
@JsonKey(name: 'status')
String status;
@JsonKey(name: 'pay_time')
String payTime;
@JsonKey(name: 'confirm_time')
String confirmTime;
@JsonKey(name: 'remarks')
String remarks;
@JsonKey(name: 'attach')
String attach;
@JsonKey(name: 'currency')
String currency;
@JsonKey(name: 'detail')
String detail;
@JsonKey(name: 'description')
String description;
@JsonKey(name: 'profit_sharing')
String profitSharing;
@JsonKey(name: 'create_time')
String createTime;
OrderInfo(
this.id,
this.orderNo,
this.outTradeNo,
this.openid,
this.sid,
this.rid,
this.sellername,
this.tablename,
this.wechatNo,
this.billList,
this.price,
this.shouldPrice,
this.subsidyType,
this.subsidyPrice,
this.isWine,
this.isPack,
this.status,
this.payTime,
this.confirmTime,
this.remarks,
this.attach,
this.currency,
this.detail,
this.description,
this.profitSharing,
this.createTime,
);
factory OrderInfo.fromJson(Map<String, dynamic> srcJson) =>
_$OrderInfoFromJson(srcJson);
Map<String, dynamic> toJson() => _$OrderInfoToJson(this);
}
... ...
... ... @@ -43,7 +43,10 @@ Notebook _$NotebookFromJson(Map<String, dynamic> json) {
..operator_openid = json['operator_openid'] as String
..channel = json['channel'] as String
..cdate = json['cdate'] as String
..name = json['name'] as String;
..name = json['name'] as String
..orderInfo = json['order_info'] == null
? null
: OrderInfo.fromJson(json['order_info'] as Map<String, dynamic>);
}
Map<String, dynamic> _$NotebookToJson(Notebook instance) => <String, dynamic>{
... ... @@ -82,5 +85,65 @@ Map<String, dynamic> _$NotebookToJson(Notebook instance) => <String, dynamic>{
'operator_openid': instance.operator_openid,
'channel': instance.channel,
'cdate': instance.cdate,
'name': instance.name
'name': instance.name,
'order_info': instance.orderInfo
};
OrderInfo _$OrderInfoFromJson(Map<String, dynamic> json) {
return OrderInfo(
json['id'] as String,
json['order_no'] as String,
json['out_trade_no'] as String,
json['openid'] as String,
json['sid'] as String,
json['rid'] as String,
json['sellername'] as String,
json['tablename'] as String,
json['wechat_no'] as String,
json['bill_list'] as List,
json['price'] as String,
json['should_price'] as String,
json['subsidy_type'] as String,
json['subsidy_price'] as String,
json['is_wine'] as String,
json['is_pack'] as String,
json['status'] as String,
json['pay_time'] as String,
json['confirm_time'] as String,
json['remarks'] as String,
json['attach'] as String,
json['currency'] as String,
json['detail'] as String,
json['description'] as String,
json['profit_sharing'] as String,
json['create_time'] as String);
}
Map<String, dynamic> _$OrderInfoToJson(OrderInfo instance) => <String, dynamic>{
'id': instance.id,
'order_no': instance.orderNo,
'out_trade_no': instance.outTradeNo,
'openid': instance.openid,
'sid': instance.sid,
'rid': instance.rid,
'sellername': instance.sellername,
'tablename': instance.tablename,
'wechat_no': instance.wechatNo,
'bill_list': instance.billList,
'price': instance.price,
'should_price': instance.shouldPrice,
'subsidy_type': instance.subsidyType,
'subsidy_price': instance.subsidyPrice,
'is_wine': instance.isWine,
'is_pack': instance.isPack,
'status': instance.status,
'pay_time': instance.payTime,
'confirm_time': instance.confirmTime,
'remarks': instance.remarks,
'attach': instance.attach,
'currency': instance.currency,
'detail': instance.detail,
'description': instance.description,
'profit_sharing': instance.profitSharing,
'create_time': instance.createTime
};
... ...
import 'package:json_annotation/json_annotation.dart';
import 'package:one_key/utils/utils.dart';
part 'order_info_model.g.dart';
... ... @@ -105,6 +106,9 @@ class OrderInfoSunModel extends Object {
@JsonKey(name: 'create_time')
String createTime;
@JsonKey(name: 'invoice')
Invoice invoice;
@JsonKey(name: 'discount')
List<dynamic> discount;
... ... @@ -157,8 +161,78 @@ class OrderInfoSunModel extends Object {
this.discount,
);
// 买单时间
String get payTimeStr {
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(
int.parse(payTime.toString()) * 1000);
return dateTime.year.toString() +
"/" +
Utils.addZeroNumber(dateTime.month) +
"/" +
Utils.addZeroNumber(dateTime.day) +
" " +
Utils.addZeroNumber(dateTime.hour) +
":" +
Utils.addZeroNumber(dateTime.minute);
}
factory OrderInfoSunModel.fromJson(Map<String, dynamic> srcJson) =>
_$OrderInfoSunModelFromJson(srcJson);
Map<String, dynamic> toJson() => _$OrderInfoSunModelToJson(this);
}
@JsonSerializable()
class Invoice extends Object {
@JsonKey(name: 'id')
String id;
@JsonKey(name: 'rid')
String rid;
@JsonKey(name: 'openid')
String openid;
@JsonKey(name: 'type')
String type;
@JsonKey(name: 'title')
String title;
@JsonKey(name: 'taxnumber')
String taxnumber;
@JsonKey(name: 'companyaddress')
String companyaddress;
@JsonKey(name: 'telephone')
String telephone;
@JsonKey(name: 'bankname')
String bankname;
@JsonKey(name: 'bankaccount')
String bankaccount;
@JsonKey(name: 'cdate')
String cdate;
Invoice(
this.id,
this.rid,
this.openid,
this.type,
this.title,
this.taxnumber,
this.companyaddress,
this.telephone,
this.bankname,
this.bankaccount,
this.cdate,
);
factory Invoice.fromJson(Map<String, dynamic> srcJson) =>
_$InvoiceFromJson(srcJson);
Map<String, dynamic> toJson() => _$InvoiceToJson(this);
}
... ...
... ... @@ -50,7 +50,10 @@ OrderInfoSunModel _$OrderInfoSunModelFromJson(Map<String, dynamic> json) {
json['description'] as String,
json['profit_sharing'] as String,
json['create_time'] as String,
json['discount'] as List);
json['discount'] as List)
..invoice = json['invoice'] == null
? null
: Invoice.fromJson(json['invoice'] as Map<String, dynamic>);
}
Map<String, dynamic> _$OrderInfoSunModelToJson(OrderInfoSunModel instance) =>
... ... @@ -81,5 +84,35 @@ Map<String, dynamic> _$OrderInfoSunModelToJson(OrderInfoSunModel instance) =>
'description': instance.description,
'profit_sharing': instance.profitSharing,
'create_time': instance.createTime,
'invoice': instance.invoice,
'discount': instance.discount
};
Invoice _$InvoiceFromJson(Map<String, dynamic> json) {
return Invoice(
json['id'] as String,
json['rid'] as String,
json['openid'] as String,
json['type'] as String,
json['title'] as String,
json['taxnumber'] as String,
json['companyaddress'] as String,
json['telephone'] as String,
json['bankname'] as String,
json['bankaccount'] as String,
json['cdate'] as String);
}
Map<String, dynamic> _$InvoiceToJson(Invoice instance) => <String, dynamic>{
'id': instance.id,
'rid': instance.rid,
'openid': instance.openid,
'type': instance.type,
'title': instance.title,
'taxnumber': instance.taxnumber,
'companyaddress': instance.companyaddress,
'telephone': instance.telephone,
'bankname': instance.bankname,
'bankaccount': instance.bankaccount,
'cdate': instance.cdate
};
... ...
... ... @@ -127,6 +127,27 @@ class ReserveDetailSunModel extends Object {
@JsonKey(name: 'order')
Order order;
// if(entity.getDiscount()!=null){
// double platform=0.0;
// double store=0.0;
// for (Discount discount:entity.getDiscount()){
// if(discount.getOwner().equals("1")){//平台
// platform+=Double.parseDouble(discount.getPrice());
// }else if(discount.getOwner().equals("2")){//店铺
// store+=Double.parseDouble(discount.getPrice());
// }
// }
// observablePlatformSubsidyPrice.set("¥"+String.format("%.2f",platform));
// observableStoreSubsidyPrice.set("-¥"+String.format("%.2f",store));
// observableStoreSubsidyVisibility.set(View.VISIBLE);
// observableRealPrice.set("¥"+(String.format("%.2f",(Double.parseDouble(entity.getOrder_info().getPrice())-store)>0.01?(Double.parseDouble(entity.getOrder_info().getPrice())-store):0.01)));
// }else{
// observablePlatformSubsidyPrice.set("¥0.00");
// observableStoreSubsidyPrice.set("-¥0.00");
// observableStoreSubsidyVisibility.set(View.GONE);
// observableRealPrice.set("¥"+entity.getOrder_info().getPrice());
// }
///年月日 餐段
String get ddateStr {
String ymd = "";
... ...
... ... @@ -69,10 +69,20 @@ class Table {
}
String get signStr {
if (sign != null&&sign.isNotEmpty) {
if (sign != null && sign.isNotEmpty) {
switch (sign) {
case "1": //已预订
case "5": //已安排包间
// itemRv.setBackgroundResource(R.drawable.table_white);
// if(item.getOrder_status()==3){
// status.setBackgroundResource(R.drawable.table_bg_bottom_yellow);
// status.setText("已买单");
// }else{
// status.setBackgroundResource(R.drawable.table_bg_bottom_red);
// status.setText("已预订");
// }
// status.setVisibility(View.VISIBLE);
// pnum.setText(item.getNoteName());
return "已预订";
case "2": //用餐中
return "用餐中";
... ... @@ -91,5 +101,4 @@ class Table {
String toString() {
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}';
}
}
... ...
... ... @@ -69,5 +69,7 @@ class HttpUrl {
"?service=App.Customer.GetOrderInfo"; //获取账单详情
static const String update_order_info =
"?service=App.Customer.UpdateOrderInfo"; // 商家确认账单
static const String new_get_reserve_list =
"?service=App.Reserve.NewGetReserveList"; //商家预订本列表【2019-11-26】
}
... ...
... ... @@ -8,6 +8,7 @@ import 'package:one_key/models/manager.dart';
import 'package:one_key/models/notebook_detail.dart';
import 'package:one_key/provider/message_dialog_model.dart';
import 'package:one_key/provider/notebook_detail_model.dart';
import 'package:one_key/provider/online_check_edit_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/dialog_util.dart';
... ... @@ -66,6 +67,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
ScrollController _scrollController;
String formatPhone = "";
OnlineCheckEditProvider _onlineCheckEditProvider;
@override
void initState() {
... ... @@ -74,6 +76,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
WidgetsBinding.instance.addPostFrameCallback((_) async {
_initCancel();
_getReserveDetail();
_getOrderInfo();
managers = await detailModel.getManagers(context);
//添加listener监听
//对应的TextField失去或者获取焦点都会回调此监听
... ... @@ -114,6 +117,15 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
bus.off("refresh_detail");
}
///获取订单详情
_getOrderInfo() async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {"rid": widget.rid};
//remark信息获取
await _onlineCheckEditProvider.getOrderInfo(context, params);
}
///订座详情
_getReserveDetail() async {
detailEntity = await detailModel.getReserveDetail(context, {
"rid": widget.rid,
... ... @@ -431,6 +443,9 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
_cancelNode.unfocus();
}
detailModel = Provider.of<NotebookDetailModel>(context, listen: true);
_onlineCheckEditProvider =
Provider.of<OnlineCheckEditProvider>(context, listen: true);
return Scaffold(
body: SafeArea(
child: WillPopScope(
... ... @@ -687,6 +702,187 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
],
),
),
_onlineCheckEditProvider
.orderInfoSunModel !=
null &&
_onlineCheckEditProvider
.orderInfoSunModel
.invoice !=
null &&
detailEntity.status != "4"
? MyDivider(double.infinity,
ScreenUtil().setHeight(1))
: Container(),
_onlineCheckEditProvider
.orderInfoSunModel !=
null &&
_onlineCheckEditProvider
.orderInfoSunModel
.invoice !=
null &&
detailEntity.status != "4"
? InkWell(
onTap: () {
NavigatorUtil
.goInvoiceDetailPage(
context,
fromNotify: false,
rid: widget.rid);
},
child: Container(
height: ScreenUtil()
.setWidth(87 * 2),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Text(
"发票抬头",
style: TextStyle(
color: MyColours
.color_828282,
fontSize:
ScreenUtil()
.setSp(30)),
),
Spacer(),
Column(
mainAxisAlignment:
MainAxisAlignment
.center,
children: [
Text(
_onlineCheckEditProvider
.orderInfoSunModel
.invoice
.title,
style: TextStyle(
color: MyColours
.color_353535,
fontWeight:
FontWeight
.bold,
fontSize:
ScreenUtil()
.setSp(
33))),
_onlineCheckEditProvider
.orderInfoSunModel
.invoice
.taxnumber ==
null ||
_onlineCheckEditProvider
.orderInfoSunModel
.invoice
.taxnumber ==
''
? Container()
: Column(
children: [
VEmptyView(
10),
Text(
'税号:${_onlineCheckEditProvider.orderInfoSunModel.invoice.taxnumber}',
style: TextStyle(
color:
MyColours.color_707070,
fontSize: ScreenUtil().setSp(28)))
],
)
],
),
HEmptyView(20),
Image.asset(
Utils.getImgPath(
'arr_right_gray'),
width: ScreenUtil()
.setWidth(12),
height: ScreenUtil()
.setWidth(22),
)
],
),
),
)
: Container(),
_onlineCheckEditProvider
.orderInfoSunModel !=
null &&
_onlineCheckEditProvider
.orderInfoSunModel
.price !=
null &&
detailEntity.status != "4"
? MyDivider(double.infinity,
ScreenUtil().setHeight(1))
: Container(),
_onlineCheckEditProvider
.orderInfoSunModel !=
null &&
_onlineCheckEditProvider
.orderInfoSunModel
.price !=
null &&
detailEntity.status != "4"
? InkWell(
onTap: () {
//在线买单消息 去查看 跳转在线买单详情页面
NavigatorUtil
.goOnlineCheckDetailPage(
context,
rid: '${widget.rid}');
},
child: Container(
height: ScreenUtil()
.setWidth(87 * 2),
child: Row(
mainAxisAlignment:
MainAxisAlignment
.spaceBetween,
children: [
Text(
"实收金额:",
style: TextStyle(
color: MyColours
.color_707070,
fontSize:
ScreenUtil()
.setSp(30)),
),
HEmptyView(20),
Text(
'¥ ${_onlineCheckEditProvider.orderInfoSunModel.price}',
style: TextStyle(
color: MyColours
.color_353535,
fontSize:
ScreenUtil()
.setSp(32)),
),
Spacer(),
Text('查看明细',
style: TextStyle(
color: MyColours
.color_707070,
fontSize:
ScreenUtil()
.setSp(
28))),
HEmptyView(20),
Image.asset(
Utils.getImgPath(
'arr_right_gray'),
width: ScreenUtil()
.setWidth(12),
height: ScreenUtil()
.setWidth(22),
)
],
),
),
)
: Container(),
],
)),
),
... ...
... ... @@ -5,21 +5,15 @@ import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/app.dart';
import 'package:one_key/models/notebook_detail.dart';
import 'package:one_key/pages/detail/notebook_detail_change_page.dart';
import 'package:one_key/pages/detail/notebook_detail_page.dart';
import 'package:one_key/pages/enter/enter_page.dart';
import 'package:one_key/pages/message/message_page.dart';
import 'package:one_key/pages/my/my_page.dart';
import 'package:one_key/pages/notebook/notebook_page.dart';
import 'package:one_key/pages/table/table_manager_page.dart';
import 'package:one_key/provider/contact_model.dart';
import 'package:one_key/provider/enter_model.dart';
import 'package:one_key/provider/message_dialog_model.dart';
import 'package:one_key/provider/message_model.dart';
import 'package:one_key/provider/my_model.dart';
import 'package:one_key/provider/notebook_detail_change_model.dart';
import 'package:one_key/provider/notebook_model.dart';
import 'package:one_key/provider/table_manager_model.dart';
import 'package:one_key/provider/tools.dart';
... ... @@ -27,13 +21,10 @@ import 'package:one_key/provider/update_model.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/event_bus.dart';
import 'package:one_key/utils/misc.dart';
import 'package:one_key/utils/navigator_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart';
import 'package:flutter_app_badger/flutter_app_badger.dart';
import 'package:one_key/models/message.dart';
... ... @@ -131,6 +122,11 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
NavigatorUtil.goOnlineCheckEditPage(context,
rid: notifyParam["rid"], fromNotify: true);
break;
case "13":
//在线买单消息 去查看 跳转在线买单详情页面
NavigatorUtil.goOnlineCheckDetailPage(context,
rid: notifyParam["rid"], fromNotify: true);
break;
case "1":
NavigatorUtil.goHasOrderFoodPage(context,
rid: notifyParam["rid"], fromNotify: true);
... ... @@ -226,6 +222,16 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
context, custom['rid'].toString(),
mid: custom['mid'].toString(), fromNotify: true);
break;
case "12":
//在线买单消息 去处理 跳转在线买单处理页面
NavigatorUtil.goOnlineCheckEditPage(context,
rid: custom["rid"], fromNotify: true);
break;
case "13":
//在线买单消息 去查看 跳转在线买单详情页面
NavigatorUtil.goOnlineCheckDetailPage(context,
rid: custom["rid"], fromNotify: true);
break;
case "1":
NavigatorUtil.goHasOrderFoodPage(context,
rid: custom["rid"], fromNotify: true);
... ... @@ -352,27 +358,25 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
///获取全部未读消息
///
_getAllUnMessages() {
getUntreatedMessage('1', () {
getUntreatedMessage('10', () {
MessageDialogModel messageModel =
Provider.of<MessageDialogModel>(context, listen: false);
if (messageModel.messages.isNotEmpty) {
//底部弹出布局
if (!messageModel.showMessageDialog) {
DialogUtil.showMessageDialog(context);
} else {
messageModel.notifyListeners();
}
//播放声音
if (messageModel.messages.length > 1) {
messageModel.play("-1");
} else {
for (Message message in messageModel.messages) {
messageModel.play(message.message_type);
}
getUntreatedMessage('11,10,1,12,13,14', () {
MessageDialogModel messageModel =
Provider.of<MessageDialogModel>(context, listen: false);
if (messageModel.messages.isNotEmpty) {
//底部弹出布局
if (!messageModel.showMessageDialog) {
DialogUtil.showMessageDialog(context);
} else {
messageModel.notifyListeners();
}
//播放声音
if (messageModel.messages.length > 1) {
messageModel.play("-1");
} else {
for (Message message in messageModel.messages) {
messageModel.play(message.message_type);
}
}
});
}
});
}
... ...
... ... @@ -41,7 +41,23 @@ class MessageDialogItem extends StatelessWidget {
subTitleFir = '桌位信息';
subTitleSec = '就餐时间';
subTitleThr = '预订人';
} else if (message.message_type == "12") {
title = "在线买单";
subTitleFir = '桌位信息';
subTitleSec = '申请时间';
subTitleThr = '预订人';
} else if (message.message_type == "13") {
title = "买单通知";
subTitleFir = '桌位信息';
subTitleSec = '申请时间';
subTitleThr = '预订人';
} else if (message.message_type == "14") {
title = "发票申请";
subTitleFir = '桌位信息';
subTitleSec = '申请时间';
subTitleThr = '预订人';
}
Color textColor =
isTreated ? MyColours.color_999999 : MyColours.color_353535;
MessageDialogModel messageDialogModel =
... ... @@ -49,7 +65,26 @@ class MessageDialogItem extends StatelessWidget {
return GestureDetector(
onTap: () {
if (isTreated) {
NavigatorUtil.goNotebookDetailPage(context, message.rid.toString());
if (message.message_type == "10") {
NavigatorUtil.goNotebookDetailPage(
context, message.rid.toString());
} else if (message.message_type == "1") {
NavigatorUtil.goHasOrderFoodPage(context, rid: message.rid);
} else if (message.message_type == "11") {
NavigatorUtil.goNotebookDetailPage(
context, message.rid.toString());
} else if (message.message_type == "12") {
//在线买单消息查看
NavigatorUtil.goOnlineCheckDetailPage(context,
rid: '${message.rid}');
} else if (message.message_type == "13") {
//买单通知,跳转至买单详情查看
NavigatorUtil.goOnlineCheckDetailPage(context,
rid: '${message.rid}');
} else if (message.message_type == "14") {
//发票详情页面跳转
NavigatorUtil.goInvoiceDetailPage(context, rid: '${message.rid}');
}
}
},
child: Stack(
... ... @@ -135,7 +170,10 @@ class MessageDialogItem extends StatelessWidget {
width: 160,
height: 48,
fontSize: 28,
content: message.message_type == "10" ? "立即处理" : "立即查看",
content: message.message_type == "10" ||
message.message_type == "12"
? "立即处理"
: "立即查看",
state: 1,
onPress: () async {
messageDialogModel.removeMessage(message.id);
... ... @@ -181,6 +219,46 @@ class MessageDialogItem extends StatelessWidget {
await messageDialogModel.setMessageStatus(
context, params);
bus.emit("refresh_untreated_num"); //刷新未读消息数目
} else if ('${message.message_type}' == "12") {
//在线买单消息 去处理 跳转在线买单处理页面
NavigatorUtil.goOnlineCheckEditPage(context,
rid: '${message.rid}', mid: message.id);
} else if ('${message.message_type}' == "13") {
//在线买单消息 去查看 跳转在线买单详情页面
NavigatorUtil.goOnlineCheckDetailPage(context,
rid: '${message.rid}');
bus.emit("remove_untreated_message", message.id);
Map<String, String> params = {
"sid": Provider.of<UserModel>(context, listen: false)
.user
.sellerid,
"id": message.id,
"status": message.message_type == "1"
? "is_read"
: "is_handle"
};
await messageDialogModel.setMessageStatus(
context, params);
bus.emit("refresh_untreated_num"); //刷新未读消息数目
} else if (message.message_type == "14") {
//发票详情页面跳转
NavigatorUtil.goInvoiceDetailPage(context,
rid: '${message.rid}');
bus.emit("remove_untreated_message", message.id);
Map<String, String> params = {
"sid": Provider.of<UserModel>(context, listen: false)
.user
.sellerid,
"id": message.id,
"status": message.message_type == "1"
? "is_read"
: "is_handle"
};
await messageDialogModel.setMessageStatus(
context, params);
bus.emit("refresh_untreated_num"); //刷新未读消息数目
}
},
),
... ...
... ... @@ -39,6 +39,14 @@ class MessageItem extends StatelessWidget {
titleText = "在线买单";
subTitleTextFir = '桌位信息';
subTitleTextSec = '申请时间';
} else if (message.message_type == "13") {
titleText = "买单通知";
subTitleTextFir = '桌位信息';
subTitleTextSec = '申请时间';
} else if (message.message_type == "14") {
titleText = "发票申请";
subTitleTextFir = '桌位信息';
subTitleTextSec = '申请时间';
}
MessageDialogModel messageDialogModel =
... ... @@ -57,8 +65,15 @@ class MessageItem extends StatelessWidget {
context, message.rid.toString());
} else if (message.message_type == "12") {
//在线买单消息查看
NavigatorUtil.goOnlineCheckEditPage(context,
NavigatorUtil.goOnlineCheckDetailPage(context,
rid: '${message.rid}');
} else if (message.message_type == "13") {
//买单通知,跳转至买单详情查看
NavigatorUtil.goOnlineCheckDetailPage(context,
rid: '${message.rid}');
} else if (message.message_type == "14") {
//发票详情页面跳转
NavigatorUtil.goInvoiceDetailPage(context, rid: '${message.rid}');
}
}
},
... ... @@ -194,7 +209,43 @@ class MessageItem extends StatelessWidget {
} else if ('${message.message_type}' == "12") {
//在线买单消息 去处理 跳转在线买单处理页面
NavigatorUtil.goOnlineCheckEditPage(context,
rid: '${message.rid}', mid: message.id);
} else if ('${message.message_type}' == "13") {
//在线买单消息 去查看 跳转在线买单详情页面
NavigatorUtil.goOnlineCheckDetailPage(context,
rid: '${message.rid}');
bus.emit("remove_untreated_message", message.id);
Map<String, String> params = {
"sid": Provider.of<UserModel>(context, listen: false)
.user
.sellerid,
"id": message.id,
"status": message.message_type == "1"
? "is_read"
: "is_handle"
};
await messageDialogModel.setMessageStatus(
context, params);
bus.emit("refresh_untreated_num"); //刷新未读消息数目
} else if (message.message_type == "14") {
//发票详情页面跳转
NavigatorUtil.goInvoiceDetailPage(context,
rid: '${message.rid}');
bus.emit("remove_untreated_message", message.id);
Map<String, String> params = {
"sid": Provider.of<UserModel>(context, listen: false)
.user
.sellerid,
"id": message.id,
"status": message.message_type == "1"
? "is_read"
: "is_handle"
};
await messageDialogModel.setMessageStatus(
context, params);
bus.emit("refresh_untreated_num"); //刷新未读消息数目
}
},
),
... ...
... ... @@ -43,115 +43,137 @@ class NotebookItemState extends State<NoteBookItem> {
? MyColours.color_bfbfbf
: MyColours.color_353535;
return Container(
width: double.infinity,
// height: ScreenUtil().setWidth(120),
color: (widget.index % 2 == 0)
? MyColours.color_f7fdfd
: MyColours.color_ffffff,
child: Row(
children: <Widget>[
GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
NavigatorUtil.goNotebookDetailPage(context, notebook.id);
},
child: Row(
children: <Widget>[
Container(
width: ScreenUtil().setWidth(171),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(24),
vertical: ScreenUtil().setWidth(20)),
alignment: Alignment.center,
child: Text(
notebook.tableinfoStr?.trim(),
maxLines: 30,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: textColor,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(30)),
),
),
MyDivider(
ScreenUtil().setWidth(1),
ScreenUtil().setHeight(90),
color: MyColours.color_ededed,
),
Container(
width: ScreenUtil().setWidth(230),
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
notebook.rnameStr,
// 'nnnnnnnnnnnnnn',
maxLines: 1,
return Stack(
children: [
Container(
width: double.infinity,
// height: ScreenUtil().setWidth(120),
color: (widget.index % 2 == 0)
? MyColours.color_f7fdfd
: MyColours.color_ffffff,
child: Row(
children: <Widget>[
GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
NavigatorUtil.goNotebookDetailPage(context, notebook.id);
},
child: Row(
children: <Widget>[
Container(
width: ScreenUtil().setWidth(86 * 2),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(14),
vertical: ScreenUtil().setWidth(40)),
alignment: Alignment.center,
child: Text(
notebook.tableinfoStr?.trim(),
maxLines: 30,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: textColor,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(30)),
),
VEmptyView(10),
Text(
notebook.phoneStr,
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
MyDivider(
ScreenUtil().setWidth(1),
ScreenUtil().setHeight(90),
color: MyColours.color_ededed,
),
Container(
width: ScreenUtil().setWidth(230),
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
notebook.rnameStr,
// 'nnnnnnnnnnnnnn',
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: textColor,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(30)),
),
VEmptyView(10),
Text(
notebook.phoneStr,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: textColor,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(26)),
)
],
),
),
MyDivider(
ScreenUtil().setWidth(1),
ScreenUtil().setHeight(90),
color: MyColours.color_ededed,
),
Container(
width: ScreenUtil().setWidth(159),
alignment: Alignment.center,
child: Text(
notebook.ddateStr,
style: TextStyle(
color: textColor,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(26)),
)
],
),
),
MyDivider(
ScreenUtil().setWidth(1),
ScreenUtil().setHeight(90),
color: MyColours.color_ededed,
fontSize: ScreenUtil().setSp(30)),
),
),
],
),
Container(
width: ScreenUtil().setWidth(159),
),
MyDivider(
ScreenUtil().setWidth(1),
ScreenUtil().setHeight(90),
color: MyColours.color_ededed,
),
GestureDetector(
onTap: _onOperateClick,
child: Container(
width: ScreenUtil().setWidth(184),
alignment: Alignment.center,
child: Text(
notebook.ddateStr,
notebook.operationText,
style: TextStyle(
color: textColor,
color: (notebook.status == "3" ||
notebook.status == "4" ||
notebook.status == "6")
? MyColours.color_bfbfbf
: MyColours.color_2bb5b7,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(30)),
),
),
],
),
),
MyDivider(
ScreenUtil().setWidth(1),
ScreenUtil().setHeight(90),
color: MyColours.color_ededed,
),
GestureDetector(
onTap: _onOperateClick,
child: Container(
width: ScreenUtil().setWidth(184),
alignment: Alignment.center,
child: Text(
notebook.operationText,
style: TextStyle(
color: (notebook.status == "3" ||
notebook.status == "4" ||
notebook.status == "6")
? MyColours.color_bfbfbf
: MyColours.color_2bb5b7,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil().setSp(30)),
),
),
],
),
],
),
),
notebook.orderInfo != null && notebook.orderInfo.status == '3'
? Container(
alignment: Alignment.center,
width: ScreenUtil().setWidth(52 * 2),
height: ScreenUtil().setWidth(19 * 2),
decoration: BoxDecoration(
color: MyColours.color_F59A23,
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(ScreenUtil().setWidth(10))),
),
child: Text(
'已买单',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_ffffff,
fontWeight: FontWeight.bold),
))
: Container()
],
);
}
}
... ...
... ... @@ -469,19 +469,22 @@ class _ImgPickerWidgetState extends DisposableState<ImgPickerWidget> {
? Text('')
: InkWell(
onTap: () {
_onlineCheckEditProvider.imageQiniuUrlList = [];
if (_onlineCheckEditProvider.imageList[index].qiniuUrl !=
null) {
for (int i = 0;
i < _onlineCheckEditProvider.imageList.length;
i++) {
_onlineCheckEditProvider.imageQiniuUrlList.add(
_onlineCheckEditProvider.imageList[i].qiniuUrl);
}
if (_onlineCheckEditProvider.imageList[index].process ==
1) {
_onlineCheckEditProvider.imageQiniuUrlList = [];
if (_onlineCheckEditProvider.imageList[index].qiniuUrl !=
null) {
for (int i = 0;
i < _onlineCheckEditProvider.imageList.length;
i++) {
_onlineCheckEditProvider.imageQiniuUrlList.add(
_onlineCheckEditProvider.imageList[i].qiniuUrl);
}
///没有上传完成的不可以点击
_showPhotoView(
context, index, _provider.imageQiniuUrlList);
///没有上传完成的不可以点击
_showPhotoView(
context, index, _provider.imageQiniuUrlList);
}
}
},
child: Stack(
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:one_key/provider/online_check_edit_provider.dart';
import 'package:one_key/provider/order_food_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/navigator_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
class InvoiceDetailPage extends StatefulWidget {
final bool fromNotify;
final String rid;
InvoiceDetailPage({Key key, this.fromNotify, this.rid}) : super(key: key);
@override
_InvoiceDetailPageState createState() => _InvoiceDetailPageState();
}
class _InvoiceDetailPageState extends State<InvoiceDetailPage> {
OnlineCheckEditProvider _onlineCheckEditProvider;
OrderFoodProvider _orderFoodProvider;
bool arrowStatus = true; // true合住 false展开
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
_getTableInfoData();
_getOrderInfo();
});
}
///获取订单详情
_getOrderInfo() async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {"rid": widget.rid};
//remark信息获取
await _onlineCheckEditProvider.getOrderInfo(context, params);
}
///接口获取桌位信息
_getTableInfoData() async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {
"openid": userModel.user.openid,
"rid": widget.rid
};
//明天完成 桌位名称信息
await _orderFoodProvider.getTableInfoData(context, params);
}
///桌位信息
Widget _tableInfoWidget() {
bool showArrow = false;
//1散座 2包间 3卡座
List<String> tableNameSunList1 = []; //单个类型包含的所有桌子名称
List<String> tableNameSunList2 = []; //单个类型包含的所有桌子名称
List<String> tableNameSunList3 = []; //单个类型包含的所有桌子名称
if (_orderFoodProvider.reserveDetailSunModel != null) {
tableNameSunList1 =
_orderFoodProvider.reserveDetailSunModel.tableNameList[0]['散座'];
tableNameSunList2 =
_orderFoodProvider.reserveDetailSunModel.tableNameList[1]['包间'];
tableNameSunList3 =
_orderFoodProvider.reserveDetailSunModel.tableNameList[2]['卡座'];
if (tableNameSunList2.length > 0) {
if (arrowStatus) {
_orderFoodProvider.showTable = '【包间】${tableNameSunList2[0]}';
} else {
_orderFoodProvider.showTable = '';
}
} else if (tableNameSunList3.length > 0) {
if (arrowStatus) {
_orderFoodProvider.showTable = '【卡座】${tableNameSunList3[0]}';
} else {
_orderFoodProvider.showTable = '';
}
} else if (tableNameSunList1.length > 0) {
if (arrowStatus) {
_orderFoodProvider.showTable = '【散座】${tableNameSunList1[0]}';
} else {
_orderFoodProvider.showTable = '';
}
}
if (tableNameSunList1.length > 1 ||
tableNameSunList2.length > 1 ||
tableNameSunList3.length > 1) {
showArrow = true;
} else {
showArrow = false;
}
}
return Container(
height: ScreenUtil().setWidth(57 * 2),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10))),
padding: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40),
vertical: ScreenUtil().setWidth(18 * 2)),
child: Column(children: [
InkWell(
onTap: () {
if (showArrow) {
//有arrow
arrowStatus = !arrowStatus;
_orderFoodProvider.notifyListeners();
}
},
child: Container(
child: Row(
children: [
Text('桌位信息',
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_707070,
fontWeight: FontWeight.bold)),
Spacer(),
Text(
_orderFoodProvider.showTable,
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
fontWeight: FontWeight.bold,
color: MyColours.color_353535),
),
Offstage(
offstage: !showArrow,
child: Row(
children: [
HEmptyView(20),
Image.asset(
arrowStatus
? Utils.getImgPath('down')
: Utils.getImgPath('up'),
width: ScreenUtil().setWidth(24),
height: ScreenUtil().setWidth(12))
],
),
)
],
),
),
),
Offstage(
offstage: arrowStatus,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VEmptyView(14),
tableNameSunList2.length > 0
? Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(60),
ScreenUtil().setWidth(10)),
child: Text(
'【包间】${Utils.listToString(tableNameSunList2)}',
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535,
fontWeight: FontWeight.bold),
),
)
: Container(),
tableNameSunList3.length > 0
? Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(60),
ScreenUtil().setWidth(10)),
child: Text(
'【卡座】${Utils.listToString(tableNameSunList3)}',
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535),
),
)
: Container(),
tableNameSunList1.length > 0
? Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(60),
ScreenUtil().setWidth(10)),
child: Text(
'【散座】${Utils.listToString(tableNameSunList1)}',
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535),
),
)
: Container(),
],
),
),
]));
}
///发票信息
Widget _invoiceInfoWidget() {
return Container(
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(10)),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: <
Widget>[
Container(
height: ScreenUtil().setWidth(53 * 2),
width: double.infinity,
decoration: BoxDecoration(
color: MyColours.color_FAFAFA,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
topRight: Radius.circular(10)),
),
child: Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(20),
ScreenUtil().setWidth(36),
ScreenUtil().setWidth(20),
ScreenUtil().setWidth(26)),
child: Text(
'发票信息',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_353535,
fontWeight: FontWeight.bold),
),
)),
Container(
color: Colors.white,
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(24),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(36)),
child: Column(children: [
_customInfoItemWidget(
'名称',
_onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider
.orderInfoSunModel.invoice.title
: ''),
Offstage(
offstage: _onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider
.orderInfoSunModel.invoice.taxnumber ==
''
: true,
child: Padding(
padding: EdgeInsets.only(top: ScreenUtil().setWidth(24)),
child: _customInfoItemWidget(
'税号',
_onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider
.orderInfoSunModel.invoice.taxnumber
: ''),
),
),
Offstage(
offstage: _onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider
.orderInfoSunModel.invoice.companyaddress ==
''
: true,
child: Padding(
padding: EdgeInsets.only(top: ScreenUtil().setWidth(24)),
child: _customInfoItemWidget(
'单位地址',
_onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider
.orderInfoSunModel.invoice.companyaddress
: ''),
),
),
Offstage(
offstage: _onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider
.orderInfoSunModel.invoice.telephone ==
''
: true,
child: Padding(
padding: EdgeInsets.only(top: ScreenUtil().setWidth(24)),
child: _customInfoItemWidget(
'电话号码',
_onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider
.orderInfoSunModel.invoice.telephone
: ''),
),
),
Offstage(
offstage: _onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider
.orderInfoSunModel.invoice.bankname ==
''
: true,
child: Padding(
padding: EdgeInsets.only(top: ScreenUtil().setWidth(24)),
child: _customInfoItemWidget(
'开户银行',
_onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider
.orderInfoSunModel.invoice.bankname
: ''),
),
),
Offstage(
offstage: _onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider
.orderInfoSunModel.invoice.bankaccount ==
''
: true,
child: Padding(
padding: EdgeInsets.only(top: ScreenUtil().setWidth(24)),
child: _customInfoItemWidget(
'银行账号',
_onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider
.orderInfoSunModel.invoice.bankaccount
: ''),
),
)
]))
]));
}
///顾客信息
Widget _customInfoWidget() {
return Container(
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(10)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
height: ScreenUtil().setWidth(53 * 2),
width: double.infinity,
decoration: BoxDecoration(
color: MyColours.color_FAFAFA,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
topRight: Radius.circular(10)),
),
child: Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(20),
ScreenUtil().setWidth(36),
ScreenUtil().setWidth(20),
ScreenUtil().setWidth(26)),
child: Text(
'顾客信息',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_353535,
fontWeight: FontWeight.bold),
),
)),
Container(
color: Colors.white,
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(24),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(36)),
child: Column(
children: [
_customInfoItemWidget(
'买单顾客',
_orderFoodProvider.reserveDetailSunModel != null
? _orderFoodProvider.reserveDetailSunModel.rnameStr
: ''),
VEmptyView(24),
_customInfoItemWidget(
'顾客电话',
_orderFoodProvider.reserveDetailSunModel != null
? _orderFoodProvider.reserveDetailSunModel.phone
: ''),
VEmptyView(24),
_customInfoItemWidget(
'到店时间',
_orderFoodProvider.reserveDetailSunModel != null
? _orderFoodProvider.reserveDetailSunModel.ddateStr
: ''),
VEmptyView(24),
_customInfoItemWidget(
'申请时间',
_orderFoodProvider.reserveDetailSunModel != null
? _orderFoodProvider.reserveDetailSunModel.cdateStr
: '')
],
),
)
// _getGridImg(1, context)
],
),
);
}
///顾客信息
Widget _customInfoItemWidget(String title, String subTitle) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title,
style: TextStyle(
fontSize: ScreenUtil().setSp(28), color: MyColours.color_707070),
),
HEmptyView(176),
Text(
subTitle,
maxLines: 3,
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_707070,
fontWeight: FontWeight.bold),
)
],
);
}
@override
Widget build(BuildContext context) {
_onlineCheckEditProvider =
Provider.of<OnlineCheckEditProvider>(context, listen: true);
_orderFoodProvider = Provider.of<OrderFoodProvider>(context, listen: true);
return Scaffold(
backgroundColor: MyColours.color_f5f5f5,
appBar: SystemAppBar(
'发票详情',
onTap: () {
if (widget.fromNotify) {
NavigatorUtil.goHomePage(context, initialIndex: 0);
} else {
Navigator.of(context).pop();
}
},
),
body: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.all(ScreenUtil().setWidth(20)),
child: Column(children: [
_tableInfoWidget(),
VEmptyView(20),
_invoiceInfoWidget(),
VEmptyView(20),
_customInfoWidget()
]))));
}
}
... ...
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:one_key/pages/online_check/photo_view_wiget.dart';
import 'package:one_key/provider/online_check_edit_provider.dart';
import 'package:one_key/provider/order_food_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/navigator_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
class OnlineCheckDetailPage extends StatefulWidget {
final String rid;
final bool fromNotify;
OnlineCheckDetailPage({Key key, this.rid, this.fromNotify}) : super(key: key);
@override
_OnlineCheckDetailPageState createState() => _OnlineCheckDetailPageState();
}
class _OnlineCheckDetailPageState extends State<OnlineCheckDetailPage> {
OnlineCheckEditProvider _onlineCheckEditProvider;
OrderFoodProvider _orderFoodProvider;
bool arrowStatus = true; // true合住 false展开
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
_getQiniuInfo();
_getTableInfoData();
_getOrderInfo();
});
}
@override
void dispose() {
_onlineCheckEditProvider.orderInfoSunModel = null;
_orderFoodProvider.reserveDetailSunModel = null;
super.dispose();
}
///获取七牛云token
///
_getQiniuInfo() async {
await _onlineCheckEditProvider.getQiniuInfo(context, {});
}
///接口获取桌位信息
_getTableInfoData() async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {
"openid": userModel.user.openid,
"rid": widget.rid
};
//明天完成 桌位名称信息
await _orderFoodProvider.getTableInfoData(context, params);
}
///获取订单详情
_getOrderInfo() async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {"rid": widget.rid};
//remark信息获取
await _onlineCheckEditProvider.getOrderInfo(context, params);
}
///顾客信息
Widget _customInfoItemWidget(String title, String subTitle,
{Color textColor = MyColours.color_707070, bool isBold = false}) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
title,
style: TextStyle(
fontWeight: isBold ? FontWeight.bold : FontWeight.normal,
fontSize: ScreenUtil().setSp(28),
color: textColor),
),
Text(
subTitle,
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: textColor,
fontWeight: FontWeight.bold),
)
],
);
}
//查看大图
_showPhotoView(BuildContext context, int index, List imgs,
{isShow = false, List<String> dashName}) async {
Utils.setBarStatus(false, color: Colors.black);
dynamic result = await showGeneralDialog(
context: context,
barrierDismissible: false,
// barrierColor: Colors.red,
barrierLabel:
MaterialLocalizations.of(context).modalBarrierDismissLabel,
transitionDuration: const Duration(milliseconds: 150),
pageBuilder: (BuildContext context, Animation animation,
Animation secondaryAnimation) {
Widget child = Stack(
children: <Widget>[
PhotoPreview(
initialIndex: index,
photoList: imgs,
isShow: isShow,
dashName: dashName)
],
);
return child;
});
Utils.setBarStatus(true, color: Colors.white);
}
///消费信息
Widget _consumptionInfoWidget() {
return Container(
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(10)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
height: ScreenUtil().setWidth(58 * 2),
width: double.infinity,
decoration: BoxDecoration(
color: MyColours.color_FAFAFA,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
topRight: Radius.circular(10)),
),
child: Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(20),
ScreenUtil().setWidth(36),
ScreenUtil().setWidth(20),
ScreenUtil().setWidth(26)),
child: Text(
'消费信息',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_353535,
fontWeight: FontWeight.bold),
),
)),
Stack(
alignment: Alignment.center,
children: [
Container(
color: Colors.white,
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(24),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(36)),
child: Column(
children: [
_customInfoItemWidget(
'应收金额',
_onlineCheckEditProvider.orderInfoSunModel != null
? '¥ ${_onlineCheckEditProvider.orderInfoSunModel.shouldPrice}'
: ''),
Offstage(
offstage:
_onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider
.orderInfoSunModel.billList.length ==
0
: true,
child: Padding(
padding:
EdgeInsets.only(top: ScreenUtil().setWidth(24)),
child: InkWell(
onTap: () {
List<String> temp = [];
for (int i = 0;
i <
_onlineCheckEditProvider
.orderInfoSunModel.billList.length;
i++) {
temp.add(_onlineCheckEditProvider
.orderInfoSunModel.billList[i]);
}
_showPhotoView(
context,
0,
temp,
);
},
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
'消费清单',
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_707070),
),
Text(
'查看消费清单',
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_24A4A8,
decoration: TextDecoration.underline,
fontWeight: FontWeight.bold),
),
],
),
)))
],
),
),
//2待支付 wait_pay 3已买单 has_pay
_onlineCheckEditProvider.orderInfoSunModel != null
? Align(
child: Image.asset(
Utils.getImgPath(
_onlineCheckEditProvider.orderInfoSunModel.status ==
'2'
? 'wait_pay'
: 'has_pay'),
width: ScreenUtil().setWidth(56 * 2),
height: ScreenUtil().setWidth(28 * 2),
),
)
: Container(),
],
)
],
),
);
}
///顾客信息
Widget _customerInfoWidget() {
bool showArrow = false;
//1散座 2包间 3卡座
List<String> tableNameSunList1 = []; //单个类型包含的所有桌子名称
List<String> tableNameSunList2 = []; //单个类型包含的所有桌子名称
List<String> tableNameSunList3 = []; //单个类型包含的所有桌子名称
if (_orderFoodProvider.reserveDetailSunModel != null) {
tableNameSunList1 =
_orderFoodProvider.reserveDetailSunModel.tableNameList[0]['散座'];
tableNameSunList2 =
_orderFoodProvider.reserveDetailSunModel.tableNameList[1]['包间'];
tableNameSunList3 =
_orderFoodProvider.reserveDetailSunModel.tableNameList[2]['卡座'];
if (tableNameSunList2.length > 0) {
if (arrowStatus) {
_orderFoodProvider.showTable = '【包间】${tableNameSunList2[0]}';
} else {
_orderFoodProvider.showTable = '';
}
} else if (tableNameSunList3.length > 0) {
if (arrowStatus) {
_orderFoodProvider.showTable = '【卡座】${tableNameSunList3[0]}';
} else {
_orderFoodProvider.showTable = '';
}
} else if (tableNameSunList1.length > 0) {
if (arrowStatus) {
_orderFoodProvider.showTable = '【散座】${tableNameSunList1[0]}';
} else {
_orderFoodProvider.showTable = '';
}
}
if (tableNameSunList1.length > 1 ||
tableNameSunList2.length > 1 ||
tableNameSunList3.length > 1) {
showArrow = true;
} else {
showArrow = false;
}
}
return Container(
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(10)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
height: ScreenUtil().setWidth(58 * 2),
width: double.infinity,
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(20),
ScreenUtil().setWidth(36),
ScreenUtil().setWidth(20),
ScreenUtil().setWidth(26)),
decoration: BoxDecoration(
color: MyColours.color_FAFAFA,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
topRight: Radius.circular(10)),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'顾客信息',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_353535,
fontWeight: FontWeight.bold),
),
// 备注信息
Offstage(
offstage: _onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider
.orderInfoSunModel.orderRemark ==
''
: true,
child: Container(
child: Text(
_onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider
.orderInfoSunModel.orderRemark
: '',
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_FD5656),
),
),
),
],
)),
Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(24),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(36)),
child: Column(
children: [
InkWell(
onTap: () {
if (showArrow) {
//有arrow
arrowStatus = !arrowStatus;
_orderFoodProvider.notifyListeners();
}
},
child: Container(
child: Row(
children: [
Text(
'桌位信息',
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
color: MyColours.color_707070),
),
Spacer(),
Text(
_orderFoodProvider.showTable,
style: TextStyle(
fontSize: ScreenUtil().setSp(28),
fontWeight: FontWeight.bold,
color: MyColours.color_707070),
),
Offstage(
offstage: !showArrow,
child: Row(
children: [
HEmptyView(20),
Image.asset(
arrowStatus
? Utils.getImgPath('down')
: Utils.getImgPath('up'),
width: ScreenUtil().setWidth(24),
height: ScreenUtil().setWidth(12))
],
),
)
],
),
),
),
Offstage(
offstage: arrowStatus,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VEmptyView(14),
tableNameSunList2.length > 0
? Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(60),
ScreenUtil().setWidth(10)),
child: Text(
'【包间】${Utils.listToString(tableNameSunList2)}',
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535,
fontWeight: FontWeight.bold),
),
)
: Container(),
tableNameSunList3.length > 0
? Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(60),
ScreenUtil().setWidth(10)),
child: Text(
'【卡座】${Utils.listToString(tableNameSunList3)}',
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535),
),
)
: Container(),
tableNameSunList1.length > 0
? Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(0),
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(60),
ScreenUtil().setWidth(10)),
child: Text(
'【散座】${Utils.listToString(tableNameSunList1)}',
style: TextStyle(
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535),
),
)
: Container(),
VEmptyView(36),
],
),
),
VEmptyView(24),
_customInfoItemWidget(
'买单顾客',
_orderFoodProvider.reserveDetailSunModel != null
? _orderFoodProvider.reserveDetailSunModel.rnameStr
: ''),
VEmptyView(24),
_customInfoItemWidget(
'顾客电话',
_orderFoodProvider.reserveDetailSunModel != null
? _orderFoodProvider.reserveDetailSunModel.phone
: ''),
VEmptyView(24),
_customInfoItemWidget(
'到店时间',
_orderFoodProvider.reserveDetailSunModel != null
? _orderFoodProvider.reserveDetailSunModel.ddateStr
: ''),
VEmptyView(24),
_customInfoItemWidget(
'申请时间',
_orderFoodProvider.reserveDetailSunModel != null
? _orderFoodProvider.reserveDetailSunModel.cdateStr
: '')
],
),
)
],
),
);
}
///买单信息
Widget _orderInfoWidget() {
return Container(
width: double.infinity,
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(10)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
height: ScreenUtil().setWidth(58 * 2),
width: double.infinity,
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(20),
ScreenUtil().setWidth(36),
ScreenUtil().setWidth(20),
ScreenUtil().setWidth(26)),
decoration: BoxDecoration(
color: MyColours.color_FAFAFA,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10),
topRight: Radius.circular(10)),
),
child: Text(
'买单信息',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
color: MyColours.color_353535,
fontWeight: FontWeight.bold),
)),
Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(24),
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(36)),
child: Column(children: [
_customInfoItemWidget(
'应收金额',
_onlineCheckEditProvider.orderInfoSunModel != null
? '¥ ${_onlineCheckEditProvider.orderInfoSunModel.shouldPrice}'
: ''),
VEmptyView(24),
_customInfoItemWidget(
'实收金额',
_onlineCheckEditProvider.orderInfoSunModel != null
? '¥ ${_onlineCheckEditProvider.orderInfoSunModel.price}'
: '',
textColor: MyColours.color_353535,
isBold: true),
VEmptyView(24),
_customInfoItemWidget('支付方式', '微信支付'),
VEmptyView(24),
_customInfoItemWidget(
'买单时间',
_onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider
.orderInfoSunModel?.payTimeStr
: ''),
VEmptyView(24),
]))
]));
}
@override
Widget build(BuildContext context) {
_onlineCheckEditProvider =
Provider.of<OnlineCheckEditProvider>(context, listen: true);
_orderFoodProvider = Provider.of<OrderFoodProvider>(context, listen: true);
return Scaffold(
backgroundColor: MyColours.color_f5f5f5,
appBar: SystemAppBar(
'买单申请详情',
onTap: () {
if (widget.fromNotify) {
NavigatorUtil.goHomePage(context, initialIndex: 0);
} else {
Navigator.of(context).pop();
}
},
),
body: SingleChildScrollView(
child: Padding(
padding: EdgeInsets.all(ScreenUtil().setWidth(20)),
child: Column(
children: [
_consumptionInfoWidget(),
VEmptyView(20),
_customerInfoWidget(),
VEmptyView(20),
Offstage(
offstage: _onlineCheckEditProvider.orderInfoSunModel != null
? _onlineCheckEditProvider.orderInfoSunModel.status == '2'
: true,
child: _orderInfoWidget(),
)
],
),
),
),
);
}
}
... ...
... ... @@ -3,17 +3,18 @@ import 'dart:convert';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/screenutil.dart';
import 'package:one_key/pages/online_check/img_picker_widget.dart';
import 'package:one_key/provider/notebook_detail_model.dart';
import 'package:one_key/provider/online_check_edit_provider.dart';
import 'package:one_key/provider/order_food_provider.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/res/colors.dart';
import 'package:one_key/utils/dialog_util.dart';
import 'package:one_key/utils/event_bus.dart';
import 'package:one_key/utils/navigator_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/MyDivider.dart';
import 'package:one_key/widgets/common_button.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/my_item.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:provider/provider.dart';
... ... @@ -21,7 +22,8 @@ import 'package:provider/provider.dart';
class OnlineCheckEditPage extends StatefulWidget {
final bool fromNotify;
final String rid;
OnlineCheckEditPage({Key key, this.fromNotify = false, this.rid})
final String mid;
OnlineCheckEditPage({Key key, this.fromNotify = false, this.rid, this.mid})
: super(key: key);
@override
... ... @@ -36,6 +38,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
OrderFoodProvider _orderFoodProvider;
int btnState = -1;
bool arrowStatus = true; // true合住 false展开
NotebookDetailModel detailModel;
@override
void initState() {
... ... @@ -64,6 +67,18 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
super.dispose();
}
//处理在线预订
setMessageStatus() {
bus.emit("remove_untreated_message", widget.mid);
bus.emit("refresh_untreated_num"); //刷新未读消息数目
Map<String, String> params = {
"sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
"id": widget.mid,
"status": "is_handle"
};
detailModel.setMessageStatus(context, params);
}
///接口获取桌位信息
_getTableInfoData() async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
... ... @@ -75,6 +90,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
await _orderFoodProvider.getTableInfoData(context, params);
}
///获取订单详情
_getOrderInfo() async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {"rid": widget.rid};
... ... @@ -84,22 +100,31 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
///商家确认账单操作
_updateOrderInfo() async {
String price = _editingController.text;
if (_editingController.text.startsWith('¥')) {
price = _editingController.text
.substring(1, _editingController.text.length)
.trim();
}
for (int i = 0; i < _onlineCheckEditProvider.imageList.length; i++) {
_onlineCheckEditProvider.imageQiniuUrlList
.add(_onlineCheckEditProvider.imageList[i].qiniuUrl);
}
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {
"price": _editingController.text,
"price": price,
"rid": widget.rid,
'bill_list': json.encode(_onlineCheckEditProvider.imageQiniuUrlList)
};
print(pragma);
print(params);
//明天完成 桌位名称信息
bool result =
await _onlineCheckEditProvider.updateOrderInfo(context, params);
if (result) {
//跳转至在线买单处理完的详情页面
// 跳转至在线买单处理完的详情页面
NavigatorUtil.goOnlineCheckDetailPage(context,
rid: '${widget.rid}', replace: true);
setMessageStatus();
}
}
... ... @@ -136,7 +161,6 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
///桌位信息、应收金额
Widget _getTabAndMoneyInfoWidget() {
String showTable = '';
bool showArrow = false;
//1散座 2包间 3卡座
List<String> tableNameSunList1 = []; //单个类型包含的所有桌子名称
... ... @@ -150,14 +174,30 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
tableNameSunList3 =
_orderFoodProvider.reserveDetailSunModel.tableNameList[2]['卡座'];
if (tableNameSunList2.length > 0) {
showTable = '【包间】${tableNameSunList2[0]}';
showArrow = true;
if (arrowStatus) {
_orderFoodProvider.showTable = '【包间】${tableNameSunList2[0]}';
} else {
_orderFoodProvider.showTable = '';
}
} else if (tableNameSunList3.length > 0) {
showTable = '【卡座】${tableNameSunList3[0]}';
showArrow = true;
if (arrowStatus) {
_orderFoodProvider.showTable = '【卡座】${tableNameSunList3[0]}';
} else {
_orderFoodProvider.showTable = '';
}
} else if (tableNameSunList1.length > 0) {
showTable = '【散座】${tableNameSunList1[0]}';
if (arrowStatus) {
_orderFoodProvider.showTable = '【散座】${tableNameSunList1[0]}';
} else {
_orderFoodProvider.showTable = '';
}
}
if (tableNameSunList1.length > 1 ||
tableNameSunList2.length > 1 ||
tableNameSunList3.length > 1) {
showArrow = true;
} else {
showArrow = false;
}
}
... ... @@ -190,7 +230,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
Spacer(),
Text(
_orderFoodProvider.reserveDetailSunModel != null
? showTable
? _orderFoodProvider.showTable
: '',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
... ... @@ -229,7 +269,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
child: Text(
'【包间】${Utils.listToString(tableNameSunList2)}',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535),
),
)
... ... @@ -244,7 +284,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
child: Text(
'【卡座】${Utils.listToString(tableNameSunList3)}',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535),
),
)
... ... @@ -259,7 +299,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
child: Text(
'【散座】${Utils.listToString(tableNameSunList1)}',
style: TextStyle(
fontSize: ScreenUtil().setSp(32),
fontSize: ScreenUtil().setSp(30),
color: MyColours.color_353535),
),
)
... ... @@ -328,6 +368,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
onEditingComplete: () {
print('fff');
_focusNode.unfocus();
// _editingController.text = '';
// _needNode.unfocus();
},
... ... @@ -438,6 +479,7 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
@override
Widget build(BuildContext context) {
detailModel = Provider.of<NotebookDetailModel>(context, listen: true);
_onlineCheckEditProvider =
Provider.of<OnlineCheckEditProvider>(context, listen: true);
_orderFoodProvider = Provider.of<OrderFoodProvider>(context, listen: true);
... ... @@ -509,8 +551,17 @@ class _OnlineCheckEditPageState extends State<OnlineCheckEditPage> {
content: '发送给顾客',
state: btnState,
onPress: () async {
if (_editingController.text.startsWith('¥') &&
_editingController.text.length == 1) {
Utils.showToast('请输入金额');
setState(() {
btnState = -1;
});
return;
}
DialogUtil.confirmDialog(
context, _editingController.text, 426, onTap: () {
Navigator.pop(context);
_updateOrderInfo();
});
},
... ...
... ... @@ -86,14 +86,14 @@ class MessageDialogModel extends ChangeNotifier {
}
return true;
});
if (params["type_id"] == '10') {
unMessagesOnline = messagesTemp;
} else if (params["type_id"] == '1') {
unMessagesOrder = messagesTemp;
}
messages = [];
messages.addAll(unMessagesOnline);
messages.addAll(unMessagesOrder);
// if (params["type_id"] == '10') {
// unMessagesOnline = messagesTemp;
// } else if (params["type_id"] == '1') {
// unMessagesOrder = messagesTemp;
// }
messages.addAll(messagesTemp);
// messages.addAll(unMessagesOnline);
// messages.addAll(unMessagesOrder);
callback();
// if (messages.isNotEmpty) {
// //播放声音
... ...
import 'package:flutter/material.dart';
import 'package:one_key/constant/constant.dart';
import 'package:one_key/constant/error.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/new_reserve_list_model.dart';
import 'package:one_key/models/order_info_model.dart';
import 'package:one_key/models/qiniu_info_model.dart';
import 'package:one_key/models/upload_img_model.dart';
... ... @@ -13,6 +16,7 @@ class OnlineCheckEditProvider extends ChangeNotifier {
List<String> imageQiniuUrlList = []; //七牛云地址列表
QiniuInfoSunModel qiniuInfoSunModel;
OrderInfoSunModel orderInfoSunModel;
List<NewReserveListSunModel> reserveList = [];
/// 获取七牛上传token信息
Future<QiniuInfoSunModel> getQiniuInfo(
... ... @@ -46,7 +50,7 @@ class OnlineCheckEditProvider extends ChangeNotifier {
data: params, showLoading: false)
.catchError((error) {});
if (baseResp.code == Constant.status_success) {
if (baseResp.data.isEmpty) {
if (baseResp.data == null) {
} else {
//解析解析
orderInfoSunModel = OrderInfoModel.fromJson(baseResp.responseData).data;
... ... @@ -64,7 +68,7 @@ class OnlineCheckEditProvider extends ChangeNotifier {
{isShowLoading = true}) async {
BaseResp<dynamic> baseResp = await DioUtil()
.request<dynamic>(context, Method.get, HttpUrl.update_order_info,
data: params, showLoading: false)
data: params, showLoading: isShowLoading)
.catchError((error) {});
if (baseResp.code == Constant.status_success) {
//解析解析
... ... @@ -81,4 +85,40 @@ class OnlineCheckEditProvider extends ChangeNotifier {
}
return false;
}
//商家预订本列表【2019-11-26】
getNewReserveList(BuildContext context, Map<String, String> params) async {
BaseResp<List> baseResp = await DioUtil()
.request<List>(context, Method.get, HttpUrl.new_get_reserve_list,
data: params, showLoading: false)
.catchError((error) {
print(error.toString());
if (error is MyError) {
// switch (error.type) {
// case 1:
// pageState = PageState.ConnectivityError;
// break;
// case 2:
// pageState = PageState.ConnectivityTimeOut;
// break;
// default:
// pageState = PageState.ConnectivityError;
// break;
// }
}
notifyListeners();
});
if (baseResp.code == Constant.status_success) {
if (baseResp.data.isEmpty) {
} else {
//解析解析
reserveList = NewReserveListModel.fromJson(baseResp.responseData).data;
}
notifyListeners();
} else {
if (baseResp != null) {
Utils.showToast(baseResp.msg ?? "");
}
}
}
}
... ...
... ... @@ -15,6 +15,7 @@ class OrderFoodProvider extends ChangeNotifier {
List<Map<String, List<Cookbooklist>>> orderList = []; //已点菜单信息
CreatedOrderSunModel createdOrderSunModel;
ReserveDetailSunModel reserveDetailSunModel;
String showTable = '';
///顾客扫桌码点餐-扫码创建订单
getOrderFoodData(BuildContext context, Map<String, String> params,
... ...
... ... @@ -58,4 +58,6 @@ class MyColours {
static const Color color_FD5656 = Color(0xffFD5656);
static const Color color_FAFAFA = Color(0xffFAFAFA);
static const Color color_0D0D0D = Color(0xff0D0D0D);
static const Color color_24A4A8 = Color(0xff24A4A8);
static const Color color_F59A23 = Color(0xffF59A23);
}
... ...
... ... @@ -16,6 +16,8 @@ import 'package:one_key/pages/message/message_order_menu.dart';
import 'package:one_key/pages/my/book_time_set.dart';
import 'package:one_key/pages/my/receive_orders_time_set.dart';
import 'package:one_key/pages/my/remark_manager_page.dart';
import 'package:one_key/pages/online_check/invoice_detail_page.dart';
import 'package:one_key/pages/online_check/online_check_detail_page.dart';
import 'package:one_key/pages/online_check/online_check_edit_page.dart';
import 'package:one_key/pages/sms/sms_page.dart';
import 'package:one_key/pages/table/select_table_page.dart';
... ... @@ -180,8 +182,33 @@ var handleHasOrderFoodHandler = new Handler(
var handleOnlineCheckEditHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
String rid = params["rid"].first;
String mid = params["mid"].first;
bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first);
return ChangeNotifierProvider<OrderFoodProvider>(
create: (_) => OrderFoodProvider(),
child: OnlineCheckEditPage(
fromNotify: fromNotify,
rid: rid,
mid: mid,
));
});
///提前买单查看页面
var handleOnlineCheckDetailPageHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
String rid = params["rid"].first;
bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first);
return ChangeNotifierProvider<OrderFoodProvider>(
create: (_) => OrderFoodProvider(),
child: OnlineCheckDetailPage(fromNotify: fromNotify, rid: rid));
});
///发票详情
var handleInvoiceDetailPageHandler = new Handler(
handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
String rid = params["rid"].first;
bool fromNotify = FluroConvertUtils.string2bool(params["fromNotify"].first);
return ChangeNotifierProvider<OrderFoodProvider>(
create: (_) => OrderFoodProvider(),
child: OnlineCheckEditPage(fromNotify: fromNotify,rid:rid));
child: InvoiceDetailPage(fromNotify: fromNotify, rid: rid));
});
... ...
... ... @@ -19,7 +19,9 @@ class Routes {
static String receive_orders_time_set = "/receive_orders_time_set"; //接单时间管理
static String remark_manager = "/remark_manager"; //常用备注管理
static String has_order_food = "/has_order_food"; //已点菜品
static String online_check_edit = "/online_check_edit"; //提前买单
static String online_check_edit = "/online_check_edit"; //提前买单处理
static String online_check_detail = "/online_check_detail"; //提前买单查看
static String invoice_detail = "/invoice_detail"; //查看发票详情
static void configureRoutes(FluroRouter router) {
router.notFoundHandler = new Handler(
... ... @@ -43,5 +45,10 @@ class Routes {
router.define(remark_manager, handler: handleRemarkManagerHandler);
router.define(has_order_food, handler: handleHasOrderFoodHandler);
router.define(online_check_edit, handler: handleOnlineCheckEditHandler);
router.define(online_check_detail,
handler: handleOnlineCheckDetailPageHandler);
router.define(invoice_detail,
handler: handleInvoiceDetailPageHandler);
}
}
... ...
... ... @@ -131,9 +131,25 @@ class NavigatorUtil {
/// 提前买单编辑页面
static void goOnlineCheckEditPage(BuildContext context,
{String rid, String mid, fromNotify = false, replace = false}) {
_navigateTo(context,
"${Routes.online_check_edit}?fromNotify=${fromNotify}&rid=${rid}&mid=$mid",
replace: replace);
}
/// 提前买单查看页面
static void goOnlineCheckDetailPage(BuildContext context,
{String rid, fromNotify = false, replace = false}) {
_navigateTo(context,
"${Routes.online_check_edit}?fromNotify=${fromNotify}&rid=${rid}",
"${Routes.online_check_detail}?fromNotify=${fromNotify}&rid=${rid}",
replace: replace);
}
/// 发票详情
static void goInvoiceDetailPage(BuildContext context,
{String rid, fromNotify = false, replace = false}) {
_navigateTo(
context, "${Routes.invoice_detail}?fromNotify=${fromNotify}&rid=${rid}",
replace: replace);
}
}
... ...
... ... @@ -36,11 +36,18 @@ class TableItemState extends State<TableItem> {
Widget build(BuildContext context) {
t.Table table = widget.table;
String signStr = table.signStr;
if (table.sign == '5' && widget.tableMap[table.id].orderInfo != null) {
if (widget.tableMap[table.id].orderInfo.status == '3') {
signStr = '已买单';
}
}
return GestureDetector(
onTap: () {
if (widget.canSelected && widget.canChoose) {
//从变更页面进来 canChoose = true
if (widget.canSelected && table.signStr.isEmpty) {
if (widget.canSelected && signStr.isEmpty) {
setState(() {
table.selected = !(table.selected ?? false);
});
... ... @@ -64,12 +71,13 @@ class TableItemState extends State<TableItem> {
}
}
}
} else if (widget.canSelected && table.signStr.isEmpty){//从安排桌位进来
} else if (widget.canSelected && signStr.isEmpty) {
//从安排桌位进来
setState(() {
table.selected = !(table.selected ?? false);
});
widget.onSelected(table);
}else{
} else {
table.selected = !(table.selected ?? false);
widget.onSelected(table);
}
... ... @@ -143,10 +151,10 @@ class TableItemState extends State<TableItem> {
fontWeight: FontWeight.normal),
overflow: TextOverflow.ellipsis,
strutStyle: StrutStyle(
forceStrutHeight: true,
height: ScreenUtil().setWidth(2),
// leading: ScreenUtil().setWidth(0.4)
),
forceStrutHeight: true,
height: ScreenUtil().setWidth(2),
// leading: ScreenUtil().setWidth(0.4)
),
),
)
// Text(
... ... @@ -169,7 +177,7 @@ class TableItemState extends State<TableItem> {
? table.tableNum
: table.reserver,
style: TextStyle(
color: table.signStr == '已停用'
color: signStr == '已停用'
? MyColours.color_999999
: (table.reserver == null ||
table.reserver.isEmpty)
... ... @@ -197,23 +205,25 @@ class TableItemState extends State<TableItem> {
bottom: 0,
left: 0,
right: 0,
child: table.signStr.isEmpty
child: signStr.isEmpty
? Container()
: Container(
width: ScreenUtil().setWidth(160),
height: ScreenUtil().setHeight(36),
alignment: Alignment.center,
decoration: BoxDecoration(
color: table.signStr == '已停用'
color: signStr == '已停用'
? MyColours.color_777777
: MyColours.color_E95750,
: signStr == '已买单'
? MyColours.color_F59A23
: MyColours.color_E95750,
borderRadius: BorderRadius.only(
bottomLeft:
Radius.circular(ScreenUtil().setWidth(8)),
bottomRight: Radius.circular(
ScreenUtil().setWidth(8)))),
child: Text(
table.signStr,
signStr,
style: TextStyle(
color: MyColours.color_ffffff,
fontSize: ScreenUtil().setSp(24),
... ... @@ -228,12 +238,13 @@ class TableItemState extends State<TableItem> {
Positioned(
top: 3,
right: 5,
child: widget.canSelected&&(table.selected ?? false)
child: widget.canSelected && (table.selected ?? false)
? Image.asset(
"assets/icon_selected.png",
width: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(40),
):Container())
"assets/icon_selected.png",
width: ScreenUtil().setWidth(40),
height: ScreenUtil().setWidth(40),
)
: Container())
],
),
);
... ...