From fa6bcb2e9907772480f99205f36ec2a1ce735a22 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 09 一月 2020 14:11:07 +0800
Subject: [PATCH] 合并代码

---
 ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs |  143 ++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 110 insertions(+), 33 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs
index a400080..b438cb5 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/SecondAuthenticationForm.cs
@@ -54,9 +54,7 @@
             btnEffect.TextColor = UserCenterColor.Current.TextGrayColor1;
             rowFinger.AddChidren(btnEffect, ChidrenBindMode.NotBind);
             //寮�鍏虫寜閽�
-            var btnFingerSwicth = rowFinger.AddMostRightEmptyIcon(104, 63);
-            btnFingerSwicth.UnSelectedImagePath = "Item/Switch.png";
-            btnFingerSwicth.SelectedImagePath = "Item/SwitchSelected.png";
+            var btnFingerSwicth = rowFinger.AddMostRightSwitchIcon();
             btnFingerSwicth.IsSelected = UserCenterResourse.Option.FingerprintAuthentication;
             //搴曠嚎
             rowFinger.AddBottomLine();
@@ -92,13 +90,18 @@
             }
 
             //浜屾瀹夊叏楠岃瘉灏嗙敤浜庝笅鍒楁搷浣�
-            var btnTitle = new NormalViewControl(800, 49, true);
+            var btnTitle = new NormalViewControl(800, 50, true);
             btnTitle.X = ControlCommonResourse.XXLeft;
-            btnTitle.Y = frameTop.Bottom + Application.GetRealHeight(35);
+            btnTitle.Y = frameTop.Bottom + Application.GetRealHeight(34);
             btnTitle.TextSize = 12;
             btnTitle.TextColor = UserCenterColor.Current.TextGrayColor3;
             btnTitle.TextID = R.MyInternationalizationString.uSecondarySecurityWillBeUsedForTheFollowingOperations;
             bodyFrameLayout.AddChidren(btnTitle);
+            btnTitle.ButtonClickEvent += (sender, e) =>
+            {
+                //闅愬尶鍔熻兘鐐瑰嚮
+                this.HideOptionClick(btnTitle);
+            };
 
             var frameButtom = new FrameListControl(12);
             frameButtom.Y = btnTitle.Bottom + Application.GetRealHeight(23);
@@ -132,9 +135,7 @@
             btnUnLockByApp.TextColor = UserCenterColor.Current.TextGrayColor1;
             rowLock.AddChidren(btnUnLockByApp, ChidrenBindMode.NotBind);
             //寮�鍏虫寜閽�
-            var btnLockSwicth = rowLock.AddMostRightEmptyIcon(104, 63);
-            btnLockSwicth.UnSelectedImagePath = "Item/Switch.png";
-            btnLockSwicth.SelectedImagePath = "Item/SwitchSelected.png";
+            var btnLockSwicth = rowLock.AddMostRightSwitchIcon();
             //搴曠嚎
             rowLock.AddBottomLine();
             btnLockSwicth.IsSelected = UserCenterResourse.Option.DoorUnLockByRemote;
@@ -159,29 +160,64 @@
                     {
                         //寮�鍚寚绾归獙璇佸け璐ワ紒璇峰墠寰�鎵嬫満{0}璁剧疆寮�鍚寚绾瑰紑閿侀獙璇�
                         string msg = Language.StringByID(R.MyInternationalizationString.uUseFingerprintAuthenticationFailMsg);
-                        if (msg.Contains("{0}") == true)
-                        {
-                            msg = string.Format(msg, "\r\n");
-                        }
+                        msg = msg.Replace("{0}", "\r\n");
                         this.ShowMassage(ShowMsgType.Normal, msg);
                         return;
                     }
