| | |
| | | using System; |
| | | using Shared; |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.DAL.Server; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public partial class AppUnlockPasswordPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | EditText etPassword; |
| | | |
| | | string passwrod = ""; |
| | | string oldPasswrod = ""; |
| | |
| | | oldPasswrod = pw; |
| | | backAction = action; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | |
| | | bodyView.AddChidren(btnTipError); |
| | | |
| | | |
| | | var etPassword = new EditText() |
| | | etPassword = new EditText() |
| | | { |
| | | Y = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(10), |
| | | Height = Application.GetRealWidth(0), |
| | | Foucs = true, |
| | | Visible = false, |
| | | //Visible = false, |
| | | IsNumberKeyboardType = true, |
| | | }; |
| | | bodyView.AddChidren(etPassword); |
| | | |
| | | //etPassword.MouseUpEventHandler = (sender, e) => { }; |
| | | |
| | | etPassword.TextChangeEventHandler = (sender, e) => { |
| | | passwrod = etPassword.Text.Trim(); |
| | |
| | | btnTipIcon2.IsSelected = true; |
| | | btnTipIcon3.IsSelected = true; |
| | | btnTipIcon4.IsSelected = true; |
| | | Application.HideSoftInput(); |
| | | if (string.IsNullOrEmpty(oldPasswrod)) |
| | | { |
| | | //移除当前界面,每次返回都返回到最上级 |
| | | this.RemoveFromParent(); |
| | | var page = new AppUnlockPasswordPage(passwrod,backAction); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(optionType); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | //移除当前界面,每次返回都返回到最上级 |
| | | MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 2); |
| | | } |
| | | else |
| | | { |
| | | if(optionType == "2") |
| | | if (optionType == "2") |
| | | { |
| | | //移除当前界面,每次返回都返回到最上级 |
| | | this.RemoveFromParent(); |
| | | var page = new AppUnlockPasswordPage("", backAction); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage("1"); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | //移除当前界面,每次返回都返回到最上级 |
| | | MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 2); |
| | | return; |
| | | } |
| | | |
| | |
| | | { |
| | | if (passwrod == oldPasswrod) |
| | | { |
| | | //MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | this.RemoveFromParent(); |
| | | backAction(); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | |
| | | this.RemoveFromParent(); |
| | | return; |
| | | } |
| | | if (MainPage.LoginUser.appUnlockType.Contains("1")) |
| | | if (OnAppConfig.Instance.appUnlockType.Contains("1")) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Remove("1"); |
| | | MainPage.LoginUser.appUnlockPasswrod = ""; |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | OnAppConfig.Instance.appUnlockType =new System.Collections.Generic.List<string>();//.Remove("1"); |
| | | OnAppConfig.Instance.appUnlockPasswrod = ""; |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | this.RemoveFromParent(); |
| | | backAction(); |
| | | } |
| | |
| | | { |
| | | if (optionType == "5") |
| | | { |
| | | if (MainPage.LoginUser.appUnlockType.Contains("3")) |
| | | MainPage.LoginUser.appUnlockType.Remove("3"); |
| | | if (OnAppConfig.Instance.appUnlockType.Contains("3")) |
| | | OnAppConfig.Instance.appUnlockType.Remove("3"); |
| | | else |
| | | MainPage.LoginUser.appUnlockType.Add("3"); |
| | | OnAppConfig.Instance.appUnlockType.Add("3"); |
| | | |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | this.RemoveFromParent(); |
| | | } |
| | | if (optionType == "6") |
| | | { |
| | | if (MainPage.LoginUser.appUnlockType.Contains("4")) |
| | | MainPage.LoginUser.appUnlockType.Remove("4"); |
| | | if (OnAppConfig.Instance.appUnlockType.Contains("4")) |
| | | OnAppConfig.Instance.appUnlockType.Remove("4"); |
| | | else |
| | | MainPage.LoginUser.appUnlockType.Add("4"); |
| | | OnAppConfig.Instance.appUnlockType.Add("4"); |
| | | |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | this.RemoveFromParent(); |
| | | } |
| | | backAction(); |
| | |
| | | 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); |
| | | Action<bool> action = (result) => |
| | | |
| | | if (TouchIDUtils.getTouchIDSupperType() != TouchIDUtils.TouchIDSupperType.None) |
| | | { |
| | | var unlockType = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? "3" : "4"; |
| | | if (result) |
| | | Action<bool> action = (result) => |
| | | { |
| | | if (!MainPage.LoginUser.appUnlockType.Contains(unlockType)) |
| | | if (result) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Add(unlockType); |
| | | if (!OnAppConfig.Instance.appUnlockType.Contains(unlockType)) |
| | | { |
| | | OnAppConfig.Instance.appUnlockType.Add(unlockType); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (MainPage.LoginUser.appUnlockType.Contains(unlockType)) |
| | | else |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Remove(unlockType); |
| | | if (OnAppConfig.Instance.appUnlockType.Contains(unlockType)) |
| | | { |
| | | OnAppConfig.Instance.appUnlockType.Remove(unlockType); |
| | | } |
| | | } |
| | | } |
| | | backAction(); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | }; |
| | | page.AdditionalOperations(tipMsg, action); |
| | | if (!MainPage.LoginUser.appUnlockType.Contains("1")) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Add("1"); |
| | | backAction(); |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | }; |
| | | page.AdditionalOperations(tipMsg, action); |
| | | } |
| | | MainPage.LoginUser.appUnlockPasswrod = passwrod; |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | if (!OnAppConfig.Instance.appUnlockType.Contains("1")) |
| | | { |
| | | OnAppConfig.Instance.appUnlockType.Add("1"); |
| | | } |
| | | OnAppConfig.Instance.appUnlockPasswrod = passwrod; |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | backAction(); |
| | | } |
| | | else |
| | |
| | | btnTipIcon2.MouseUpEventHandler = eventHandler; |
| | | btnTipIcon3.MouseUpEventHandler = eventHandler; |
| | | btnTipIcon4.MouseUpEventHandler = eventHandler; |
| | | |
| | | etPassword.Foucs = true; |
| | | |
| | | |
| | | if (optionType == "3" || optionType == "5" || optionType == "6" || optionType == "7") |
| | | { |
| | | 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); |
| | | } |
| | | else |
| | | { |
| | | Action<string> action = (pw) => { |
| | | var resultObj = new HttpServerRequest().LoginByPassword( UserInfo.Current.AccountString, pw); |
| | | if (resultObj.Code.ToUpper() == StateCode.SUCCESS) |
| | | { |
| | | OnAppConfig.Instance.appUnlockPasswrod = ""; |
| | | OnAppConfig.Instance.appUnlockType = new System.Collections.Generic.List<string>(); |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | 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); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |