| | |
| | | |
| | | class HomeListenSubVC: BaseVC { |
| | | |
| | | private var page:Int! |
| | | private var quarter:Int! |
| | | private var week:Int! |
| | | private(set) var tableView:UITableView! |
| | | var studyScheduleModel:StudyScheduleModel? |
| | | private var page:Int! |
| | | private var quarter:Int! |
| | | private var week:Int! |
| | | private(set) var tableView:UITableView! |
| | | var studyScheduleModel:StudyScheduleModel? |
| | | |
| | | required init(page:Int,quarter:Int,week:Int,studyScheduleModel:StudyScheduleModel) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.page = page |
| | | self.quarter = quarter |
| | | self.week = week |
| | | self.studyScheduleModel = studyScheduleModel |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | | fatalError("init(coder:) has not been implemented") |
| | | } |
| | | required init(page:Int,quarter:Int,week:Int,studyScheduleModel:StudyScheduleModel) { |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.page = page |
| | | self.quarter = quarter |
| | | self.week = week |
| | | self.studyScheduleModel = studyScheduleModel |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | | fatalError("init(coder:) has not been implemented") |
| | | } |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | navigationItem.titleView = UIView() |
| | | navigationItem.titleView = UIView() |
| | | } |
| | | |
| | | override func setUI() { |
| | | super.setUI() |
| | | tableView = UITableView(frame: .zero, style: .plain) |
| | | tableView.delegate = self |
| | | tableView.dataSource = self |
| | | tableView.separatorStyle = .none |
| | | tableView.showsVerticalScrollIndicator = false |
| | | tableView.showsHorizontalScrollIndicator = false |
| | | tableView.backgroundColor = Config.ThemeBGColor |
| | | tableView.register(UINib(nibName: "HomeListen_process_TCell", bundle: nil), forCellReuseIdentifier: "_HomeListen_process_TCell") |
| | | tableView.register(UINib(nibName: "HomeListen_item_TCell", bundle: nil), forCellReuseIdentifier: "_HomeListen_item_TCell") |
| | | view.addSubview(tableView) |
| | | tableView.snp.makeConstraints { make in |
| | | make.edges.equalToSuperview() |
| | | } |
| | | } |
| | | override func setUI() { |
| | | super.setUI() |
| | | tableView = UITableView(frame: .zero, style: .plain) |
| | | tableView.delegate = self |
| | | tableView.dataSource = self |
| | | tableView.separatorStyle = .none |
| | | tableView.showsVerticalScrollIndicator = false |
| | | tableView.showsHorizontalScrollIndicator = false |
| | | tableView.backgroundColor = Config.ThemeBGColor |
| | | tableView.register(UINib(nibName: "HomeListen_process_TCell", bundle: nil), forCellReuseIdentifier: "_HomeListen_process_TCell") |
| | | tableView.register(UINib(nibName: "HomeListen_item_TCell", bundle: nil), forCellReuseIdentifier: "_HomeListen_item_TCell") |
| | | view.addSubview(tableView) |
| | | tableView.snp.makeConstraints { make in |
| | | make.edges.equalToSuperview() |
| | | } |
| | | } |
| | | |
| | | func jumpAt(listenType:ListenType){ |
| | | let row = listenType.rawValue - 1 |
| | | let jumpIndex:IndexPath = IndexPath(row: row, section: 1) |
| | | tableView(self.tableView, didSelectRowAt: jumpIndex) |
| | | } |
| | | func jumpAt(listenType:ListenType){ |
| | | let row = listenType.rawValue - 1 |
| | | let jumpIndex:IndexPath = IndexPath(row: row, section: 1) |
| | | tableView(self.tableView, didSelectRowAt: jumpIndex) |
| | | } |
| | | } |
| | | |
| | | extension HomeListenSubVC:UITableViewDelegate{ |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { |
| | | |
| | | if page <= 4 && indexPath.section == 0{return} |
| | | if page <= 4 && indexPath.section == 0{return} |
| | | |
| | | let day = page + 1 |
| | | sceneDelegate?.startTimer() |
| | | let day = page + 1 |
| | | sceneDelegate?.startTimer() |
| | | |
| | | if page <= 4{ |
| | | if indexPath.row == 0{ |
| | | Services.teamSchedule(type: .lesson1, week: week, day: day).subscribe(onNext: {[weak self] teamSchedule in |
| | | guard let weakSelf = self else { return } |
| | | //听音选图 |
| | | Services.listenSelectPicture(day:day, quarter: weakSelf.quarter, week: weakSelf.week).subscribe(onNext: {[weak self] result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .lesson1,quarter:weakSelf.quarter,week: weakSelf.week,day:day) |
| | | fightVC.title = ListenType.lesson1.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) |
| | | } |
| | | if page <= 4{ |
| | | if indexPath.row == 0{ |
| | | Services.teamSchedule(type: .lesson1, week: week, day: day).subscribe(onNext: {[weak self] teamSchedule in |
| | | guard let weakSelf = self else { return } |
| | | //听音选图 |
| | | Services.listenSelectPicture(day:day, quarter: weakSelf.quarter, week: weakSelf.week).subscribe(onNext: {[weak self] result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .lesson1,quarter:weakSelf.quarter,week: weakSelf.week,day:day) |
| | | fightVC.title = ListenType.lesson1.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) |
| | | } |
| | | |
| | | if indexPath.row == 1{ |
| | | //看图选音 |
| | | Services.teamSchedule(type: .lesson2, week: week, day: day).subscribe(onNext: {[weak self] teamSchedule in |
| | | guard let weakSelf = self else { return } |
| | | Services.pictureSelectVoice(day: day, quarter: weakSelf.quarter, week: weakSelf.week).subscribe(onNext: {[weak self] result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .lesson2,quarter:weakSelf.quarter,week: weakSelf.week,day:day) |
| | | 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) |
| | | }).disposed(by: disposeBag) |
| | | if indexPath.row == 1{ |
| | | //看图选音 |
| | | Services.teamSchedule(type: .lesson2, week: week, day: day).subscribe(onNext: {[weak self] teamSchedule in |
| | | guard let weakSelf = self else { return } |
| | | Services.pictureSelectVoice(day: day, quarter: weakSelf.quarter, week: weakSelf.week).subscribe(onNext: {[weak self] result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .lesson2,quarter:weakSelf.quarter,week: weakSelf.week,day:day) |
| | | 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) |
| | | }).disposed(by: disposeBag) |
| | | |
| | | } |
| | | } |
| | | |
| | | if indexPath.row == 2{ |
| | | //归纳排除 |
| | | Services.teamSchedule(type: .lesson3, week: week, day: day).subscribe(onNext: {[weak self] teamSchedule in |
| | | guard let weakSelf = self else { return } |
| | | Services.induceExclude(day: day, quarter: weakSelf.quarter, week: weakSelf.week).subscribe(onNext: {[weak self] result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .lesson3,quarter:weakSelf.quarter,week: weakSelf.week,day:day) |
| | | 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) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | if indexPath.row == 2{ |
| | | //归纳排除 |
| | | Services.teamSchedule(type: .lesson3, week: week, day: day).subscribe(onNext: {[weak self] teamSchedule in |
| | | guard let weakSelf = self else { return } |
| | | Services.induceExclude(day: day, quarter: weakSelf.quarter, week: weakSelf.week).subscribe(onNext: {[weak self] result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .lesson3,quarter:weakSelf.quarter,week: weakSelf.week,day:day) |
| | | 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) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | if indexPath.row == 3{ |
| | | //有问有答 |
| | | Services.teamSchedule(type: .lesson4, week: week, day: day).subscribe(onNext: {[weak self] teamSchedule in |
| | | guard let weakSelf = self else { return } |
| | | Services.questionsAndAnswers(day: day, quarter: weakSelf.quarter, week: weakSelf.week).subscribe(onNext: {[weak self] result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .lesson4,quarter:weakSelf.quarter,week: weakSelf.week,day:day) |
| | | 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) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | if indexPath.row == 3{ |
| | | //有问有答 |
| | | Services.teamSchedule(type: .lesson4, week: week, day: day).subscribe(onNext: {[weak self] teamSchedule in |
| | | guard let weakSelf = self else { return } |
| | | Services.questionsAndAnswers(day: day, quarter: weakSelf.quarter, week: weakSelf.week).subscribe(onNext: {[weak self] result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .lesson4,quarter:weakSelf.quarter,week: weakSelf.week,day:day) |
| | | 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) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | if indexPath.row == 4{ |
| | | //音图相配 |
| | | Services.teamSchedule(type: .lesson5, week: week, day: day).subscribe(onNext: {[weak self] teamSchedule in |
| | | guard let weakSelf = self else { return } |
| | | Services.pictureMateVoice(day: day, quarter: weakSelf.quarter, week: weakSelf.week).subscribe(onNext: {[weak self] result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .lesson5,quarter:weakSelf.quarter,week: weakSelf.week,day:day) |
| | | 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) |
| | | } |
| | | } |
| | | if indexPath.row == 4{ |
| | | //音图相配 |
| | | Services.teamSchedule(type: .lesson5, week: week, day: day).subscribe(onNext: {[weak self] teamSchedule in |
| | | guard let weakSelf = self else { return } |
| | | Services.pictureMateVoice(day: day, quarter: weakSelf.quarter, week: weakSelf.week).subscribe(onNext: {[weak self] result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .lesson5,quarter:weakSelf.quarter,week: weakSelf.week,day:day) |
| | | 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) |
| | | } |
| | | } |
| | | |
| | | //自主游戏 |
| | | if page == 5{ |
| | | if indexPath.row == 0{ |
| | | let fightVC = HomeListenFightVC(listenType: .game1,quarter: quarter,week: week,day: day) |
| | | fightVC.title = ListenType.game1.rawTitle |
| | | fightVC.studyScheduleModel = studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc:fightVC) |
| | | } |
| | | if indexPath.row == 1{ |
| | | Services.gameMemory(quarter: quarter, week: week).subscribe(onNext: {[weak self]result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .game2,quarter: weakSelf.quarter,week: weakSelf.week,day: day) |
| | | fightVC.title = ListenType.game2.rawTitle |
| | | fightVC.data = data |
| | | fightVC.studyScheduleModel = self?.studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc: fightVC) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | | //自主游戏 |
| | | if page == 5{ |
| | | if indexPath.row == 0{ |
| | | let fightVC = HomeListenFightVC(listenType: .game1,quarter: quarter,week: week,day: day) |
| | | fightVC.title = ListenType.game1.rawTitle |
| | | fightVC.studyScheduleModel = studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc:fightVC) |
| | | } |
| | | if indexPath.row == 1{ |
| | | Services.gameMemory(quarter: quarter, week: week).subscribe(onNext: {[weak self]result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .game2,quarter: weakSelf.quarter,week: weakSelf.week,day: day) |
| | | fightVC.title = ListenType.game2.rawTitle |
| | | fightVC.data = data |
| | | fightVC.studyScheduleModel = self?.studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc: fightVC) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | | |
| | | //听故事 |
| | | if page == 6{ |
| | | if indexPath.row == 0{ |
| | | Services.lookpictureDbu(quarter: quarter, week: week).subscribe(onNext: {[weak self]result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .story1,quarter: weakSelf.quarter,week: weakSelf.week,day: day) |
| | | fightVC.title = ListenType.story1.rawTitle |
| | | fightVC.data = data |
| | | fightVC.studyScheduleModel = self?.studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc: fightVC) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | if indexPath.row == 1{ |
| | | Services.frameworkMemory(quarter: quarter, week: week).subscribe(onNext: {[weak self]result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .story2,quarter: weakSelf.quarter,week: weakSelf.week,day: day) |
| | | fightVC.title = ListenType.story2.rawTitle |
| | | fightVC.data = data |
| | | fightVC.studyScheduleModel = self?.studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc: fightVC) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | | } |
| | | //听故事 |
| | | if page == 6{ |
| | | if indexPath.row == 0{ |
| | | Services.lookpictureDbu(quarter: quarter, week: week).subscribe(onNext: {[weak self]result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .story1,quarter: weakSelf.quarter,week: weakSelf.week,day: day) |
| | | fightVC.title = ListenType.story1.rawTitle |
| | | fightVC.data = data |
| | | fightVC.studyScheduleModel = self?.studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc: fightVC) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | if indexPath.row == 1{ |
| | | Services.frameworkMemory(quarter: quarter, week: week).subscribe(onNext: {[weak self]result in |
| | | guard let weakSelf = self else { return } |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .story2,quarter: weakSelf.quarter,week: weakSelf.week,day: day) |
| | | fightVC.title = ListenType.story2.rawTitle |
| | | fightVC.data = data |
| | | fightVC.studyScheduleModel = self?.studyScheduleModel |
| | | JQ_currentViewController().jq_push(vc: fightVC) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | extension HomeListenSubVC:UITableViewDataSource{ |
| | | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| | | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { |
| | | |
| | | if page <= 4{ |
| | | if section == 0{return 1} |
| | | return 5 |
| | | }else{ |
| | | return 2 |
| | | } |
| | | } |
| | | if page <= 4{ |
| | | if section == 0{return 1} |
| | | return 5 |
| | | }else{ |
| | | return 2 |
| | | } |
| | | } |
| | | |
| | | func numberOfSections(in tableView: UITableView) -> Int { |
| | | if page <= 4{ |
| | | return 2 |
| | | } |
| | | return 1 |
| | | } |
| | | func numberOfSections(in tableView: UITableView) -> Int { |
| | | if page <= 4{ |
| | | return 2 |
| | | } |
| | | return 1 |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| | | if indexPath.section == 0 && page <= 4{ |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_HomeListen_process_TCell", for: indexPath) as! HomeListen_process_TCell |
| | | cell.studyScheduleModel = studyScheduleModel |
| | | cell.label_currentWeek.text = "当前周目:\(week.jq_cn)周目" |
| | | return cell |
| | | }else{ |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_HomeListen_item_TCell", for: indexPath) as! HomeListen_item_TCell |
| | | cell.label_title.text = "\(indexPath.row + 1)" |
| | | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
| | | if indexPath.section == 0 && page <= 4{ |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_HomeListen_process_TCell", for: indexPath) as! HomeListen_process_TCell |
| | | cell.studyScheduleModel = studyScheduleModel |
| | | cell.label_currentWeek.text = "当前周目:\(week.jq_cn)周目" |
| | | return cell |
| | | }else{ |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_HomeListen_item_TCell", for: indexPath) as! HomeListen_item_TCell |
| | | cell.label_title.text = "\(indexPath.row + 1)" |
| | | |
| | | if page <= 4{ |
| | | cell.view_bg1.isHidden = true |
| | | switch indexPath.row { |
| | | case 0: |
| | | cell.label_title.text = "自主学习1-听音选图" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#6EC3FF") |
| | | if page <= 4{ |
| | | cell.view_bg1.isHidden = true |
| | | switch indexPath.row { |
| | | case 0: |
| | | cell.label_title.text = "自主学习1-听音选图" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#6EC3FF") |
| | | |
| | | if studyScheduleModel?.day == (page + 1){ |
| | | cell.setProgress(progress: studyScheduleModel?.listen ?? 0) |
| | | }else if (studyScheduleModel?.day ?? 0) > (page+1){ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | | cell.setProgress(progress: 0) |
| | | } |
| | | case 1: |
| | | cell.label_title.text = "自主学习2-看图选音" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#FF9A85") |
| | | if studyScheduleModel?.day == (page + 1){ |
| | | cell.setProgress(progress: studyScheduleModel?.listen ?? 0) |
| | | }else if (studyScheduleModel?.day ?? 0) > (page+1){ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | | cell.setProgress(progress: 0) |
| | | } |
| | | case 1: |
| | | cell.label_title.text = "自主学习2-看图选音" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#FF9A85") |
| | | |
| | | if studyScheduleModel?.day == (page + 1){ |
| | | cell.setProgress(progress: studyScheduleModel?.look ?? 0) |
| | | }else if (studyScheduleModel?.day ?? 0) > (page+1){ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | | cell.setProgress(progress: 0) |
| | | } |
| | | case 2: |
| | | cell.label_title.text = "自主学习3-归纳排除" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#28C8C5") |
| | | if studyScheduleModel?.day == (page + 1){ |
| | | cell.setProgress(progress: studyScheduleModel?.look ?? 0) |
| | | }else if (studyScheduleModel?.day ?? 0) > (page+1){ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | | cell.setProgress(progress: 0) |
| | | } |
| | | case 2: |
| | | cell.label_title.text = "自主学习3-归纳排除" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#28C8C5") |
| | | |
| | | |
| | | if studyScheduleModel?.day == (page + 1){ |
| | | cell.setProgress(progress: studyScheduleModel?.induction ?? 0) |
| | | }else if (studyScheduleModel?.day ?? 0) > (page+1){ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | | cell.setProgress(progress: 0) |
| | | } |
| | | case 3: |
| | | cell.label_title.text = "自主学习4-有问有答" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#F8A169") |
| | | if studyScheduleModel?.day == (page + 1){ |
| | | cell.setProgress(progress: studyScheduleModel?.induction ?? 0) |
| | | }else if (studyScheduleModel?.day ?? 0) > (page+1){ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | | cell.setProgress(progress: 0) |
| | | } |
| | | case 3: |
| | | cell.label_title.text = "自主学习4-有问有答" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#F8A169") |
| | | |
| | | |
| | | if studyScheduleModel?.day == (page + 1){ |
| | | cell.setProgress(progress: studyScheduleModel?.answer ?? 0) |
| | | }else if (studyScheduleModel?.day ?? 0) > (page+1){ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | | cell.setProgress(progress: 0) |
| | | } |
| | | case 4: |
| | | cell.label_title.text = "自主学习5-音图相配" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#92CADB") |
| | | if studyScheduleModel?.day == (page + 1){ |
| | | cell.setProgress(progress: studyScheduleModel?.answer ?? 0) |
| | | }else if (studyScheduleModel?.day ?? 0) > (page+1){ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | | cell.setProgress(progress: 0) |
| | | } |
| | | case 4: |
| | | cell.label_title.text = "自主学习5-音图相配" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#92CADB") |
| | | |
| | | if studyScheduleModel?.day == (page + 1){ |
| | | cell.setProgress(progress: studyScheduleModel?.pair ?? 0) |
| | | }else if (studyScheduleModel?.day ?? 0) > (page+1){ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | | cell.setProgress(progress: 0) |
| | | } |
| | | default:break |
| | | } |
| | | } |
| | | if studyScheduleModel?.day == (page + 1){ |
| | | cell.setProgress(progress: studyScheduleModel?.pair ?? 0) |
| | | }else if (studyScheduleModel?.day ?? 0) > (page+1){ |
| | | cell.setProgress(progress: 100) |
| | | }else{ |
| | | cell.setProgress(progress: 0) |
| | | } |
| | | default:break |
| | | } |
| | | } |
| | | |
| | | if page == 5{ |
| | | cell.view_bg2.isHidden = true |
| | | cell.view_state.isHidden = true |
| | | switch indexPath.row { |
| | | case 0: |
| | | cell.label_title.text = "自主游戏1-超级听力" |
| | | cell.view_bg1.backgroundColor = UIColor(hexString: "#6EC3FF") |
| | | case 1: |
| | | cell.label_title.text = "自主游戏2-超级记忆" |
| | | cell.view_bg1.backgroundColor = UIColor(hexString: "#FF9A85") |
| | | default:break |
| | | } |
| | | } |
| | | if page == 5{ |
| | | cell.view_bg2.isHidden = true |
| | | cell.view_state.isHidden = true |
| | | switch indexPath.row { |
| | | case 0: |
| | | cell.label_title.text = "自主游戏1-超级听力" |
| | | cell.view_bg1.backgroundColor = UIColor(hexString: "#6EC3FF") |
| | | case 1: |
| | | cell.label_title.text = "自主游戏2-超级记忆" |
| | | cell.view_bg1.backgroundColor = UIColor(hexString: "#FF9A85") |
| | | default:break |
| | | } |
| | | } |
| | | |
| | | if page == 6{ |
| | | cell.view_bg2.isHidden = true |
| | | cell.view_state.isHidden = true |
| | | switch indexPath.row { |
| | | case 0: |
| | | cell.label_title.text = "自主故事1-看图配音" |
| | | cell.view_bg1.backgroundColor = UIColor(hexString: "#6EC3FF") |
| | | case 1: |
| | | cell.label_title.text = "自主故事2-框架记忆" |
| | | cell.view_bg1.backgroundColor = UIColor(hexString: "#FF9A85") |
| | | default:break |
| | | } |
| | | } |
| | | if page == 6{ |
| | | cell.view_bg2.isHidden = true |
| | | cell.view_state.isHidden = true |
| | | switch indexPath.row { |
| | | case 0: |
| | | cell.label_title.text = "自主故事1-看图配音" |
| | | cell.view_bg1.backgroundColor = UIColor(hexString: "#6EC3FF") |
| | | case 1: |
| | | cell.label_title.text = "自主故事2-框架记忆" |
| | | cell.view_bg1.backgroundColor = UIColor(hexString: "#FF9A85") |
| | | default:break |
| | | } |
| | | } |
| | | |
| | | return cell |
| | | } |
| | | } |
| | | return cell |
| | | } |
| | | } |
| | | |
| | | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| | | if page <= 5{ |
| | | if indexPath.section == 0{return 145.5} |
| | | return 127.5 |
| | | }else{ |
| | | return 127.5 |
| | | } |
| | | } |
| | | func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { |
| | | if page <= 5{ |
| | | if indexPath.section == 0{return 145.5} |
| | | return 127.5 |
| | | }else{ |
| | | return 127.5 |
| | | } |
| | | } |
| | | } |