From 9c16d3614d9b88c637f967518a329f239fcd3aaf Mon Sep 17 00:00:00 2001
From: lss <316519258@qq.com>
Date: 星期五, 12 六月 2020 09:22:04 +0800
Subject: [PATCH] 2020.06.12

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/VerificationCodeControl.cs |   41 ++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 40 insertions(+), 1 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/VerificationCodeControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/VerificationCodeControl.cs
index 02e26e4..0d4f93f 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/VerificationCodeControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/CompoundControls/VerificationCodeControl.cs
@@ -20,9 +20,13 @@
         /// </summary>
         public Action<string> FinishInputEvent = null;
         /// <summary>
-        /// 瀵嗙爜杈撳叆绫诲瀷
+        /// 瀵嗙爜杈撳叆绫诲瀷(瀹冧笌NumberInputOnly涓嶅叡瀛�)
         /// </summary>
         public bool SecureTextEntry = false;
+        /// <summary>
+        /// 杈撳叆閿洏鎸囧畾涓烘暟瀛楅敭鐩�(榛樿涓簍rue,瀹冧笌SecureTextEntry涓嶅叡瀛�)
+        /// </summary>
+        public bool NumberInputOnly = true;
         /// <summary>
         /// 楠岃瘉鐮侀暱搴�
         /// </summary>
@@ -74,6 +78,10 @@
                 {
                     txtCode.SecureTextEntry = true;
                 }
+                else if (NumberInputOnly == true)
+                {
+                    txtCode.IsNumberKeyboardType = true;
+                }
                 txtCode.Name = i.ToString();
                 txtCode.TextAlignment = TextAlignment.Center;
                 frameCode.AddChidren(txtCode);
@@ -107,6 +115,21 @@
             }
             if (e.Focus == true)
             {
+                //鑷姩鐒︾偣閫夋嫨鍓嶉潰鐨勭┖鐧戒綅缃�
+                //if (txtCode.Text == string.Empty)
+                //{
+                //    for (int i = 0; i < this.CodeLenth; i++)
+                //    {
+                //        if (dicCodeControls[i].Text == string.Empty)
+                //        {
+                //            dicCodeControls[i].FoucsChanged -= this.TxtCode_FoucsChangedEvent;
+                //            dicCodeControls[i].Parent.BorderColor = UserCenterColor.Current.TextFrameSelectColor;
+                //            dicCodeControls[i].Foucs = true;
+                //            dicCodeControls[i].FoucsChanged += this.TxtCode_FoucsChangedEvent;
+                //            return;
+                //        }
+                //    }
+                //}
                 txtCode.Parent.BorderColor = UserCenterColor.Current.TextFrameSelectColor;
             }
             else
@@ -209,6 +232,22 @@
             }
         }
 
+        /// <summary>
+        /// 娓呯┖杈撳叆鐨勫��
+        /// </summary>
+        public void ClearInputValue()
+        {
+            foreach (var inputText in this.dicCodeControls.Values)
+            {
+                //鍏堢Щ闄や簨浠�
+                inputText.TextChangeEventHandler -= TxtCode_TextChangeEvent;
+                //璧嬪��
+                inputText.Text = string.Empty;
+                inputText.TextChangeEventHandler += TxtCode_TextChangeEvent;
+            }
+            dicCodeControls[0].Foucs = true;
+        }
+
         #endregion
 
         #region 鈻� 鎺т欢鎽ф瘉___________________________

--
Gitblit v1.8.0