Explorar o código

[new]调整会员支付提示流程

zk hai 5 meses
pai
achega
4461a12ed7
Modificáronse 1 ficheiros con 10 adicións e 9 borrados
  1. 10 9
      lib/module/member/member_controller.dart

+ 10 - 9
lib/module/member/member_controller.dart

@@ -298,7 +298,6 @@ class MemberController extends BaseController implements PaymentStatusCallback {
     }
   }
 
-
   ///用户取消支付展示
   void userCancelsPaymentDisplay() {
     if (_isShowPayFailedDialog) {
@@ -309,11 +308,12 @@ class MemberController extends BaseController implements PaymentStatusCallback {
   }
 
   ///支付错误的时候调用
-  void showRetainDialog({bool isBack = false}) {
+  void showRetainDialog({bool isBack = false, int? errno}) {
     _isShowPayFailedDialog = true;
     MemberRetainDialog.show(payClick: () {
       onBuyClick();
     }, cancelClick: () {
+      errorPayToast(errno);
       if (Platform.isAndroid && isBack) back();
     });
   }
@@ -561,18 +561,16 @@ class MemberController extends BaseController implements PaymentStatusCallback {
       GoodsBean buyGoods, PayItemBean buyPayWay) {
     AgilePay.startPay(payInfo, success: (String? result) {
       checkPaymentStatus(outTradeNo, buyPayWay, buyGoods, receiptData: result);
-    }, payError: (int error, String? errorMessage) {
+    }, payError: (int errno, String? errorMessage) {
       LoadingDialog.hide();
-      debugPrint('zk---payError: $error, $errorMessage');
-      errorPayToast(error);
+      debugPrint('zk---payError: $errno, $errorMessage');
       errorEventReport(payMethod);
-      showRetainDialog();
+      showRetainDialog(errno: errno);
     }, error: (int errno, String? error) {
       LoadingDialog.hide();
       debugPrint('zk---error: $errno, $error');
-      errorPayToast(errno);
       errorEventReport(payMethod);
-      showRetainDialog();
+      showRetainDialog(errno: errno);
     });
   }
 
@@ -586,7 +584,10 @@ class MemberController extends BaseController implements PaymentStatusCallback {
     }
   }
 
-  void errorPayToast(int errno) {
+  void errorPayToast(int? errno) {
+    if (errno == null) {
+      return;
+    }
     if (errno == AgilePayCode.payCodeNotSupport) {
       ToastUtil.show(StringName.payNotSupport);
     } else if (errno == AgilePayCode.payCodeCancelError) {