wxr
2020-08-11 2bec9c838d2d688025698de8ec1de401ffd7dd1f
HDL_ON/UI/UI0-Public/AppUnlockPage.cs
@@ -5,18 +5,24 @@
    /// <summary>
   /// app解锁界面
   /// </summary>
    public  class AppUnlockPage
    public class AppUnlockPage
    {
         DateTime unlockTime = DateTime.MinValue;
         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"))
            {
                Action fAction = () => {
                Action fAction = () =>
                {
                    LoadOption();
                };
                LoadGesturePage("7", fAction);
@@ -27,52 +33,77 @@
                    {
                        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("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  void LoadPage()
        public void LoadPage()
        {
            LoadOption();
        }
@@ -80,8 +111,10 @@
        /// <summary>
        /// 加载指纹验证界面
        /// </summary>
        public void LoadGesturePage(string optionType,Action fingerAction)
        public void LoadGesturePage(string optionType, Action fingerAction)
        {
            //Dialog dialog = new Dialog();
            if (optionType == "7")
            {
                if (unlockTime.AddSeconds(60) > DateTime.Now || MainPage.LoginUser.appUnlockPasswrod == "" || MainPage.LoginUser.appUnlockPage.Count == 0)
@@ -96,7 +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,
            });
@@ -121,7 +155,8 @@
            };
            bodyView.AddChidren(btnFingerIcon);
            btnFingerIcon.MouseUpEventHandler = (sender, e) => {
            btnFingerIcon.MouseUpEventHandler = (sender, e) =>
            {
                fingerAction();
            };
@@ -136,11 +171,11 @@
            };
            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"))
@@ -157,8 +192,13 @@
                    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");
        }
    }
}
}