fix
无故事王国
2024-06-19 ee4954eb4dc84e0a6c0a784da717f9cc648b106b
DolphinEnglishLearnStudent/Moudle/Home/Listen/VC/HomeListenGame_1_VC.swift
@@ -53,6 +53,7 @@
                        let collection = UICollectionView(frame: .zero, collectionViewLayout: flowLayout)
                        collection.contentInset = UIEdgeInsets(top: 0, left: 35, bottom: 0, right: 35)
                        collection.register(UINib(nibName: "ListenFight_Game_CCell", bundle: nil), forCellWithReuseIdentifier: "_ListenFight_Game_CCell")
                        collection.isScrollEnabled = false
                        return collection
            }()
@@ -94,10 +95,6 @@
    override func viewDidLoad() {
        super.viewDidLoad()
                        #if DEBUG
                        listen1Model?.data?.time = 60
                        #endif
                        if  listen1Model != nil{
                                    times = listen1Model?.data?.time ?? 10
@@ -197,15 +194,17 @@
                                    totalCount += 1
                                    rootViewModel.errorNum += 1
                                    label_class.text = "\(totalCount)"
                                    //答题完成
                                    if self.answerSet.count == 0{completeQuestion()}
                        }
                        //答题完成
                        if self.answerSet.count == 0{
                                    timer?.invalidate()
                                    completeQuestion()
                        }
            }
            private func answerQuestion(){
                        view.layoutIfNeeded()
                        view.isUserInteractionEnabled = false
                        guard let row = viewModel.selectIndex.value?.row else { alertError(msg: "请选择");return  }
                        var answerType:Fight_lessonType = .none
@@ -221,7 +220,6 @@
                                    case .success:
                                                viewModel.answerType.accept(.success)
                                                collectionView.reloadData()
                                                rootViewModel.correctNum += 1
                                                if let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "_ListenFight_Game_CCell", for: viewModel.selectIndex.value!) as? ListenFight_Game_CCell{
                                                            let newRect = cell.contentView.convert(cell.bounds, from: self.collectionView)
                                                            let x = abs(newRect.origin.x) + self.collectionView.contentInset.left + 5
@@ -238,9 +236,9 @@
                                                                                    self.voicePlayer.playerAt(url: self.currentAnswer?.correct)
                                                                                    self.timer?.fireDate = .distantFuture
                                                                                    //答题完成
                                                                                    if self.answerSet.count == 0{
                                                                                                self.completeQuestion()
                                                                                    }
//                                                                                    if self.answerSet.count == 0{
//                                                                                                self.completeQuestion()
//                                                                                    }
                                                                        }
                                                            }
                                                }
@@ -298,6 +296,7 @@
extension HomeListenGame_1_VC:VoicePlayerDelegate{
            func playComplete() {
                        view.isUserInteractionEnabled = true
                        view_studyHandleView.resetView()
                        if viewModel.answerType.value == .success{
@@ -317,9 +316,14 @@
                                                self.timer?.fireDate = .distantPast
                                    }
                        }
                        //答题完成
                        if self.answerSet.count == 0{completeQuestion()}
            }
            
            func playing() {
                        view.isUserInteractionEnabled = false
                        view_studyHandleView.playing()
            }