JLChen
2020-12-09 e87985ec1dcb69beedaf9f95e8e7aba14b7c08d6
HDL_ON/UI/UI1-Login/RegisterPageBLL.cs
@@ -69,7 +69,7 @@
            //选择手机注册
            btnPhoneLogin.MouseUpEventHandler = (sender, e) =>
            {
                if(registerType == 0)
                if (registerType == 0)
                {
                    return;
                }
@@ -207,7 +207,7 @@
                            }
                        }
                    }
                    if(accountType ==0)
                    if (accountType == 0)
                    {
                        registerPhone = etAccount.Text.Trim();
                    }
@@ -373,66 +373,91 @@
                    string account = etAccount.Text.Trim();
                    int time = 60;
                    //加载Loading效果
                    var waitPage = new Loading();
                    bodyView.AddChidren(waitPage);
                    waitPage.Start(Language.StringByID(StringId.PleaseWait));
                    new Thread(() =>
                    {
                        //1.先检查账号是否注册过
                        var result = pm.GetRegionByAccount(account);
                        //2.账号不存在,才允许继续注册
                        if (result.Code == StateCode.ACCOUNT_NOT_EXIST)
                        try
                        {
                            //账号不存在 未注册允许发送验证码注册
                            Application.RunOnMainThread(() =>
                            //1.先检查账号是否注册过
                            var result = pm.GetRegionByAccount(account);
                            //2.账号不存在,才允许继续注册
                            if (result.Code == StateCode.ACCOUNT_NOT_EXIST)
                            {
                                //短信发送间隔60s
                                (sender as Button).IsSelected = false;
                            });
                            //2.1 开始倒计时
                            new Thread(() =>
                            {
                                while (time > 0)
                                //账号不存在 未注册允许发送验证码注册
                                //2.2  获取验证码
                                ResponsePackNew resultObj;
                                if (registerType == 1)//邮箱
                                {
                                    time--;
                                    resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account);
                                }
                                else
                                {
                                    resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account, true, phoneZoneCode);
                                }
                                if (resultObj.Code != StateCode.SUCCESS)
                                {
                                    // 提示错误
                                    IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code);
                                }
                                else
                                {
                                    //2.1 开始倒计时
                                    Application.RunOnMainThread(() =>
                                    {
                                        (sender as Button).Text = time.ToString() + "s";
                                    });
                                    Thread.Sleep(1000);
                                }
                                Application.RunOnMainThread(() =>
                                {
                                    //回复获取短信按钮事件
                                    (sender as Button).IsSelected = true;
                                    (sender as Button).TextID = StringId.GetVerificationCode;
                                });
                            })
                            { IsBackground = true }.Start();
                                        //短信发送间隔60s
                                        (sender as Button).IsSelected = false;
                            //2.2  获取验证码
                            ResponsePackNew resultObj;
                            if (registerType == 1)//邮箱
                                    });
                                    new Thread(() =>
                                    {
                                        while (time > 0)
                                        {
                                            time--;
                                            Application.RunOnMainThread(() =>
                                            {
                                                (sender as Button).Text = time.ToString() + "s";
                                            });
                                            Thread.Sleep(1000);
                                        }
                                        Application.RunOnMainThread(() =>
                                        {
                                            //回复获取短信按钮事件
                                            (sender as Button).IsSelected = true;
                                            (sender as Button).TextID = StringId.GetVerificationCode;
                                        });
                                    })
                                    { IsBackground = true }.Start();
                                }
                            }
                            else if (result.Code.ToUpper() == StateCode.SUCCESS)
                            {
                                resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account);
                                //3.提示账号已存在,无法重复注册
                                Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.AccountAlreadyUse));
                            }
                            else
                            {
                                resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account, true, phoneZoneCode);
                                //4.提示其它异常错误
                                IMessageCommon.Current.ShowErrorInfoAlter(result.Code);
                            }
                            if (resultObj.Code != StateCode.SUCCESS)
                        }
                        catch { }
                        finally
                        {
                            Application.RunOnMainThread(() =>
                            {
                                // 提示错误
                                IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code);
                            }
                        }else if (result.Code.ToUpper() == StateCode.SUCCESS)
                        {
                            //3.提示账号已存在,无法重复注册
                            Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.AccountAlreadyUse));
                        } else
                        {
                            //4.提示其它异常错误
                            IMessageCommon.Current.ShowErrorInfoAlter(result.Code);
                                if (waitPage != null)
                                {
                                    waitPage.RemoveFromParent();
                                    waitPage = null;
                                }
                            });
                        }
                    })
                    { IsBackground = true }.Start();
@@ -494,7 +519,7 @@
        {
            btnRegister.MouseUpEventHandler = (sender, e) =>
            {
                if(etPassword.Text.Trim().Length > 13 || etPassword.Text.Trim().Length<6)
                if (etPassword.Text.Trim().Length > 13 || etPassword.Text.Trim().Length < 6)
                {
                    new Tip()
                    {
@@ -602,15 +627,19 @@
        /// </summary>
        void LoadEvent_Server()
        {
            //判断之前是否选择过
            if (UserInfo.Current.GlobalRegion != null && !string.IsNullOrEmpty(UserInfo.Current.GlobalRegion.regionUrl))
            {
                SetServerText();
            }
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
                Action selectAction = () =>
                {
                    //服务器选择过标记为true
                    isSelectServer = true;
                    ShowServerBottomLineState(false);
                    btnServerText.TextColor = CSS_Color.FirstLevelTitleColor;
                    btnServerText.Text = UserInfo.Current.GlobalRegion.regionName;
                    SetServerText();
                };
                new SelectServerDialog(selectAction).LoadPage();
@@ -653,5 +682,17 @@
                btnServerBottomLine.Height = Application.GetRealHeight(1);
            }
        }
        /// <summary>
        ///
        /// </summary>
        void SetServerText()
        {
            //服务器选择过标记为true
            isSelectServer = true;
            ShowServerBottomLineState(false);
            btnServerText.TextColor = CSS_Color.FirstLevelTitleColor;
            btnServerText.Text = UserInfo.Current.GlobalRegion.regionName;
        }
    }
}