| | |
| | | //密码验证失败 |
| | | PasswordInputError(optionType); |
| | | } |
| | | |
| | | //if (optionType == "2") |
| | | //{ |
| | | // //移除当前界面,每次返回都返回到最上级 |
| | | // this.RemoveFromParent(); |
| | | // var page = new AppUnlockPasswordPage("", backAction); |
| | | // MainPage.BasePageView.AddChidren(page); |
| | | // page.LoadPage("1"); |
| | | // MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | // return; |
| | | //} |
| | | |
| | | //if (optionType == "7") |
| | | //{ |
| | | // if (passwrod == oldPasswrod) |
| | | // { |
| | | // //MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | // this.RemoveFromParent(); |
| | | // backAction(); |
| | | // return; |
| | | // } |
| | | // else |
| | | // { |
| | | // btnTipError.TextID = StringId.AuthenticationFailedPasswordError; |
| | | // etPassword.Text = ""; |
| | | // btnTipError.Visible = true; |
| | | // } |
| | | // return; |
| | | //} |
| | | //if (optionType == "3"|| optionType == "4") |
| | | //{ |
| | | // if (passwrod == oldPasswrod) |
| | | // { |
| | | // if(optionType == "4") |
| | | // { |
| | | // backAction(); |
| | | // this.RemoveFromParent(); |
| | | // return; |
| | | // } |
| | | // if (UserInfo.Current.appUnlockType.Contains("1")) |
| | | // { |
| | | // UserInfo.Current.appUnlockType =new System.Collections.Generic.List<string>();//.Remove("1"); |
| | | // UserInfo.Current.appUnlockPasswrod = ""; |
| | | // UserInfo.Current.SaveUserInfo(); |
| | | // this.RemoveFromParent(); |
| | | // backAction(); |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // btnTipError.TextID = StringId.AuthenticationFailedPasswordError; |
| | | // etPassword.Text = ""; |
| | | // btnTipError.Visible = true; |
| | | // } |
| | | // return; |
| | | //} |
| | | ////关闭/开启指纹或者面容 |
| | | //if (optionType == "5" || optionType == "6")//|| optionType == "8" || optionType == "9") |
| | | //{ |
| | | // if (passwrod == oldPasswrod) |
| | | // { |
| | | // if (optionType == "5") |
| | | // { |
| | | // if (UserInfo.Current.appUnlockType.Contains("3")) |
| | | // UserInfo.Current.appUnlockType.Remove("3"); |
| | | // else |
| | | // UserInfo.Current.appUnlockType.Add("3"); |
| | | |
| | | // UserInfo.Current.SaveUserInfo(); |
| | | // this.RemoveFromParent(); |
| | | // } |
| | | // if (optionType == "6") |
| | | // { |
| | | // if (UserInfo.Current.appUnlockType.Contains("4")) |
| | | // UserInfo.Current.appUnlockType.Remove("4"); |
| | | // else |
| | | // UserInfo.Current.appUnlockType.Add("4"); |
| | | |
| | | // UserInfo.Current.SaveUserInfo(); |
| | | // this.RemoveFromParent(); |
| | | // } |
| | | // backAction(); |
| | | // } |
| | | // else |
| | | // { |
| | | // btnTipError.TextID = StringId.AuthenticationFailedPasswordError; |
| | | // etPassword.Text = ""; |
| | | // btnTipError.Visible = true; |
| | | // } |
| | | // return; |
| | | //} |
| | | //if (passwrod == oldPasswrod) |
| | | //{ |
| | | // this.RemoveFromParent(); |
| | | // var page = new OperationResultDisPalyPage(); |
| | | // page.Show(); |
| | | |
| | | // page.LoadPage(true, Language.StringByID(StringId.SetSuccessfully), Language.StringByID(StringId.SetSuccessfully), ""); |
| | | // string tipMsg = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? Language.StringByID(StringId.TurnOnFingerprintUnlocking) : |
| | | // Language.StringByID(StringId.TurnOnFaceIdUnlocking); |
| | | |
| | | // if (TouchIDUtils.getTouchIDSupperType() != TouchIDUtils.TouchIDSupperType.None) |
| | | // { |
| | | // var unlockType = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? "3" : "4"; |
| | | // Action<bool> action = (result) => |
| | | // { |
| | | // if (result) |
| | | // { |
| | | // if (!UserInfo.Current.appUnlockType.Contains(unlockType)) |
| | | // { |
| | | // UserInfo.Current.appUnlockType.Add(unlockType); |
| | | // } |
| | | // } |
| | | // else |
| | | // { |
| | | // if (UserInfo.Current.appUnlockType.Contains(unlockType)) |
| | | // { |
| | | // UserInfo.Current.appUnlockType.Remove(unlockType); |
| | | // } |
| | | // } |
| | | // backAction(); |
| | | // UserInfo.Current.SaveUserInfo(); |
| | | // }; |
| | | // page.AdditionalOperations(tipMsg, action); |
| | | // } |
| | | // if (!UserInfo.Current.appUnlockType.Contains("1")) |
| | | // { |
| | | // UserInfo.Current.appUnlockType.Add("1"); |
| | | // } |
| | | // UserInfo.Current.appUnlockPasswrod = passwrod; |
| | | // UserInfo.Current.SaveUserInfo(); |
| | | // backAction(); |
| | | //} |
| | | //else |
| | | //{ |
| | | // btnTipError.TextID = StringId.IncorrectRepeatPassword; |
| | | // etPassword.Text = ""; |
| | | // btnTipError.Visible = true; |
| | | //} |
| | | } |
| | | break; |
| | | } |
| | |
| | | |
| | | etPassword.Foucs = true; |
| | | |
| | | |
| | | if (optionType == "3" || optionType == "5" || optionType == "6" || optionType == "7") |
| | | //加载底部验证按钮 |
| | | if (optionType == "3" || optionType == "5" || optionType == "6") |
| | | { |
| | | Button btnLoginAccountVerify = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(517), |
| | | Height = Application.GetRealHeight(60), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextID = StringId.EnterLoginPasswordVerification, |
| | | }; |
| | | bodyView.AddChidren(btnLoginAccountVerify); |
| | | |
| | | btnLoginAccountVerify.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (optionType == "7") |
| | | { |
| | | //MainPage.GoLoginPage( UserInfo.Current); |
| | | //2020-12-12 退出登录 |
| | | HDLCommon.Current.Logout(); |
| | | //输入登录密码验证 提示按钮 |
| | | AddInputPasswordTipButton(); |
| | | } |
| | | else |
| | | else if(optionType == "7") |
| | | { |
| | | Action<string> action = (pw) => { |
| | | var resultObj = new HttpServerRequest().LoginByPassword( UserInfo.Current.AccountString, pw); |
| | | if (resultObj.Code.ToUpper() == StateCode.SUCCESS) |
| | | { |
| | | UserInfo.Current.appUnlockPasswrod = ""; |
| | | UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | this.RemoveFromParent(); |
| | | backAction(); |
| | | } |
| | | else |
| | | { |
| | | //登录失败 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); |
| | | } |
| | | |
| | | }; |
| | | new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true); |
| | | } |
| | | }; |
| | | //使用账户密码登录按钮 提示按钮 |
| | | AddLoginTipButton(); |
| | | } |
| | | |
| | | } |
| | |
| | | backAction(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 使用账户密码登录按钮 提示按钮 |
| | | /// </summary> |
| | | void AddLoginTipButton(){ |
| | | Button btnLoginAccountVerify = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(517), |
| | | Height = Application.GetRealHeight(60), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextID = StringId.LogWithAccountAndPassword, |
| | | }; |
| | | bodyView.AddChidren(btnLoginAccountVerify); |
| | | |
| | | btnLoginAccountVerify.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //退出登录 |
| | | HDLCommon.Current.Logout(); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 输入登录密码验证 提示按钮 |
| | | /// </summary> |
| | | void AddInputPasswordTipButton() |
| | | { |
| | | Button btnLoginAccountVerify = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(517), |
| | | Height = Application.GetRealHeight(60), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextID = StringId.EnterLoginPasswordVerification, |
| | | }; |
| | | bodyView.AddChidren(btnLoginAccountVerify); |
| | | |
| | | btnLoginAccountVerify.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //输入登录密码验证 |
| | | Action<string> action = (pw) => { |
| | | var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw); |
| | | if (resultObj.Code.ToUpper() == StateCode.SUCCESS) |
| | | { |
| | | UserInfo.Current.appUnlockPasswrod = ""; |
| | | UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | this.RemoveFromParent(); |
| | | backAction(); |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError)); |
| | | }); |
| | | ////登录失败 |
| | | //IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); |
| | | } |
| | | |
| | | }; |
| | | new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true); |
| | | }; |
| | | } |
| | | |
| | | } |
| | | } |