From 5eeafe3af80bfd88306bd8ad9e76c8f4b51ca35f Mon Sep 17 00:00:00 2001 From: hxb <hxb@hdlchina.com.cn> Date: 星期四, 17 十二月 2020 14:16:20 +0800 Subject: [PATCH] 增加本地发送的重发机制 --- HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs | 95 +++++++++++++++++++++++++++++++++++++---------- 1 files changed, 74 insertions(+), 21 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs index aa4ad3f..6afbed5 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs @@ -66,7 +66,7 @@ IsBold = true, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.EmphasisFontSize_Secondary, - TextID = optionType == "7" ? StringId.SetGesturePassword : StringId.VerifyGesturePassword, + TextID = StringId.VerifyGesturePassword, }; bodyView.AddChidren(btnTipTitle); @@ -79,14 +79,27 @@ TextColor = CSS_Color.TextualColor, SelectedTextColor = CSS_Color.WarningColor, TextSize = CSS_FontSize.TextFontSize, - TextID = optionType == "2" ? StringId.DrawUnlockPatternAgain : StringId.DrawUnlockPattern, + TextID = StringId.DrawUnlockPattern, }; bodyView.AddChidren(btnTipMsg); - if (optionType == "7") + if (optionType == "1") { - btnTipTitle.TextID = StringId.DrawUnlockPattern; + btnTipMsg.TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.DrawUnlockPattern : StringId.DrawUnlockPatternAgain; + //璁剧疆鎵嬪娍瀵嗙爜 + btnTipTitle.TextID = StringId.SetGesturePassword; + }else if(optionType == "2") + { + //璇疯緭鍏ュ師鎵嬪娍瀵嗙爜 + btnTipTitle.TextID = StringId.PleaseDrawTheOriginalGesturePassword; } + + //if (optionType == "7") + //{ + // //璇风粯鍒惰В閿佸浘妗� + // btnTipTitle.TextID = StringId.DrawUnlockPattern; + //} + GestureLockView mGestureLockView = new GestureLockView { @@ -383,27 +396,67 @@ //杈撳叆鐧诲綍瀵嗙爜楠岃瘉 Action<string> action = (pw) => { - var resultObj = new HttpServerRequest().LoginByPassword(UserInfo.Current.AccountString, pw); - if (resultObj.Code == StateCode.SUCCESS) - { - //UserInfo.Current.appUnlockPasswrod = ""; - //UserInfo.Current.appUnlockType = new System.Collections.Generic.List<string>(); - //UserInfo.Current.SaveUserInfo(); - //this.RemoveFromParent(); - //backAction(); - PasswordInputPassed(optionType); - } - else - { - Application.RunOnMainThread(() => - { - Utlis.ShowTip(Language.StringByID(StringId.AuthenticationFailedPasswordError)); - }); - } + 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(); + } } } \ No newline at end of file -- Gitblit v1.8.0