gxc
2020-02-28 66a9965c44ecc32a6696abca876ab9d1cd091584
ZigbeeApp/Shared/Phone/UserCenter/Password/EditorGesturePasswordForm.cs
@@ -30,7 +30,7 @@
        public void ShowForm()
        {
            //界面右划不可
            UserView.HomePage.Instance.ScrollEnabled = false;
            this.ScrollEnabled = false;
            //设置头部信息
            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uGestureAuthentication));
@@ -103,7 +103,7 @@
                    form.AddForm();
                };
                //底线
                int lineWidth = btnForgotPsw.GetRealWidthByText(12);
                int lineWidth = btnForgotPsw.GetRealWidthByText();
                var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false);
                btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
                btnLine.Gravity = Gravity.CenterHorizontal;
@@ -146,10 +146,8 @@
                    pswControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.uGestureNotEqual));
                    return;
                }
                UserCenterResourse.Option.GestureAuthentication = i_Psw;
                UserCenterResourse.Option.Save();
                //关闭界面
                this.CloseForm();
                //保存密码
                this.SaveSecondaryPassword(pswControl, i_Psw);
            }
            else if (formMode == FormMode.A验证前回密码)
            {
@@ -176,6 +174,12 @@
            }
            else if (formMode == FormMode.A修改密码)
            {
                if (i_Psw == UserCenterResourse.Option.GestureAuthentication)
                {
                    //新密码和原密码一致,请重新输入
                    pswControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.uNewPswAndOldPswIsEqual));
                    return;
                }
                if (pswLength <= 4)
                {
                    //手势密码长度必须大于4
@@ -196,10 +200,8 @@
                    pswControl.SetErrorMsg(Language.StringByID(R.MyInternationalizationString.uGestureNotEqual));
                    return;
                }
                UserCenterResourse.Option.GestureAuthentication = i_Psw;
                UserCenterResourse.Option.Save();
                //关闭界面
                this.CloseForm();
                //保存密码
                this.SaveSecondaryPassword(pswControl, i_Psw);
            }
        }
@@ -218,17 +220,46 @@
        #endregion
        #region ■ 界面关闭___________________________
        #region ■ 保存密码___________________________
        /// <summary>
        /// 界面关闭
        /// 保存密码
        /// </summary>
        public override void CloseForm()
        /// <param name="contr">控件</param>
        /// <param name="psw">密码</param>
        private void SaveSecondaryPassword(PswGestureInputControl contr, string psw)
        {
            //界面右划可
            UserView.HomePage.Instance.ScrollEnabled = true;
            HdlThreadLogic.Current.RunThread(async () =>
            {
                //打开进度条
                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);
                //关闭进度条
                this.CloseProgressBar();
            base.CloseForm();
                if (result == false)
                {
                    contr.SetErrorMsg(string.Empty);
                }
                else
                {
                    UserCenterResourse.Option.GestureAuthentication = psw;
                    UserCenterResourse.Option.Save();
                    HdlThreadLogic.Current.RunMain(() =>
                    {
                        //界面关闭
                        this.CloseForm();
                    });
                }
            });
        }
        #endregion