fix
无故事王国
2024-06-26 46acca18a3d1744e1930f0bac7509a2a5959df1b
DolphinEnglishLearnStudent/Other/UIView/CommonAlertView.swift
@@ -16,6 +16,7 @@
            @IBOutlet weak var cons_btnClose: NSLayoutConstraint!
            
            private var clouse:(()->Void)?
            private var cancelClouse:(()->Void)?
            override func awakeFromNib() {
                        super.awakeFromNib()
                        self.alpha = 0
@@ -47,12 +48,35 @@
                        }
            }
            static func showSimple(content:String,completeTitle:String? = nil,cancelClouse:@escaping (()->Void)){
                        let commonAlertView = CommonAlertView.jq_loadNibView()
                        sceneDelegate?.window?.addSubview(commonAlertView)
                        commonAlertView.label_content.text = content
                        commonAlertView.label_content.numberOfLines = 0
                        commonAlertView.label_content.textAlignment = .center
                        commonAlertView.cancelClouse = cancelClouse
                        commonAlertView.frame = sceneDelegate?.window?.frame ?? .zero
                        commonAlertView.btn_complete.isHidden = true
                        commonAlertView.cons_btnClose.constant = 219
                        commonAlertView.btn_close.backgroundColor = Config.ThemeColor
                        commonAlertView.btn_close.jq_borderWidth = 0
                        commonAlertView.btn_close.setTitleColor(.white, for: .normal)
                        UIView.animate(withDuration: 0.4) {
                                    commonAlertView.alpha = 1
                                    commonAlertView.view_container.transform = .init(translationX: 1.0, y: 1.0)
                                    commonAlertView.layoutIfNeeded()
                        }
            }
            @IBAction func closeAction(_ sender: UIButton) {
                        UIView.animate(withDuration: 0.4) {
                                    self.alpha = 0
                                    self.view_container.transform = .init(scaleX: 0.1, y: 0.1)
                        } completion: { _ in
                                    self.removeFromSuperview()
                                    self.cancelClouse?()
                        }
            }