From 86b4742e122bb3ff19f8b61574b4bbf8e5db4b11 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期六, 12 十二月 2020 19:35:34 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/CJL' into NewFilePath --- HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs | 271 ++++++++++++++++------------------------------------- 1 files changed, 83 insertions(+), 188 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs index 8a8391b..4934c6b 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs @@ -20,7 +20,7 @@ string passwrod = ""; string oldPasswrod = ""; Action backAction; - public AppUnlockPasswordPage(string pw,Action action) + public AppUnlockPasswordPage(string pw, Action action) { bodyView = this; oldPasswrod = pw; @@ -54,16 +54,16 @@ TextAlignment = TextAlignment.Center, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.SubheadingFontSize, - TextID = string.IsNullOrEmpty(oldPasswrod)? StringId.PlsEntryPassword : StringId.PlsRegisterRepeatPassword, + TextID = string.IsNullOrEmpty(oldPasswrod) ? StringId.PlsEntryPassword : StringId.PlsRegisterRepeatPassword, }; bodyView.AddChidren(btnTipTitle); - if (optionType == "2"|| optionType == "3") + if (optionType == "2" || optionType == "3") { btnTipTitle.TextID = StringId.PleaseEnterTheOriginalDigitalPassword; } - if(optionType == "7") + if (optionType == "7") { btnTipTitle.TextID = StringId.PlsEntryPassword; } @@ -154,7 +154,7 @@ etPassword.TextChangeEventHandler = (sender, e) => { passwrod = etPassword.Text.Trim(); - switch(etPassword.Text.Trim().Length) + switch (etPassword.Text.Trim().Length) { case 0: btnTipIcon1.IsSelected = false; @@ -191,7 +191,7 @@ { //绉婚櫎褰撳墠鐣岄潰锛屾瘡娆¤繑鍥為兘杩斿洖鍒版渶涓婄骇 this.RemoveFromParent(); - var page = new AppUnlockPasswordPage(passwrod,backAction); + var page = new AppUnlockPasswordPage(passwrod, backAction); MainPage.BasePageView.AddChidren(page); page.LoadPage(optionType); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; @@ -209,145 +209,6 @@ //瀵嗙爜楠岃瘉澶辫触 PasswordInputError(optionType); } - - //if (optionType == "2") - //{ - // //绉婚櫎褰撳墠鐣岄潰锛屾瘡娆¤繑鍥為兘杩斿洖鍒版渶涓婄骇 - // this.RemoveFromParent(); - // var page = new AppUnlockPasswordPage("", backAction); - // MainPage.BasePageView.AddChidren(page); - // page.LoadPage("1"); - // MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - // return; - //} - - //if (optionType == "7") - //{ - // if (passwrod == oldPasswrod) - // { - // //MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); - // this.RemoveFromParent(); - // backAction(); - // return; - // } - // else - // { - // btnTipError.TextID = StringId.AuthenticationFailedPasswordError; - // etPassword.Text = ""; - // btnTipError.Visible = true; - // } - // return; - //} - //if (optionType == "3"|| optionType == "4") - //{ - // if (passwrod == oldPasswrod) - // { - // if(optionType == "4") - // { - // backAction(); - // this.RemoveFromParent(); - // return; - // } - // if (UserInfo.Current.appUnlockType.Contains("1")) - // { - // UserInfo.Current.appUnlockType =new System.Collections.Generic.List<string>();//.Remove("1"); - // UserInfo.Current.appUnlockPasswrod = ""; - // UserInfo.Current.SaveUserInfo(); - // this.RemoveFromParent(); - // backAction(); - // } - // } - // else - // { - // btnTipError.TextID = StringId.AuthenticationFailedPasswordError; - // etPassword.Text = ""; - // btnTipError.Visible = true; - // } - // return; - //} - ////鍏抽棴/寮�鍚寚绾规垨鑰呴潰瀹� - //if (optionType == "5" || optionType == "6")//|| optionType == "8" || optionType == "9") - //{ - // if (passwrod == oldPasswrod) - // { - // if (optionType == "5") - // { - // if (UserInfo.Current.appUnlockType.Contains("3")) - // UserInfo.Current.appUnlockType.Remove("3"); - // else - // UserInfo.Current.appUnlockType.Add("3"); - - // UserInfo.Current.SaveUserInfo(); - // this.RemoveFromParent(); - // } - // if (optionType == "6") - // { - // if (UserInfo.Current.appUnlockType.Contains("4")) - // UserInfo.Current.appUnlockType.Remove("4"); - // else - // UserInfo.Current.appUnlockType.Add("4"); - - // UserInfo.Current.SaveUserInfo(); - // this.RemoveFromParent(); - // } - // backAction(); - // } - // else - // { - // btnTipError.TextID = StringId.AuthenticationFailedPasswordError; - // etPassword.Text = ""; - // btnTipError.Visible = true; - // } - // return; - //} - //if (passwrod == oldPasswrod) - //{ - // 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); - - // if (TouchIDUtils.getTouchIDSupperType() != TouchIDUtils.TouchIDSupperType.None) - // { - // var unlockType = TouchIDUtils.getTouchIDSupperType() == TouchIDUtils.TouchIDSupperType.TouchID ? "3" : "4"; - // Action<bool> action = (result) => - // { - // if (result) - // { - // if (!UserInfo.Current.appUnlockType.Contains(unlockType)) - // { - // UserInfo.Current.appUnlockType.Add(unlockType); - // } - // } - // else - // { - // if (UserInfo.Current.appUnlockType.Contains(unlockType)) - // { - // UserInfo.Current.appUnlockType.Remove(unlockType); - // } - // } - // backAction(); - // UserInfo.Current.SaveUserInfo(); - // }; - // page.AdditionalOperations(tipMsg, action); - // } - // if (!UserInfo.Current.appUnlockType.Contains("1")) - // { - // UserInfo.Current.appUnlockType.Add("1"); - // } - // UserInfo.Current.appUnlockPasswrod = passwrod; - // UserInfo.Current.SaveUserInfo(); - // backAction(); - //} - //else - //{ - // btnTipError.TextID = StringId.IncorrectRepeatPassword; - // etPassword.Text = ""; - // btnTipError.Visible = true; - //} } break; } @@ -364,50 +225,16 @@ etPassword.Foucs = true; - - if (optionType == "3" || optionType == "5" || optionType == "6" || optionType == "7") + //鍔犺浇搴曢儴楠岃瘉鎸夐挳 + if (optionType == "3" || optionType == "5" || optionType == "6") { - 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); - //2020-12-12 閫�鍑虹櫥褰� - HDLCommon.Current.Logout(); - } - else - { - 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 - { - //鐧诲綍澶辫触 - IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); - } - - }; - new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true); - } - }; + //杈撳叆鐧诲綍瀵嗙爜楠岃瘉 鎻愮ず鎸夐挳 + AddInputPasswordTipButton(); + } + else if(optionType == "7") + { + //浣跨敤璐︽埛瀵嗙爜鐧诲綍鎸夐挳 鎻愮ず鎸夐挳 + AddLoginTipButton(); } } @@ -552,5 +379,73 @@ backAction(); } } + + + /// <summary> + /// 浣跨敤璐︽埛瀵嗙爜鐧诲綍鎸夐挳 鎻愮ず鎸夐挳 + /// </summary> + void AddLoginTipButton(){ + 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.LogWithAccountAndPassword, + }; + bodyView.AddChidren(btnLoginAccountVerify); + + btnLoginAccountVerify.MouseUpEventHandler = (sender, e) => + { + //閫�鍑虹櫥褰� + HDLCommon.Current.Logout(); + }; + } + + /// <summary> + /// 杈撳叆鐧诲綍瀵嗙爜楠岃瘉 鎻愮ず鎸夐挳 + /// </summary> + void AddInputPasswordTipButton() + { + 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) => + { + //杈撳叆鐧诲綍瀵嗙爜楠岃瘉 + 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); + } + + }; + new PublicAssmebly().LoadDialog_EditParater(StringId.EnterLoginPasswordVerification, "", action, StringId.PlsEntryPassword, 0, new System.Collections.Generic.List<string>(), true); + }; + } + } } -- Gitblit v1.8.0