feat:交易记录、日期组建

This commit is contained in:
dzc committed 2025-03-11 18:04:58 +08:00
1 parent 08ad1c2d81
commit 88e73ad950
32 files changed
+672 -279

No files matched your search

@@ -122,9 +122,6 @@ mixin OrderMixin {
Future<void> getProduct({
String classifyCode = "-1",
}) async {
if (hourType.value != appController.hourType.value) {
hourType.value = appController.hourType.value;
}
final list = await appController.dataBase.getProductDao.getAll(
classifyCode,
hourType.value.code,
@@ -38,12 +38,17 @@ class SelectPayTypeDialogController extends GetxController {
final app = Get.find<AppControl>();
final payTypeRadioC = FRadioSelectGroupController<OrderPayDisplayType>();
Rxn<ServiceUser?> payUser = Rxn(null);
Rxn<OrderPayType> orderPayType = Rxn(OrderPayType.face);
Rxn<OrderPayDisplayType> orderPayDisplayType = Rxn(OrderPayDisplayType.face);
RxList<OrderPayDisplayType> usePayDisplayTypeList =
<OrderPayDisplayType>[].obs;
Rxn<OrderType> orderType = Rxn(OrderType.below);
RxBool isRecognition = RxBool(false);
@@ -59,6 +64,34 @@ class SelectPayTypeDialogController extends GetxController {
// 人脸识别回调锁
bool _faceCallbackLock = false;
@override
void onInit() async {
super.onInit();
final appSetting = await AppSettingTool.getSysSetting();
if (appSetting.defaultPayDisplayType != null) {
payTypeRadioC.value = {appSetting.defaultPayDisplayType!};
}
if (!ObjectUtil.isEmptyList(appSetting.usePayDisplayType)) {
usePayDisplayTypeList.value = appSetting.usePayDisplayType!;
}
// 监听支付方式变化
payTypeRadioC.addValueListener((v) {
final payType = OrderPayDisplayType.values.fromCode(
v.first.code,
);
if (payType == null || payType == orderPayDisplayType.value) {
return;
}
orderPayDisplayType.value = payType;
});
}
@override
void onClose() {
super.onClose();
payTypeRadioC.dispose();
}
_closeStatus() {
payUser.value = null;
isRecognition.value = false;
@@ -427,12 +460,6 @@ class SelectPayTypeDialogController extends GetxController {
Future<void> selectPayTypeDialog(BuildContext context) async {
final payTypeC = Get.find<SelectPayTypeDialogController>();
final payUser = payTypeC.payUser.value;
payTypeC.orderPayType.value = OrderPayType.face;
payTypeC.orderPayDisplayType.value = OrderPayDisplayType.face;
final controller = FRadioSelectGroupController<OrderPayDisplayType>(
value: payTypeC.orderPayDisplayType.value,
);
final theme = FTheme.of(context);
final screenWidth = context.screenWidth;
@@ -443,50 +470,59 @@ Future<void> selectPayTypeDialog(BuildContext context) async {
direction: Axis.vertical,
title: Text("选择支付方式", style: theme.typography.lg),
body: <Widget>[
FSelectGroup(
controller: controller,
style: theme.selectGroupStyle.copyWith(
labelLayoutStyle: theme.selectGroupStyle.labelLayoutStyle.copyWith(
childPadding: EdgeInsets.symmetric(
vertical: 10.h,
),
),
radioStyle: theme.selectGroupStyle.radioStyle.copyWith(
padding: EdgeInsets.symmetric(
vertical: 10.h,
),
),
),
items: OrderPayDisplayType.values
.map<FSelectGroupItem<OrderPayDisplayType>>(
(v) => FSelectGroupItem.radio(
value: v,
label: Text(
v.title,
style: theme.typography.xl,
),
Obx(
() => FSelectGroup(
controller: payTypeC.payTypeRadioC,
style: theme.selectGroupStyle.copyWith(
labelLayoutStyle:
theme.selectGroupStyle.labelLayoutStyle.copyWith(
childPadding: EdgeInsets.symmetric(
vertical: 10.h,
),
)
.toList(),
),
radioStyle: theme.selectGroupStyle.radioStyle.copyWith(
padding: EdgeInsets.symmetric(
vertical: 10.h,
),
),
),
items: payTypeC.usePayDisplayTypeList
.map<FSelectGroupItem<OrderPayDisplayType>>(
(v) => FSelectGroupItem.radio(
value: v,
label: Text(
v.title,
style: theme.typography.xl,
),
),
)
.toList(),
),
),
SizedBox(height: 20.h),
Obx(() {
final payTypeCode = payTypeC.orderPayDisplayType.value?.code;
if (payTypeCode == null) return const SizedBox.shrink();
final payType = payTypeC.orderPayDisplayType.value;
if (payType == null) return const SizedBox.shrink();
const baseMsg = "请点击开始识别按钮";
String msg = "";
SvgAsset icon = FAssets.icons.bird;
if (payTypeCode == "1") {
msg = "$baseMsg,并让用户扫描二维码";
icon = FAssets.icons.qrCode;
}
if (payTypeCode == "2") {
msg = "$baseMsg,并让用户刷饭卡";
icon = FAssets.icons.idCard;
}
if (payTypeCode == "3") {
msg = "$baseMsg,并让用户进行刷脸";
icon = FAssets.icons.scanFace;
switch (payType) {
case OrderPayDisplayType.qrCode:
msg = "$baseMsg,并让用户扫描二维码";
icon = FAssets.icons.qrCode;
break;
case OrderPayDisplayType.walletCard:
msg = "$baseMsg,并让用户刷饭卡";
icon = FAssets.icons.idCard;
break;
case OrderPayDisplayType.face:
msg = "$baseMsg,并让用户进行刷脸";
icon = FAssets.icons.scanFace;
break;
case OrderPayDisplayType.cash:
msg = "请打开钱箱,放入现金";
icon = FAssets.icons.circleDollarSign;
break;
}
return <Widget>[
FIcon(