| | |
| | | import FFPage |
| | | import QMUIKit |
| | | |
| | | let StudentRefresh_Nofi = Notification.Name.init("StudentRefresh_Nofi") |
| | | |
| | | class CourseInfoVC: BaseVC { |
| | | |
| | | @IBOutlet weak var scrollView: CourseInfoScrollView! |
| | |
| | | } |
| | | |
| | | override func setRx() { |
| | | NotificationCenter.default.rx.notification(StudentRefresh_Nofi).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] noti in |
| | | guard let weakSelf = self else { return } |
| | | Services.startCourseHome().subscribe(onNext: {[weak self] data in |
| | | if let model = data.data{ |
| | | self?.startClouseHomeModel = model |
| | | if model.courseList.count > 0{ |
| | | self?.pageMenu.setItems(model.courseList.map({$0.courseName}), selectedItemIndex: 0) |
| | | } |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | }).disposed(by: disposeBag) |
| | | |
| | | |
| | | NotificationCenter.default.rx.notification(StudentUpdate_Nofi).take(until: self.rx.deallocated).subscribe(onNext: {[weak self] noti in |
| | | guard let weakSelf = self else { return } |
| | | Services.startCourseHome().subscribe(onNext: {[weak self] data in |
| | |
| | | }) { error in |
| | | |
| | | }.disposed(by: disposeBag) |
| | | } |
| | | |
| | | private func updateData(){ |
| | | |
| | | } |
| | | |
| | | private func setAttribute(t1:String,t2:String)->NSMutableAttributedString{ |
| | |
| | | push(vc: vc) |
| | | } |
| | | |
| | | |
| | | @IBAction func renewalAction(_ sender: UIButton) { |
| | | let index = pageMenu.selectedItemIndex |
| | | let models = startClouseHomeModel!.courseList |
| | | Services.queryCourseInfo(id: models[index].courseId).subscribe(onNext: {[weak self] data in |
| | | if let m = data.data{ |
| | | let vc = CourseDetailApplyVC(detailModel: m,isExtend: true) |
| | | self?.push(vc: vc) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | @IBAction func bookingRecordAction(_ sender: UIButton) { |
| | | guard startClouseHomeModel != nil else {return} |
| | | let vc = CourseBookingListVC(student: startClouseHomeModel!) |