From 2004d0578480d12cd69c4d42d414ffd11828d0f1 Mon Sep 17 00:00:00 2001 From: 杨锴 <841720330@qq.com> Date: 星期四, 31 十月 2024 20:18:47 +0800 Subject: [PATCH] fix bug --- XQMuse/Root/Other/View/CountdownChooseListView.swift | 56 +++++++++++++++++++++++++++++++++----------------------- 1 files changed, 33 insertions(+), 23 deletions(-) diff --git a/XQMuse/Root/Other/View/CountdownChooseListView.swift b/XQMuse/Root/Other/View/CountdownChooseListView.swift index 80acca1..255602c 100644 --- a/XQMuse/Root/Other/View/CountdownChooseListView.swift +++ b/XQMuse/Root/Other/View/CountdownChooseListView.swift @@ -22,7 +22,7 @@ @IBOutlet weak var cons_bottom: NSLayoutConstraint! @IBOutlet weak var tf_input: UITextField! private var disposeBag = DisposeBag() - private var clouse:((Int)->Void)? + private var clouse:((CountDownStatus)->Void)? private var status:CountDownStatus = .close var numberMinutes = 1 @@ -68,7 +68,7 @@ } - static func show(clouse:@escaping (Int)->Void){ + static func show(clouse:@escaping (CountDownStatus)->Void){ let countdownChooseListView = CountdownChooseListView.jq_loadNibView() countdownChooseListView.clouse = clouse countdownChooseListView.frame = sceneDelegate?.window?.frame ?? .zero @@ -107,7 +107,7 @@ endEditing(true) if case .choose(let v) = status { - clouse?(v) + clouse?(status) } cons_bottom.constant = -JQ_ScreenH @@ -146,30 +146,40 @@ @IBAction func clickAction(_ sender: TapBtn) { endEditing(true) + + for subView in stackView.arrangedSubviews as! [TapBtn]{ if subView.tag == sender.tag{ - for v in subView.subviews{ - if let label = v as? UILabel{ - label.textColor = UIColor(hexString: "#8AAE65") - switch label.text { - case "关闭倒计时": - numberMinutes = -1 - status = .close - case "自定义","分钟": - numberMinutes = self.tf_input.text!.int ?? 1 - status = .choose(numberMinutes) - default: - numberMinutes = label.text?.jq_filterNum().int ?? 0 - self.tf_input.text = numberMinutes.string - status = .choose(numberMinutes) - } - } + var text:String? + for v in subView.subviews{ + if let label = v as? UILabel{ + label.textColor = UIColor(hexString: "#8AAE65") + text = label.text + break + } + } - if let image = v as? UIImageView{ - image.image = UIImage(named: "icon_choose_small_s") - } - } + for v in subView.subviews{ + if let image = v as? UIImageView{ + image.image = UIImage(named: "icon_choose_small_s") + break + } + } + + + switch text! { + case "关闭倒计时": + numberMinutes = -1 + status = .close + case "自定义": + numberMinutes = self.tf_input.text!.int ?? 1 + status = .choose(numberMinutes) + default: + numberMinutes = text!.jq_filterNum().int ?? 0 + tf_input.text = numberMinutes.string + status = .choose(numberMinutes) + } }else{ for v in subView.subviews{ if let label = v as? UILabel{ -- Gitblit v1.7.1