无故事王国
2025-08-10 9d8138cb1690c4c1990535d0507eb17cdbe497f9
DolphinEnglishLearnStudent/Moudle/Home/Listen/VC/HomeListenFightVC.swift
@@ -63,7 +63,7 @@
    var day = BehaviorRelay<Int?>(value: 0)
    //游戏专属,游戏等级
    var gameLevel = BehaviorRelay<Int>(value:0)
    var gameLevel = BehaviorRelay<Int>(value:-1)
    //回答错误数量
    var correctNum:Int = 0{
@@ -367,6 +367,7 @@
    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)
@@ -671,7 +672,7 @@
                    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
@@ -695,7 +696,7 @@
                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
@@ -732,7 +733,7 @@
                    }).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
@@ -1005,33 +1006,35 @@
    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_CardItemCCell", for: indexPath) as! CardItemCCell
        if data is ListenNewModel{
            let model = pages[indexPath.row]
            cell.titleL.text = "\(indexPath.row + 1)"
            if pages.count > indexPath.row{
                let model = pages[indexPath.row]
                cell.titleL.text = "\(indexPath.row + 1)"
            if viewModel.listenType.value == .lesson1{
                if model.filter({$0.status == 2}).count == 4{
                    cell.titleL.textColor = UIColor(hexString: "#52C41A")
                    cell.titleL.jq_borderColor = UIColor(hexString: "#52C41A")
                }else if model.filter({$0.status == 3}).count >= 1 {
                    cell.titleL.textColor = UIColor(hexString: "#FF4D4F")
                    cell.titleL.jq_borderColor = UIColor(hexString: "#52C41A")
                if viewModel.listenType.value == .lesson1{
                    if model.filter({$0.status == 2}).count == 4{
                        cell.titleL.textColor = UIColor(hexString: "#52C41A")
                        cell.titleL.jq_borderColor = UIColor(hexString: "#52C41A")
                    }else if model.filter({$0.status == 3}).count >= 1 {
                        cell.titleL.textColor = UIColor(hexString: "#FF4D4F")
                        cell.titleL.jq_borderColor = UIColor(hexString: "#52C41A")
                    }else{
                        cell.titleL.textColor = .black.withAlphaComponent(0.25)
                        cell.titleL.jq_borderColor = .black.withAlphaComponent(0.25)
                    }
                }else{
                    cell.titleL.textColor = .black.withAlphaComponent(0.25)
                    cell.titleL.jq_borderColor = .black.withAlphaComponent(0.25)
                }
            }else{
                //状态1灰色未答题 2绿色正确 3红色错误
                switch model.first!.status{
                case 1:
                    cell.titleL.textColor = .black.withAlphaComponent(0.25)
                    cell.titleL.jq_borderColor = .black.withAlphaComponent(0.25)
                case 2:
                    cell.titleL.textColor = UIColor(hexString: "#52C41A")
                    cell.titleL.jq_borderColor = UIColor(hexString: "#52C41A")
                case 3:
                    cell.titleL.textColor = UIColor(hexString: "#FF4D4F")
                    cell.titleL.jq_borderColor = UIColor(hexString: "#52C41A")
                default:break
                    //状态1灰色未答题 2绿色正确 3红色错误
                    switch model.first!.status{
                    case 1:
                        cell.titleL.textColor = .black.withAlphaComponent(0.25)
                        cell.titleL.jq_borderColor = .black.withAlphaComponent(0.25)
                    case 2:
                        cell.titleL.textColor = UIColor(hexString: "#52C41A")
                        cell.titleL.jq_borderColor = UIColor(hexString: "#52C41A")
                    case 3:
                        cell.titleL.textColor = UIColor(hexString: "#FF4D4F")
                        cell.titleL.jq_borderColor = UIColor(hexString: "#52C41A")
                    default:break
                    }
                }
            }
        }