| | |
| | | |
| | | |
| | | @IBAction func joinAction(_ sender: QMUIButton) { |
| | | PaymentView.show { status in |
| | | let paymentState:PaymentResultVC.PaymentResult = status ? .success:.fail |
| | | let vc = PaymentResultVC(result: paymentState, objType: .member) |
| | | vc.modalPresentationStyle = .fullScreen |
| | | self.present(vc, animated: true) |
| | | |
| | | PaymentView.show(money: (ali:199,wx:199,coin:nil,course:nil)) { type in |
| | | Services.enrollMember(paytype: type).subscribe(onNext: {data in |
| | | switch type { |
| | | case .aliPay: |
| | | if let orderString = data.data?.orderString{ |
| | | YYPaymentManager.shared.sendPaymentRequest(YYAlipayRequest(orderString: orderString)) { result in |
| | | switch result { |
| | | case .success: |
| | | alertSuccess(msg: "支付成功") |
| | | case .cancel: |
| | | alert(msg: "已取消支付") |
| | | case .failure(let error): |
| | | alertError(msg: error.localizedDescription) |
| | | } |
| | | } |
| | | } |
| | | case .wechat:break |
| | | default:break |
| | | } |
| | | }).disposed(by: self.disposeBag) |
| | | |
| | | } |
| | | |
| | | // PaymentView.show { status in |
| | | // let paymentState:PaymentResultVC.PaymentResult = status ? .success:.fail |
| | | // let vc = PaymentResultVC(result: paymentState, objType: .member) |
| | | // vc.modalPresentationStyle = .fullScreen |
| | | // self.present(vc, animated: true) |
| | | // |
| | | // } |
| | | } |
| | | } |