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/CommonBase/Form/PswGestureSecirityForm.cs |   47 ++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 40 insertions(+), 7 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/GesturePswSecirityForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/PswGestureSecirityForm.cs
similarity index 74%
rename from ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/GesturePswSecirityForm.cs
rename to ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/PswGestureSecirityForm.cs
index 66e5f5b..21e0727 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/GesturePswSecirityForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/PswGestureSecirityForm.cs
@@ -7,7 +7,7 @@
     /// <summary>
     /// 鎵嬪娍瀵嗙爜楠岃瘉鐣岄潰
     /// </summary>
-    public class GesturePswSecirityForm : DialogCommonForm
+    public class PswGestureSecirityForm : DialogCommonForm
     {
         #region 鈻� 鍙橀噺澹版槑___________________________
 
@@ -43,11 +43,44 @@
             frameBack.Width = Application.GetRealWidth(965);
             frameBack.Height = Application.GetRealHeight(1486);
             frameBack.BackgroundColor = UserCenterColor.Current.White;
-            frameBack.Radius = (uint)Application.GetMinRealAverage(6);
+            frameBack.Radius = 6;
             bodyFrameLayout.AddChidren(frameBack);
 
-
-
+            //鎵嬪娍楠岃瘉鎺т欢
+            var gestureControl = new PswGestureInputControl(i_GestureText);
+            gestureControl.Y = Application.GetRealHeight(69);
+            frameBack.AddChidren(gestureControl);
+            gestureControl.InitControl();
+            //娣诲姞鍏抽棴鎸夐挳
+            var btnClose = gestureControl.AddCloseButton();
+            btnClose.ButtonClickEvent += (sender, e) =>
+            {
+                this.CloseForm();
+            };
+            gestureControl.FinishInputEvent += (Password, pswLeng) =>
+            {
+                if (UserCenterResourse.Option.GestureAuthentication != Password)
+                {
+                    UserCenterResourse.Option.PasswordGestureInputCount--;
+                    if (UserCenterResourse.Option.PasswordGestureInputCount <= 0)
+                    {
+                        //绠$悊鍛樿韩浠介獙璇佸け璐�,璇烽噸鏂扮櫥褰�
+                        string msg2 = Language.StringByID(R.MyInternationalizationString.uCheckAdministratorFailAndReload);
+                        this.ShowMassage(ShowMsgType.Tip, msg2);
+                        UserCenterLogic.ReLoginAgain(Common.Config.Instance.Account);
+                        return;
+                    }
+                    //瀵嗙爜閿欒锛岃閲嶆柊杈撳叆
+                    gestureControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.uOldPsswordIsError));
+                    return;
+                }
+                //閲嶇疆鍓╀綑瀵嗙爜娆℃暟
+                UserCenterResourse.Option.ResetPasswordCount();
+                //鐣岄潰鍏抽棴
+                this.CloseForm();
+                SuccessAction?.Invoke();
+                SuccessAction = null;
+            };
 
             //Touch ID寮�閿�
             var btnTouch = new NormalClickButton(frameBack.Width / 2, Application.GetRealHeight(127));
@@ -90,13 +123,13 @@
                         //瀵嗙爜楠岃瘉
                         if (string.IsNullOrEmpty(UserCenterResourse.Option.PswAuthentication) == false)
                         {
-                            var form = new SecondaryPswSecurityForm();
+                            var form = new PswSecondarySecurityForm();
                             this.AddFromAndRemoveNowForm(form, i_TouchText, i_PasswordText, i_GestureText, SuccessAction);
                         }
                         //鎵嬪娍楠岃瘉
                         else if (string.IsNullOrEmpty(UserCenterResourse.Option.GestureAuthentication) == false)
                         {
-                            var form = new GesturePswSecirityForm();
+                            var form = new PswGestureSecirityForm();
                             this.AddFromAndRemoveNowForm(form, i_TouchText, i_PasswordText, i_GestureText, SuccessAction);
                         }
                         else
@@ -124,7 +157,7 @@
             }
             btnPsw.ButtonClickEvent += (sender, e) =>
             {
-                var form = new SecondaryPswSecurityForm();
+                var form = new PswSecondarySecurityForm();
                 this.AddFromAndRemoveNowForm(form, i_TouchText, i_PasswordText, i_GestureText, SuccessAction);
             };
         }

--
Gitblit v1.8.0