| | |
| | | |
| | | #region 控件View |
| | | /// <summary> |
| | | /// 原密码文本框 |
| | | /// </summary> |
| | | EditText etOldPwd; |
| | | |
| | | /// <summary> |
| | | /// 密码文本框 |
| | | /// </summary> |
| | | EditText etPassword; |
| | |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.ModifyPassword)).LoadTopView(backAction); |
| | | |
| | | |
| | | #region 原密码 |
| | | FrameLayout oldPwdView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(oldPwdView); |
| | | |
| | | Button btnOldPwdTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(180), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = Language.StringByID(StringId.OriginalPassword) + ":" |
| | | }; |
| | | oldPwdView.AddChidren(btnOldPwdTitle); |
| | | |
| | | etOldPwd = new EditText() |
| | | { |
| | | Width = Application.GetRealWidth(359), |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | SecureTextEntry = true, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | Foucs = true |
| | | }; |
| | | oldPwdView.AddChidren(etOldPwd); |
| | | oldPwdView.AddChidren(new LineView(oldPwdView.Height)); |
| | | #endregion |
| | | |
| | | |
| | | #region 新密码 |
| | | FrameLayout rowView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Y = oldPwdView.Bottom , |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | |
| | | public partial class ResetPasswordPage |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 指定关闭页面个数 |
| | | /// </summary> |
| | | /// <param name="countPage"></param> |
| | | void ClosePageWithCount(int countPage) |
| | | { |
| | | //关闭多少个页面 |
| | | for (int i = 0; i < countPage; i++) |
| | | { |
| | | MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | } |
| | | } |
| | | ///// <summary> |
| | | ///// 指定关闭页面个数 |
| | | ///// </summary> |
| | | ///// <param name="countPage"></param> |
| | | //void ClosePageWithCount(int countPage) |
| | | //{ |
| | | // //关闭多少个页面 |
| | | // for (int i = 0; i < countPage; i++) |
| | | // { |
| | | // MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | // } |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="password"></param> |
| | | void ResetPassword(string password) |
| | | void ResetPassword(string oldPwd, string password) |
| | | { |
| | | |
| | | //校验密码是否符合要求 |
| | |
| | | try |
| | | { |
| | | // 忘记密码 |
| | | var resultObj = new HttpServerRequest().ForgetPassword(account, password, verCode, isPhone); |
| | | var resultObj = new HttpServerRequest().UpdataPassword(oldPwd, password); |
| | | if (resultObj.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | Utlis.ShowTip(Language.StringByID(StringId.PasswordChangeSuccessfully)); |
| | | ClosePageWithCount(2); |
| | | this.RemoveFromParent(); |
| | | }); |
| | | } |
| | | else |
| | |
| | | { |
| | | if (btnReset.IsSelected) |
| | | { |
| | | ResetPassword(etPassword.Text.ToString()); |
| | | ResetPassword(etOldPwd.Text.Trim().ToString(), etPassword.Text.ToString()); |
| | | } |
| | | }; |
| | | } |