feat:医院支付,选择支付钱包支付

This commit is contained in:
dzc committed 2025-08-14 20:05:56 +08:00
1 parent c2707899db
commit 3a7ca1e5be
17 files changed
+441 -117

No files matched your search

@@ -94,3 +94,43 @@ class ServiceMchRule {
Map<String, dynamic> toJson() => _$ServiceMchRuleToJson(this);
}
@JsonSerializable()
class ServiceWallet {
/// 钱包id
String id;
/// 唯一编号
String walletTypeUniqueCode;
/// 用户id
String userId;
/// 钱包类型
String walletTypeId;
/// 余额(单位分)
int balance = 0;
/// 卡号
String? cardNumber;
/// 是否冻结饭卡
@JsonKey(fromJson: JsonTool.stringToBoolean, toJson: JsonTool.booleanToString)
bool? walletIsFreeze;
ServiceWallet({
required this.id,
required this.walletTypeUniqueCode,
required this.userId,
required this.walletTypeId,
required this.balance,
this.cardNumber,
this.walletIsFreeze,
});
factory ServiceWallet.fromJson(Map<String, dynamic> json) =>
_$ServiceWalletFromJson(json);
Map<String, dynamic> toJson() => _$ServiceWalletToJson(this);
}
@@ -58,3 +58,24 @@ Map<String, dynamic> _$ServiceMchRuleToJson(ServiceMchRule instance) =>
'basePrice': JsonTool.intToString(instance.basePrice),
'multiple': JsonTool.intToString(instance.multiple),
};
ServiceWallet _$ServiceWalletFromJson(Map<String, dynamic> json) =>
ServiceWallet(
id: json['id'] as String,
walletTypeUniqueCode: json['walletTypeUniqueCode'] as String,
userId: json['userId'] as String,
walletTypeId: json['walletTypeId'] as String,
balance: (json['balance'] as num).toInt(),
walletIsFreeze:
JsonTool.stringToBoolean(json['walletIsFreeze'] as String),
);
Map<String, dynamic> _$ServiceWalletToJson(ServiceWallet instance) =>
<String, dynamic>{
'id': instance.id,
'walletTypeUniqueCode': instance.walletTypeUniqueCode,
'userId': instance.userId,
'walletTypeId': instance.walletTypeId,
'balance': instance.balance,
'walletIsFreeze': JsonTool.booleanToString(instance.walletIsFreeze),
};
@@ -132,7 +132,6 @@ const _$OrderPayDisplayTypeEnumMap = {
OrderPayDisplayType.cash: 'cash',
OrderPayDisplayType.zyy: 'zyy',
OrderPayDisplayType.rmyy: 'rmyy',
OrderPayDisplayType.qrCodeScan: 'qrCodeScan',
};
UserSetting _$UserSettingFromJson(Map<String, dynamic> json) => UserSetting(
+1
View File
@@ -6,6 +6,7 @@ enum MqtActionEnum implements BaseEnum {
CANTEEN_CLASSIFY("30", "食堂分类变化"),
SUPERMARKET_PRODUCT("40", "超市商品变化"),
SUPERMARKET_CLASSIFY("50", "超市分类变化"),
SUPERMARKET("51", "超市分类变化"),
PRINT("60", "打印变化"),
FACE("70", "人脸变化"),
TAKE_FOOD_BROADCAST("80", "定餐广播"),
+1
View File
@@ -20,6 +20,7 @@ const _$MqtActionEnumEnumMap = {
MqtActionEnum.CANTEEN_CLASSIFY: 'CANTEEN_CLASSIFY',
MqtActionEnum.SUPERMARKET_PRODUCT: 'SUPERMARKET_PRODUCT',
MqtActionEnum.SUPERMARKET_CLASSIFY: 'SUPERMARKET_CLASSIFY',
MqtActionEnum.SUPERMARKET: 'SUPERMARKET',
MqtActionEnum.PRINT: 'PRINT',
MqtActionEnum.FACE: 'FACE',
MqtActionEnum.TAKE_FOOD_BROADCAST: 'TAKE_FOOD_BROADCAST',
@@ -1,13 +1,12 @@
import 'package:pj_supermarket_cloud/common/index.dart';
enum OrderPayDisplayType implements BaseEnum {
qrCode("1", "二维码支付", false),
walletCard("2", "饭卡支付", true),
face("3", "人脸支付", true),
cash("4", "现金支付", true),
zyy("12", "中医院", true),
rmyy("13", "人民医院", true),
qrCodeScan("22", "钱包扫一扫", false),
qrCode("1", "二维码支付", false, 1),
walletCard("2", "饭卡支付", true, 2),
face("3", "人脸支付", true, 3),
cash("4", "现金支付", true, 4),
zyy("12", "中医院", true, 5),
rmyy("13", "人民医院", true, 6),
;
@override
@@ -16,6 +15,35 @@ enum OrderPayDisplayType implements BaseEnum {
final String title;
// 是否支离线支付
final bool supportOffLine;
// 是否支离线支付
final int order;
const OrderPayDisplayType(this.code, this.title, this.supportOffLine);
// 线下支付的订单类型(现金支付,其他渠道支付如中医院、人民医院)
static const List<OrderPayDisplayType> offlinePayTypeList = [
OrderPayDisplayType.cash,
OrderPayDisplayType.zyy,
OrderPayDisplayType.rmyy,
];
// 是否为线下支付
static bool isOffline(OrderPayDisplayType type) {
return offlinePayTypeList.contains(type);
}
// 需要选择钱包
static const List<OrderPayDisplayType> selectWalletPayTypeList = [
OrderPayDisplayType.face,
];
// 是否需要选择钱包
static bool isSelectWalletPayType(OrderPayDisplayType type) {
return selectWalletPayTypeList.contains(type);
}
const OrderPayDisplayType(
this.code,
this.title,
this.supportOffLine,
this.order,
);
}