| | |
| | | btnAccountViewBottomLine.Height = Application.GetRealHeight(2); |
| | | return; |
| | | } |
| | | btnGetVerificationCode.IsSelected = false ; |
| | | btnGetVerificationCode.TextColor = CSS_Color.PromptingColor1; |
| | | |
| | | int time = 60; |
| | | new Thread(() => |
| | | { |
| | | while (time > 0) |
| | | //1.先检查账号是否注册过 |
| | | var result = pm.GetRegionByAccount(account); |
| | | if (result.Code != StateCode.SUCCESS) |
| | | { |
| | | time--; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnGetVerificationCode.Text = time.ToString() + "s"; |
| | | }); |
| | | Thread.Sleep(1000); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code); |
| | | return; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnGetVerificationCode.IsSelected = true; |
| | | btnGetVerificationCode.TextID = StringId.GetVerificationCode; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | new Thread(() => |
| | | { |
| | | //获取验证码 |
| | | var result = pm.GetLoginVerCode(phoneNumber); |
| | | if (result.StateCode.ToUpper() == HttpUtil.SUCCESS_CODE) |
| | | { |
| | | } |
| | | //登录失败 |
| | | else |
| | | { |
| | | string tipStr = "Sever erorr"; |
| | | switch (result.StateCode.ToUpper()) |
| | | { |
| | | case "USERNAMEORPWDERROR": |
| | | tipStr = Language.StringByID(StringId.LoginFailed_AccountOrPasswordError); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | btnPasswordViewBottomLine.Height = Application.GetRealHeight(2); |
| | | }); |
| | | break; |
| | | case "ACCOUNTNOEXISTS": |
| | | tipStr = Language.StringByID(StringId.ACCOUNTNOEXISTS); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | btnAccountViewBottomLine.Height = Application.GetRealHeight(2); |
| | | }); |
| | | break; |
| | | case "SENDFAIL": |
| | | tipStr = Language.StringByID(StringId.FailedToSendVerificationCode); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | btnAccountViewBottomLine.Height = Application.GetRealHeight(2); |
| | | }); |
| | | break; |
| | | case "Self:Net_Error": |
| | | tipStr = Language.StringByID(StringId.NetworkAnomaly); |
| | | break; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //提示原因 |
| | | var tip = new Tip() |
| | | { |
| | | Text = tipStr, |
| | | CloseTime = 1, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(bodyView); |
| | | btnGetVerificationCode.IsSelected = false; |
| | | btnGetVerificationCode.TextColor = CSS_Color.PromptingColor1; |
| | | }); |
| | | new Thread(() => |
| | | { |
| | | while (time > 0) |
| | | { |
| | | time--; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnGetVerificationCode.Text = time.ToString() + "s"; |
| | | }); |
| | | Thread.Sleep(1000); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnGetVerificationCode.IsSelected = true; |
| | | btnGetVerificationCode.TextID = StringId.GetVerificationCode; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | //2.1请求获取验证码 |
| | | var resultObj = pm.VerificationCodeSend(VerifyType.VERIFY_LOGIN, account, true, phoneZoneCode); |
| | | if (resultObj.Code != StateCode.SUCCESS) |
| | | { |
| | | //2.2请求获取验证码失败 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | btnPasswordViewBottomLine.Height = Application.GetRealHeight(2); |
| | | }); |
| | | // 提示错误 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code); |
| | | } |
| | | } |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | // btnGetVerificationCode.IsSelected = false ; |
| | | // btnGetVerificationCode.TextColor = CSS_Color.PromptingColor1; |
| | | // int time = 60; |
| | | // new Thread(() => |
| | | // { |
| | | // while (time > 0) |
| | | // { |
| | | // time--; |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // btnGetVerificationCode.Text = time.ToString() + "s"; |
| | | // }); |
| | | // Thread.Sleep(1000); |
| | | // } |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // btnGetVerificationCode.IsSelected = true; |
| | | // btnGetVerificationCode.TextID = StringId.GetVerificationCode; |
| | | // }); |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | // new Thread(() => |
| | | // { |
| | | // //获取验证码 |
| | | // var result = pm.GetLoginVerCode(phoneNumber); |
| | | // if (result.StateCode.ToUpper() == StateCode.SUCCESS_CODE) |
| | | // { |
| | | // } |
| | | // //登录失败 |
| | | // else |
| | | // { |
| | | // string tipStr = "Sever erorr"; |
| | | // switch (result.StateCode.ToUpper()) |
| | | // { |
| | | // case "USERNAMEORPWDERROR": |
| | | // tipStr = Language.StringByID(StringId.LoginFailed_AccountOrPasswordError); |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | // btnPasswordViewBottomLine.Height = Application.GetRealHeight(2); |
| | | // }); |
| | | // break; |
| | | // case "ACCOUNTNOEXISTS": |
| | | // tipStr = Language.StringByID(StringId.ACCOUNTNOEXISTS); |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | // btnAccountViewBottomLine.Height = Application.GetRealHeight(2); |
| | | // }); |
| | | // break; |
| | | // case "SENDFAIL": |
| | | // tipStr = Language.StringByID(StringId.FailedToSendVerificationCode); |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | // btnAccountViewBottomLine.Height = Application.GetRealHeight(2); |
| | | // }); |
| | | // break; |
| | | // case "Self:Net_Error": |
| | | // tipStr = Language.StringByID(StringId.NetworkAnomaly); |
| | | // break; |
| | | // } |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // //提示原因 |
| | | // var tip = new Tip() |
| | | // { |
| | | // Text = tipStr, |
| | | // CloseTime = 1, |
| | | // Direction = AMPopTipDirection.None |
| | | // }; |
| | | // tip.Show(bodyView); |
| | | // }); |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | } |
| | | }; |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | //如果是账号密码登录,先检查一次账号是否注册过 |
| | | if (logintMode == 0) |
| | | { |
| | | //1.先检查账号是否注册过 |
| | | var result = pm.GetRegionByAccount(account); |
| | | if (result.Code != StateCode.SUCCESS) |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | //登录 |
| | | var loginResult = LoadMethod_Login(); |
| | | if( !string.IsNullOrEmpty (verAccount))//验证登录账号 |
| | |
| | | MainPage.GoUserPage(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | //2020-11-13 待确认 |
| | | MainPage.ShowAlertOnMainThread("登录失败,请先添加住宅。"); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | //调用验证码登录接口 |
| | | loginResult = pm.LoginValidCode(account, password); |
| | | } |
| | | if (loginResult.Code == HttpUtil.SUCCESS_CODE) |
| | | if (loginResult.Code == StateCode.SUCCESS) |
| | | { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(loginResult.Data.ToString()); |
| | | MainPage.LoginUser = new UserInfo |
| | |
| | | //登录失败 |
| | | else |
| | | { |
| | | //2020-11-12 待修改 |
| | | //2020-11-13 待修改 |
| | | string tipStr = "Sever erorr"; |
| | | switch (loginResult.Code) |
| | | { |
| | |
| | | { |
| | | var result = false; |
| | | var responsePack = pm.GetHomePager(); |
| | | |
| | | if (responsePack == HttpUtil.SUCCESS_CODE) |
| | | if (responsePack == StateCode.SUCCESS) |
| | | { |
| | | result = true; |
| | | //2020-11-13 待确认,没有住宅,不算登录成功 |
| | | if (MainPage.LoginUser.regionList != null && MainPage.LoginUser.regionList.Count > 0){ |
| | | result = true; |
| | | } |
| | | //result = true; |
| | | } |
| | | else |
| | | { |
| | | var tipStr = "Server erorr"; |
| | | switch (responsePack) |
| | | { |
| | | case "NoLogin": |
| | | tipStr = Language.StringByID(StringId.InvalidLoginCertificate); |
| | | break; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //提示原因 |
| | | var tip = new Tip() |
| | | { |
| | | Text = tipStr, |
| | | CloseTime = 1, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(bodyView); |
| | | }); |
| | | // 提示错误 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Gethomepager, responsePack); |
| | | } |
| | | return result; |
| | | } |