| | |
| | | import UIKit |
| | | import RxSwift |
| | | import RxRelay |
| | | import JQTools |
| | | |
| | | class GamesTCell: UITableViewCell { |
| | | |
| | |
| | | } |
| | | |
| | | @IBAction func intruduceAction(_ sender: UIButton) { |
| | | GamesIntruduceView.show() |
| | | GamesIntruduceView.show(url: gameListModel.video, content: gameListModel.intro) |
| | | } |
| | | |
| | | @IBAction func launchGameAction(_ sender: UIButton) { |
| | |
| | | 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) |
| | | } |
| | | } |