JLChen
2021-02-02 c90de55be7a33e196029c1f4a1bb7f84ea449f29
HDL_ON/UI/UI1-Login/LoginPageBLL.cs
@@ -598,7 +598,7 @@
                            if (verAccount == etPassword.Text.Trim())
                            {
                                //跳转页面----
                                MainPage.GoUserPage();
                                MainPage.GoUserPage(true);
                                return;
                            }
                        });
@@ -629,8 +629,10 @@
                            //}
                            Application.RunOnMainThread(() =>
                            {
                                //20201223-登录成功之后,将下载数据完成标记标记为false,防止主页提前加载
                                Common.ApiUtlis.Ins.DownloadDataComplete = false;
                                //跳转页面----
                                MainPage.GoUserPage();
                                MainPage.GoUserPage(true);
                            });
                        }
                        else
@@ -754,10 +756,11 @@
                        btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
                        btnPasswordViewBottomLine.Height = Application.GetRealHeight(2);
                    }
                    else if (loginResult.Code == "10019")
                    else if (loginResult.Code == StateCode.AccountLoginLock)
                    {
                        var tipStr = Language.StringByID(StringId.AccountLoginLock) + "\r\n" + Language.StringByID(StringId.PleaseTryToForgetPassword);
                        Utlis.ShowTip(tipStr);
                        ShowAccountLoginLockTip(loginResult);
                        //var tipStr = Language.StringByID(StringId.AccountLoginLock) + "\r\n" + Language.StringByID(StringId.PleaseTryToForgetPassword);
                        //Utlis.ShowTip(tipStr);
                        return;
                    }
                    IMessageCommon.Current.ShowErrorInfoAlter(loginResult.Code);
@@ -766,6 +769,40 @@
            
            }
            return result;
        }
        /// <summary>
        /// 解析提示用户解锁时间
        /// 密码错误次数过多,账号被锁定!请通过忘记密码找回密码或{0}分钟后重试.
        /// </summary>
        /// <param name="loginResult"></param>
        void ShowAccountLoginLockTip(ResponsePackNew loginResult)
        {
            //密码错误次数过多,账号被锁定!
            var tipStr = Language.StringByID(StringId.AccountLoginLock);
            try
            {
                if (loginResult.extra != null)
                {
                    //请通过忘记密码找回密码或{0}分钟后重试.
                    var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountLoginLockExtraRes>(loginResult.extra.ToString());
                    string msg = Language.StringByID(StringId.PleaseTryToForgetPassword);
                    //var unlockTime = Utlis.UnixToDateTimeWithFormatMS(revertData.unlockTime, "HH:mm");
                    //msg = msg.Replace("{0}", unlockTime);
                    var unlockDatetime = Utlis.UnixToDateTimeMS(revertData.unlockTime);
                    var unlockTimeInt = unlockDatetime.Minute - DateTime.Now.Minute;
                    if(unlockTimeInt <= 0)
                    {
                        unlockTimeInt = 1;
                    }
                    msg = msg.Replace("{0}", unlockTimeInt.ToString());
                    tipStr = tipStr + "\r\n" + msg;
                }
            }
            catch { }
            Utlis.ShowTip(tipStr);
        }
        /// <summary>
@@ -800,6 +837,15 @@
        {
            btnRegister.MouseUpEventHandler += (sender, e) =>
            {
                //2020-12-22 增加点击隐藏键盘事件
                Application.HideSoftInput();
#if DEBUG
                TestEZSDK();
                return;
#endif
                //判断是否同意了隐私政策
                if (CheckPrivacyPolicy() == false) return;
@@ -814,11 +860,42 @@
                        MainPage.Log($"login callBackAction : {ex.Message}");
                    }
                };
                var registerPage = new RegisterPage(autoLoginAction);
                registerPage.Show();
                registerPage.ShowDialog();
            };
        }
        void TestESVideo()
        {
#if __Android__
#else
            //EZSDK.IOS.EZSDK.Go2EZvizMonitor();
            Shared.ESVideoInfo eSVideoInfo = new Shared.ESVideoInfo();
            eSVideoInfo.DeviceName = "室外机88";
            eSVideoInfo.ESVideoUUID = "JJY000019VPLLF";
            eSVideoInfo.ESRoomID = 801;
            eSVideoInfo.RoomName = "0801";
            Shared.ESVideo.ShowESVideoMonitor(eSVideoInfo);
            return;
#endif
        }
        void TestEZSDK()
        {
#if __Android__
#else
            EZSDK.IOS.EZSDK.Go2EZvizMonitor();
            return;
#endif
        }
        /// <summary>
@@ -828,6 +905,14 @@
        {
            btnForgetPassword.MouseUpEventHandler += (sender, e) =>
            {
                //2020-12-22 增加点击隐藏键盘事件
                Application.HideSoftInput();
#if DEBUG
                TestESVideo();
                return;
#endif
                //判断是否同意了隐私政策
                if (CheckPrivacyPolicy() == false) return;
@@ -843,6 +928,7 @@
                        MainPage.Log($"login callBackAction : {ex.Message}");
                    }
                };
                var forgetPasswordDialog = new ForgetPasswordPage(autoLoginAction);
                forgetPasswordDialog.Show();
                forgetPasswordDialog.ShowDialog();