fix
无故事王国
2024-06-18 c1862d736587c9a5c10a368dabaeb72be2df4bcb
DolphinEnglishLearnStudent/Moudle/Home/Listen/CCell/ListenFight_lesson_3_CCell.swift
@@ -14,7 +14,9 @@
            @IBOutlet weak var view_container: UIView!
            @IBOutlet weak var btn_play: UIButton!
            @IBOutlet weak var btn_playing: UIButton!
            @IBOutlet weak var view_playHandle: UIView!
            @IBOutlet weak var img_playing: UIImageView!
            private var model:Listen1SubModel!
            private var playAtClouse:((IndexPath)->Void)?
            var indexPath:IndexPath!
@@ -28,15 +30,21 @@
            func setModel(_ model:Listen1SubModel,isplaying:Bool){
                        self.model = model
                        self.btn_play.alpha = (isplaying ? 0:1)
                        self.btn_playing.alpha = (isplaying ? 0:1)
                        self.img_playing.alpha = (isplaying ? 1:0)
            }
            func palyVoiceAt(_ clouse:@escaping(IndexPath)->Void){
                        self.playAtClouse = clouse
            }
            func canClick(_ state:Bool){
                        btn_play.isEnabled = state
                        view_playHandle.backgroundColor = state == true ? UIColor(hexString: "#41A2EB") : .gray
            }
            @IBAction func playAction(_ sender: Any) {
                        VoicePlayer.share().playerAt(url: model.correct)
                        playAtClouse?(indexPath)
            }
}