+                    //灏員ouch ID鐢ㄤ簬銆孼igBee銆峽0}鏇存敼瀹夐槻璁剧疆鍜屽紑鍚棬閿佹椂浣跨敤
+                    string msg2 = Language.StringByID(R.MyInternationalizationString.uUseFingerprintAuthenticationMsg);
+                    msg2 = msg2.Replace("{0}", "\r\n");
+                    this.ShowMassage(ShowMsgType.Confirm, msg2, () =>
+                    {
+                        //濡傛灉璁剧疆鏈夊畨鍏ㄩ獙璇�,鎯宠淇敼瀹�,蹇呴』鍏堥�氳繃瀹夊叏楠岃瘉
+                        //濡傛灉娌℃湁璁剧疆鏈夊畨鍏ㄩ獙璇�,鍒欐棤闇�楠岃瘉
+                        HdlCheckLogic.Current.CheckSecondarySecurity(
+                            () => { this.DoFingerprintAuthentication(btnFingerSwicth, btnLockSwicth); },//澶勭悊鎸囩汗楠岃瘉
+                            () => { this.DoFingerprintAuthentication(btnFingerSwicth, btnLockSwicth); });//澶勭悊鎸囩汗楠岃瘉
+                    });
                 }
-                //濡傛灉璁剧疆鏈夊畨鍏ㄩ獙璇�,鎯宠淇敼瀹�,蹇呴』鍏堥�氳繃瀹夊叏楠岃瘉
-                //濡傛灉娌℃湁璁剧疆鏈夊畨鍏ㄩ獙璇�,鍒欐棤闇�楠岃瘉
-                HdlCheckLogic.Current.CheckSecondarySecurity(
-                    () => { this.DoFingerprintAuthentication(btnFingerSwicth, btnLockSwicth); },//澶勭悊鎸囩汗楠岃瘉
-                    () => { this.DoFingerprintAuthentication(btnFingerSwicth, btnLockSwicth); });//澶勭悊鎸囩汗楠岃瘉
+                else
+                {
+                    //濡傛灉璁剧疆鏈夊畨鍏ㄩ獙璇�,鎯宠淇敼瀹�,蹇呴』鍏堥�氳繃瀹夊叏楠岃瘉
+                    //濡傛灉娌℃湁璁剧疆鏈夊畨鍏ㄩ獙璇�,鍒欐棤闇�楠岃瘉
+                    HdlCheckLogic.Current.CheckSecondarySecurity(
+                        () => { this.DoFingerprintAuthentication(btnFingerSwicth, btnLockSwicth); },//澶勭悊鎸囩汗楠岃瘉
+                        () => { this.DoFingerprintAuthentication(btnFingerSwicth, btnLockSwicth); });//澶勭悊鎸囩汗楠岃瘉
+                }
             };
             //瀵嗙爜楠岃瘉
             rowPsw.ButtonClickEvent += (sender, e) =>
             {
-                var form = new Password.EditorSecondaryPasswordForm();
-                form.AddForm();
+                //濡傛灉娌℃湁瀵嗙爜楠岃瘉
+                if (string.IsNullOrEmpty(UserCenterResourse.Option.PswAuthentication) == true)
+                {
+                    //濡傛灉璁剧疆鏈夊叾浠栭獙璇佹柟寮�,鍒欓渶瑕侀獙璇�,鍚﹀垯鐩存帴璺宠繃楠岃瘉
+                    HdlCheckLogic.Current.CheckSecondarySecurity(
+                   () => { var form = new Password.EditorSecondaryPasswordForm(); form.AddForm(); },
+                   () => { var form = new Password.EditorSecondaryPasswordForm(); form.AddForm(); });
+                }
+                else
+                {
+                    var form = new Password.EditorSecondaryPasswordForm();
+                    form.AddForm();
+                }
             };
             //鎵嬪娍楠岃瘉
             rowGesture.ButtonClickEvent += (sender, e) =>
             {
+                //濡傛灉娌℃湁鎵嬪娍楠岃瘉
+                if (string.IsNullOrEmpty(UserCenterResourse.Option.GestureAuthentication) == true)
+                {
+                    //濡傛灉璁剧疆鏈夊叾浠栭獙璇佹柟寮�,鍒欓渶瑕侀獙璇�,鍚﹀垯鐩存帴璺宠繃楠岃瘉
+                    HdlCheckLogic.Current.CheckSecondarySecurity(
+                   () => { var form = new Password.EditorGesturePasswordForm(); form.AddForm(); },
+                   () => { var form = new Password.EditorGesturePasswordForm(); form.AddForm(); });
+                }
+                else
+                {
+                    var form = new Password.EditorGesturePasswordForm();
+                    form.AddForm();
+                }
             };
             //杩滅▼寮�閿�
             btnLockSwicth.ButtonClickEvent += (sender, e) =>
