From 9539cd5cb56574d2e0cc98aa5a839195bc929fb8 Mon Sep 17 00:00:00 2001 From: dzc <2388224167@qq.com> Date: Fri, 30 May 2025 10:09:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E7=8E=B0=E9=87=91=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/common/utils/sync/sync_product_tool.dart | 2 +- lib/common/values/constants.dart | 2 +- .../widgets/order/select_pay_type_dialog.dart | 41 ++++++++++++++++--- .../setting/widgets/setting_baseInfo.dart | 4 +- 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/lib/common/utils/sync/sync_product_tool.dart b/lib/common/utils/sync/sync_product_tool.dart index f15a12d..466a3b7 100644 --- a/lib/common/utils/sync/sync_product_tool.dart +++ b/lib/common/utils/sync/sync_product_tool.dart @@ -205,7 +205,7 @@ abstract class SyncProductTool { int currentPage = 1; Set serviceCodes = {}; while (true) { - final pa = {"current": currentPage, "size": 50}; + final pa = {"current": currentPage, "size": 100}; final supermarket = await ProductApi.supermarketSpu(pa); if (supermarket == null) break; if (ObjectUtil.isEmptyList(supermarket.records)) break; diff --git a/lib/common/values/constants.dart b/lib/common/values/constants.dart index bbbd4d5..7b3e642 100644 --- a/lib/common/values/constants.dart +++ b/lib/common/values/constants.dart @@ -12,7 +12,7 @@ class Constants { /// 服务 url // static const apiUrl = 'https://stgl.pj.gov.cn/api'; - static const apiUrl = 'http://192.168.101.125:9999'; + static const apiUrl = 'http://192.168.101.132:9999'; /// 静态资源 url static const ossUrl = apiUrl; diff --git a/lib/common/widgets/order/select_pay_type_dialog.dart b/lib/common/widgets/order/select_pay_type_dialog.dart index 90c86c9..f95ace9 100644 --- a/lib/common/widgets/order/select_pay_type_dialog.dart +++ b/lib/common/widgets/order/select_pay_type_dialog.dart @@ -138,6 +138,9 @@ class SelectPayTypeDialogController extends GetxController { case OrderPayDisplayType.face: await _dispatchFace(); break; + case OrderPayDisplayType.cash: + await _dispatchCash(); + break; default: } onRecognition?.call(); @@ -369,6 +372,28 @@ class SelectPayTypeDialogController extends GetxController { } } + // ************************************************************************** + // 现金支付 start + // ************************************************************************** + Future _dispatchCash() async { + orderPayType.value = OrderPayType.CASH; + orderType = OrderType.BELOW; + payUser.value = ServiceUser( + userId: "-1", + username: "未知用户", + deptId: "-1", + userMobile: "??????", + userAvatar: "", + walletId: "-1", + walletTypeId: "-1", + walletBalance: 1000 * 100, + ); + onDiscernUser?.call(payUser.value); + } + // ************************************************************************** + // 现金支付 end + // ************************************************************************** + // android人脸识别成功回调 Future _faceDiscernAfter(FaceStream event) async { try { @@ -432,11 +457,17 @@ class SelectPayTypeDialogController extends GetxController { /// 校验二维码类型是否符合 _validateQrCodeType(OrderPayType type) { - const success = [ - OrderPayType.WALLET_QR_CODE, - OrderPayType.STRIDE_DEPT_QR_CODE, - OrderPayType.FOREIGN_TICKET_QR_CODE, - ]; + List success = []; + // 超市扫码只能用二维码支付 + if (appSetting.sysType == SysType.SUPERMARKET) { + success = [OrderPayType.WALLET_QR_CODE]; + } else if (appSetting.sysType == SysType.CANTEEN) { + success = [ + OrderPayType.WALLET_QR_CODE, + OrderPayType.STRIDE_DEPT_QR_CODE, + OrderPayType.FOREIGN_TICKET_QR_CODE, + ]; + } return success.contains(type); } } diff --git a/lib/pages/setting/widgets/setting_baseInfo.dart b/lib/pages/setting/widgets/setting_baseInfo.dart index d0e2934..b8e8e86 100644 --- a/lib/pages/setting/widgets/setting_baseInfo.dart +++ b/lib/pages/setting/widgets/setting_baseInfo.dart @@ -23,7 +23,9 @@ Future _bindServiceDialog(BuildContext context, SysSetting sys) async { // 正式环境-新县府02 // uniqueCodeC.text = "1887466308336488450"; // 测试环境-测试设备 - uniqueCodeC.text = "1877592554489143298"; + // uniqueCodeC.text = "1877592554489143298"; + // 测试少年宫测试 + uniqueCodeC.text = "1927932460185784321"; // 测试环境-食堂-浦阳 // uniqueCodeC.text = "1914567628657778690"; }