| | |
| | | |
| | | import UIKit |
| | | import JQTools |
| | | import RxSwift |
| | | |
| | | class CourseDetail_3_TCell: UITableViewCell { |
| | | @IBOutlet weak var collectionView: UICollectionView! |
| | |
| | | private let CellH = ((JQ_ScreenW - 21.5 * 2 - 13.5) / 2) * 1.313 |
| | | |
| | | var items = [CourseModel]() |
| | | private var disposeBag = DisposeBag() |
| | | |
| | | override func awakeFromNib() { |
| | | super.awakeFromNib() |
| | |
| | | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { |
| | | let model = items[indexPath.row] |
| | | if model.courseType == .online{ |
| | | let vc = CourseDetialVC(courseId: model.id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | Services.getCourseDetail(courseId: model.id).subscribe(onNext: {data in |
| | | if let m = data.data{ |
| | | if m.isVip == .no && m.chargeType == .vipFree{ |
| | | let vc = VIPCenterVC() |
| | | JQ_currentNavigationController().pushViewController(vc) |
| | | }else if m.courseType == .online{ |
| | | let vc = CourseDetialVC(courseModel: m) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | }else{ |
| | | let vc = CourseDetialOfflineVC(courseId: m.id) |
| | | JQ_currentViewController().jq_push(vc: vc) |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | |
| | | }else{ |
| | | let vc = CourseDetialOfflineVC(courseId: model.id) |
| | | JQ_currentViewController().jq_push(vc: vc) |