| | |
| | | using System; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | using HDL_ON.DAL.Server; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class AppUnlockGesturePage : FrameLayout |
| | |
| | | IsBold = true, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_Secondary, |
| | | TextID = StringId.SetGesturePassword, |
| | | TextID = optionType == "7" ? StringId.SetGesturePassword : StringId.VerifyGesturePassword, |
| | | }; |
| | | bodyView.AddChidren(btnTipTitle); |
| | | |
| | |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedTextColor = CSS_Color.WarningColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.DrawUnlockPattern : StringId.DrawUnlockPatternAgain, |
| | | TextID = optionType == "2" ? StringId.DrawUnlockPatternAgain : StringId.DrawUnlockPattern, |
| | | }; |
| | | bodyView.AddChidren(btnTipMsg); |
| | | |
| | | |
| | | if (optionType == "7") |
| | | { |
| | |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(215), |
| | | Height = Application.GetRealWidth(215), |
| | | //LockViewCorrectColor = 0xFF00FF00,//默认和正确 时显示的颜色 |
| | | //LockViewErrorColor = 0xFFFF0000, //错误时 显示的颜色 |
| | | LockViewCorrectColor = CSS_Color.MainColor,//0xFF00FF00,//默认和正确 时显示的颜色 |
| | | LockViewErrorColor = 0xFFFF0000, //错误时 显示的颜色 |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(mGestureLockView); |
| | | |
| | | mGestureLockView.SetSolidType(true); |
| | | //滑动结束 回调密码结果和密码长度 |
| | | mGestureLockView.OnLockVerifyEvent += (selectNumStr, selectCount) => |
| | | { |
| | |
| | | this.RemoveFromParent(); |
| | | return; |
| | | } |
| | | if (MainPage.LoginUser.appUnlockType.Contains("2")) |
| | | if (OnAppConfig.Instance.appUnlockType.Contains("2")) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Remove("2"); |
| | | MainPage.LoginUser.appUnlockPasswrod = ""; |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | OnAppConfig.Instance.appUnlockType = new System.Collections.Generic.List<string>(); |
| | | OnAppConfig.Instance.appUnlockPasswrod = ""; |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | this.RemoveFromParent(); |
| | | backAction(); |
| | | } |
| | |
| | | { |
| | | if (passwrod == oldPasswrod) |
| | | { |
| | | if (optionType == "5" && MainPage.LoginUser.appUnlockType.Contains("3")) |
| | | if (optionType == "5" )//&& OnAppConfig.Instance.appUnlockType.Contains("3")) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Remove("3"); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | if (OnAppConfig.Instance.appUnlockType.Contains("3")) |
| | | OnAppConfig.Instance.appUnlockType.Remove("3"); |
| | | else |
| | | OnAppConfig.Instance.appUnlockType.Add("3"); |
| | | |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | this.RemoveFromParent(); |
| | | } |
| | | if (MainPage.LoginUser.appUnlockType.Contains("4") && optionType == "6") |
| | | if ( optionType == "6") |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Remove("4"); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | if (OnAppConfig.Instance.appUnlockType.Contains("4")) |
| | | OnAppConfig.Instance.appUnlockType.Remove("4"); |
| | | else |
| | | OnAppConfig.Instance.appUnlockType.Add("4"); |
| | | |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | this.RemoveFromParent(); |
| | | } |
| | | if (optionType == "8" && !MainPage.LoginUser.appUnlockType.Contains("3")) |
| | | if (optionType == "8" && !OnAppConfig.Instance.appUnlockType.Contains("3")) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Add("3"); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | OnAppConfig.Instance.appUnlockType.Add("3"); |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | this.RemoveFromParent(); |
| | | } |
| | | if (!MainPage.LoginUser.appUnlockType.Contains("4") && optionType == "9") |
| | | if (!OnAppConfig.Instance.appUnlockType.Contains("4") && optionType == "9") |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Remove("4"); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | OnAppConfig.Instance.appUnlockType.Remove("4"); |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | this.RemoveFromParent(); |
| | | } |
| | | backAction(); |
| | |
| | | var unlockType = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? "3" : "4"; |
| | | if (result) |
| | | { |
| | | if (!MainPage.LoginUser.appUnlockType.Contains(unlockType)) |
| | | if (!OnAppConfig.Instance.appUnlockType.Contains(unlockType)) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Add(unlockType); |
| | | OnAppConfig.Instance.appUnlockType.Add(unlockType); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (MainPage.LoginUser.appUnlockType.Contains(unlockType)) |
| | | if (OnAppConfig.Instance.appUnlockType.Contains(unlockType)) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Remove(unlockType); |
| | | OnAppConfig.Instance.appUnlockType.Remove(unlockType); |
| | | } |
| | | } |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | backAction(); |
| | | }; |
| | | page.AdditionalOperations(tipMsg, action); |
| | | } |
| | | if (!MainPage.LoginUser.appUnlockType.Contains("2")) |
| | | if (!OnAppConfig.Instance.appUnlockType.Contains("2")) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Add("2"); |
| | | OnAppConfig.Instance.appUnlockType.Add("2"); |
| | | } |
| | | MainPage.LoginUser.appUnlockPasswrod = passwrod; |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | OnAppConfig.Instance.appUnlockPasswrod = passwrod; |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | backAction(); |
| | | } |
| | | else |
| | |
| | | |
| | | }; |
| | | |
| | | if (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 == 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); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | | } |
| | | } |