杨锴
2024-10-24 e821bea13d9f20905bba3972c4e9c4964994db5d
XQMuse/Root/Plans/PlanGuideVC.swift
@@ -11,6 +11,8 @@
let PlantGuideQuit_Noti = Notification.Name.init(rawValue: "PlantGuideQuit_Noti")
let backgroundVoiceUrl = "https://xqgwzh.obs.cn-south-1.myhuaweicloud.com/question/backgroundQuestion.wav"
class PlanGuideVC: BaseVC {
            @IBOutlet weak var view_gradient: UIView!
@@ -19,6 +21,8 @@
            @IBOutlet weak var label_subTitle: UILabel!
            @IBOutlet weak var label_info: UILabel!
            @IBOutlet weak var btn_custom: UIButton!
    private let masterPlayer = AudioPlayer.getSharedInstance()
            private lazy var player:AVPlayer = {
                        let bgPath = Bundle.main.url(forResource: "bg_movie", withExtension: "mov")
@@ -35,7 +39,7 @@
            override func viewDidLoad() {
                        super.viewDidLoad()
        masterPlayer.playBGMAt(firstPlayIndex: 0, model: MeditationModel(backgroundUrl:backgroundVoiceUrl), delegate: self)
            }
            override func viewWillAppear(_ animated: Bool) {
@@ -84,11 +88,11 @@
                                    self?.player.play()
                        }
                        NotificationCenter.default.rx.notification(PlantGuideQuit_Noti).take(until: self.rx.deallocated).subscribe(onNext: {data in
                        NotificationCenter.default.rx.notification(PlantGuideQuit_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self]data in
                                    if data.object as? Bool == true{
                                    }
                                    self.dismiss(animated: true)
                                    self?.dismiss(animated: true)
                        }).disposed(by: disposeBag)
            }
@@ -101,13 +105,13 @@
            }
            @IBAction func customAction(_ sender: UIButton) {
                        PlanGuidePromptView.show { type in
                        PlanGuidePromptView.show {[weak self] type in
                                    switch type {
                                                case .seeOther:
                                                            let vc = PlanGuide_1_VC()
                                                            self.jq_push(vc: vc)
                                                            self?.jq_push(vc: vc)
                                                case .toSeting:
                                                            self.dismiss(animated: true) {
                                                            self?.dismiss(animated: true) {
                                                                        let vc = BackgroundVoiceVC()
                                                                        vc.hidesBottomBarWhenPushed = true
                                                                        JQ_currentNavigationController().pushViewController(vc)
@@ -115,4 +119,15 @@
                                    }
                        }
            }
    deinit{
        masterPlayer.clean()
    }
}
extension PlanGuideVC:PayMusicDelegate{
    func playState(_ state: PlayMusicState) {
    }
}