| | |
| | | let jumpIndex:IndexPath = IndexPath(row: row, section: 1) |
| | | tableView(self.tableView, didSelectRowAt: jumpIndex) |
| | | } |
| | | } |
| | | |
| | | extension HomeListenSubV2VC:UITableViewDelegate{ |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | |
| | | func jumpVC(studyScheduleModel:StudyScheduleModel,indexPath:IndexPath){ |
| | | sceneDelegate?.startTimer() |
| | | |
| | | let day = indexPath.row + 1 |
| | |
| | | fightVC.title = ListenType.lesson1.rawTitle |
| | | fightVC.teamScheduleModel = teamSchedule.data |
| | | fightVC.data = data |
| | | fightVC.studyScheduleModel = self?.studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc:fightVC) |
| | | print("---->>>>>1:\(teamSchedule.data)") |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | }).disposed(by: disposeBag) |
| | |
| | | fightVC.title = ListenType.lesson2.rawTitle |
| | | fightVC.teamScheduleModel = teamSchedule.data |
| | | fightVC.data = data |
| | | fightVC.studyScheduleModel = self?.studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc:fightVC) |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | |
| | | fightVC.title = ListenType.lesson3.rawTitle |
| | | fightVC.teamScheduleModel = teamSchedule.data |
| | | fightVC.data = data |
| | | fightVC.studyScheduleModel = self?.studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc: fightVC) |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | |
| | | fightVC.title = ListenType.lesson4.rawTitle |
| | | fightVC.teamScheduleModel = teamSchedule.data |
| | | fightVC.data = data |
| | | fightVC.studyScheduleModel = self?.studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc: fightVC) |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | |
| | | fightVC.title = ListenType.lesson5.rawTitle |
| | | fightVC.teamScheduleModel = teamSchedule.data |
| | | fightVC.data = data |
| | | fightVC.studyScheduleModel = self?.studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc: fightVC) |
| | | } |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | guard (studyScheduleModel?.day ?? 0) >= 6 else {return} |
| | | guard (studyScheduleModel.day) >= 6 else {return} |
| | | |
| | | //自主游戏 |
| | | if indexPath.row == 5{ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | extension HomeListenSubV2VC:UITableViewDelegate{ |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | |
| | | Services.studySchedule(week: week).subscribe(onNext: {[weak self]data in |
| | | guard let weakSelf = self else { return } |
| | | var studyScheduleModel = StudyScheduleModel() |
| | | if let m = data.data{ |
| | | studyScheduleModel = m |
| | | } |
| | | weakSelf.jumpVC(studyScheduleModel: studyScheduleModel, indexPath: indexPath) |
| | | }).disposed(by: disposeBag) |
| | | |
| | | } |
| | | } |
| | | |
| | | extension HomeListenSubV2VC:UITableViewDataSource{ |
| | | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| | | if section == 0{return 1} |
| | |
| | | if indexPath.section == 0{ |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_HomeListen_process_TCell", for: indexPath) as! HomeListen_process_TCell |
| | | cell.studyScheduleModel = studyScheduleModel |
| | | cell.label_currentWeek.text = "当前周目:\(week.jq_cn)周目" |
| | | cell.label_currentWeek.text = "自主学习:第\(week ?? 0)周" |
| | | return cell |
| | | }else{ |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_HomeListen_item_TV2Cell", for: indexPath) as! HomeListen_item_TV2Cell |
| | | cell.label_title.text = "\(indexPath.row + 1)" |
| | | cell.label_title.text = "第\(indexPath.row + 1)天" |
| | | cell.view_state.isHidden = false |
| | | // cell.view_state.isHidden = false |
| | | |
| | | switch indexPath.row { |
| | | case 0: |
| | | cell.label_subTitle.text = "自主学习1-听音选图" |
| | | cell.label_subTitle.text = "听音选图" |
| | | cell.setProgress(progress: studyScheduleModel?.listen ?? 0) |
| | | cell.view_center.backgroundColor = UIColor.white |
| | | case 1: |
| | | cell.label_subTitle.text = "自主学习2-看图选音" |
| | | cell.label_subTitle.text = "看图选音" |
| | | cell.setProgress(progress: studyScheduleModel?.look ?? 0) |
| | | if (studyScheduleModel?.listen ?? 0) >= 90{ |
| | | cell.view_center.backgroundColor = UIColor.white |
| | | } |
| | | |
| | | case 2: |
| | | cell.label_subTitle.text = "自主学习3-归纳排除" |
| | | cell.label_subTitle.text = "归纳排除" |
| | | cell.setProgress(progress: studyScheduleModel?.computeSchedule ?? 0) |
| | | if (studyScheduleModel?.look ?? 0) >= 90{ |
| | | cell.view_center.backgroundColor = UIColor.white |
| | | } |
| | | case 3: |
| | | cell.label_subTitle.text = "自主学习4-有问有答" |
| | | cell.label_subTitle.text = "有问有答" |
| | | cell.setProgress(progress: studyScheduleModel?.answer ?? 0) |
| | | if (studyScheduleModel?.computeSchedule ?? 0) >= 90{ |
| | | cell.view_center.backgroundColor = UIColor.white |
| | | } |
| | | case 4: |
| | | cell.label_subTitle.text = "自主学习5-音图相配" |
| | | cell.label_subTitle.text = "音图相配" |
| | | cell.setProgress(progress: studyScheduleModel?.pair ?? 0) |
| | | if (studyScheduleModel?.answer ?? 0) >= 90{ |
| | | cell.view_center.backgroundColor = UIColor.white |
| | | } |
| | | case 5: |
| | | cell.label_subTitle.text = "自主游戏" |
| | | cell.view_state.isHidden = true |
| | | // cell.view_state.isHidden = true |
| | | if (studyScheduleModel?.day ?? 0) >= 6{ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | |
| | | } |
| | | case 6: |
| | | cell.label_subTitle.text = "听故事" |
| | | cell.view_state.isHidden = true |
| | | // cell.view_state.isHidden = true |
| | | if (studyScheduleModel?.day ?? 0) >= 6{ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |