| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 面容ID开启和关闭 |
| | | /// 面容ID验证弹窗 |
| | | /// </summary> |
| | | void FaceIDVerification_SwtichOnOff() |
| | | /// <param name="successAction"></param> |
| | | /// <param name="goToVerifyPasswordAction"></param> |
| | | void FaceIDVerification_Show(Action successAction, Action goToVerifyPasswordAction) |
| | | { |
| | | //6:面容ID开关 |
| | | string optionType = "6"; |
| | | //4:面容ID |
| | | string faceIDUnlockType = "4"; |
| | | //提示数字密码验证还是绘制手势验证 |
| | | string verificationTitleString = GetVerificationTitleString(); |
| | | |
| | | //成功事件 |
| | | 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 fingerAction = () => |
| | | { |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.VerifyFaceID)); |
| | | }; |
| | | new AppUnlockPage().LoadFaceIDGesturePage(optionType, fingerAction, successAction); |
| | | |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.VerifyFaceID)); |
| | | |
| | | TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => |
| | | { |
| | | if (e == TouchIDUtils.TouchIDState.Success) |
| | | { |
| | | successAction?.Invoke(); |
| | | MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | } |
| | | else// if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout) |
| | | { |
| | | ///将验证面容ID的页面移除 |
| | | MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | |
| | | GotogoToVerifyPasswordPage(optionType, refreshAction); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// FaceID验证 关闭解锁设置 |
| | | /// </summary> |
| | | /// <param name="action">验证成功事件</param> |
| | | void FaceIDVerification_TurnOffUnlock(Action successAction) |
| | | { |
| | | //使用密码验证 |
| | | Action goToVerifyPasswordAction = () => |
| | | { |
| | | //关闭解锁验证 |
| | | GotogoToVerifyPasswordPage("4", successAction); |
| | | }; |
| | | |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.VerifyFaceID)); |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(verificationTitleString, Language.StringByID(StringId.VerifyFaceID)); |
| | | TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => |
| | | { |
| | | if (e == TouchIDUtils.TouchIDState.Success) |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 指纹ID开启和关闭 |
| | | /// 面容ID开启和关闭 |
| | | /// </summary> |
| | | void TouchIDVerification_SwtichOnOff() |
| | | /// <param name="successAction">验证成功事件</param> |
| | | void FaceIDVerification_SwtichOnOff() |
| | | { |
| | | //5:指纹ID开关 |
| | | string optionType = "5"; |
| | | //4:面容ID |
| | | string faceIDUnlockType = "4"; |
| | | //6:面容ID开关 |
| | | string optionType = "6"; |
| | | //成功事件 |
| | | Action successAction = () => |
| | | { |
| | | var result = btnFingerprintUnlockSwtichIcon.IsSelected = !btnFingerprintUnlockSwtichIcon.IsSelected; |
| | | var result = btnFaceIdUnlockSwtichIcon.IsSelected = !btnFaceIdUnlockSwtichIcon.IsSelected; |
| | | if (result) |
| | | { |
| | | if (!UserInfo.Current.appUnlockType.Contains("3")) |
| | | if (!UserInfo.Current.appUnlockType.Contains(faceIDUnlockType)) |
| | | { |
| | | UserInfo.Current.appUnlockType.Add("3"); |
| | | UserInfo.Current.appUnlockType.Add(faceIDUnlockType); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (UserInfo.Current.appUnlockType.Contains("3")) |
| | | if (UserInfo.Current.appUnlockType.Contains(faceIDUnlockType)) |
| | | { |
| | | UserInfo.Current.appUnlockType.Remove("3"); |
| | | UserInfo.Current.appUnlockType.Remove(faceIDUnlockType); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | } |
| | | } |
| | | }; |
| | | |
| | | |
| | | Action fingerAction = () => |
| | | |
| | | //跳转数字密码或者手势密码验证页面 |
| | | Action goToVerifyPasswordAction = () => |
| | | { |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); |
| | | //关闭解锁验证 |
| | | GotogoToVerifyPasswordPage(optionType, successAction); |
| | | }; |
| | | new AppUnlockPage().LoadGesturePage(optionType, fingerAction, successAction); |
| | | |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); |
| | | FaceIDVerification_Show(successAction, goToVerifyPasswordAction); |
| | | |
| | | TouchIDUtils.Instance.OnHDLTouchIDStateBackEvent = (sender1, e) => |
| | | { |
| | | if (e == TouchIDUtils.TouchIDState.Success) |
| | | { |
| | | successAction?.Invoke(); |
| | | |
| | | MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | } |
| | | else// if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout) |
| | | { |
| | | ///将验证指纹ID的页面移除 |
| | | MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | |
| | | GotogoToVerifyPasswordPage(optionType, refreshAction); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// TouchID验证 关闭解锁设置 |
| | | /// FaceID验证 关闭解锁设置 |
| | | /// </summary> |
| | | /// <param name="action">验证成功事件</param> |
| | | void TouchIDVerification_TurnOffUnlock(Action successAction) |
| | | void FaceIDVerification_TurnOffUnlock(Action successAction) |
| | | { |
| | | //使用密码验证 |
| | | //调整数字密码或者手势密码验证页面 |
| | | Action goToVerifyPasswordAction = () => |
| | | { |
| | | //关闭解锁验证 |
| | | GotogoToVerifyPasswordPage("4", successAction); |
| | | }; |
| | | |
| | | TouchIDUtils.Instance.showTouchIDWithDescribe(null, Language.StringByID(StringId.PleaseVerifyTheFingerprint)); |
| | | 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) |
| | |
| | | } |
| | | |
| | | /// <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:关闭解锁设置 |
| | | /// </summary> |
| | | /// <param name="action">验证成功事件</param> |
| | | void TouchIDVerification_TurnOffUnlock(Action successAction) |
| | | { |
| | | //跳转数字密码或者手势密码验证页面 |
| | | Action goToVerifyPasswordAction = () => |
| | | { |
| | | //4.关闭解锁验证 |
| | | GotogoToVerifyPasswordPage("4", successAction); |
| | | }; |
| | | |
| | | TouchIDVerification_Show(successAction, goToVerifyPasswordAction); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 跳转手势或者密码验证界面 |
| | | /// </summary> |
| | | /// <param name="optionType">1:设置密码;2:验证密码;3:关闭密码;4:关闭解锁设置;5:指纹ID开关;6:面容ID开关;7:解锁验证</param> |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | | } |