黄学彪
2020-12-17 9f326f4000847e6167d8166fa2f6a66f53cb3734
ZigbeeApp/Shared/Phone/UserCenter/Password/EditorGesturePasswordForm.cs
@@ -30,12 +30,12 @@
        public void ShowForm()
        {
            //界面右划不可
            UserView.HomePage.Instance.ScrollEnabled = false;
            this.ScrollEnabled = false;
            //设置头部信息
            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uGestureAuthentication));
            if (string.IsNullOrEmpty(UserCenterResourse.Option.GestureAuthentication) == false)
            if (string.IsNullOrEmpty(HdlUserCenterResourse.AccountOption.GestureAuthentication) == false)
            {
                formMode = FormMode.A验证前回密码;
            }
@@ -103,8 +103,8 @@
                    form.AddForm();
                };
                //底线
                int lineWidth = btnForgotPsw.GetRealWidthByText(12);
                var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false);
                int lineWidth = btnForgotPsw.GetRealWidthByText();
                var btnLine = new NormalViewControl(lineWidth, HdlControlResourse.BottomLineHeight, false);
                btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
                btnLine.Gravity = Gravity.CenterHorizontal;
                btnLine.Y = btnForgotPsw.Bottom - Application.GetRealHeight(8);
@@ -151,15 +151,15 @@
            }
            else if (formMode == FormMode.A验证前回密码)
            {
                if (UserCenterResourse.Option.GestureAuthentication != i_Psw)
                if (HdlUserCenterResourse.AccountOption.GestureAuthentication != i_Psw)
                {
                    UserCenterResourse.Option.PasswordGestureInputCount--;
                    if (UserCenterResourse.Option.PasswordGestureInputCount <= 0)
                    HdlUserCenterResourse.AccountOption.PasswordGestureInputCount--;
                    if (HdlUserCenterResourse.AccountOption.PasswordGestureInputCount <= 0)
                    {
                        //管理员身份验证失败,请重新登录
                        string msg2 = Language.StringByID(R.MyInternationalizationString.uCheckAdministratorFailAndReload);
                        this.ShowMassage(ShowMsgType.Tip, msg2);
                        UserCenterLogic.ReLoginAgain(Common.Config.Instance.Account);
                        HdlAccountLogic.Current.ReLoginAgain(Common.Config.Instance.Account);
                        return;
                    }
                    //手势错误,请重新输入
@@ -167,14 +167,14 @@
                    return;
                }
                //重置剩余密码次数
                UserCenterResourse.Option.ResetPasswordCount();
                HdlUserCenterResourse.AccountOption.ResetPasswordCount();
                formMode = FormMode.A修改密码;
                this.InitMiddleFrame();
            }
            else if (formMode == FormMode.A修改密码)
            {
                if (i_Psw == UserCenterResourse.Option.GestureAuthentication)
                if (i_Psw == HdlUserCenterResourse.AccountOption.GestureAuthentication)
                {
                    //新密码和原密码一致,请重新输入
                    pswControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.uNewPswAndOldPswIsEqual));
@@ -229,52 +229,31 @@
        /// <param name="psw">密码</param>
        private void SaveSecondaryPassword(PswGestureInputControl contr, string psw)
        {
            HdlThreadLogic.Current.RunThread(async () =>
            HdlThreadLogic.Current.RunThread(() =>
            {
                //打开进度条
                this.ShowProgressBar();
                var pra = new
                {
                    RequestVersion = Common.CommonPage.RequestVersion,
                    LoginAccessToken = Common.Config.Instance.Token,
                    GesturePwd = psw,
                    StringPwd = UserCenterResourse.Option.PswAuthentication
                };
                var result = await UserCenterLogic.GetResultStatuByRequestHttps("ZigbeeUsers/UpdatEexpandPwd", false, pra);
                var result = HdlAccountLogic.Current.EditorNumberAndGesturePassword(null, psw);
                //关闭进度条
                this.CloseProgressBar();
                if (result == false)
                HdlThreadLogic.Current.RunMain(() =>
                {
                    contr.SetErrorMsg(string.Empty);
                }
                else
                {
                    UserCenterResourse.Option.GestureAuthentication = psw;
                    UserCenterResourse.Option.Save();
                    HdlThreadLogic.Current.RunMain(() =>
                    if (result == false)
                    {
                        //修改密码失败
                        contr.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.uEditorPasswordFail));
                    }
                    else
                    {
                        HdlUserCenterResourse.AccountOption.GestureAuthentication = psw;
                        HdlUserCenterResourse.AccountOption.Save();
                        //界面关闭
                        this.CloseForm();
                    });
                }
                    }
                });
            });
        }
        #endregion
        #region ■ 界面关闭___________________________
        /// <summary>
        /// 界面关闭
        /// </summary>
        public override void CloseForm()
        {
            //界面右划可
            UserView.HomePage.Instance.ScrollEnabled = true;
            base.CloseForm();
        }
        #endregion