| | |
| | | /// <param name="type">是否选择手机登录</param> |
| | | void LoginTypeChange(bool isPhone) |
| | | { |
| | | if(isPhone) |
| | | if (isPhone) |
| | | { |
| | | if (loginType == 0) |
| | | return; |
| | |
| | | if (verAccount == etPassword.Text.Trim()) |
| | | { |
| | | //跳转页面---- |
| | | MainPage.GoUserPage(); |
| | | MainPage.GoUserPage(true); |
| | | return; |
| | | } |
| | | }); |
| | |
| | | //} |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //20201223-登录成功之后,将下载数据完成标记标记为false,防止主页提前加载 |
| | | Common.ApiUtlis.Ins.DownloadDataComplete = false; |
| | | //跳转页面---- |
| | | MainPage.GoUserPage(); |
| | | MainPage.GoUserPage(true); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | //Application.RunOnMainThread(() => |
| | | //{ |
| | | // BindingResidencePage page = new BindingResidencePage(); |
| | | // MainPage.BaseView.AddChidren(page); |
| | | // page.LoadView(); |
| | | //}); |
| | | |
| | | |
| | | |
| | | //2020-11-13 待确认 |
| | | //获取住宅失败,重新标记为未登录状态 |
| | | UserInfo.Current.LastTime = DateTime.MinValue; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | //登录失败,请先添加住宅! |
| | | Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.FailedGetHomeList)); |
| | | //Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.FailedGetHomeList)); |
| | | } |
| | | } |
| | | } |
| | |
| | | //获取用户信息 |
| | | new Thread(() => |
| | | { |
| | | pm.GetUserHeadImage(revertData.userId); |
| | | pm.GetUserInfo(false); |
| | | pm.GetUserInfo(); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | |
| | | //账号或者密码错误 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | |
| | | if (loginResult.Code == "10008") |
| | | { |
| | | //用户名或密码错误 |
| | |
| | | btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | btnPasswordViewBottomLine.Height = Application.GetRealHeight(2); |
| | | } |
| | | waitPage.Hide(); |
| | | else if (loginResult.Code == StateCode.AccountLoginLock) |
| | | { |
| | | ShowAccountLoginLockTip(loginResult); |
| | | //var tipStr = Language.StringByID(StringId.AccountLoginLock) + "\r\n" + Language.StringByID(StringId.PleaseTryToForgetPassword); |
| | | //Utlis.ShowTip(tipStr); |
| | | return; |
| | | } |
| | | IMessageCommon.Current.ShowErrorInfoAlter(loginResult.Code); |
| | | }); |
| | | |
| | | IMessageCommon.Current.ShowErrorInfoAlter(loginResult.Code); |
| | | |
| | | } |
| | | 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> |
| | |
| | | bool LoadMethod_GetResidences() |
| | | { |
| | | var result = false; |
| | | var responsePack = pm.GetHomePager(); |
| | | if (responsePack == StateCode.SUCCESS) |
| | | var code = pm.GetHomePager(); |
| | | if (code == StateCode.SUCCESS) |
| | | { |
| | | ////2020-11-13 待确认,没有住宅,不算登录成功 |
| | | //if (UserInfo.Current.regionList != null && UserInfo.Current.regionList.Count > 0) |
| | |
| | | //2020-12-10 没有住宅登录成功,但是不能进入主界面 |
| | | result = true; |
| | | } |
| | | else if( code == "null") |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | MainPage.GoUserPage(false); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | // 提示错误 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(responsePack); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(code); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | { |
| | | btnRegister.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | //2020-12-22 增加点击隐藏键盘事件 |
| | | Application.HideSoftInput(); |
| | | |
| | | //判断是否同意了隐私政策 |
| | | if (CheckPrivacyPolicy() == false) return; |
| | | |
| | |
| | | MainPage.Log($"login callBackAction : {ex.Message}"); |
| | | } |
| | | }; |
| | | |
| | | |
| | | var registerPage = new RegisterPage(autoLoginAction); |
| | | registerPage.Show(); |
| | |
| | | { |
| | | btnForgetPassword.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | //2020-12-22 增加点击隐藏键盘事件 |
| | | Application.HideSoftInput(); |
| | | |
| | | //判断是否同意了隐私政策 |
| | | if (CheckPrivacyPolicy() == false) return; |
| | | |
| | |
| | | MainPage.Log($"login callBackAction : {ex.Message}"); |
| | | } |
| | | }; |
| | | |
| | | var forgetPasswordDialog = new ForgetPasswordPage(autoLoginAction); |
| | | forgetPasswordDialog.Show(); |
| | | forgetPasswordDialog.ShowDialog(); |