This commit is contained in:
dzc committed 2025-09-03 11:43:49 +08:00
1 parent b23faf304b
commit 3d790bd36a
5 files changed
+16 -8

No files matched your search

@@ -233,6 +233,9 @@ class ServiceHardOrder {
/// 支付方式
final String? payType;
/// 支付方式
final String? walletId;
ServiceHardOrder({
this.userId,
this.username,
@@ -241,6 +244,7 @@ class ServiceHardOrder {
this.orderType,
this.orderStatus,
this.payType,
this.walletId,
});
factory ServiceHardOrder.fromJson(Map<String, dynamic> json) =>
@@ -128,6 +128,7 @@ ServiceHardOrder _$ServiceHardOrderFromJson(Map<String, dynamic> json) =>
orderType: json['orderType'] as String?,
orderStatus: json['orderStatus'] as String?,
payType: json['payType'] as String?,
walletId: json['walletId'] as String?,
);
Map<String, dynamic> _$ServiceHardOrderToJson(ServiceHardOrder instance) =>
@@ -139,6 +140,7 @@ Map<String, dynamic> _$ServiceHardOrderToJson(ServiceHardOrder instance) =>
'orderType': instance.orderType,
'orderStatus': instance.orderStatus,
'payType': instance.payType,
'walletId': instance.walletId,
};
ServiceOpenCard _$ServiceOpenCardFromJson(Map<String, dynamic> json) =>
@@ -37,7 +37,7 @@ class SelectPayTypeDialogController extends GetxController {
)? onQrCodeScanRecognition;
// |"二维码扫一扫支付" "支付成功"|
Future<void> Function()? onQrCodeScanPaySuccess;
Future<void> Function(ServiceUser? payUser)? onQrCodeScanPaySuccess;
// |取消|的回调
VoidCallback? onCancel;
@@ -520,12 +520,16 @@ class SelectPayTypeDialogController extends GetxController {
Toast.error(msg: "未支付,请检查用户是否扫码支付");
return;
}
// 设置支付用户
payUser.value?.walletId = order.walletId;
SubScreenPlugin.sendMsgToViceScreen(
SubScreenAction.qrCodeScanSuccess.name,
);
// 支付成功
await onQrCodeScanPaySuccess?.call();
await onQrCodeScanPaySuccess?.call(payUser.value);
isRecognition.value = false;
_closeStatus();
Navigator.of(Get.context!).pop();
},
);
} catch (error, stack) {
@@ -559,7 +563,7 @@ class SelectPayTypeDialogController extends GetxController {
continue;
}
if (order.orderStatus == OrderStatus.PAY.code) {
logger.e(
logger.i(
"|$_tag|轮训查询二维码订单状态,订单支付成功,sqlOrderId|$serviceOrderId|orderJson|${order.toJson()}|",
);
return order;
+2 -4
View File
@@ -281,10 +281,8 @@ class SupermarketOrderController extends GetxController with OrderMixin {
};
// |"二维码扫一扫支付" "支付成功"|
payTypeSelect.onQrCodeScanPaySuccess = () async {
// 校验
final validPayUser = _validatePayUser();
if (!validPayUser) return;
payTypeSelect.onQrCodeScanPaySuccess = (payUser) async {
if (payUser != null) this.payUser.value = payUser;
final validShopCar = _validateShopCar();
if (!validShopCar) return;
// 总金额
+1 -1
View File
@@ -85,7 +85,7 @@ class _SubProductPageState extends State<SubProductPage> {
context,
controller: qrCodeController,
qrData: subScreenEvent.qrCodeData,
countDownSeconds: 30,
countDownSeconds: 300,
onFinished: () {},
);
}