From 63f7ed967433acee3ae8764c7a077e15c29c41f2 Mon Sep 17 00:00:00 2001
From: 杨锴 <841720330@qq.com>
Date: 星期三, 06 十一月 2024 21:17:19 +0800
Subject: [PATCH] fix bug

---
 XQMuse/Root/Other/View/CountdownChooseListView.swift |   53 ++++++++++++++++++++++++++++++-----------------------
 1 files changed, 30 insertions(+), 23 deletions(-)

diff --git a/XQMuse/Root/Other/View/CountdownChooseListView.swift b/XQMuse/Root/Other/View/CountdownChooseListView.swift
index 255602c..61006b7 100644
--- a/XQMuse/Root/Other/View/CountdownChooseListView.swift
+++ b/XQMuse/Root/Other/View/CountdownChooseListView.swift
@@ -64,6 +64,7 @@
 
 								tf_input.rx.text.orEmpty.subscribe(onNext: {[unowned self] text in
 												self.numberMinutes = text.int ?? 1
+            self.status = .choose(self.numberMinutes)
 								}).disposed(by: disposeBag)
 
 				}
@@ -88,33 +89,39 @@
 								btn_cancel.jq_gradientNibColor(colorArr: [UIColor(hexStr: "#8EA47A").cgColor,UIColor(hexStr: "#AFCA98").cgColor], cornerRadius: 18.5)
 				}
 
-
-				@IBAction func customReduceAction(_ sender: Any) {
-								userCustomer()
-								numberMinutes-=1
-
-								numberMinutes = max(1,numberMinutes)
-								tf_input.text = numberMinutes.string
-				}
-
-				@IBAction func customAddAction(_ sender: Any) {
-								userCustomer()
-								numberMinutes+=1
-								tf_input.text = numberMinutes.string
-				}
-
-				@IBAction func cancelAction(_ sender: UIButton) {
-								endEditing(true)
-
-        if case .choose(let v) = status {
-            clouse?(status)
-        }
-
+    private func closeAni(){
         cons_bottom.constant = -JQ_ScreenH
         UIView.animate(withDuration: 0.4) {
             self.alpha = 0
             self.layoutIfNeeded()
         }
+    }
+
+
+				@IBAction func customReduceAction(_ sender: Any) {
+								userCustomer()
+        var t = tf_input.text?.int ?? 1
+								t = max(1,t)
+        status = .choose(t)
+        tf_input.text = t.string
+				}
+
+				@IBAction func customAddAction(_ sender: Any) {
+								userCustomer()
+        var t = tf_input.text?.int ?? 1
+        t += 1
+        status = .choose(t)
+								tf_input.text = t.string
+				}
+
+    @IBAction func closeAction(_ sender: UIButton) {
+        closeAni()
+    }
+    
+				@IBAction func cancelAction(_ sender: UIButton) {
+								endEditing(true)
+        clouse?(status)
+        closeAni()
 				}
 
 				private func userCustomer(){
@@ -177,7 +184,7 @@
                         status = .choose(numberMinutes)
                     default:
                         numberMinutes = text!.jq_filterNum().int ?? 0
-                        tf_input.text = numberMinutes.string
+//                        tf_input.text = numberMinutes.string
                         status = .choose(numberMinutes)
                 }
 												}else{

--
Gitblit v1.7.1