From c7698e163e43cea9e7f8ee45f8e3f91c9265cca4 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 04 十一月 2019 19:11:41 +0800
Subject: [PATCH] 合并了全部的代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs |   77 ++++++++++++++++++--------------------
 1 files changed, 37 insertions(+), 40 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs
index 4486590..074ea87 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorSecondaryPasswordForm.cs
@@ -49,53 +49,41 @@
             //娓呯┖bodyFrame
             this.ClearBodyFrame();
 
-            var btnMsg = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(49), false);
-            btnMsg.Y = Application.GetRealHeight(311);
-            btnMsg.TextAlignment = TextAlignment.Center;
-            btnMsg.TextSize = 12;
-            bodyFrameLayout.AddChidren(btnMsg);
-            if (formMode == FormMode.A鏂板缓瀵嗙爜
-                || formMode == FormMode.A楠岃瘉鍓嶅洖瀵嗙爜)
+            string title = string.Empty;
+            if (formMode == FormMode.A鏂板缓瀵嗙爜)
+            {
+                //璇疯緭鍏ユ柊瀵嗙爜
+                title = Language.StringByID(R.MyInternationalizationString.uPleaseInputNewPassword);
+            }
+            else if (formMode == FormMode.A楠岃瘉鍓嶅洖瀵嗙爜)
             {
                 //璇疯緭鍏ュ瘑鐮�
-                btnMsg.TextID = R.MyInternationalizationString.uPleaseInputPsw;
+                title = Language.StringByID(R.MyInternationalizationString.uPleaseInputPsw);
             }
             else if (formMode == FormMode.A纭鏂板缓瀵嗙爜
                 || formMode == FormMode.A纭淇敼瀵嗙爜)
             {
                 //璇峰啀娆$‘璁ゅ瘑鐮�
-                btnMsg.TextID = R.MyInternationalizationString.uPleaseConfirmPswAgain;
+                title = Language.StringByID(R.MyInternationalizationString.uPleaseConfirmPswAgain);
             }
             else if (formMode == FormMode.A淇敼瀵嗙爜)
             {
                 //淇敼瀵嗙爜锛岃杈撳叆鏂板瘑鐮�
-                btnMsg.TextID = R.MyInternationalizationString.uEditorPswPleaseInputNewPsw;
+                title = Language.StringByID(R.MyInternationalizationString.uEditorPswPleaseInputNewPsw);
             }
 
-            //閿欒淇℃伅
-            var msgControl = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(58), false);
-            msgControl.Y = Application.GetRealHeight(660);
-            msgControl.TextAlignment = TextAlignment.Center;
-            msgControl.TextColor = 0xfff75858;
-            bodyFrameLayout.AddChidren(msgControl);
-
-            //鍒濆鍖栭獙璇佺爜鎺т欢
-            var btnCodeControl = new VerificationCodeControl(4);
-            btnCodeControl.SecureTextEntry = true;
-            btnCodeControl.Y = Application.GetRealHeight(464);
-            bodyFrameLayout.AddChidren(btnCodeControl);
-            btnCodeControl.InitControl();;
-            btnCodeControl.TxtCodeChangeEvent += (sender, e) =>
-            {
-                if (msgControl.Visible == true)
-                {
-                    msgControl.Visible = false;
-                }
-            };
-            btnCodeControl.FinishInputEvent += (value) =>
+            //瀵嗙爜鎺т欢
+            var pswControl = new PswNumberInputControl(title);
+            //鍙樻洿鏁板瓧琛ㄧ洏鑳屾櫙鑹�
+            pswControl.NumberIconBackColor = UserCenterColor.Current.White;
+            pswControl.Y = Application.GetRealHeight(104);
+            pswControl.Gravity = Gravity.CenterHorizontal;
+            bodyFrameLayout.AddChidren(pswControl);
+            pswControl.InitControl();
+            pswControl.FinishInputEvent += (password) =>
             {
                 //鏍¢獙瀵嗙爜
-                this.DoAdjustPssword(value, msgControl);
+                this.DoAdjustPssword(password, pswControl);
             };
 
             if (formMode == FormMode.A楠岃瘉鍓嶅洖瀵嗙爜)
@@ -131,8 +119,8 @@
         /// 鏍¢獙瀵嗙爜
         /// </summary>
         /// <param name="i_Psw"></param>
-        /// <param name="msgControl"></param>
-        private void DoAdjustPssword(string i_Psw, NormalViewControl msgControl)
+        /// <param name="pswControl"></param>
+        private void DoAdjustPssword(string i_Psw, PswNumberInputControl pswControl)
         {
             if (formMode == FormMode.A鏂板缓瀵嗙爜)
             {
@@ -146,8 +134,7 @@
                 if (this.firstPssword != i_Psw)
                 {
                     //纭瀵嗙爜閿欒锛岃閲嶆柊璁剧疆
-                    msgControl.Visible = true;
-                    msgControl.TextID = R.MyInternationalizationString.SecondPswNotEqual2;
+                    pswControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.SecondPswNotEqual2));
                     return;
                 }
                 UserCenterResourse.Option.PswAuthentication = i_Psw;
@@ -159,11 +146,22 @@
             {
                 if (UserCenterResourse.Option.PswAuthentication != i_Psw)
                 {
+                    UserCenterResourse.Option.PasswordInputCount--;
+                    if (UserCenterResourse.Option.PasswordInputCount <= 0)
+                    {
+                        //绠$悊鍛樿韩浠介獙璇佸け璐�,璇烽噸鏂扮櫥褰�
+                        string msg2 = Language.StringByID(R.MyInternationalizationString.uCheckAdministratorFailAndReload);
+                        this.ShowMassage(ShowMsgType.Tip, msg2);
+                        UserCenterLogic.ReLoginAgain(Common.Config.Instance.Account);
+                        return;
+                    }
                     //瀵嗙爜閿欒锛岃閲嶆柊杈撳叆
-                    msgControl.Visible = true;
-                    msgControl.TextID = R.MyInternationalizationString.uOldPsswordIsError;
+                    pswControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.uOldPsswordIsError));
                     return;
                 }
+                //閲嶇疆鍓╀綑瀵嗙爜娆℃暟
+                UserCenterResourse.Option.ResetPasswordCount();
+
                 formMode = FormMode.A淇敼瀵嗙爜;
                 this.InitMiddleFrame();
             }
@@ -179,8 +177,7 @@
                 if (this.firstPssword != i_Psw)
                 {
                     //纭瀵嗙爜閿欒锛岃閲嶆柊璁剧疆
-                    msgControl.Visible = true;
-                    msgControl.TextID = R.MyInternationalizationString.SecondPswNotEqual2;
+                    pswControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.SecondPswNotEqual2));
                     return;
                 }
                 UserCenterResourse.Option.PswAuthentication = i_Psw;

--
Gitblit v1.8.0