| | |
| | | using Shared.SimpleControl; |
| | | using System; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Security.Cryptography; |
| | | using System.Text; |
| | | using System.Text.RegularExpressions; |
| | | using Shared.SimpleControl.R; |
| | | |
| | | namespace Shared.SimpleControl.Phone |
| | | { |
| | |
| | | //etAccount.Text = "18926269190@189.cn"; |
| | | //etAccount.Text = "721343314@qq.com"; |
| | | //etAccount.Text = "crabtreel12019@gmail.com"; |
| | | etAccount.Text = "2791308028@qq.com"; |
| | | //etAccount.Text = "2791308028@qq.com"; |
| | | etAccount.Text = "551775569@qq.com"; |
| | | |
| | | //etAccount.Text = "cjl@hdlchina.com.cn"; |
| | | #endif |
| | | |
| | | accountView.AddChidren (etAccount); |
| | |
| | | Text = password, |
| | | }; |
| | | #if DEBUG |
| | | etPasswrod.Text = "123456"; |
| | | //etPasswrod.Text = "123456"; |
| | | etPasswrod.Text = "123456-Aa"; |
| | | #endif |
| | | passwrodView.AddChidren (etPasswrod); |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | //检测账号是否锁定 |
| | | if (CommonConfig.Current.CheckIfLock (account)) { |
| | | return; |
| | | } |
| | | ////检测账号是否锁定 |
| | | //if (CommonConfig.Current.CheckIfLock (account)) { |
| | | // return; |
| | | //} |
| | | |
| | | System.Threading.Tasks.Task.Run (() => { |
| | | try { |
| | |
| | | if (UserConfig.Instance.internetStatus == 0) { |
| | | Application.RunOnMainThread (() => { |
| | | Utlis.ShowTip ("Network abnormal, unable to connect to the Internet"); |
| | | |
| | | //new Tip () { Text = "Network abnormal, unable to connect to the Internet", Direction = AMPopTipDirection.Down, CloseTime = 3 }.Show (btnLogo); |
| | | }); |
| | | return; |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="stateCodeStr"></param> |
| | | void ShowGetHomePagerErrorInfo (string stateCodeStr) |
| | | { |
| | | string mes = ""; |
| | | //2020-01-06 待补充 |
| | | if (stateCodeStr == ErrorCode.NetworkError) { |
| | | mes = ErrorCode.NetworkError; |
| | | } else { |
| | | mes = ErrorCode.OperationFailed + ErrorCode.Reason + stateCodeStr; |
| | | |
| | | } |
| | | if (!string.IsNullOrEmpty (mes)) { |
| | | Application.RunOnMainThread (() => { |
| | | new Alert ("", mes, Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | | }); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | ///// <summary> |
| | | ///// |
| | | ///// </summary> |
| | | ///// <param name="stateCodeStr"></param> |
| | | //void ShowGetAllBindGatewarysPaggerErrorInfo (string stateCodeStr) |
| | | //{ |
| | | // string mes = ""; |
| | | // //2020-01-06 待补充 |
| | | // if (stateCodeStr == ErrorCode.NetworkError) { |
| | | // mes = ErrorCode.NetworkError; |
| | | // } else { |
| | | // mes = ErrorCode.OperationFailed + ErrorCode.Reason + stateCodeStr; |
| | | |
| | | // } |
| | | // if (!string.IsNullOrEmpty (mes)) { |
| | | // Application.RunOnMainThread (() => { |
| | | // new Alert ("", mes, Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | | // }); |
| | | // } |
| | | |
| | | |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 登录 2020-01-11 |
| | | /// </summary> |
| | |
| | | Room.InitAllRoom (); |
| | | } else { |
| | | |
| | | //if (findRoom == null) { |
| | | if (mHomeLists != null && mHomeLists.Count > 0) { |
| | | var bFind = false; |
| | | foreach (var mHome in mHomeLists) { |
| | |
| | | break; |
| | | } |
| | | } |
| | | //if (!bFind) { |
| | | // UserConfig.Instance.CurrentRegion = revertRoomData [0]; |
| | | //} |
| | | |
| | | if (!bFind) { |
| | | var findRoom2 = mHomeLists.Find ((obj) => obj.IsOthreShare == false); |
| | | if (findRoom2 != null) { |
| | |
| | | |
| | | IO.FileUtils.DeleteAllFile (); |
| | | } |
| | | //}else { |
| | | // //刷新住宅 解决子账号问题 |
| | | // UserConfig.Instance.CurrentRegion = findRoom; |
| | | // Room.InitAllRoom (); |
| | | //} |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | ////原方案 |
| | | //GetAllBindGatewarysPagger (revertRoomData); |
| | | ////获取当前住宅网关方案 |
| | |
| | | IMessageCommon.Current.ShowErrorInfoAlter (revertObjCode); |
| | | } |
| | | } else { |
| | | |
| | | //提示登录锁定 |
| | | if (revertObj.Code == StateCode.AccountLoginLock) { |
| | | Application.RunOnMainThread (() => { |
| | | ShowAccountLoginLockTip (revertObj); |
| | | }); |
| | | return; |
| | | } |
| | | IMessageCommon.Current.ShowErrorInfoAlter (revertObj.Code); |
| | | } |
| | | } |
| | | |
| | | private void SetMqttHost (string URL) { |
| | | string pattern = @"(http|https)://(?<domain>[^(:|/]*)"; |
| | | //private void SetMqttHost (string URL) { |
| | | // string pattern = @"(http|https)://(?<domain>[^(:|/]*)"; |
| | | |
| | | Regex reg = new Regex (pattern, RegexOptions.IgnoreCase); |
| | | Match m = reg.Match (URL); |
| | | string mResult = m.Value; |
| | | if (!string.IsNullOrEmpty (mResult)) { |
| | | MainPage.RequestHttpsHostMqtt = mResult; |
| | | } |
| | | } |
| | | // Regex reg = new Regex (pattern, RegexOptions.IgnoreCase); |
| | | // Match m = reg.Match (URL); |
| | | // string mResult = m.Value; |
| | | // if (!string.IsNullOrEmpty (mResult)) { |
| | | // MainPage.RequestHttpsHostMqtt = mResult; |
| | | // } |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 保存数据 并加载页面 |
| | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 解析提示用户解锁时间 |
| | | /// 密码错误次数过多,账号被锁定!请通过忘记密码找回密码或{0}分钟后重试. |
| | | /// </summary> |
| | | /// <param name="loginResult"></param> |
| | | void ShowAccountLoginLockTip (ResponsePackNew loginResult) |
| | | { |
| | | //密码错误次数过多,账号被锁定! |
| | | var tipStr = Language.StringByID (MyInternationalizationString.AccountLoginLock); |
| | | try { |
| | | if (loginResult.extra != null) { |
| | | //请通过忘记密码找回密码或{0}分钟后重试. |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountLoginLockExtraRes> (loginResult.extra.ToString ()); |
| | | string msg = Language.StringByID (MyInternationalizationString.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> |