Files
biz_xfj_cloud/lib/common/models/plugs/sub_screen_models.dart
T

98 lines
2.3 KiB
Dart

import 'package:json_annotation/json_annotation.dart';
import 'package:pj_supermarket_cloud/common/index.dart';
part 'sub_screen_models.g.dart';
@JsonSerializable()
class SubScreenProductEvent {
// 购物车列表
// List<ShopCardEntity>
List<Map<String, dynamic>> shopList;
// 系统类型
SysType sysType;
// 支付用户
// ServiceUser
Map<String, dynamic>? payUser;
// 购物车总价
int totalPrice;
// 额外支付
int amountMealPrice;
SubScreenProductEvent({
required this.shopList,
required this.sysType,
required this.payUser,
required this.totalPrice,
required this.amountMealPrice,
});
factory SubScreenProductEvent.fromJson(Map<String, dynamic> json) =>
_$SubScreenProductEventFromJson(json);
Map<String, dynamic> toJson() => _$SubScreenProductEventToJson(this);
}
@JsonSerializable()
class SubScreenQrCodeScanEvent {
String action;
String orderId;
String qrCodeData;
SubScreenQrCodeScanEvent({
required this.action,
required this.orderId,
required this.qrCodeData,
});
factory SubScreenQrCodeScanEvent.fromJson(Map<String, dynamic> json) =>
_$SubScreenQrCodeScanEventFromJson(json);
Map<String, dynamic> toJson() => _$SubScreenQrCodeScanEventToJson(this);
}
/// 主屏向预约查询副屏发送的完整快照;副屏以 sessionId + revision 丢弃旧消息。
@JsonSerializable()
class SubScreenReservationQueryEvent {
final String sessionId;
final int revision;
final String scenario;
final String? maskedName;
final String? deptName;
final String? merchantName;
final int totalDayCount;
final int totalMealCount;
final int currentPage;
final int totalPages;
final List<Map<String, dynamic>> days;
final String? expiresAt;
const SubScreenReservationQueryEvent({
required this.sessionId,
required this.revision,
required this.scenario,
this.maskedName,
this.deptName,
this.merchantName,
required this.totalDayCount,
required this.totalMealCount,
required this.currentPage,
required this.totalPages,
required this.days,
this.expiresAt,
});
factory SubScreenReservationQueryEvent.fromJson(
Map<String, dynamic> json,
) =>
_$SubScreenReservationQueryEventFromJson(json);
Map<String, dynamic> toJson() => _$SubScreenReservationQueryEventToJson(this);
}