| | |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(64), |
| | | Height = Application.GetRealWidth(64), |
| | | UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/GestureGrayIcon.png", |
| | | //UnSelectedImagePath = "PersonalCenter/AppUnlockSetting/GestureGrayIcon.png", |
| | | }; |
| | | bodyView.AddChidren(btnGestureIcon); |
| | | |
| | |
| | | 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) => |
| | | { |
| | | //自行验证密码,提示正确或者错误 false为显示红色错误, 自行选择调用时机 |
| | | mGestureLockView.showCorrectStatus(false); |
| | | Console.WriteLine("手势密码 : " + selectNumStr + " selectCount:" + selectCount); |
| | | |
| | | if (selectCount < 4) |
| | | { |
| | | btnTipMsg.Text = Language.StringByID(StringId.DrawingLengthError); |
| | |
| | | |
| | | if (string.IsNullOrEmpty(oldPasswrod)) |
| | | { |
| | | this.RemoveFromParent(); |
| | | var page = new AppUnlockGesturePage(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") |
| | | { |
| | | //移除当前界面,每次返回都返回到最上级 |
| | | this.RemoveFromParent(); |
| | | var page = new AppUnlockGesturePage("", backAction); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage("1"); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | //移除当前界面,每次返回都返回到最上级 |
| | | MainPage.BasePageView.RemoveAt(MainPage.BasePageView.ChildrenCount - 2); |
| | | return; |
| | | } |
| | | if(optionType == "7") |
| | |
| | | } |
| | | if (MainPage.LoginUser.appUnlockType.Contains("2")) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Remove("2"); |
| | | MainPage.LoginUser.appUnlockType = new System.Collections.Generic.List<string>(); |
| | | MainPage.LoginUser.appUnlockPasswrod = ""; |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | this.RemoveFromParent(); |
| | |
| | | { |
| | | if (passwrod == oldPasswrod) |
| | | { |
| | | if (optionType == "5" && MainPage.LoginUser.appUnlockType.Contains("3")) |
| | | if (optionType == "5" )//&& MainPage.LoginUser.appUnlockType.Contains("3")) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Remove("3"); |
| | | if (MainPage.LoginUser.appUnlockType.Contains("3")) |
| | | MainPage.LoginUser.appUnlockType.Remove("3"); |
| | | else |
| | | MainPage.LoginUser.appUnlockType.Add("3"); |
| | | |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | this.RemoveFromParent(); |
| | | } |
| | | if (MainPage.LoginUser.appUnlockType.Contains("4") && optionType == "6") |
| | | if ( optionType == "6") |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Remove("4"); |
| | | if (MainPage.LoginUser.appUnlockType.Contains("4")) |
| | | MainPage.LoginUser.appUnlockType.Remove("4"); |
| | | else |
| | | MainPage.LoginUser.appUnlockType.Add("4"); |
| | | |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | this.RemoveFromParent(); |
| | | } |
| | |
| | | //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)) |
| | | var unlockType = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? "3" : "4"; |
| | | if (result) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Add(unlockType); |
| | | if (!MainPage.LoginUser.appUnlockType.Contains(unlockType)) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Add(unlockType); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (MainPage.LoginUser.appUnlockType.Contains(unlockType)) |
| | | else |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Remove(unlockType); |
| | | if (MainPage.LoginUser.appUnlockType.Contains(unlockType)) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Remove(unlockType); |
| | | } |
| | | } |
| | | } |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | backAction(); |
| | | }; |
| | | page.AdditionalOperations(tipMsg, action); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | backAction(); |
| | | }; |
| | | page.AdditionalOperations(tipMsg, action); |
| | | } |
| | | if (!MainPage.LoginUser.appUnlockType.Contains("2")) |
| | | { |
| | | MainPage.LoginUser.appUnlockType.Add("2"); |
| | |
| | | |
| | | }; |
| | | |
| | | 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(MainPage.LoginUser); |
| | | } |
| | | else |
| | | { |
| | | Action<string> action = (pw) => { |
| | | var loginResult = new DAL.Server.HttpServerRequest().LoginByPassword(MainPage.LoginUser.accountString, pw); |
| | | if (loginResult.StateCode.ToUpper() == "SUCCESS") |
| | | { |
| | | MainPage.LoginUser.appUnlockPasswrod = ""; |
| | | MainPage.LoginUser.appUnlockType = new System.Collections.Generic.List<string>(); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | this.RemoveFromParent(); |
| | | backAction(); |
| | | } |
| | | //登录失败 |
| | | else |
| | | { |
| | | string tipStr = "Sever erorr"; |
| | | switch (loginResult.StateCode) |
| | | { |
| | | case "ValidCodeAndPhoneNoEqual": |
| | | tipStr = Language.StringByID(StringId.VerificationCodeError); |
| | | break; |
| | | case "USERNAMEORPWDERROR": |
| | | tipStr = Language.StringByID(StringId.LoginFailed_AccountOrPasswordError); |
| | | break; |
| | | case "ACCOUNTNOEXISTS": |
| | | tipStr = Language.StringByID(StringId.ACCOUNTNOEXISTS); |
| | | break; |
| | | case "NoRecord": |
| | | tipStr = Language.StringByID(StringId.PlsGetTheVerificationCode); |
| | | break; |
| | | case "Self:Net_Error": |
| | | tipStr = Language.StringByID(StringId.NetworkAnomaly); |
| | | break; |
| | | } |
| | | //账号或者密码错误 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //提示原因 |
| | | var tip = new Tip() |
| | | { |
| | | Text = tipStr, |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(bodyView); |
| | | }); |
| | | } |
| | | |
| | | }; |
| | | new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action,StringId.PlsEntryPassword,0,new System.Collections.Generic.List<string>(),true); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | | } |
| | | } |