JLChen
2020-11-13 017af840d60fd6a56da9711308bf8239cb7fc1e6
HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs
@@ -300,12 +300,28 @@
                var account = etAccount.Text.Trim();
                if ((sender as Button).IsSelected)
                {
                    int time = 60;
                    new Thread(() =>
                    {
                        //1.先检查账号是否注册过
                        var result = pm.GetRegionByAccount(account);
                        if (result.Code != HttpUtil.SUCCESS_CODE)
                        {
                            IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code);
                            return;
                        }
                        else
                        {
                            //2.已经注册过,发送验证码找回密码
                            Application.RunOnMainThread(() =>
                            {
                    //短信发送间隔60s
                    (sender as Button).IsSelected = false;
                    etVerificationCode.Foucs = true;
                    //获取验证码
                        int time = 60;
                    new Thread(() => {
                            });
                            //2.1获取验证码倒计时
                            new Thread(() =>
                            {
                        while (time > 0)
                        {
                            time--;
@@ -321,41 +337,25 @@
                            (sender as Button).IsSelected = true;
                            (sender as Button).TextID = StringId.GetVerificationCode;
                        });
                    }){ IsBackground = true}.Start();
                    new Thread(() =>
                            })
                            { IsBackground = true }.Start();
                            ResponsePackNew resultObj;
                            //2.1请求获取验证码
                            if (registerType == 1)//邮箱
                    {
                        var result = pm.GetLoginVerCode(account);
                        if (result.StateCode.ToUpper() == "SUCCESS")
                        {
                                resultObj = pm.VerificationCodeSend(VerifyType.FORGOTPASSWORD, account);
                        }
                        else
                        {
                            string tipString = "Server error";
                            switch (result.StateCode)
                            {
                                case "Exist":
                                    tipString = Language.StringByID(StringId.AccountAlreadyUse);
                                    break;
                                case "SendFail":
                                    tipString = Language.StringByID(StringId.FailedToSendVerificationCode);
                                    break;
                                case "AccountNoExists":
                                    tipString = Language.StringByID(StringId.AccountNotExist);
                                    break;
                                case "Self:Net_Error":
                                    tipString = Language.StringByID(StringId.NetworkAnomaly);
                                    break;
                                resultObj = pm.VerificationCodeSend(VerifyType.FORGOTPASSWORD, account, true, phoneZoneCode);
                            }
                            Application.RunOnMainThread(() =>
                            if (resultObj.Code != HttpUtil.SUCCESS_CODE)
                            {
                                new Tip()
                                {
                                    CloseTime = 1,
                                    Direction = AMPopTipDirection.None,
                                    Text = tipString
                                }.Show(bodyView);
                            });
                                // 提示错误
                                IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code);
                            }
                        }
                    })
                    { IsBackground = true }.Start();
@@ -401,81 +401,29 @@
            return new Thread(() =>
            {
                var verResult = pm.ValidatorCode(account, verCode, countryIndex);
                if (verResult.StateCode.ToUpper() == "SUCCESS")
                {
                    var resetResult = pm.ResetPassword(account, password, repeatPassword, countryIndex);
                    if (resetResult.StateCode.ToUpper() == "SUCCESS")
                // 忘记密码
                var isPhone = registerType == 0;
                var resultObj = pm.ForgetPassword(account, password, verCode, isPhone);
                if (resultObj.Code == HttpUtil.SUCCESS_CODE)
                    {
                        Application.RunOnMainThread(() =>
                        {
                            LoadEvent_AutoLogin();
                            callbackAction?.Invoke(account);
                        });
                    }
                    else
                    {
                        string erorrInfo = "";
                        switch (resetResult.StateCode)
                        {
                            case "PwdNoConfirm"://两次输入的密码不一致
                                erorrInfo = Language.StringByID(StringId.IncorrectRepeatPassword);
                                break;
                            case "AccountNoExists"://两次输入的密码不一致
                                erorrInfo = Language.StringByID(StringId.AccountNotExist);
                                break;
                            default:
                                erorrInfo = "Server error";
                                break;
                        }
                    // 2020-11-13 待修改 验证码错误 警告提示
                    //btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
                    //btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2);
                        Application.RunOnMainThread(() =>
                        {
                            waitPage.Hide();
                            new Tip()
                            {
                                CloseTime = 1,
                                Direction = AMPopTipDirection.None,
                                Text = erorrInfo,
                            }.Show(bodyView);
                        });
                    }
                }
                else
                {
                    string erorrInfo = "";
                    switch (verResult.StateCode)
                    {
                        case "ValidCodeAndPhoneNoEqual"://验证码错误
                            erorrInfo = Language.StringByID(StringId.VerificationCodeWrong);
                            Application.RunOnMainThread(() =>
                            {
                                btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
                                btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2);
                            });
                            break;
                        case "NoRecord":
                            erorrInfo = Language.StringByID(StringId.PlsGetTheVerificationCode);
                            Application.RunOnMainThread(() =>
                            {
                                btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
                                btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2);
                            });
                            break;
                        default:
                            erorrInfo = "Server error";
                            break;
                    }
                    Application.RunOnMainThread(() =>
                    {
                        waitPage.Hide();
                        new Tip()
                        {
                            CloseTime = 1,
                            Direction = AMPopTipDirection.None,
                            Text = erorrInfo,
                        }.Show(bodyView);
                    });
                    // 提示错误
                    IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Member_ForgetPwd, resultObj.Code);
                }
            });
        }