| | |
| | | YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: data.data!.orderString)) { [weak self] result in |
| | | switch result { |
| | | case .success: |
| | | // self?.navigationController?.popViewController(animated: false) |
| | | let vc = PaymentResultVC(result: .success, objType: .courseApply,handleVC: self,courseConfigId: model.id) |
| | | vc.modalPresentationStyle = .fullScreen |
| | | self?.present(vc, animated: true) |
| | | self?.push(vc: vc) |
| | | case .cancel: |
| | | alert(msg: "已取消") |
| | | case .failure(let error): |
| | | let vc = PaymentResultVC(result: .fail(error.localizedDescription), objType: .courseApply) |
| | | self?.present(vc, animated: true) |
| | | case .failure(_): |
| | | let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .courseApply) |
| | | self?.push(vc: vc) |
| | | } |
| | | } |
| | | case .wechat: |
| | |
| | | case .coin: |
| | | // self?.navigationController?.popViewController(animated: false) |
| | | let vc = PaymentResultVC(result: .success, objType: .courseApply,handleVC: self,courseConfigId: model.id) |
| | | vc.modalPresentationStyle = .fullScreen |
| | | self?.present(vc, animated: true) |
| | | self?.push(vc: vc) |
| | | case .courseNum,.integral:break |
| | | } |
| | | }else{ |
| | |
| | | },onError: { error in |
| | | if let er = error as? NetworkRequest.NetRequestError{ |
| | | switch er { |
| | | case .Other(_,let string): |
| | | let vc = PaymentResultVC(result: .fail(string), objType: .courseApply,handleVC: nil) |
| | | vc.modalPresentationStyle = .fullScreen |
| | | weakSelf.present(vc, animated: true) |
| | | case .Other(let code,let string): |
| | | let vc = PaymentResultVC(result: .fail(string,code), objType: .courseApply,handleVC: nil) |
| | | self?.push(vc: vc) |
| | | default: |
| | | let vc = PaymentResultVC(result: .fail("支付失败"), objType: .courseApply,handleVC: nil) |
| | | vc.modalPresentationStyle = .fullScreen |
| | | weakSelf.present(vc, animated: true) |
| | | let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .courseApply,handleVC: nil) |
| | | self?.push(vc: vc) |
| | | } |
| | | } |
| | | |