From cd1029a11d96f55337430cec97b7d4cd510f5d5f Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期四, 17 十二月 2020 15:09:38 +0800 Subject: [PATCH] 2020-12-17 1.成员管理UI还原度修改。2.增加右键删除。3.增加无区域功能管理。 --- HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs | 318 ++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 233 insertions(+), 85 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs index 01125ba..50d6980 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockSettingsPageBLL.cs @@ -44,48 +44,19 @@ unlockOptionView.Visible = false; refreshAction(); }; - Action action1 = () => { + Action action1 = () => + { if (!btnUnprotectedBg.IsSelected) { //1:楠岃瘉鎸囩汗 if (UserInfo.Current.appUnlockType.Contains("3")) { - TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); - TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => - { - if (e == TouchIDUtils.TouchIDState.NotSupport) - { - MainPage.Log("KK:褰撳墠璁惧涓嶆敮鎸乀ouchID楠岃瘉,璇疯緭鍏ュ瘑鐮佹潵楠岃瘉"); - } - else if (e == TouchIDUtils.TouchIDState.Success) - { - MainPage.Log("KK:TouchID楠岃瘉鎴愬姛"); - action(); - } - else if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout) - { - MainPage.Log("KK:鐢ㄦ埛閫夋嫨鎵嬪姩杈撳叆瀵嗙爜"); - if (UserInfo.Current.appUnlockType.Contains("1")) - { - var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, action); - MainPage.BasePageView.AddChidren(page); - page.LoadPage("4"); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - else if (UserInfo.Current.appUnlockType.Contains("1")) - { - var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, action); - MainPage.BasePageView.AddChidren(page); - page.LoadPage("4"); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - } - }; + TouchIDVerification_TurnOffUnlock(action); } else if (UserInfo.Current.appUnlockType.Contains("4")) { //Face ID楠岃瘉 - // + FaceIDVerification_TurnOffUnlock(action); } else if (UserInfo.Current.appUnlockType.Contains("1")) { @@ -319,64 +290,14 @@ { btnFingerprintUnlockSwtichIcon.MouseUpEventHandler = (sender, e1) => { - Action fingerAction = () => { - TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); - }; - new AppUnlockPage().LoadGesturePage("5",fingerAction); - - TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); - - TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => - { - if (e == TouchIDUtils.TouchIDState.Success) - { - var result = btnFingerprintUnlockSwtichIcon.IsSelected = !btnFingerprintUnlockSwtichIcon.IsSelected; - if (result) - { - if (!UserInfo.Current.appUnlockType.Contains("3")) - { - UserInfo.Current.appUnlockType.Add("3"); - UserInfo.Current.SaveUserInfo(); - } - } - else - { - if (UserInfo.Current.appUnlockType.Contains("3")) - { - UserInfo.Current.appUnlockType.Remove("3"); - UserInfo.Current.SaveUserInfo(); - } - } - //MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 1); - MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); - } - else// if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout) - { - if (UserInfo.Current.appUnlockType.Contains("1")) - { - var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, refreshAction); - MainPage.BasePageView.AddChidren(page); - page.LoadPage("5"); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - else if (UserInfo.Current.appUnlockType.Contains("2")) - { - var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, refreshAction); - MainPage.BasePageView.AddChidren(page); - page.LoadPage("5"); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - } - }; + TouchIDVerification_SwtichOnOff(); }; } if (sFaceID) { btnFaceIdUnlockSwtichIcon.MouseUpEventHandler = (sender, e1) => { - //btnFaceIdUnlockSwtichIcon.IsSelected = !btnFaceIdUnlockSwtichIcon.IsSelected; - if (!btnFaceIdUnlockSwtichIcon.IsSelected) - { } + FaceIDVerification_SwtichOnOff(); }; } } @@ -396,5 +317,232 @@ return true; } + /// <summary> + /// 闈㈠ID楠岃瘉寮圭獥 + /// </summary> + /// <param name="successAction"></param> + /// <param name="goToVerifyPasswordAction"></param> + void FaceIDVerification_Show(Action successAction, Action goToVerifyPasswordAction) + { + //鎻愮ず鏁板瓧瀵嗙爜楠岃瘉杩樻槸缁樺埗鎵嬪娍楠岃瘉 + string verificationTitleString = GetVerificationTitleString(); + + TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.VerifyFaceID)); + TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => + { + if (e == TouchIDUtils.TouchIDState.Success) + { + MainPage.Log("KK:FaceID楠岃瘉鎴愬姛"); + successAction?.Invoke(); + } + else if (e == TouchIDUtils.TouchIDState.NotSupport) + { + MainPage.Log("KK:褰撳墠璁惧涓嶆敮鎸丗aceID楠岃瘉,璇疯緭鍏ュ瘑鐮佹潵楠岃瘉"); + goToVerifyPasswordAction(); + } + else if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout) + { + MainPage.Log("KK:鐢ㄦ埛閫夋嫨鎵嬪姩杈撳叆瀵嗙爜"); + goToVerifyPasswordAction(); + } + }; + } + + /// <summary> + /// 闈㈠ID寮�鍚拰鍏抽棴 + /// </summary> + /// <param name="successAction">楠岃瘉鎴愬姛浜嬩欢</param> + void FaceIDVerification_SwtichOnOff() + { + //4:闈㈠ID + string faceIDUnlockType = "4"; + //6:闈㈠ID寮�鍏� + string optionType = "6"; + //鎴愬姛浜嬩欢 + Action successAction = () => + { + var result = btnFaceIdUnlockSwtichIcon.IsSelected = !btnFaceIdUnlockSwtichIcon.IsSelected; + if (result) + { + if (!UserInfo.Current.appUnlockType.Contains(faceIDUnlockType)) + { + UserInfo.Current.appUnlockType.Add(faceIDUnlockType); + UserInfo.Current.SaveUserInfo(); + } + } + else + { + if (UserInfo.Current.appUnlockType.Contains(faceIDUnlockType)) + { + UserInfo.Current.appUnlockType.Remove(faceIDUnlockType); + UserInfo.Current.SaveUserInfo(); + } + } + }; + + //璺宠浆鏁板瓧瀵嗙爜鎴栬�呮墜鍔垮瘑鐮侀獙璇侀〉闈� + Action goToVerifyPasswordAction = () => + { + //鍏抽棴瑙i攣楠岃瘉 + GotogoToVerifyPasswordPage(optionType, successAction); + }; + + FaceIDVerification_Show(successAction, goToVerifyPasswordAction); + + } + + /// <summary> + /// FaceID楠岃瘉 鍏抽棴瑙i攣璁剧疆 + /// </summary> + /// <param name="action">楠岃瘉鎴愬姛浜嬩欢</param> + void FaceIDVerification_TurnOffUnlock(Action successAction) + { + //璋冩暣鏁板瓧瀵嗙爜鎴栬�呮墜鍔垮瘑鐮侀獙璇侀〉闈� + Action goToVerifyPasswordAction = () => + { + //鍏抽棴瑙i攣楠岃瘉 + GotogoToVerifyPasswordPage("4", successAction); + }; + + FaceIDVerification_Show(successAction, goToVerifyPasswordAction); + } + + /// <summary> + /// 鎸囩汗ID缁熶竴寮瑰嚭 + /// </summary> + /// <param name="optionType"></param> + /// <param name="successAction"></param> + /// <param name="goToVerifyPasswordAction"></param> + void TouchIDVerification_Show(Action successAction, Action goToVerifyPasswordAction) + { + //鎻愮ず鏁板瓧瀵嗙爜楠岃瘉杩樻槸缁樺埗鎵嬪娍楠岃瘉 + string verificationTitleString = GetVerificationTitleString(); + + TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); + TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => + { + if (e == TouchIDUtils.TouchIDState.NotSupport) + { + MainPage.Log("KK:褰撳墠璁惧涓嶆敮鎸乀ouchID楠岃瘉,璇疯緭鍏ュ瘑鐮佹潵楠岃瘉"); + goToVerifyPasswordAction?.Invoke(); + } + else if (e == TouchIDUtils.TouchIDState.Success) + { + MainPage.Log("KK:TouchID楠岃瘉鎴愬姛"); + successAction?.Invoke(); + } + else if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout) + { + MainPage.Log("KK:鐢ㄦ埛閫夋嫨鎵嬪姩杈撳叆瀵嗙爜"); + goToVerifyPasswordAction?.Invoke(); + } + + }; + } + + /// <summary> + /// 鎸囩汗ID寮�鍚拰鍏抽棴 5:鎸囩汗ID寮�鍏� + /// </summary> + void TouchIDVerification_SwtichOnOff() + { + //鎸囩汗鍏抽棴鎴愬姛浜嬩欢 鎴愬姛浜嬩欢 + Action successAction = () => + { + var result = btnFingerprintUnlockSwtichIcon.IsSelected = !btnFingerprintUnlockSwtichIcon.IsSelected; + if (result) + { + if (!UserInfo.Current.appUnlockType.Contains("3")) + { + UserInfo.Current.appUnlockType.Add("3"); + UserInfo.Current.SaveUserInfo(); + } + } + else + { + if (UserInfo.Current.appUnlockType.Contains("3")) + { + UserInfo.Current.appUnlockType.Remove("3"); + UserInfo.Current.SaveUserInfo(); + } + } + }; + + //5:鎸囩汗ID寮�鍏� + string optionType = "5"; + //璺宠浆鏁板瓧瀵嗙爜鎴栬�呮墜鍔垮瘑鐮侀獙璇侀〉闈� + Action goToVerifyPasswordAction = () => + { + //5:鎸囩汗ID寮�鍏� + GotogoToVerifyPasswordPage(optionType, successAction); + }; + + + + TouchIDVerification_Show(successAction, goToVerifyPasswordAction); + } + + /// <summary> + /// TouchID楠岃瘉 4:鍏抽棴瑙i攣璁剧疆 + /// </summary> + /// <param name="action">楠岃瘉鎴愬姛浜嬩欢</param> + void TouchIDVerification_TurnOffUnlock(Action successAction) + { + //璺宠浆鏁板瓧瀵嗙爜鎴栬�呮墜鍔垮瘑鐮侀獙璇侀〉闈� + Action goToVerifyPasswordAction = () => + { + //4.鍏抽棴瑙i攣楠岃瘉 + GotogoToVerifyPasswordPage("4", successAction); + }; + + TouchIDVerification_Show(successAction, goToVerifyPasswordAction); + } + + /// <summary> + /// 璺宠浆鎵嬪娍鎴栬�呭瘑鐮侀獙璇佺晫闈� + /// </summary> + /// <param name="optionType">1:璁剧疆瀵嗙爜锛�2:楠岃瘉瀵嗙爜;3:鍏抽棴瀵嗙爜;4:鍏抽棴瑙i攣璁剧疆;5:鎸囩汗ID寮�鍏筹紱6:闈㈠ID寮�鍏�;7:瑙i攣楠岃瘉</param> + /// <param name="successAction"></param> + void GotogoToVerifyPasswordPage(string optionType, Action successAction) + { + if (UserInfo.Current.appUnlockType.Contains("1")) + { + var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, successAction); + 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, successAction); + MainPage.BasePageView.AddChidren(page); + page.LoadPage(optionType); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + } + } + + /// <summary> + /// 鍒ゆ柇鏄惁鏁板瓧楠岃瘉銆佸惁鍒欑粯鍒舵墜鍔块獙璇� + /// </summary> + /// <returns></returns> + bool CheckIfUnlockPassword() + { + return UserInfo.Current.appUnlockType.Contains("1"); + } + + /// <summary> + /// 鍒ゆ柇鏄惁鏁板瓧楠岃瘉銆佸惁鍒欑粯鍒舵墜鍔块獙璇� + /// </summary> + /// <returns></returns> + string GetVerificationTitleString() + { + if (CheckIfUnlockPassword()) + { + return Language.StringByID(StringId.PasswordVerification); + } + else + { + return Language.StringByID(StringId.GestureVerification); + } + } } } \ No newline at end of file -- Gitblit v1.8.0