younger_times
2023-07-14 b932f704f6c04adc7d7b4104a06cbc09c8d49cb5
WanPai/Root/Home/VC/JoinMemberIntroduceVC.swift
@@ -35,12 +35,35 @@
    
    
    @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)
//
//        }
    }
}