From 9c8baf7e7e1169ebdf7d5f7ed33ab29dd5fcbf18 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期一, 14 十二月 2020 17:45:17 +0800
Subject: [PATCH] 2020-12-14 1.解锁设置问题修复,增加面容ID验证。2.错误码对接增加。

---
 HDL_ON/UI/UI0-Public/AppUnlockPage.cs |  228 +++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 190 insertions(+), 38 deletions(-)

diff --git a/HDL_ON/UI/UI0-Public/AppUnlockPage.cs b/HDL_ON/UI/UI0-Public/AppUnlockPage.cs
index 4edda15..64d416a 100644
--- a/HDL_ON/UI/UI0-Public/AppUnlockPage.cs
+++ b/HDL_ON/UI/UI0-Public/AppUnlockPage.cs
@@ -10,7 +10,7 @@
         void LoadOption()
         {
             //2020-12-12 鏈櫥褰曟垨鑰匒PP鏈惎鍔ㄩ兘杩斿洖锛岃В鍐抽棯閫�闂
-            if ( UserInfo.Current == null || !UserInfo.Current.IsLogin || MainPage.BasePageView == null)
+            if (UserInfo.Current == null || !UserInfo.Current.IsLogin || MainPage.BasePageView == null)
             {
                 return;
             }
@@ -21,46 +21,13 @@
             //1:楠岃瘉鎸囩汗
             if (UserInfo.Current.appUnlockType.Contains("3"))
             {
-                Action fAction = () =>
-                {
-                    LoadOption();
-                };
-                LoadGesturePage("7", fAction);
-                TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint));
-                TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) =>
-                {
-                    if (e == TouchIDUtils.TouchIDState.Success)
-                    {
-                        MainPage.Log("KK:TouchID楠岃瘉鎴愬姛");
-                        UserInfo.Current.unlockTime = DateTime.Now;
-                        MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
-                    }
-                    else
-                    {
-                        ///灏嗛獙璇佹寚绾圭殑椤甸潰绉婚櫎
-                        MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
-                        if (UserInfo.Current.appUnlockType.Contains("1"))
-                        {
-                            var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, action);
-                            MainPage.BasePageView.AddChidren(page);
-                            page.LoadPage("7");
-                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-                        }
-                        else if (UserInfo.Current.appUnlockType.Contains("2"))
-                        {
-                            var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, action);
-                            MainPage.BasePageView.AddChidren(page);
-                            page.LoadPage("7");
-                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-                        }
-
-                    }
-                };
+                TouchIDVerification();
             }
             else if (UserInfo.Current.appUnlockType.Contains("4"))
             {
                 //Face ID楠岃瘉
                 //2020-12-11 寰呭鍔犻潰瀹瑰け璐ラ獙璇侀〉闈紝涓嶇劧浼氬鑷撮攣灞忓姞瀵嗘棤鏁�
+                FaceIDVerification();
             }
             else if (UserInfo.Current.appUnlockType.Contains("1"))
             {
@@ -120,6 +87,57 @@
         }
 
         /// <summary>
+        /// 鎸囩汗楠岃瘉
+        /// </summary>
+        void TouchIDVerification()
+        {
+            //楠岃瘉鎴愬姛Action
+            Action successAction = () =>
+            {
+                UserInfo.Current.unlockTime = DateTime.Now;
+            };
+
+            //寮瑰嚭鎸囩汗楠岃瘉瀵硅瘽妗�
+            Action fingerAction = () =>
+            {
+                TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint));
+            };
+            //鍔犺浇UI椤甸潰
+            LoadGesturePage("7", fingerAction);
+
+            TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint));
+            TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) =>
+            {
+                if (e == TouchIDUtils.TouchIDState.Success)
+                {
+                    MainPage.Log("KK:TouchID楠岃瘉鎴愬姛");
+                    UserInfo.Current.unlockTime = DateTime.Now;
+                    MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
+                }
+                else
+                {
+                    ///灏嗛獙璇佹寚绾圭殑椤甸潰绉婚櫎
+                    MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
+                    if (UserInfo.Current.appUnlockType.Contains("1"))
+                    {
+                        var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, successAction);
+                        MainPage.BasePageView.AddChidren(page);
+                        page.LoadPage("7");
+                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                    }
+                    else if (UserInfo.Current.appUnlockType.Contains("2"))
+                    {
+                        var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, successAction);
+                        MainPage.BasePageView.AddChidren(page);
+                        page.LoadPage("7");
+                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                    }
+
+                }
+            };
+        }
+
+        /// <summary>
         /// 鍔犺浇鎸囩汗楠岃瘉鐣岄潰
         /// </summary>
         public void LoadGesturePage(string optionType, Action fingerAction)
@@ -152,7 +170,7 @@
                 Gravity = Gravity.CenterHorizontal,
                 Width = Application.GetRealWidth(102),
                 Height = Application.GetRealWidth(102),
