| | |
| | | // @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() |
| | |
| | | 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 |
| | |
| | | ruleView.alpha = 1.0 |
| | | ruleView.view_container.transform = .init(scaleX: 1.0, y: 1.0) |
| | | } |
| | | return ruleView |
| | | } |
| | | |
| | | @IBAction func completeAction(_ sender: UIButton) { |
| | |
| | | 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))*/ |
| | | // } |
| | | } |