| | |
| | | private var quarter:Int! |
| | | private var week:Int! |
| | | private var tableView:UITableView! |
| | | private var studyScheduleModel:StudyScheduleModel? |
| | | |
| | | required init(page:Int,quarter:Int,week:Int) { |
| | | super.init(nibName: nil, bundle: nil) |
| | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | navigationItem.titleView = UIView() |
| | | Services.studySchedule(week: week, day: page + 1).subscribe(onNext: {data in |
| | | self.studyScheduleModel = data.data |
| | | self.tableView.reloadData() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | override func setUI() { |
| | |
| | | //听故事 |
| | | if page == 6{ |
| | | if indexPath.row == 0{ |
| | | JQ_currentViewController().jq_push(vc: HomeListenFightVC(listenType: .story1)) |
| | | Services.lookpictureDbu(quarter: quarter, week: week).subscribe(onNext: {result in |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .story1) |
| | | fightVC.title = ListenType.story1.rawTitle |
| | | fightVC.data = data |
| | | JQ_currentViewController().jq_push(vc: fightVC) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | if indexPath.row == 1{ |
| | | JQ_currentViewController().jq_push(vc: HomeListenFightVC(listenType: .story2)) |
| | | Services.frameworkMemory(quarter: quarter, week: week).subscribe(onNext: {result in |
| | | if let data = result.data{ |
| | | let fightVC = HomeListenFightVC(listenType: .story2) |
| | | fightVC.title = ListenType.story2.rawTitle |
| | | fightVC.data = data |
| | | JQ_currentViewController().jq_push(vc: fightVC) |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | } |
| | | } |
| | |
| | | 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 |
| | | return cell |
| | | }else{ |
| | | let cell = tableView.dequeueReusableCell(withIdentifier: "_HomeListen_item_TCell", for: indexPath) as! HomeListen_item_TCell |
| | |
| | | case 0: |
| | | cell.label_title.text = "自主学习1-听音选图" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#6EC3FF") |
| | | cell.setProgress(progress: studyScheduleModel?.listen ?? 0) |
| | | case 1: |
| | | cell.label_title.text = "自主学习2-看图选音" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#FF9A85") |
| | | cell.setProgress(progress: studyScheduleModel?.look ?? 0) |
| | | case 2: |
| | | cell.label_title.text = "自主学习3-归纳排除" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#28C8C5") |
| | | cell.setProgress(progress: studyScheduleModel?.induction ?? 0) |
| | | case 3: |
| | | cell.label_title.text = "自主学习4-有问有答" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#F8A169") |
| | | cell.setProgress(progress: studyScheduleModel?.answer ?? 0) |
| | | case 4: |
| | | cell.label_title.text = "自主学习5-音图相配" |
| | | cell.view_bg2.backgroundColor = UIColor(hexString: "#92CADB") |
| | | cell.setProgress(progress: studyScheduleModel?.pair ?? 0) |
| | | default:break |
| | | } |
| | | } |