无故事王国
2025-08-10 9d8138cb1690c4c1990535d0507eb17cdbe497f9
DolphinEnglishLearnStudent/Moudle/Home/Listen/VC/HomeListenFight_lesson_5_VC.swift
@@ -20,6 +20,7 @@
    private var voicePlayer = VoicePlayer.share()
    private var isListen:Bool = false
    private var handleClouse:(()->Void)?
    private var jumpFormRest:Bool = false //重新答题
    private lazy var collectionView:UICollectionView = {
        let flowLayout = UICollectionViewFlowLayout()
@@ -125,6 +126,7 @@
    override func setRx() {
        NotificationCenter.default.rx.notification(ResetLession_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self]_ in
            self?.jumpFormRest = true
            self?.restore()
            self?.viewDidLoad()
        }).disposed(by: disposeBag)
@@ -183,7 +185,14 @@
        DispatchQueue.main.asyncAfter(deadline: .now()+1.0) {
            //自动播放第一条
            tempArray.first?.playingAction()
            if self.jumpFormRest{
                if self.page == 0{
                    tempArray.first?.playingAction()
                }
                self.jumpFormRest.toggle()
            }else{
                tempArray.first?.playingAction()
            }
        }
        stackView.addArrangedSubviews(tempArray)
@@ -274,6 +283,12 @@
                                    break
                                }
                            }
                            //全部答完
                            if self.stackView.subviews.filter({$0.alpha == 0}).count == 4{
                                self.voicePlayer.playerEnd()
                                NotificationCenter.default.post(name: NextLession_Noti, object: nil)
                            }
                        }
                    }