From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 17 十二月 2020 09:07:13 +0800 Subject: [PATCH] 新云端Ver1.3 --- ZigbeeApp/Shared/Phone/UserCenter/Password/EditorAccountPasswordForm.cs | 61 +++++++++--------------------- 1 files changed, 19 insertions(+), 42 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorAccountPasswordForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorAccountPasswordForm.cs index af5834a..02831e2 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorAccountPasswordForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/Password/EditorAccountPasswordForm.cs @@ -50,12 +50,14 @@ rowOldPsw.Y = Application.GetRealHeight(26); frameBackGroud.AddChidren(rowOldPsw); var txtoldPsw = new TextInputControl(Application.GetRealWidth(800), rowOldPsw.Height); - txtoldPsw.X = ControlCommonResourse.XXLeft; + txtoldPsw.X = HdlControlResourse.XXLeft; txtoldPsw.SecureTextEntry = true; txtoldPsw.PlaceholderText = Language.StringByID(R.MyInternationalizationString.PleaseInputOldPsw); rowOldPsw.AddChidren(txtoldPsw); //搴曠嚎 - rowOldPsw.AddBottomLine(); + var btnOldLine = rowOldPsw.AddBottomLine(); + //鑱斿姩绾跨殑鐘舵�� + txtoldPsw.btnLine = btnOldLine; //鍥炬爣 var btnoldPswIcon = rowOldPsw.AddMostRightEmptyIcon(58, 58); btnoldPswIcon.UnSelectedImagePath = "Item/HidenPWD.png"; @@ -74,7 +76,7 @@ btnForgotPsw.TextID = R.MyInternationalizationString.ForgotPasswordMsg; btnForgotPsw.TextAlignment = TextAlignment.CenterRight; frameBackGroud.AddChidren(btnForgotPsw); - btnForgotPsw.X = bodyFrameLayout.Width - ControlCommonResourse.XXLeft - btnForgotPsw.Width; + btnForgotPsw.X = bodyFrameLayout.Width - HdlControlResourse.XXLeft - btnForgotPsw.Width; btnForgotPsw.ButtonClickEvent += (sender, e) => { var form = new ForgotAccountPasswordForm(); @@ -88,12 +90,14 @@ rowNewPsw.Y = Application.GetRealHeight(236); frameBackGroud.AddChidren(rowNewPsw); var txtNewPsw = new TextInputControl(Application.GetRealWidth(800), rowNewPsw.Height); - txtNewPsw.X = ControlCommonResourse.XXLeft; + txtNewPsw.X = HdlControlResourse.XXLeft; txtNewPsw.SecureTextEntry = true; txtNewPsw.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputNewPassword); rowNewPsw.AddChidren(txtNewPsw); //搴曠嚎 - rowNewPsw.AddBottomLine(); + var btnNewLine = rowNewPsw.AddBottomLine(); + //鑱斿姩绾跨殑鐘舵�� + txtNewPsw.btnLine = btnNewLine; //鍥炬爣 var btnNewPswIcon = rowNewPsw.AddMostRightEmptyIcon(58, 58); btnNewPswIcon.UnSelectedImagePath = "Item/HidenPWD.png"; @@ -111,7 +115,7 @@ rowConfirmPsw.Y = rowNewPsw.Bottom + Application.GetRealHeight(10); frameBackGroud.AddChidren(rowConfirmPsw); var txtConfirmPsw = new TextInputControl(Application.GetRealWidth(800), rowConfirmPsw.Height); - txtConfirmPsw.X = ControlCommonResourse.XXLeft; + txtConfirmPsw.X = HdlControlResourse.XXLeft; txtConfirmPsw.SecureTextEntry = true; txtConfirmPsw.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseRepeatInputNewPassword); rowConfirmPsw.AddChidren(txtConfirmPsw); @@ -148,7 +152,7 @@ return; } //淇濆瓨瀵嗙爜 - this.SavePassword(txtConfirmPsw.Text); + this.SavePassword(txtoldPsw.Text, txtConfirmPsw.Text); }; } @@ -159,24 +163,22 @@ /// <summary> /// 淇濆瓨瀵嗙爜 /// </summary> - /// <param name="newPassword"></param> - private async void SavePassword(string newPassword) + /// <param name="i_oldPsw"></param> + /// <param name="i_newPsw"></param> + private void SavePassword(string i_oldPsw, string i_newPsw) { - var pra = new SavePasswordPra(); - pra.NewPassword = newPassword; - - //鏇存敼瀵嗙爜 - bool flage = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/UpdatePassword", false, pra); - if (flage == false) + //缂栬緫瀵嗙爜 + var result = HdlAccountLogic.Current.EditorPassword(i_oldPsw, i_newPsw); + if (result == false) { return; } //瀵嗙爜宸茬粡淇敼锛岃閲嶆柊鐧诲綍 string msg = Language.StringByID(R.MyInternationalizationString.uPasswordIsHadChangedAndLoginAgain); - this.ShowMassage(ShowMsgType.Normal, msg, () => + this.ShowMassage(ShowMsgType.Remind, msg, () => { //浠庢柊鐧诲綍 - UserCenterLogic.ReLoginAgain(Common.Config.Instance.Account); + HdlAccountLogic.Current.ReLoginAgain(Common.Config.Instance.Account); }, Language.StringByID(R.MyInternationalizationString.Login)); } @@ -211,12 +213,6 @@ this.msgControl.TextID = R.MyInternationalizationString.uPleaseRepeatInputNewPassword; return false; } - if (oldPsw != Common.Config.Instance.Password) - { - //瀵嗙爜閿欒锛岃閲嶆柊杈撳叆 - this.msgControl.TextID = R.MyInternationalizationString.uOldPsswordIsError; - return false; - } if (newPsw != newPsw2) { //纭瀵嗙爜涓嶄竴鑷达紝璇烽噸鏂拌緭鍏� @@ -242,25 +238,6 @@ } return true; - } - - #endregion - - #region 鈻� 缁撴瀯浣揰____________________________ - - /// <summary> - /// 淇濆瓨瀵嗙爜鐨勫惎鍔ㄥ弬鏁扮被 - /// </summary> - private class SavePasswordPra - { - /// <summary> - /// 鏃у瘑鐮� - /// </summary> - public string OldPassword = Common.Config.Instance.Password; - /// <summary> - /// 鏂板瘑鐮� - /// </summary> - public string NewPassword = string.Empty; } #endregion -- Gitblit v1.8.0