杨锴
2024-11-05 0fb7413df54760ac6bd15b90b738e0706de1629e
XQMuse/Root/Home/VC/BackgroundVoiceVC.swift
@@ -20,6 +20,7 @@
            private var playAtIndex:IndexPath?
            private var tempPlayer:AVPlayer?
            private var isPlaying:Bool = false
    private var needPopRoot = false
            override func viewDidDisappear(_ animated: Bool) {
                        super.viewDidDisappear(animated)
@@ -34,6 +35,14 @@
            override func viewDidLoad() {
        super.viewDidLoad()
                        title = "心泉·疗愈"
        yy_popBlock = { [weak self] in
            if self?.needPopRoot ?? false{
                NotificationCenter.default.post(name: PlantGuideQuit_Noti, object: nil, userInfo: nil)
            }else{
                self?.navigationController?.popViewController(animated: true)
            }
        }
                        slider_voice.isEnabled = false
                        slider_voice.value = Float(settingModel?.volume ?? 0.5)
@@ -96,7 +105,11 @@
                                    UserDefaultSettingViewModel.saveSetting(settingModel!)
                                    audioPlayer.playSceneAt(items[index.row].audioFile)
                                    alertSuccess(msg: "设置成功")
            needPopRoot = true
                                    NotificationCenter.default.post(name: SetBGMSuccess_Noti, object: items[index.row])
            DispatchQueue.main.asyncAfter(delay: 0.6) {
                self.navigationController?.popViewController()
            }
                        }
            }