| | |
| | | using Shared; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.DAL.Server; |
| | | using System.Security.Cryptography; |
| | | using System.Text; |
| | | |
| | | namespace HDL_ON.UI.UI1Login |
| | | { |
| | |
| | | /// <param name="type">是否选择手机登录</param> |
| | | void LoginTypeChange(bool isPhone) |
| | | { |
| | | if(isPhone) |
| | | if (isPhone) |
| | | { |
| | | if (loginType == 0) |
| | | return; |
| | |
| | | } |
| | | else |
| | | { |
| | | BindingResidencePage page = new BindingResidencePage(); |
| | | MainPage.BaseView.AddChidren(page); |
| | | page.LoadView(); |
| | | //Application.RunOnMainThread(() => |
| | | //{ |
| | | // BindingResidencePage page = new BindingResidencePage(); |
| | | // MainPage.BaseView.AddChidren(page); |
| | | // page.LoadView(); |
| | | //}); |
| | | |
| | | |
| | | |
| | |
| | | UserInfo.Current.LastTime = DateTime.MinValue; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | //登录失败,请先添加住宅! |
| | | Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.FailedGetHomeList)); |
| | | //Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.FailedGetHomeList)); |
| | | } |
| | | } |
| | | } |
| | |
| | | IMessageCommon.Current.ShowErrorInfoAlter(loginResult.Code); |
| | | }); |
| | | |
| | | |
| | | |
| | | } |
| | | return result; |
| | | } |
| | |
| | | |
| | | var unlockDatetime = Utlis.UnixToDateTimeMS(revertData.unlockTime); |
| | | var unlockTimeInt = unlockDatetime.Minute - DateTime.Now.Minute; |
| | | if(unlockTimeInt <= 0) |
| | | if (unlockTimeInt <= 0) |
| | | { |
| | | unlockTimeInt = 1; |
| | | } |
| | |
| | | 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; |
| | | } |
| | |
| | | { |
| | | //2020-12-22 增加点击隐藏键盘事件 |
| | | Application.HideSoftInput(); |
| | | |
| | | |
| | | #if DEBUG |
| | | TestEZSDK(); |
| | | return; |
| | | #endif |
| | | |
| | | //判断是否同意了隐私政策 |
| | | if (CheckPrivacyPolicy() == false) return; |
| | |
| | | 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 |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="signstr"></param> |
| | | /// <returns></returns> |
| | | static string SignMD5Encrypt(string s) |
| | | { |
| | | byte[] sign = MD5.Create().ComputeHash(UTF8Encoding.UTF8.GetBytes(s)); |
| | | string signstr = string.Empty; |
| | | foreach (byte item in sign) |
| | | { |
| | | signstr += item.ToString("X2"); |
| | | } |
| | | return signstr.ToLower(); |
| | | } |
| | | |
| | | void TestEZSDK() |
| | | { |
| | | |
| | | #if __Android__ |
| | | #else |
| | | //设置子账号AccessToken方案 |
| | | EZSDK.IOS.EZSDK.SetEZAccessToken("ra.cekz6j9y1zg7mqgj3rmb099p49fuf6w3-9keosamseq-00wktld-brmhuciz1"); |
| | | |
| | | EZSDK.IOS.EZSDK.Go2EZvizMonitor(); |
| | | |
| | | |
| | | //var psw = SignMD5Encrypt("1aa98a90489b4838b966b57018b4b04b#123456"); |
| | | |
| | | //Utlis.WriteLine("MD5 psw: " + psw); |
| | | return; |
| | | #endif |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | { |
| | | //2020-12-22 增加点击隐藏键盘事件 |
| | | Application.HideSoftInput(); |
| | | |
| | | #if DEBUG |
| | | TestESVideo(); |
| | | return; |
| | | #endif |
| | | |
| | | //判断是否同意了隐私政策 |
| | | if (CheckPrivacyPolicy() == false) return; |