-                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/FingerIconRed.png",
+                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/FingerIconBlue.png",
             };
             bodyView.AddChidren(btnFingerIcon);
 
@@ -200,7 +218,141 @@
             MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
 
             //dialog.Show();
-            Console.WriteLine("-0987654321");
+            //Console.WriteLine("-0987654321");
         }
+
+        /// <summary>
+        /// 闈㈠ID楠岃瘉
+        /// </summary>
+        void FaceIDVerification()
+        {
+            //楠岃瘉鎴愬姛Action
+            Action successAction = () =>
+            {
+                UserInfo.Current.unlockTime = DateTime.Now;
+            };
+
+            //寮瑰嚭鎸囩汗楠岃瘉瀵硅瘽妗�
+            Action faceIDAction = () =>
+            {
+                TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.VerifyFaceID));
+            };
+            //鍔犺浇UI椤甸潰
+            LoadFaceIDGesturePage("7", faceIDAction);
+
+            TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.VerifyFaceID));
+            TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) =>
+            {
+                if (e == TouchIDUtils.TouchIDState.Success)
+                {
+                    MainPage.Log("KK:TouchID楠岃瘉鎴愬姛");
+                    UserInfo.Current.unlockTime = DateTime.Now;
+                    MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
+                }
+                else
+                {
+                    ///灏嗛獙璇佹寚绾圭殑椤甸潰绉婚櫎
+                    MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
+                    if (UserInfo.Current.appUnlockType.Contains("1"))
+                    {
+                        var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, successAction);
+                        MainPage.BasePageView.AddChidren(page);
+                        page.LoadPage("7");
+                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                    }
+                    else if (UserInfo.Current.appUnlockType.Contains("2"))
+                    {
+                        var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, successAction);
+                        MainPage.BasePageView.AddChidren(page);
+                        page.LoadPage("7");
+                        MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                    }
+
+                }
+            };
+        }
+
+        /// <summary>
+        /// 鍔犺浇闈㈠ID楠岃瘉鐣岄潰
+        /// </summary>
+        public void LoadFaceIDGesturePage(string optionType, Action faceIDAction)
+        {
+            var bodyView = new FrameLayout()
+            {
+                BackgroundColor = CSS.CSS_Color.MainBackgroundColor
+            };
+            MainPage.BasePageView.AddChidren(bodyView);
+
+            bodyView.AddChidren(new Button()
+            {
+                Height = Application.GetRealHeight(64),
+                BackgroundColor = CSS.CSS_Color.BackgroundColor,
+            });
+
+            bodyView.AddChidren(new Button()
+            {
+                Y = Application.GetRealHeight(196),
+                Height = Application.GetRealHeight(42),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS.CSS_Color.FirstLevelTitleColor,
+                TextSize = CSS.CSS_FontSize.SubheadingFontSize,
+                TextID = StringId.VerifyFaceID,
+            });
+
+            var btnFaceIdIcon = new Button()
+            {
+                Y = Application.GetRealHeight(260),
+                Gravity = Gravity.CenterHorizontal,
+                Width = Application.GetRealWidth(102),
+                Height = Application.GetRealWidth(102),
+                UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/FaceIdIconBig.png",
+            };
+            bodyView.AddChidren(btnFaceIdIcon);
+
+            btnFaceIdIcon.MouseUpEventHandler = (sender, e) =>
+            {
+                faceIDAction();
+            };
+
+            var btnOtherVerify = new Button()
+            {
+                Y = Application.GetRealHeight(527),
+                Height = Application.GetRealHeight(40),
+                TextAlignment = TextAlignment.Center,
+                TextColor = CSS.CSS_Color.MainColor,
+                TextSize = CSS.CSS_FontSize.TextFontSize,
+                TextID = UserInfo.Current.appUnlockType.Contains("1") ? StringId.VerifyDigitalPassword : StringId.VerifyGesturePassword,
+            };
+            bodyView.AddChidren(btnOtherVerify);
+
+            btnOtherVerify.MouseUpEventHandler = (sender, e) =>
+            {
+                ///灏嗛獙璇侀潰瀹笽D鐨勯〉闈㈢Щ闄�
+                MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
+                Action action = () =>
+                {
+                    UserInfo.Current.unlockTime = DateTime.Now;
+                };
+                if (UserInfo.Current.appUnlockType.Contains("1"))
+                {
+                    var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, action);
+                    MainPage.BasePageView.AddChidren(page);
+                    page.LoadPage(optionType);
+                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                }
+                else if (UserInfo.Current.appUnlockType.Contains("2"))
+                {
+                    var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, action);
+                    MainPage.BasePageView.AddChidren(page);
+                    page.LoadPage(optionType);
+                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                }
+
+            };
+
+            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+
+        }
+
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0