| | |
| | | /// <summary> |
| | | /// app解锁界面 |
| | | /// </summary> |
| | | public static class AppUnlockPage |
| | | public class AppUnlockPage |
| | | { |
| | | static DateTime unlockTime = DateTime.MinValue; |
| | | static void LoadOption() |
| | | void LoadOption() |
| | | { |
| | | |
| | | Action action = () => { |
| | | unlockTime = DateTime.Now; |
| | | if (MainPage.LoginUser == null) |
| | | { |
| | | return; |
| | | } |
| | | Action action = () => |
| | | { |
| | | OnAppConfig.Instance.unlockTime = DateTime.Now; |
| | | }; |
| | | //1:验证指纹 |
| | | if (MainPage.LoginUser.appUnlockType.Contains("3")) |
| | | if (OnAppConfig.Instance.appUnlockType.Contains("3")) |
| | | { |
| | | LoadGesturePage(); |
| | | 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验证成功"); |
| | | unlockTime = DateTime.Now; |
| | | MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1); |
| | | OnAppConfig.Instance.unlockTime = DateTime.Now; |
| | | MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | } |
| | | else |
| | | { |
| | | ///将验证指纹的页面移除 |
| | | MainPage.BasePageView.RemoveAt( MainPage.BasePageView.ChildrenCount - 1); |
| | | MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | if (OnAppConfig.Instance.appUnlockType.Contains("1")) |
| | | { |
| | | var page = new AppUnlockPasswordPage(OnAppConfig.Instance.appUnlockPasswrod, action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage("7"); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | else if (OnAppConfig.Instance.appUnlockType.Contains("2")) |
| | | { |
| | | var page = new AppUnlockGesturePage(OnAppConfig.Instance.appUnlockPasswrod, action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage("7"); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | else if (MainPage.LoginUser.appUnlockType.Contains("1")) |
| | | { |
| | | var page = new AppUnlockGesturePage(MainPage.LoginUser.appUnlockPasswrod, action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage("7"); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | else if (MainPage.LoginUser.appUnlockType.Contains("4")) |
| | | else if (OnAppConfig.Instance.appUnlockType.Contains("4")) |
| | | { |
| | | //Face ID验证 |
| | | // |
| | | } |
| | | else if (MainPage.LoginUser.appUnlockType.Contains("1")) |
| | | else if (OnAppConfig.Instance.appUnlockType.Contains("1")) |
| | | { |
| | | var page = new AppUnlockPasswordPage(MainPage.LoginUser.appUnlockPasswrod, action); |
| | | var page = new AppUnlockPasswordPage(OnAppConfig.Instance.appUnlockPasswrod, action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage("7"); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | else if (MainPage.LoginUser.appUnlockType.Contains("2")) |
| | | else if (OnAppConfig.Instance.appUnlockType.Contains("2")) |
| | | { |
| | | var page = new AppUnlockGesturePage(MainPage.LoginUser.appUnlockPasswrod, action); |
| | | var page = new AppUnlockGesturePage(OnAppConfig.Instance.appUnlockPasswrod, action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage("7"); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | #if __ANDROID__ |
| | | new System.Threading.Thread(() => |
| | | { |
| | | int i = 0; |
| | | while (i > 1) |
| | | { |
| | | MainPage.Log($"倒计时:{i} sec"); |
| | | System.Threading.Thread.Sleep(1000); |
| | | i++; |
| | | } |
| | | 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 (OnAppConfig.Instance.unlockTime.AddSeconds(60) > DateTime.Now || OnAppConfig.Instance.appUnlockPasswrod == "" || OnAppConfig.Instance.appUnlockPage.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | } |
| | | var bodyView = new FrameLayout() |
| | | { |
| | | BackgroundColor = CSS.CSS_Color.MainBackgroundColor |
| | | }; |
| | | 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, |
| | | }); |
| | |
| | | }; |
| | | bodyView.AddChidren(btnFingerIcon); |
| | | |
| | | btnFingerIcon.MouseUpEventHandler = (sender, e) => { |
| | | LoadOption(); |
| | | btnFingerIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | fingerAction(); |
| | | }; |
| | | |
| | | var btnOtherVerify = new Button() |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS.CSS_Color.MainColor, |
| | | TextSize = CSS.CSS_FontSize.TextFontSize, |
| | | TextID = MainPage.LoginUser.appUnlockType.Contains("1") ? StringId.VerifyDigitalPassword : StringId.VerifyGesturePassword |
| | | TextID = OnAppConfig.Instance.appUnlockType.Contains("1") ? StringId.VerifyDigitalPassword : StringId.VerifyGesturePassword, |
| | | }; |
| | | bodyView.AddChidren(btnOtherVerify); |
| | | |
| | | btnOtherVerify.MouseUpEventHandler = (sender, e) => { |
| | | btnOtherVerify.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | ///将验证指纹的页面移除 |
| | | MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1); |
| | | |
| | | Action action = () => { |
| | | unlockTime = DateTime.Now; |
| | | MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | Action action = () => |
| | | { |
| | | OnAppConfig.Instance.unlockTime = DateTime.Now; |
| | | }; |
| | | if (MainPage.LoginUser.appUnlockType.Contains("1")) |
| | | if (OnAppConfig.Instance.appUnlockType.Contains("1")) |
| | | { |
| | | var page = new AppUnlockPasswordPage(MainPage.LoginUser.appUnlockPasswrod, action); |
| | | var page = new AppUnlockPasswordPage(OnAppConfig.Instance.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")) |
| | | else if (OnAppConfig.Instance.appUnlockType.Contains("2")) |
| | | { |
| | | var page = new AppUnlockGesturePage(MainPage.LoginUser.appUnlockPasswrod, action); |
| | | var page = new AppUnlockGesturePage(OnAppConfig.Instance.appUnlockPasswrod, action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage("7"); |
| | | page.LoadPage(optionType); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | |
| | | }; |
| | | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | //dialog.Show(); |
| | | Console.WriteLine("-0987654321"); |
| | | } |
| | | } |
| | | } |
| | | } |