11
This commit is contained in:
1 parent
295b4058be
commit
08bf352984
21 files changed
+1109
-234
No files matched your search
@@ -70,29 +70,25 @@ abstract class HardApi {
|
||||
}
|
||||
|
||||
/// 获取订单详情
|
||||
static Future<ServiceBase> getOrder(dynamic formData) async {
|
||||
final res = await HttpManage().dio.get<ServiceBase>(
|
||||
static Future<ServiceHardOrder?> getOrder(dynamic formData) async {
|
||||
final res = await HttpManage().dio.get(
|
||||
"/hard/hard-api/ad/get-order",
|
||||
queryParameters: formData,
|
||||
);
|
||||
return res.data as ServiceBase;
|
||||
if (res.data == null) return null;
|
||||
return ServiceHardOrder.fromJson(res.data);
|
||||
}
|
||||
|
||||
/// 获取订单购物车
|
||||
static Future<ServiceListBase<ServiceCar>> getCarByOrderId(
|
||||
static Future<List<ServiceCar>?> getCarByOrderId(
|
||||
dynamic formData,
|
||||
) async {
|
||||
final res = await HttpManage().dio.get(
|
||||
"/hard/hard-api/ad/get-by-order-id",
|
||||
queryParameters: formData,
|
||||
);
|
||||
if (res.data?.data == null) {
|
||||
return res.data!;
|
||||
}
|
||||
final typeData =
|
||||
res.data?.data?.map<ServiceCar>((e) => ServiceCar.fromJson(e)).toList();
|
||||
res.data?.data = typeData;
|
||||
return res.data!;
|
||||
if (res.data == null) return null;
|
||||
return res.data?.map<ServiceCar>((e) => ServiceCar.fromJson(e)).toList();
|
||||
}
|
||||
|
||||
/// 核销订单
|
||||
|
||||
@@ -44,20 +44,16 @@ abstract class UserApi {
|
||||
}
|
||||
|
||||
/// 获取人脸
|
||||
static Future<ServiceListBase<ServiceAsyncFace>> getFaceList(
|
||||
static Future<List<ServiceAsyncFace>?> getFaceList(
|
||||
dynamic formData,
|
||||
) async {
|
||||
final res = await HttpManage().dio.get(
|
||||
"/admin/user-face/ad/find-face",
|
||||
queryParameters: formData,
|
||||
);
|
||||
if (res.data?.data == null) {
|
||||
return res.data;
|
||||
}
|
||||
final typeData = res.data?.data
|
||||
if (res.data == null) return null;
|
||||
return res.data
|
||||
?.map<ServiceAsyncFace>((e) => ServiceAsyncFace.fromJson(e))
|
||||
.toList();
|
||||
res.data?.data = typeData;
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
@@ -11,13 +11,15 @@ abstract class WalletApi {
|
||||
}
|
||||
|
||||
/// 开卡列表
|
||||
static Future<ServiceBase?> openCardList(dynamic pa) async {
|
||||
static Future<ServiceOpenCardPage?> openCardList(
|
||||
dynamic pa,
|
||||
) async {
|
||||
final res = await HttpManage().dio.get(
|
||||
"/wallet/wallet-active/ad/open-card-list",
|
||||
queryParameters: pa,
|
||||
);
|
||||
if (res.data == null) return null;
|
||||
return res.data as ServiceBase;
|
||||
return ServiceOpenCardPage.fromJson(res.data);
|
||||
}
|
||||
|
||||
/// 开卡成功
|
||||
|
||||
@@ -21,20 +21,21 @@ class ServiceBase<T> {
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceListBase<T> {
|
||||
String? msg;
|
||||
int? code;
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
List<T>? data;
|
||||
class ServicePageBase {
|
||||
int current;
|
||||
int pages;
|
||||
int size;
|
||||
int total;
|
||||
|
||||
ServiceListBase({
|
||||
this.msg,
|
||||
this.code,
|
||||
this.data,
|
||||
ServicePageBase({
|
||||
this.current = 1,
|
||||
this.pages = 1,
|
||||
this.size = 10,
|
||||
this.total = 0,
|
||||
});
|
||||
|
||||
factory ServiceListBase.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceListBaseFromJson(json);
|
||||
factory ServicePageBase.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServicePageBaseFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceListBaseToJson(this);
|
||||
Map<String, dynamic> toJson() => _$ServicePageBaseToJson(this);
|
||||
}
|
||||
@@ -20,14 +20,18 @@ Map<String, dynamic> _$ServiceBaseToJson<T>(ServiceBase<T> instance) =>
|
||||
'data': instance.data,
|
||||
};
|
||||
|
||||
ServiceListBase<T> _$ServiceListBaseFromJson<T>(Map<String, dynamic> json) =>
|
||||
ServiceListBase<T>(
|
||||
msg: json['msg'] as String?,
|
||||
code: (json['code'] as num?)?.toInt(),
|
||||
ServicePageBase _$ServicePageBaseFromJson(Map<String, dynamic> json) =>
|
||||
ServicePageBase(
|
||||
current: (json['current'] as num?)?.toInt() ?? 1,
|
||||
pages: (json['pages'] as num?)?.toInt() ?? 1,
|
||||
size: (json['size'] as num?)?.toInt() ?? 10,
|
||||
total: (json['total'] as num?)?.toInt() ?? 0,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceListBaseToJson<T>(ServiceListBase<T> instance) =>
|
||||
Map<String, dynamic> _$ServicePageBaseToJson(ServicePageBase instance) =>
|
||||
<String, dynamic>{
|
||||
'msg': instance.msg,
|
||||
'code': instance.code,
|
||||
'current': instance.current,
|
||||
'pages': instance.pages,
|
||||
'size': instance.size,
|
||||
'total': instance.total,
|
||||
};
|
||||
@@ -201,3 +201,110 @@ class ServiceQRCode {
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceQRCodeToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceHardOrder {
|
||||
/// 用户名
|
||||
final String? username;
|
||||
|
||||
/// 用户手机号
|
||||
final String? userMobile;
|
||||
|
||||
/// 用户头像
|
||||
final String? userAvatar;
|
||||
|
||||
ServiceHardOrder({
|
||||
this.username,
|
||||
this.userMobile,
|
||||
this.userAvatar,
|
||||
});
|
||||
|
||||
factory ServiceHardOrder.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceHardOrderFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceHardOrderToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceOpenCard {
|
||||
/// 用户名
|
||||
String? username;
|
||||
|
||||
/// 用户手机号
|
||||
String? mobile;
|
||||
|
||||
/// 用户头像
|
||||
String? avatar;
|
||||
|
||||
/// 饭卡状态
|
||||
String? cardStatus;
|
||||
|
||||
/// 编号
|
||||
String? id;
|
||||
|
||||
/// 部门名
|
||||
String? deptId;
|
||||
|
||||
/// 部门名
|
||||
String? deptName;
|
||||
|
||||
/// 用户编号
|
||||
String? userId;
|
||||
|
||||
/// 饭卡类型Id
|
||||
String? walletTypeId;
|
||||
|
||||
/// 饭卡类型
|
||||
String? walletTypeUniqueCode;
|
||||
|
||||
/// 饭卡图标
|
||||
String? walletTypeIcon;
|
||||
|
||||
/// 用户卡号
|
||||
String? cardNumber;
|
||||
|
||||
/// 钱包编号
|
||||
String? walletId;
|
||||
|
||||
/// 是否激活
|
||||
@JsonKey(fromJson: JsonTool.stringToBoolean, toJson: JsonTool.booleanToString)
|
||||
bool? isActiveHardware;
|
||||
|
||||
ServiceOpenCard({
|
||||
this.username,
|
||||
this.mobile,
|
||||
this.avatar,
|
||||
this.cardStatus,
|
||||
this.id,
|
||||
this.deptId,
|
||||
this.deptName,
|
||||
this.userId,
|
||||
this.walletTypeId,
|
||||
this.walletTypeUniqueCode,
|
||||
this.walletTypeIcon,
|
||||
this.cardNumber,
|
||||
this.walletId,
|
||||
this.isActiveHardware,
|
||||
});
|
||||
|
||||
factory ServiceOpenCard.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceOpenCardFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceOpenCardToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class ServiceOpenCardPage extends ServicePageBase {
|
||||
List<ServiceOpenCard>? records;
|
||||
|
||||
ServiceOpenCardPage({
|
||||
this.records,
|
||||
});
|
||||
|
||||
factory ServiceOpenCardPage.fromJson(Map<String, dynamic> json) =>
|
||||
_$ServiceOpenCardPageFromJson(
|
||||
json,
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => _$ServiceOpenCardPageToJson(this);
|
||||
}
|
||||
@@ -118,3 +118,75 @@ Map<String, dynamic> _$ServiceQRCodeToJson(ServiceQRCode instance) =>
|
||||
'exceedTime': instance.exceedTime,
|
||||
'extra': instance.extra,
|
||||
};
|
||||
|
||||
ServiceHardOrder _$ServiceHardOrderFromJson(Map<String, dynamic> json) =>
|
||||
ServiceHardOrder(
|
||||
username: json['username'] as String?,
|
||||
userMobile: json['userMobile'] as String?,
|
||||
userAvatar: json['userAvatar'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceHardOrderToJson(ServiceHardOrder instance) =>
|
||||
<String, dynamic>{
|
||||
'username': instance.username,
|
||||
'userMobile': instance.userMobile,
|
||||
'userAvatar': instance.userAvatar,
|
||||
};
|
||||
|
||||
ServiceOpenCard _$ServiceOpenCardFromJson(Map<String, dynamic> json) =>
|
||||
ServiceOpenCard(
|
||||
username: json['username'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
avatar: json['avatar'] as String?,
|
||||
cardStatus: json['cardStatus'] as String?,
|
||||
id: json['id'] as String?,
|
||||
deptId: json['deptId'] as String?,
|
||||
deptName: json['deptName'] as String?,
|
||||
userId: json['userId'] as String?,
|
||||
walletTypeId: json['walletTypeId'] as String?,
|
||||
walletTypeUniqueCode: json['walletTypeUniqueCode'] as String?,
|
||||
walletTypeIcon: json['walletTypeIcon'] as String?,
|
||||
cardNumber: json['cardNumber'] as String?,
|
||||
walletId: json['walletId'] as String?,
|
||||
isActiveHardware:
|
||||
JsonTool.stringToBoolean(json['isActiveHardware'] as String),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ServiceOpenCardToJson(ServiceOpenCard instance) =>
|
||||
<String, dynamic>{
|
||||
'username': instance.username,
|
||||
'mobile': instance.mobile,
|
||||
'avatar': instance.avatar,
|
||||
'cardStatus': instance.cardStatus,
|
||||
'id': instance.id,
|
||||
'deptId': instance.deptId,
|
||||
'deptName': instance.deptName,
|
||||
'userId': instance.userId,
|
||||
'walletTypeId': instance.walletTypeId,
|
||||
'walletTypeUniqueCode': instance.walletTypeUniqueCode,
|
||||
'walletTypeIcon': instance.walletTypeIcon,
|
||||
'cardNumber': instance.cardNumber,
|
||||
'walletId': instance.walletId,
|
||||
'isActiveHardware': JsonTool.booleanToString(instance.isActiveHardware),
|
||||
};
|
||||
|
||||
ServiceOpenCardPage _$ServiceOpenCardPageFromJson(Map<String, dynamic> json) =>
|
||||
ServiceOpenCardPage(
|
||||
records: (json['records'] as List<dynamic>?)
|
||||
?.map((e) => ServiceOpenCard.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
)
|
||||
..current = (json['current'] as num).toInt()
|
||||
..pages = (json['pages'] as num).toInt()
|
||||
..size = (json['size'] as num).toInt()
|
||||
..total = (json['total'] as num).toInt();
|
||||
|
||||
Map<String, dynamic> _$ServiceOpenCardPageToJson(
|
||||
ServiceOpenCardPage instance) =>
|
||||
<String, dynamic>{
|
||||
'current': instance.current,
|
||||
'pages': instance.pages,
|
||||
'size': instance.size,
|
||||
'total': instance.total,
|
||||
'records': instance.records,
|
||||
};
|
||||
@@ -100,3 +100,16 @@ enum ProductHourType implements BaseEnum {
|
||||
|
||||
const ProductHourType(this.code, this.title);
|
||||
}
|
||||
|
||||
enum WalletType implements BaseEnum {
|
||||
eat("1", "饭卡钱包"),
|
||||
pay("2", "虚拟钱包"),
|
||||
;
|
||||
|
||||
@override
|
||||
final String code;
|
||||
@override
|
||||
final String title;
|
||||
|
||||
const WalletType(this.code, this.title);
|
||||
}
|
||||
@@ -68,6 +68,7 @@ const _$OrderTypeEnumMap = {
|
||||
};
|
||||
|
||||
const _$OrderStatusEnumMap = {
|
||||
OrderStatus.all: 'all',
|
||||
OrderStatus.nonePay: 'nonePay',
|
||||
OrderStatus.pay: 'pay',
|
||||
OrderStatus.offlinePay: 'offlinePay',
|
||||
|
||||
@@ -26,9 +26,8 @@ class SyncFaceTool {
|
||||
if (isGlobalFace != null && isGlobalFace) pa["merchantDeptId"] = null;
|
||||
logger.i("|$_tag|同步人脸api参数:|$pa|");
|
||||
try {
|
||||
final res = await UserApi.getFaceList(pa);
|
||||
if (res.code != 0 || res.data == null) throw Error();
|
||||
final data = res.data as List<ServiceAsyncFace>;
|
||||
final data = await UserApi.getFaceList(pa);
|
||||
if (data == null) throw Error();
|
||||
if (ObjectUtil.isEmptyList(data)) {
|
||||
if (ObjectUtil.isEmpty(userId)) return false;
|
||||
// 删除人脸图片
|
||||
|
||||
@@ -81,7 +81,7 @@ Widget orderAllPrice(
|
||||
Widget orderSelectPanel(
|
||||
BuildContext context, {
|
||||
required void Function(int, int) onChange,
|
||||
String label = "馒头馒头馒头馒头馒头",
|
||||
String label = "",
|
||||
int total = 1,
|
||||
num price = 0,
|
||||
int index = 0,
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:flutter/widgets.dart';
|
||||
import 'package:forui/forui.dart';
|
||||
import 'package:pj_supermarket_cloud/common/index.dart';
|
||||
|
||||
Widget userInfo(
|
||||
Widget appUserInfo(
|
||||
BuildContext context, {
|
||||
dynamic username = "未知",
|
||||
dynamic balance = "未知",
|
||||
|
||||
Reference in new issue
Block a user