| | |
| | | case .course: |
| | | let model = models[indexPath.row] as! CourseModel |
| | | if model.courseType == .online{ |
| | | let vc = CourseDetialVC(courseId: model.id) |
| | | push(vc: vc) |
| | | Services.getCourseDetail(courseId: model.id).subscribe(onNext: {[weak self]data in |
| | | if let m = data.data{ |
| | | if m.isVip == .no && m.chargeType == .vipFree{ |
| | | let vc = VIPCenterVC() |
| | | self?.push(vc: vc) |
| | | }else if m.courseType == .online{ |
| | | let vc = CourseDetialVC(courseModel: m) |
| | | self?.push(vc: vc) |
| | | }else{ |
| | | let vc = CourseDetialOfflineVC(courseId: m.id) |
| | | self?.push(vc: vc) |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | }else{ |
| | | let vc = CourseDetialOfflineVC(courseId: model.id) |
| | | push(vc: vc) |
| | |
| | | |
| | | case .muse: |
| | | let model = models[indexPath.row] as! MeditationModel |
| | | let vc = HomeItemDetailVC(id: model.id) |
| | | push(vc: vc) |
| | | Services.getMeditationDetail(id: model.id).subscribe(onNext: {[weak self]data in |
| | | guard let weakSelf = self else { return } |
| | | if let m = data.data{ |
| | | let isVip = m.isVip == .yes |
| | | if m.chargeType == .free || (isVip && m.chargeType == .vipFree) || (m.chargeType == .payment && m.isBuy == .yes){ |
| | | let vc = HomeItemDetailVC(model: m) |
| | | weakSelf.jq_push(vc: vc) |
| | | return |
| | | } |
| | | |
| | | if m.chargeType == .payment && m.isBuy == .no{ |
| | | guard sceneDelegate!.checkisLoginState() else{return} |
| | | let vc = PaymentOrderVC(museItemModel: m,type: .muse,showType:.vertical) |
| | | weakSelf.jq_push(vc: vc) |
| | | return |
| | | } |
| | | |
| | | if m.chargeType == .vipFree{ |
| | | let vc = VIPCenterVC() |
| | | weakSelf.jq_push(vc: vc) |
| | | return |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | case .none:break |
| | | } |
| | | } |