无故事王国
2023-10-18 e86e19e5e5909f46e09adec1df430e0214a81590
WanPai/Root/Games/TCell/GamesTCell.swift
@@ -8,6 +8,7 @@
import UIKit
import RxSwift
import RxRelay
import JQTools
class GamesTCell: UITableViewCell {
@@ -32,7 +33,7 @@
    }
   @IBAction func intruduceAction(_ sender: UIButton) {
      GamesIntruduceView.show()
      GamesIntruduceView.show(url: gameListModel.video, content: gameListModel.intro)
   }
   @IBAction func launchGameAction(_ sender: UIButton) {
@@ -47,18 +48,39 @@
                     case .aliPay:
                        YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: data.data?.orderString ?? "")) { result in
                           switch result {
                              case .success:alertSuccess(msg: "支付成功")
                              case .success:
                                 let vc = PaymentResultVC(result: .success, objType: .games)
                                 vc.modalPresentationStyle = .fullScreen
                                 JQ_currentViewController().present(vc, animated: true)
                              case .cancel:alert(msg: "支付已取消")
                              case .failure(let error):alert(msg: error.localizedDescription)
                              case .failure(let error):
                                 alert(msg: error.localizedDescription)
                           }
                        }
                     default:alert(msg: "启动成功")
                     default:
                        let vc = PaymentResultVC(result: .success, objType: .games)
                        vc.modalPresentationStyle = .fullScreen
                        JQ_currentViewController().present(vc, animated: true)
                  }
               }else{
                  alert(msg: data.msg)
                  let vc = PaymentResultVC(result: .fail(data.msg), objType: .games)
                  vc.modalPresentationStyle = .fullScreen
                  JQ_currentViewController().present(vc, animated: true)
               }
            }) { error in
               alert(msg: error.localizedDescription)
               if let er = error as? NetworkRequest.NetRequestError{
                  switch er {
                     case .Other(_,let string):
                        let vc = PaymentResultVC(result: .fail(string), objType: .games)
                        vc.modalPresentationStyle = .fullScreen
                        JQ_currentViewController().present(vc, animated: true)
                     default:
                        let vc = PaymentResultVC(result: .fail("支付失败"), objType: .games)
                        vc.modalPresentationStyle = .fullScreen
                        JQ_currentViewController().present(vc, animated: true)
                  }
               }
            }.disposed(by: weakSelf.disposeBag)
         }
      }