| | |
| | | refreshAction = () => |
| | | { |
| | | LoadView_UnlockView(); |
| | | //fingerprintUnlockDiv.Visible = sTouchID && (MainPage.LoginUser.appUnlockType.Contains("1") || MainPage.LoginUser.appUnlockType.Contains("2")); |
| | | //faceIdUnlockDiv.Visible = sFaceID && (MainPage.LoginUser.appUnlockType.Contains("1") || MainPage.LoginUser.appUnlockType.Contains("2")); |
| | | //btnFingerprintUnlockSwtichIcon.IsSelected = MainPage.LoginUser.appUnlockType.Contains("3"); |
| | | //btnFaceIdUnlockSwtichIcon.IsSelected = MainPage.LoginUser.appUnlockType.Contains("4"); |
| | | //fingerprintUnlockDiv.Visible = sTouchID && (UserInfo.Current.appUnlockType.Contains("1") || UserInfo.Current.appUnlockType.Contains("2")); |
| | | //faceIdUnlockDiv.Visible = sFaceID && (UserInfo.Current.appUnlockType.Contains("1") || UserInfo.Current.appUnlockType.Contains("2")); |
| | | //btnFingerprintUnlockSwtichIcon.IsSelected = UserInfo.Current.appUnlockType.Contains("3"); |
| | | //btnFaceIdUnlockSwtichIcon.IsSelected = UserInfo.Current.appUnlockType.Contains("4"); |
| | | }; |
| | | } |
| | | |
| | |
| | | { |
| | | btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true; |
| | | btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = false; |
| | | btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = false; |
| | | #region F3阶段 |
| | | //btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = false; |
| | | btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = false; |
| | | #endregion |
| | | |
| | | btnTipMsg.TextID = StringId.UnprotectedTipMsg; |
| | | btnTipMsg.Visible = true; |
| | | |
| | | MainPage.LoginUser.appUnlockPage = new System.Collections.Generic.List<string>(); |
| | | MainPage.LoginUser.appUnlockType = new System.Collections.Generic.List<string>(); |
| | | MainPage.LoginUser.appUnlockPasswrod = ""; |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | UserInfo.Current.appUnlockPage = new System.Collections.Generic.List<string>(); |
| | | UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>(); |
| | | UserInfo.Current.appUnlockPasswrod = ""; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | unlockOptionView.Visible = false; |
| | | refreshAction(); |
| | | }; |
| | | Action action1 = () => { |
| | | Action action1 = () => |
| | | { |
| | | if (!btnUnprotectedBg.IsSelected) |
| | | { |
| | | //1:验证指纹 |
| | | if (MainPage.LoginUser.appUnlockType.Contains("3")) |
| | | 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:当前设备不支持TouchID验证,请输入密码来验证"); |
| | | } |
| | | 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 (MainPage.LoginUser.appUnlockType.Contains("1")) |
| | | { |
| | | var page = new AppUnlockPasswordPage(MainPage.LoginUser.appUnlockPasswrod, action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage("4"); |
| | | 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("4"); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | } |
| | | }; |
| | | TouchIDVerification_TurnOffUnlock(action); |
| | | } |
| | | else if (MainPage.LoginUser.appUnlockType.Contains("4")) |
| | | else if (UserInfo.Current.appUnlockType.Contains("4")) |
| | | { |
| | | //Face ID验证 |
| | | // |
| | | FaceIDVerification_TurnOffUnlock(action); |
| | | } |
| | | else if (MainPage.LoginUser.appUnlockType.Contains("1")) |
| | | else if (UserInfo.Current.appUnlockType.Contains("1")) |
| | | { |
| | | var page = new AppUnlockPasswordPage(MainPage.LoginUser.appUnlockPasswrod, action); |
| | | var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage("4"); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | else if (MainPage.LoginUser.appUnlockType.Contains("2")) |
| | | else if (UserInfo.Current.appUnlockType.Contains("2")) |
| | | { |
| | | var page = new AppUnlockGesturePage(MainPage.LoginUser.appUnlockPasswrod, action); |
| | | var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage("4"); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | |
| | | } |
| | | }; |
| | | |
| | | if (MainPage.LoginUser.appUnlockPasswrod != "") |
| | | if (UserInfo.Current.appUnlockPasswrod != "") |
| | | { |
| | | new PublicAssmebly().TipMsg(StringId.Tip, StringId.TipTurnOffUnlockingSetting, action1); |
| | | new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.TipTurnOffUnlockingSetting, action1); |
| | | } |
| | | else |
| | | { |
| | |
| | | btnUnprotectedSelectionIcon.MouseUpEventHandler = eventHandler1; |
| | | btnUnprotectedSelectionTip.MouseUpEventHandler = eventHandler1; |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler2 = (sender, e) => |
| | | { |
| | | bool result = !btnStartupBg.IsSelected; |
| | | if (!result) |
| | | { |
| | | //如果启动解锁 不能取消启动解锁 |
| | | if (!CheckIfCanDeselect("1")) return; |
| | | } |
| | | btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = result; |
| | | |
| | | btnTipMsg.Text = Language.StringByID(StringId.AtStartupTipMsg); |
| | | btnTipMsg.Visible = true; |
| | | if (result) |
| | | { |
| | | btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false; |
| | | if (!MainPage.LoginUser.appUnlockPage.Contains("1")) |
| | | if (!UserInfo.Current.appUnlockPage.Contains("1")) |
| | | { |
| | | MainPage.LoginUser.appUnlockPage.Add("1"); |
| | | if (MainPage.LoginUser.appUnlockPasswrod != "") |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | UserInfo.Current.appUnlockPage.Add("1"); |
| | | if (UserInfo.Current.appUnlockPasswrod != "") |
| | | UserInfo.Current.SaveUserInfo(); |
| | | } |
| | | unlockOptionView.Visible = true; |
| | | |
| | | } |
| | | else |
| | | { |
| | | if (MainPage.LoginUser.appUnlockPage.Contains("1")) |
| | | if (UserInfo.Current.appUnlockPage.Contains("1")) |
| | | { |
| | | MainPage.LoginUser.appUnlockPage.Remove("1"); |
| | | UserInfo.Current.appUnlockPage.Remove("1"); |
| | | } |
| | | if (MainPage.LoginUser.appUnlockPage.Count == 0) |
| | | if (UserInfo.Current.appUnlockPage.Count == 0) |
| | | { |
| | | btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true; |
| | | btnTipMsg.TextID = StringId.UnprotectedTipMsg; |
| | | MainPage.LoginUser.appUnlockPasswrod = ""; |
| | | UserInfo.Current.appUnlockPasswrod = ""; |
| | | unlockOptionView.Visible = false; |
| | | refreshAction(); |
| | | } |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | } |
| | | }; |
| | | btnStartupBg.MouseUpEventHandler = eventHandler2; |
| | | btnStartupSelectionIcon.MouseUpEventHandler = eventHandler2; |
| | | btnStartupSelectionTip.MouseUpEventHandler = eventHandler2; |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler3 = (sender, e) => |
| | | { |
| | | bool result = !btnSecurityBg.IsSelected; |
| | | btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = result; |
| | | |
| | | btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg); |
| | | btnTipMsg.Visible = true; |
| | | |
| | | if (result) |
| | | { |
| | | btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false; |
| | | if (!MainPage.LoginUser.appUnlockPage.Contains("2")) |
| | | { |
| | | MainPage.LoginUser.appUnlockPage.Add("2"); |
| | | if (MainPage.LoginUser.appUnlockPasswrod != "") |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | } |
| | | unlockOptionView.Visible = true; |
| | | } |
| | | else |
| | | { |
| | | if (MainPage.LoginUser.appUnlockPage.Contains("2")) |
| | | { |
| | | MainPage.LoginUser.appUnlockPage.Remove("2"); |
| | | } |
| | | if (MainPage.LoginUser.appUnlockPage.Count == 0) |
| | | { |
| | | btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = result; |
| | | btnTipMsg.TextID = StringId.UnprotectedTipMsg; |
| | | MainPage.LoginUser.appUnlockPasswrod = ""; |
| | | unlockOptionView.Visible = false; |
| | | refreshAction(); |
| | | } |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | } |
| | | }; |
| | | btnSecurityBg.MouseUpEventHandler = eventHandler3; |
| | | btnSecuritySelectionIcon.MouseUpEventHandler = eventHandler3; |
| | | btnSecuritySelectionTip.MouseUpEventHandler = eventHandler3; |
| | | |
| | | #region F3阶段 |
| | | //EventHandler<MouseEventArgs> eventHandler3 = (sender, e) => |
| | | //{ |
| | | // bool result = !btnSecurityBg.IsSelected; |
| | | // if (!result) |
| | | // { |
| | | // //如果只剩布防/撤防一种 不能取消布防/撤防 |
| | | // if (!CheckIfCanDeselect("2")) return; |
| | | // } |
| | | // btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = result; |
| | | // btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg); |
| | | // if (result) |
| | | // { |
| | | // btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false; |
| | | // if (!UserInfo.Current.appUnlockPage.Contains("2")) |
| | | // { |
| | | // UserInfo.Current.appUnlockPage.Add("2"); |
| | | // if (UserInfo.Current.appUnlockPasswrod != "") |
| | | // UserInfo.Current.SaveUserInfo(); |
| | | // } |
| | | // unlockOptionView.Visible = true; |
| | | // } |
| | | // else |
| | | // { |
| | | // if (UserInfo.Current.appUnlockPage.Contains("2")) |
| | | // { |
| | | // UserInfo.Current.appUnlockPage.Remove("2"); |
| | | // } |
| | | // if (UserInfo.Current.appUnlockPage.Count == 0) |
| | | // { |
| | | // btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = result; |
| | | // btnTipMsg.TextID = StringId.UnprotectedTipMsg; |
| | | // UserInfo.Current.appUnlockPasswrod = ""; |
| | | // unlockOptionView.Visible = false; |
| | | // refreshAction(); |
| | | // } |
| | | // UserInfo.Current.SaveUserInfo(); |
| | | // } |
| | | //}; |
| | | //btnSecurityBg.MouseUpEventHandler = eventHandler3; |
| | | //btnSecuritySelectionIcon.MouseUpEventHandler = eventHandler3; |
| | | //btnSecuritySelectionTip.MouseUpEventHandler = eventHandler3; |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler4 = (sender, e) => |
| | | { |
| | | bool result = !btnDoorlockBg.IsSelected; |
| | | if (!result) |
| | | { |
| | | //如果只剩远程开锁不能取消远程开锁 |
| | | if (!CheckIfCanDeselect("3")) return; |
| | | } |
| | | |
| | | btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = result; |
| | | |
| | | btnTipMsg.Text = Language.StringByID(StringId.RemoteUnlockingTipMsg); |
| | | btnTipMsg.Visible = true; |
| | | if (result) |
| | | { |
| | | btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false; |
| | | if (!MainPage.LoginUser.appUnlockPage.Contains("3")) |
| | | if (!UserInfo.Current.appUnlockPage.Contains("3")) |
| | | { |
| | | MainPage.LoginUser.appUnlockPage.Add("3"); |
| | | if (MainPage.LoginUser.appUnlockPasswrod != "") |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | UserInfo.Current.appUnlockPage.Add("3"); |
| | | if (UserInfo.Current.appUnlockPasswrod != "") |
| | | UserInfo.Current.SaveUserInfo(); |
| | | } |
| | | unlockOptionView.Visible = true; |
| | | } |
| | | else |
| | | { |
| | | if (MainPage.LoginUser.appUnlockPage.Contains("3")) |
| | | if (UserInfo.Current.appUnlockPage.Contains("3")) |
| | | { |
| | | MainPage.LoginUser.appUnlockPage.Remove("3"); |
| | | UserInfo.Current.appUnlockPage.Remove("3"); |
| | | } |
| | | if (MainPage.LoginUser.appUnlockPage.Count == 0) |
| | | if (UserInfo.Current.appUnlockPage.Count == 0) |
| | | { |
| | | btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true; |
| | | btnTipMsg.TextID = StringId.UnprotectedTipMsg; |
| | | MainPage.LoginUser.appUnlockPasswrod = ""; |
| | | UserInfo.Current.appUnlockPasswrod = ""; |
| | | unlockOptionView.Visible = false; |
| | | refreshAction(); |
| | | } |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | } |
| | | }; |
| | | btnDoorlockBg.MouseUpEventHandler = eventHandler4; |
| | | btnDoorlockSelectionIcon.MouseUpEventHandler = eventHandler4; |
| | | btnDoorlockSelectionTip.MouseUpEventHandler = eventHandler4; |
| | | |
| | | |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | void LoadEvent_InitOptionState() |
| | | { |
| | | if (MainPage.LoginUser.appUnlockPage.Count == 0) |
| | | if (UserInfo.Current.appUnlockPage.Count == 0) |
| | | { |
| | | btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true; |
| | | } |
| | | else |
| | | { |
| | | if (MainPage.LoginUser.appUnlockPage.Contains("1")) |
| | | if (UserInfo.Current.appUnlockPage.Contains("1")) |
| | | { |
| | | btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = true; |
| | | btnTipMsg.Text = Language.StringByID(StringId.AtStartupTipMsg); |
| | | } |
| | | if (MainPage.LoginUser.appUnlockPage.Contains("2")) |
| | | { |
| | | btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = true; |
| | | } |
| | | if (MainPage.LoginUser.appUnlockPage.Contains("3")) |
| | | #region F3阶段 |
| | | //if (UserInfo.Current.appUnlockPage.Contains("2")) |
| | | //{ |
| | | // btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = true; |
| | | // btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg); |
| | | //} |
| | | if (UserInfo.Current.appUnlockPage.Contains("3")) |
| | | { |
| | | btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = true; |
| | | btnTipMsg.Text = Language.StringByID(StringId.RemoteUnlockingTipMsg); |
| | | } |
| | | #endregion |
| | | } |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | void LoadEvet_SkipEventList() |
| | | { |
| | | |
| | | |
| | | btnPasswordUnlockTitle.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new AppUnlockPasswordPage(MainPage.LoginUser.appUnlockPasswrod, refreshAction); |
| | | var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, refreshAction); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(MainPage.LoginUser.appUnlockType.Contains("1") ? "3" : "1"); |
| | | page.LoadPage(UserInfo.Current.appUnlockType.Contains("1") ? "3" : "1"); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | btnResetPasswordTitle.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new AppUnlockPasswordPage(MainPage.LoginUser.appUnlockPasswrod, refreshAction); |
| | | var page = new AppUnlockPasswordPage(UserInfo.Current.appUnlockPasswrod, refreshAction); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage("2"); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | |
| | | |
| | | btnGestureUnlockTitle.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new AppUnlockGesturePage(MainPage.LoginUser.appUnlockPasswrod, refreshAction); |
| | | var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, refreshAction); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(MainPage.LoginUser.appUnlockType.Contains("2") ? "3" : "1"); |
| | | page.LoadPage(UserInfo.Current.appUnlockType.Contains("2") ? "3" : "1"); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | btnResetGestureTitle.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new AppUnlockGesturePage(MainPage.LoginUser.appUnlockPasswrod, refreshAction); |
| | | var page = new AppUnlockGesturePage(UserInfo.Current.appUnlockPasswrod, refreshAction); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage("2"); |
| | | page.LoadPage("2");//2020-12-11 |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | |
| | | { |
| | | btnFingerprintUnlockSwtichIcon.MouseUpEventHandler = (sender, e1) => |
| | | { |
| | | 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 (!MainPage.LoginUser.appUnlockType.Contains("3")) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Add("3"); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (MainPage.LoginUser.appUnlockType.Contains("3")) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Remove("3"); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | } |
| | | } |
| | | } |
| | | else// if (e == TouchIDUtils.TouchIDState.InputPassword || e == TouchIDUtils.TouchIDState.TouchIDLockout) |
| | | { |
| | | if (MainPage.LoginUser.appUnlockType.Contains("1")) |
| | | { |
| | | var page = new AppUnlockPasswordPage(MainPage.LoginUser.appUnlockPasswrod, refreshAction); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage("5"); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | else if (MainPage.LoginUser.appUnlockType.Contains("2")) |
| | | { |
| | | var page = new AppUnlockGesturePage(MainPage.LoginUser.appUnlockPasswrod, refreshAction); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage("6"); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | } |
| | | }; |
| | | TouchIDVerification_SwtichOnOff(); |
| | | }; |
| | | } |
| | | if (sFaceID) |
| | | { |
| | | btnFaceIdUnlockSwtichIcon.MouseUpEventHandler = (sender, e1) => |
| | | { |
| | | //btnFaceIdUnlockSwtichIcon.IsSelected = !btnFaceIdUnlockSwtichIcon.IsSelected; |
| | | if (!btnFaceIdUnlockSwtichIcon.IsSelected) |
| | | { } |
| | | FaceIDVerification_SwtichOnOff(); |
| | | }; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断是否能够取消,如果只剩最后一种解锁方案禁止取消 |
| | | /// </summary> |
| | | /// <param name="appUnlockPageType">1:启动时 2:布防撤防时 3:远程开锁时</param> |
| | | /// <returns></returns> |
| | | bool CheckIfCanDeselect(string appUnlockPageType) |
| | | { |
| | | if (UserInfo.Current.appUnlockPage.Count == 1 && UserInfo.Current.appUnlockPage.Contains(appUnlockPageType)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | 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:当前设备不支持FaceID验证,请输入密码来验证"); |
| | | 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 = () => |
| | | { |
| | | //关闭解锁验证 |
| | | GotogoToVerifyPasswordPage(optionType, successAction); |
| | | }; |
| | | |
| | | FaceIDVerification_Show(successAction, goToVerifyPasswordAction); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// FaceID验证 关闭解锁设置 |
| | | /// </summary> |
| | | /// <param name="action">验证成功事件</param> |
| | | void FaceIDVerification_TurnOffUnlock(Action successAction) |
| | | { |
| | | //调整数字密码或者手势密码验证页面 |
| | | Action goToVerifyPasswordAction = () => |
| | | { |
| | | //关闭解锁验证 |
| | | 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:当前设备不支持TouchID验证,请输入密码来验证"); |
| | | 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:关闭解锁设置 |
| | | /// </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> |
| | | /// <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); |
| | | } |
| | | } |
| | | } |
| | | } |