| | |
| | | } |
| | | |
| | | if let model{ |
| | | Services.exerciseCourseDetail(coursePackageId: model.coursePackageId, videoId: model.videoId).subscribe(onNext: {[weak self] data in |
| | | Services.exerciseCourseDetail(coursePackageId: model.coursePackageId, videoId: model.videoId,scId: model.scId).subscribe(onNext: {[weak self] data in |
| | | if let model = data.data{ |
| | | self?.exerciseVideoDetailModel = model |
| | | self?.label_name.text = model.packageName |
| | |
| | | @objc private func playbackEnd(){ |
| | | if let m = exerciseVideoDetailModel{ |
| | | if timeDuration >= CMTimeGetSeconds((playerVC.player?.currentItem?.duration)!) && m.studyStatus == 1 { |
| | | Services.updateVideoStatus(coursePackageId: m.coursePackageId, videoId: m.videoId).subscribe(onNext: {[weak self] data in |
| | | Services.updateVideoStatus(coursePackageId: m.coursePackageId, videoId: m.videoId,scId: model?.scId).subscribe(onNext: {[weak self] data in |
| | | alertSuccess(msg: "已获得积分") |
| | | self?.exerciseVideoDetailModel?.studyStatus = 2 |
| | | self?.label_studyState.text = "已学习" |
| | |
| | | self?.label_studyState.textColor = UIColor(hexStr: "#318C10") |
| | | self?.timeDuration = 0 |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | NotificationCenter.default.post(name: CourseExercise_Noti, object: nil) |
| | | |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | |
| | | self?.label_studyState.textColor = UIColor(hexStr: "#318C10") |
| | | self?.timeDuration = 0 |
| | | NotificationCenter.default.post(name: UpdateWelfare_Noti, object: nil) |
| | | NotificationCenter.default.post(name: CourseExercise_Noti, object: nil) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |