Browse Source

fix:解决 付款成功后,一直显示【正在查询订单状态】弹窗的问题。

“HeShaoZe” 4 tháng trước cách đây
mục cha
commit
149bb9e59a

+ 8 - 0
lib/module/member/member_controller.dart

@@ -615,10 +615,18 @@ class MemberController extends BaseController implements PaymentStatusCallback {
   @override
   void onPaymentSuccess(
       String orderNo, PayItemBean paymentWay, GoodsBean storeItemBean) {
+    ///购买成功消失
+    LoadingDialog.hide();
     ///购买成功之后弹出
     afterTheFirstPurchasePromptSharingBoxPops();
   }
 
+  @override
+  void onPaymentFail() {
+    ///购买成功消失
+    LoadingDialog.hide();
+  }
+
   ///第一次购买之后弹出提示分享框
   void afterTheFirstPurchasePromptSharingBoxPops() {
     paymentStatusManager.onOrderFirstCheck().then((checkReponse) {

+ 4 - 0
lib/utils/payment_status_manager.dart

@@ -60,6 +60,8 @@ class PaymentStatusManager {
         reportPaySuccess(storeItemBean.amount, orderNo, storeItemBean.name,
             paymentWay.payMethod);
       }).catchError((error) async {
+        ///失败回调
+        callbackMap[orderNo]?.onPaymentFail();
         await _lock.synchronized(() {
           callbackMap.remove(orderNo);
         });
@@ -137,4 +139,6 @@ class PaymentStatusException implements Exception {
 abstract class PaymentStatusCallback {
   void onPaymentSuccess(
       String orderNo, PayItemBean paymentWay, GoodsBean storeItemBean);
+
+  void onPaymentFail();
 }