| | |
| | | weakSelf.cons_tableHei.constant = CGFloat((weakSelf.studentModels.count) * 87) |
| | | weakSelf.changePrice(weakSelf.selectClassIndex) |
| | | } needAddClouse: { [weak self] () in |
| | | let vc = AddStudentVC(type: .course) |
| | | let vc = AddStudentVC(type: .course,studentInfo: nil) |
| | | self?.push(vc: vc) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | Services.courcePayment(conponId: weakSelf.selectCouponModel?.id, courseConfigId: model.id, id: weakSelf.detailModel!.id, price: resultPayPrice, payType: payType, stuId: weakSelf.studentModels.map({$0.id}),orderId: weakSelf.signUpModel?.coursePayId).subscribe(onNext: { data in |
| | | if data.code == 200{ |
| | | switch payType { |
| | | case .aliPay: |
| | | YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: data.data!.orderString)) { [weak self] result in |
| | | switch result { |
| | | case .success: |
| | | let vc = PaymentResultVC(result: .success, objType: .courseApply,handleVC: self,courseConfigId: model.id) |
| | | vc.isExtend = self?.signUpModel?.payStatus == .paymented |
| | | self?.push(vc: vc) |
| | | case .cancel: |
| | | alert(msg: "已取消") |
| | | case .failure(_): |
| | | let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .courseApply) |
| | | self?.push(vc: vc) |
| | | if let m = data.data{ |
| | | if data.code == 200{ |
| | | switch payType { |
| | | case .aliPay: |
| | | YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: data.data!.orderString)) { [weak self] result in |
| | | switch result { |
| | | case .success: |
| | | let vc = PaymentResultVC(result: .success, objType: .courseApply,handleVC: self,courseConfigId: model.id) |
| | | vc.isExtend = self?.signUpModel?.payStatus == .paymented |
| | | self?.push(vc: vc) |
| | | case .cancel: |
| | | alert(msg: "已取消") |
| | | case .failure(_): |
| | | let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .courseApply) |
| | | self?.push(vc: vc) |
| | | } |
| | | } |
| | | } |
| | | case .wechat: |
| | | self?.navigationController?.popViewController(animated: false) |
| | | break |
| | | case .coin: |
| | | let vc = PaymentResultVC(result: .success, objType: .courseApply,handleVC: self,courseConfigId: model.id) |
| | | vc.isExtend = self?.signUpModel?.payStatus == .paymented |
| | | self?.push(vc: vc) |
| | | default:break |
| | | case .wechat: |
| | | YYPaymentManager.shared.sendPaymentRequest(YYWeChatPayRequest(partnerId: m.partnerid, prepayId: m.prepayid, package: m.package, nonceStr: m.noncestr, timeStamp: m.timestamp, sign: m.sign)) { [weak self] result in |
| | | switch result { |
| | | case .success: |
| | | let vc = PaymentResultVC(result: .success, objType: .courseApply,handleVC: self,courseConfigId: model.id) |
| | | vc.isExtend = self?.signUpModel?.payStatus == .paymented |
| | | self?.push(vc: vc) |
| | | case .cancel: |
| | | alert(msg: "已取消") |
| | | case .failure(_): |
| | | let vc = PaymentResultVC(result: .fail("支付失败",0), objType: .courseApply) |
| | | self?.push(vc: vc) |
| | | } |
| | | } |
| | | break |
| | | case .coin: |
| | | let vc = PaymentResultVC(result: .success, objType: .courseApply,handleVC: self,courseConfigId: model.id) |
| | | vc.isExtend = self?.signUpModel?.payStatus == .paymented |
| | | self?.push(vc: vc) |
| | | default:break |
| | | } |
| | | }else{ |
| | | alertError(msg: data.msg) |
| | | } |
| | | }else{ |
| | | alertError(msg: data.msg) |
| | | } |
| | | |
| | | },onError: { error in |
| | | if let er = error as? NetworkRequest.NetRequestError{ |
| | | switch er { |