From 611786df5108dca0bdcff03834cc285cba4b8e61 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 13 十月 2020 16:48:43 +0800
Subject: [PATCH] 2020-10-13-1

---
 HDL_ON/UI/UI0-Public/AppUnlockPage.cs |  106 ++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 77 insertions(+), 29 deletions(-)

diff --git a/HDL_ON/UI/UI0-Public/AppUnlockPage.cs b/HDL_ON/UI/UI0-Public/AppUnlockPage.cs
index 513166e..6602205 100644
--- a/HDL_ON/UI/UI0-Public/AppUnlockPage.cs
+++ b/HDL_ON/UI/UI0-Public/AppUnlockPage.cs
@@ -5,19 +5,27 @@
     /// <summary>
 	/// app瑙i攣鐣岄潰
 	/// </summary>
-    public static class AppUnlockPage
+    public class AppUnlockPage
     {
-        static DateTime unlockTime = DateTime.MinValue;
-        static void LoadOption()
+        DateTime unlockTime = DateTime.MinValue;
+        void LoadOption()
         {
-           
-            Action action = () => {
+            if (MainPage.LoginUser == null)
+            {
+                return;
+            }
+            Action action = () =>
+            {
                 unlockTime = DateTime.Now;
             };
             //1:楠岃瘉鎸囩汗
             if (MainPage.LoginUser.appUnlockType.Contains("3"))
             {
-                LoadGesturePage();
+                Action fAction = () =>
+                {
+                    LoadOption();
+                };
+                LoadGesturePage("7", fAction);
                 TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint));
                 TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) =>
                 {
@@ -25,60 +33,94 @@
                     {
                         MainPage.Log("KK:TouchID楠岃瘉鎴愬姛");
                         unlockTime = DateTime.Now;
-                        MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1);
+                        //MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1);
+                        MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
                     }
                     else
                     {
                         ///灏嗛獙璇佹寚绾圭殑椤甸潰绉婚櫎
-                        MainPage.BasePageView.RemoveAt( MainPage.BasePageView.ChildrenCount - 1);
+                        //MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1);
+                        MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
 
                         if (MainPage.LoginUser.appUnlockType.Contains("1"))
                         {
                             var page = new AppUnlockPasswordPage(MainPage.LoginUser.appUnlockPasswrod, action);
                             MainPage.BasePageView.AddChidren(page);
                             page.LoadPage("7");
-                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                            //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                         }
-                        else if (MainPage.LoginUser.appUnlockType.Contains("1"))
+                        else if (MainPage.LoginUser.appUnlockType.Contains("2"))
                         {
                             var page = new AppUnlockGesturePage(MainPage.LoginUser.appUnlockPasswrod, action);
                             MainPage.BasePageView.AddChidren(page);
                             page.LoadPage("7");
-                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                            //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                         }
                     }
                 };
+                return;
             }
             else if (MainPage.LoginUser.appUnlockType.Contains("4"))
             {
                 //Face ID楠岃瘉
                 //
+                return;
             }
             else if (MainPage.LoginUser.appUnlockType.Contains("1"))
             {
                 var page = new AppUnlockPasswordPage(MainPage.LoginUser.appUnlockPasswrod, action);
                 MainPage.BasePageView.AddChidren(page);
                 page.LoadPage("7");
-                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                return;
             }
             else if (MainPage.LoginUser.appUnlockType.Contains("2"))
             {
                 var page = new AppUnlockGesturePage(MainPage.LoginUser.appUnlockPasswrod, action);
                 MainPage.BasePageView.AddChidren(page);
                 page.LoadPage("7");
-                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                return;
             }
+#if __ANDROID__
+            new System.Threading.Thread(() =>
+            {
+                int i = 0;
+                while (i > 1)
+                {
+                    MainPage.Log($"鍊掕鏃讹細{i} sec");
+                    System.Threading.Thread.Sleep(1000);
+                }
+                Application.RunOnMainThread(() =>
+                {
+                    MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                });
+            })
+            { IsBackground = true }.Start();
+#else
+            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+#endif
+
         }
 
-        public static void LoadPage()
+        public void LoadPage()
         {
             LoadOption();
         }
-        static void LoadGesturePage()
+
+        /// <summary>
+        /// 鍔犺浇鎸囩汗楠岃瘉鐣岄潰
+        /// </summary>
+        public void LoadGesturePage(string optionType, Action fingerAction)
         {
-            if (unlockTime.AddSeconds(60) > DateTime.Now || MainPage.LoginUser.appUnlockPasswrod == "" || MainPage.LoginUser.appUnlockPage.Count == 0)
+            //Dialog dialog = new Dialog();
+
+            if (optionType == "7")
             {
-                return;
+                if (unlockTime.AddSeconds(60) > DateTime.Now || MainPage.LoginUser.appUnlockPasswrod == "" || MainPage.LoginUser.appUnlockPage.Count == 0)
+                {
+                    return;
+                }
             }
             var bodyView = new FrameLayout()
             {
@@ -87,8 +129,8 @@
             MainPage.BasePageView.AddChidren(bodyView);
             MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
 
-
-            bodyView.AddChidren(new Button() {
+            bodyView.AddChidren(new Button()
+            {
                 Height = Application.GetRealHeight(64),
                 BackgroundColor = CSS.CSS_Color.BackgroundColor,
             });
@@ -113,8 +155,9 @@
             };
             bodyView.AddChidren(btnFingerIcon);
 
-            btnFingerIcon.MouseUpEventHandler = (sender, e) => {
-                LoadOption();
+            btnFingerIcon.MouseUpEventHandler = (sender, e) =>
+            {
+                fingerAction();
             };
 
             var btnOtherVerify = new Button()
@@ -128,29 +171,34 @@
             };
             bodyView.AddChidren(btnOtherVerify);
 
-            btnOtherVerify.MouseUpEventHandler = (sender, e) => {
-                ///灏嗛獙璇佹寚绾圭殑椤甸潰绉婚櫎
-                MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1);
-
-                Action action = () => {
+            btnOtherVerify.MouseUpEventHandler = (sender, e) =>
+            {
+              
+                Action action = () =>
+                {
                     unlockTime = DateTime.Now;
                 };
                 if (MainPage.LoginUser.appUnlockType.Contains("1"))
                 {
                     var page = new AppUnlockPasswordPage(MainPage.LoginUser.appUnlockPasswrod, action);
                     MainPage.BasePageView.AddChidren(page);
-                    page.LoadPage("7");
+                    page.LoadPage(optionType);
                     MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                 }
                 else if (MainPage.LoginUser.appUnlockType.Contains("2"))
                 {
                     var page = new AppUnlockGesturePage(MainPage.LoginUser.appUnlockPasswrod, action);
                     MainPage.BasePageView.AddChidren(page);
-                    page.LoadPage("7");
+                    page.LoadPage(optionType);
                     MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                 }
+                ///灏嗛獙璇佹寚绾圭殑椤甸潰绉婚櫎
+                //MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1);
+                MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent();
             };
 
+            //dialog.Show();
+            Console.WriteLine("-0987654321");
         }
     }
-}
+}
\ No newline at end of file

--
Gitblit v1.8.0