| | |
| | | public AppUnlockPasswordPage(string pw, Action action) |
| | | { |
| | | bodyView = this; |
| | | bodyView.Tag = "unlockpage"; |
| | | oldPasswrod = pw; |
| | | backAction = action; |
| | | } |
| | |
| | | }; |
| | | bodyView.AddChidren(btnTipTitle); |
| | | |
| | | |
| | | if (optionType == "2" || optionType == "3") |
| | | if (optionType == "1") |
| | | { |
| | | btnTipTitle.TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.PlsEntryPassword : StringId.PlsRegisterRepeatPassword; |
| | | } |
| | | else if (optionType == "2") |
| | | { |
| | | btnTipTitle.TextID = StringId.PleaseEnterTheOriginalDigitalPassword; |
| | | } |
| | | if (optionType == "7") |
| | | else |
| | | { |
| | | btnTipTitle.TextID = StringId.PlsEntryPassword; |
| | | } |
| | |
| | | etPassword = new EditText() |
| | | { |
| | | Y = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(0), |
| | | Height = 1, |
| | | Foucs = true, |
| | | //Visible = false, |
| | | IsNumberKeyboardType = true, |
| | |
| | | |
| | | //etPassword.MouseUpEventHandler = (sender, e) => { }; |
| | | |
| | | etPassword.TextChangeEventHandler = (sender, e) => { |
| | | etPassword.TextChangeEventHandler = (sender, e) => |
| | | { |
| | | passwrod = etPassword.Text.Trim(); |
| | | switch (etPassword.Text.Trim().Length) |
| | | { |
| | |
| | | } |
| | | }; |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | etPassword.Foucs = true; |
| | | }; |
| | | bodyView.MouseUpEventHandler = eventHandler; |
| | |
| | | |
| | | etPassword.Foucs = true; |
| | | |
| | | //加载底部验证按钮 |
| | | if (optionType == "3" || optionType == "5" || optionType == "6") |
| | | { |
| | | //输入登录密码验证 提示按钮 |
| | | AddInputPasswordTipButton(); |
| | | } |
| | | else if(optionType == "7") |
| | | if (optionType == "7") |
| | | { |
| | | //使用账户密码登录按钮 提示按钮 |
| | | AddLoginTipButton(); |
| | | } |
| | | |
| | | else if (optionType != "1") |
| | | { |
| | | //输入登录密码验证 提示按钮 |
| | | AddInputPasswordTipButton(optionType); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | if (TouchIDUtils.getTouchIDSupperType() != TouchIDUtils.TouchIDSupperType.None) |
| | | { |
| | | var unlockType = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? "3" : "4"; |
| | | Action<bool> action = (result) => |
| | | |
| | | //如果之前没设置指纹或者面容ID才显示是否开启 |
| | | if (!UserInfo.Current.appUnlockType.Contains(unlockType)) |
| | | { |
| | | if (result) |
| | | Action<bool> action = (result) => |
| | | { |
| | | if (!UserInfo.Current.appUnlockType.Contains(unlockType)) |
| | | if (result) |
| | | { |
| | | UserInfo.Current.appUnlockType.Add(unlockType); |
| | | if (!UserInfo.Current.appUnlockType.Contains(unlockType)) |
| | | { |
| | | UserInfo.Current.appUnlockType.Add(unlockType); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (UserInfo.Current.appUnlockType.Contains(unlockType)) |
| | | else |
| | | { |
| | | UserInfo.Current.appUnlockType.Remove(unlockType); |
| | | if (UserInfo.Current.appUnlockType.Contains(unlockType)) |
| | | { |
| | | UserInfo.Current.appUnlockType.Remove(unlockType); |
| | | } |
| | | } |
| | | } |
| | | backAction(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | }; |
| | | page.AdditionalOperations(tipMsg, action); |
| | | backAction(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | }; |
| | | |
| | | |
| | | page.AdditionalOperations(tipMsg, action); |
| | | } |
| | | } |
| | | if (!UserInfo.Current.appUnlockType.Contains("1")) |
| | | { |
| | |
| | | /// <summary> |
| | | /// 使用账户密码登录按钮 提示按钮 |
| | | /// </summary> |
| | | void AddLoginTipButton(){ |
| | | void AddLoginTipButton() |
| | | { |
| | | Button btnLoginAccountVerify = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(517), |
| | |
| | | /// <summary> |
| | | /// 输入登录密码验证 提示按钮 |
| | | /// </summary> |
| | | void AddInputPasswordTipButton() |
| | | void AddInputPasswordTipButton(string optionType) |
| | | { |
| | | Button btnLoginAccountVerify = new Button() |
| | | { |
| | |
| | | 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); |
| | | } |
| | | Action<string> action = (pw) => |
| | | { |
| | | AuthenticationByLoginPassword(pw, optionType); |
| | | //var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw); |
| | | //if (resultObj.Code == StateCode.SUCCESS) |
| | | //{ |
| | | // PasswordInputPassed(optionType); |
| | | //} |
| | | //else |
| | | //{ |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError)); |
| | | // }); |
| | | |
| | | //} |
| | | |
| | | }; |
| | | new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true); |
| | | }; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 登录密码验证 |
| | | /// </summary> |
| | | /// <param name="pw"></param> |
| | | /// <param name="optionType"></param> |
| | | void AuthenticationByLoginPassword(string pw, string optionType) |
| | | { |
| | | var waitPage = new Loading(); |
| | | bodyView.AddChidren(waitPage); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (resultObj.Code == StateCode.SUCCESS) |
| | | { |
| | | PasswordInputPassed(optionType); |
| | | } |
| | | else |
| | | { |
| | | Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError)); |
| | | } |
| | | }); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | } |
| | | } |