fix
杨锴
2025-02-18 c5e51c0ec3cbf1016f3bfbd58b0f0a004aaa9900
XQMuse/Root/TreeGroup/View/TreeTeskFirstRuleView.swift
@@ -17,6 +17,7 @@
//            @IBOutlet weak var cons_hei: NSLayoutConstraint!
            @IBOutlet weak var cons_textTop: NSLayoutConstraint!
            private var settingModel = UserDefaultSettingViewModel.getSetting()
    private var clickClouse:(()->Void)?
            override func awakeFromNib() {
                        super.awakeFromNib()
@@ -27,9 +28,11 @@
                        view_container.jq_cornerRadius = 14
            }
            static func show(title:String,content:String,textAlignment:NSTextAlignment,height:Double,textTopOffset:Double){
    @discardableResult
    static func show(title:String,content:String,textAlignment:NSTextAlignment,height:Double,textTopOffset:Double,clickClouse: (()->Void)? = nil)->TreeTeskFirstRuleView{
                        let ruleView = TreeTeskFirstRuleView.jq_loadNibView()
                        ruleView.frame = sceneDelegate?.window?.frame ?? .zero
        ruleView.clickClouse = clickClouse
                        ruleView.label_title.text = title
                        ruleView.label_content.attributedText = AttributedStringbuilder.build().add(string:content, withFont: .systemFont(ofSize: 14), withColor: .black.withAlphaComponent(0.59), lineSpace: 7).mutableAttributedString
@@ -43,6 +46,7 @@
                                    ruleView.alpha = 1.0
                                    ruleView.view_container.transform = .init(scaleX: 1.0, y: 1.0)
                        }
        return ruleView
            }
            @IBAction func completeAction(_ sender: UIButton) {
@@ -54,10 +58,21 @@
                                    self.settingModel?.userFirstOpenTreeTask = false
                                    UserDefaultSettingViewModel.saveSetting(self.settingModel!)
                        }
        clickClouse?()
            }
            override func layoutSubviews() {
                        super.layoutSubviews()
        btn_complete.localGradientColor(cornerRadius: 20,bounds: CGRect(x: 0, y: 0, width: JQ_ScreenW - 85 * 2, height: 40))
            }
    func setEnableBtn(state:Bool){
        btn_complete.isEnabled = state
        if state{
            btn_complete.localGradientColor(cornerRadius: 20,bounds: CGRect(x: 0, y: 0, width: JQ_ScreenW - 85 * 2, height: 40))
        }else{
            btn_complete.jq_gradientColor(colorArr: [UIColor(hexString: "#CDCDCD")!.cgColor,UIColor(hexString: "#CDCDCD")!.cgColor], cornerRadius: 20, startPoint: CGPoint(x: 0, y: 0), endPoint: CGPoint(x: 1, y: 0), bounds: CGRect(x: 0, y: 0, width: JQ_ScreenW - 85 * 2, height: 40),clear: true)
        }
    }
//            override func layoutSubviews() {
//                        super.layoutSubviews()
        /*btn_complete.localGradientColor(cornerRadius: 20,bounds: CGRect(x: 0, y: 0, width: JQ_ScreenW - 85 * 2, height: 40))*/
//            }
}