无故事王国
2023-10-20 6382df7f214503697f041631bd7fdbc5db2c6149
WanPai/Root/Course/VC/CourseDetailApplyVC.swift
@@ -207,15 +207,13 @@
                              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:
@@ -224,8 +222,7 @@
                                    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{
@@ -234,14 +231,12 @@
                  },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)
                        }
                     }