| | |
| | | var day = BehaviorRelay<Int?>(value: 0) |
| | | |
| | | //游戏专属,游戏等级 |
| | | var gameLevel = BehaviorRelay<Int>(value:0) |
| | | var gameLevel = BehaviorRelay<Int>(value:-1) |
| | | |
| | | //回答错误数量 |
| | | var correctNum:Int = 0{ |
| | |
| | | |
| | | |
| | | private func showGameLevel(canLevel:Int){ |
| | | guard viewModel.gameLevel.value == -1 else {return} |
| | | ChooseLevelView.show(canLevel: canLevel) {[weak self] level in |
| | | guard let weakSelf = self else { return } |
| | | weakSelf.viewModel.gameLevel.accept(level) |
| | |
| | | CommonAlertView.show(content: "未完成全部答题,确认退出吗?") {[weak self] () in |
| | | guard let weakSelf = self else { return } |
| | | for vc in weakSelf.navigationController?.viewControllers ?? []{ |
| | | if vc.isKind(of: HomeListenVC.self){ |
| | | if vc.isKind(of: HomeListenV2VC.self){ |
| | | weakSelf.navigationController?.popToViewController(vc, animated: true) |
| | | NotificationCenter.default.post(name: Refresh_ListenSchedule_Noti, object: nil) |
| | | break |
| | |
| | | CommonAlertView.show(content: "未完成全部答题,确认退出吗?") {[weak self] () in |
| | | guard let weakSelf = self else { return } |
| | | for vc in weakSelf.navigationController?.viewControllers ?? []{ |
| | | if vc.isKind(of: HomeListenVC.self){ |
| | | if vc.isKind(of: HomeListenV2VC.self){ |
| | | weakSelf.navigationController?.popToViewController(vc, animated: true) |
| | | NotificationCenter.default.post(name: Refresh_ListenSchedule_Noti, object: nil) |
| | | break |
| | |
| | | }).disposed(by: weakSelf.disposeBag) |
| | | } |
| | | for vc in weakSelf.navigationController?.viewControllers ?? []{ |
| | | if vc.isKind(of: HomeListenVC.self){ |
| | | if vc.isKind(of: HomeListenV2VC.self){ |
| | | weakSelf.navigationController?.popToViewController(vc, animated: true) |
| | | NotificationCenter.default.post(name: Refresh_ListenSchedule_Noti, object: nil) |
| | | break |
| | |
| | | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { |
| | | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_CardItemCCell", for: indexPath) as! CardItemCCell |
| | | if data is ListenNewModel{ |
| | | if pages.count > indexPath.row{ |
| | | let model = pages[indexPath.row] |
| | | cell.titleL.text = "\(indexPath.row + 1)" |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return cell |
| | | } |
| | | } |