@@ -219,19 +255,11 @@
                     this.ShowMassage(ShowMsgType.Normal, msg);
                     return;
                 }
-                //灏員ouch ID鐢ㄤ簬銆孼igBee銆峽0}鏇存敼瀹夐槻璁剧疆鍜屽紑鍚棬閿佹椂浣跨敤
-                string msg2 = Language.StringByID(R.MyInternationalizationString.uUseFingerprintAuthenticationMsg);
-                if (msg2.Contains("{0}") == true)
-                {
-                    msg2 = string.Format(msg2, "\r\n");
-                }
-                this.ShowMassage(ShowMsgType.Confirm, msg2, () =>
-                {
-                    UserCenterResourse.Option.FingerprintAuthentication = !btnFingerSwicth.IsSelected;
-                    UserCenterResourse.Option.Save();
-                    //閲嶆柊鍒锋柊鐣岄潰
-                    this.InitMiddleFrame();
-                });
+
+                UserCenterResourse.Option.FingerprintAuthentication = !btnFingerSwicth.IsSelected;
+                UserCenterResourse.Option.Save();
+                //閲嶆柊鍒锋柊鐣岄潰
+                this.InitMiddleFrame();
             }
             else
             {
@@ -289,10 +317,59 @@
         /// <summary>
         /// 鑷韩鐨勪笂灞傜晫闈㈠叧闂悗,瀹冭嚜韬浜庢渶涓婂眰鏃�,瑙﹀彂鐨勪簨浠�
         /// </summary>
-        public override void FormActionAgainEvent()
+        public override int FormActionAgainEvent()
         {
             //閲嶆柊鍒锋柊鐣岄潰
             this.InitMiddleFrame();
+
+            return 1;
+        }
+
+        #endregion
+
+        #region 鈻� 闅愬尶鍔熻兘___________________________
+
+        /// <summary>
+        /// 鐐瑰嚮鍚堣
+        /// </summary>
+        private int clickCount = 0;
+        /// <summary>
+        /// 鐐瑰嚮鐨勯偅鐬棿鐨勬椂闂�
+        /// </summary>
+        private DateTime clickTime;
+        /// <summary>
+        /// 闅愬尶鍔熻兘
+        /// </summary>
+        private void HideOptionClick(NormalViewControl btnTitle)
+        {
+            if (clickCount == 0)
+            {
+                clickTime = DateTime.Now;
+            }
+            clickCount++;
+            if (clickCount >= 10)
+            {
+                if ((DateTime.Now - clickTime).TotalSeconds > 3)
+                {
+                    clickCount = 0;
+                    return;
+                }
+                btnTitle.CanClick = false;
+                HdlThreadLogic.Current.RunThread(async () =>
+                {
+                    this.ShowProgressBar();
+                    var result = await HdlBackupLogic.Current.LoadHideOption();
+                    this.CloseProgressBar();
+                    if (result == true)
+                    {
+                        this.ShowMassage(ShowMsgType.Tip, "鍒锋柊闅愬尶閰嶇疆鎴愬姛");
+                    }
+                    else
+                    {
+                        this.ShowMassage(ShowMsgType.Tip, "鍒锋柊闅愬尶閰嶇疆澶辫触");
+                    }
+                });
+            }
         }
 
         #endregion

--
Gitblit v1.8.0