| | |
| | | 704=Non Chinese users choose |
| | | 705=Please select a server |
| | | 706=NewEnergy |
| | | 707=Off-line Controlling, to switch to remote control, click here to login. |
| | | 708=Your current login status has expired, please log in again. |
| | | 709=Log in |
| | | 710=Off-line Control |
| | | |
| | | |
| | | |
| | |
| | | 704=非中国用户选择 |
| | | 705=请选择服务器 |
| | | 706=新能源 |
| | | |
| | | |
| | | |
| | | 707=离线控制中,如需切换至远程控制,点此登录 |
| | | 708=您当前的登录状态已经失效,请重新登录 |
| | | 709=去登录 |
| | | 710=离线控制 |
| | | |
| | | |
| | | |
| | |
| | | 704=Non Chinese users choose |
| | | 705=Please select a server |
| | | 706=NewEnergy |
| | | |
| | | 707=Off-line Controlling, to switch to remote control, click here to login. |
| | | 708=Your current login status has expired, please log in again. |
| | | 709=Log in |
| | | 710=Off-line Control |
| | | |
| | | |
| | | |
| | |
| | | 704=Non Chinese users choose |
| | | 705=Please select a server |
| | | 706=NewEnergy |
| | | |
| | | 707=Off-line Controlling, to switch to remote control, click here to login. |
| | | 708=Your current login status has expired, please log in again. |
| | | 709=Log in |
| | | 710=Off-line Control |
| | | |
| | | |
| | | |
| | |
| | | 704=Non Chinese users choose |
| | | 705=Please select a server |
| | | 706=NewEnergy |
| | | |
| | | 707=Off-line Controlling, to switch to remote control, click here to login. |
| | | 708=Your current login status has expired, please log in again. |
| | | 709=Log in |
| | | 710=Off-line Control |
| | | |
| | | |
| | | |
| | |
| | | 704=Non Chinese users choose |
| | | 705=Please select a server |
| | | 706=NewEnergy |
| | | |
| | | 707=Off-line Controlling, to switch to remote control, click here to login. |
| | | 708=Your current login status has expired, please log in again. |
| | | 709=Log in |
| | | 710=Off-line Control |
| | | |
| | | |
| | | |
| | |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Acst\Inverter\BatteryIconDischarg100.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Acst\Inverter\BatteryIconFault100.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Acst\Inverter\BatteryIconShutdown100.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\TokenInvalidTipIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Public\RightIcon2.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidResource Include="Resources\values\colors.xml" /> |
| | |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Acst\Inverter\BatteryIconDischarg100.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Acst\Inverter\BatteryIconFault100.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Acst\Inverter\BatteryIconShutdown100.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\TokenInvalidTipIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\RightIcon2.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
| | |
| | | 704=Non Chinese users choose |
| | | 705=Please select a server |
| | | 706=NewEnergy |
| | | 707=Off-line Controlling, to switch to remote control, click here to login. |
| | | 708=Your current login status has expired, please log in again. |
| | | 709=Log in |
| | | 710=Off-line Control |
| | | |
| | | |
| | | |
| | |
| | | 704=非中国用户选择 |
| | | 705=请选择服务器 |
| | | 706=新能源 |
| | | |
| | | |
| | | |
| | | 707=离线控制中,如需切换至远程控制,点此登录 |
| | | 708=您当前的登录状态已经失效,请重新登录 |
| | | 709=去登录 |
| | | 710=离线控制 |
| | | |
| | | |
| | | |
| | |
| | | 704=Non Chinese users choose |
| | | 705=Please select a server |
| | | 706=NewEnergy |
| | | |
| | | 707=Off-line Controlling, to switch to remote control, click here to login. |
| | | 708=Your current login status has expired, please log in again. |
| | | 709=Log in |
| | | 710=Off-line Control |
| | | |
| | | |
| | | |
| | |
| | | 704=Non Chinese users choose |
| | | 705=Please select a server |
| | | 706=NewEnergy |
| | | |
| | | 707=Off-line Controlling, to switch to remote control, click here to login. |
| | | 708=Your current login status has expired, please log in again. |
| | | 709=Log in |
| | | 710=Off-line Control |
| | | |
| | | |
| | | |
| | |
| | | 704=Non Chinese users choose |
| | | 705=Please select a server |
| | | 706=NewEnergy |
| | | |
| | | 707=Off-line Controlling, to switch to remote control, click here to login. |
| | | 708=Your current login status has expired, please log in again. |
| | | 709=Log in |
| | | 710=Off-line Control |
| | | |
| | | |
| | | |
| | |
| | | 704=Non Chinese users choose |
| | | 705=Please select a server |
| | | 706=NewEnergy |
| | | |
| | | 707=Off-line Controlling, to switch to remote control, click here to login. |
| | | 708=Your current login status has expired, please log in again. |
| | | 709=Log in |
| | | 710=Off-line Control |
| | | |
| | | |
| | | |
| | |
| | | using System.Threading.Tasks; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI; |
| | | using HDL_ON.UI.UI2.FuntionControlView.Video; |
| | | using HDL_ON.UI.UI2.Intelligence.Automation; |
| | | using Newtonsoft.Json; |
| | |
| | | string code = StateCode.SUCCESS; |
| | | |
| | | Inverter.Ins.H5Page = null;//重置光伏页面 |
| | | var downloadDataThread = new System.Threading.Thread(async() => |
| | | var downloadDataThread = new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | |
| | | return; |
| | | } |
| | | MainPage.Log($"刷新个人信息成功"); |
| | | |
| | | //int count = 0; |
| | | //while (count < 10) |
| | | //{ |
| | | // if (DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull()) |
| | | // { |
| | | // System.Threading.Thread.Sleep(200); |
| | | // } |
| | | // else |
| | | // { |
| | | // break; |
| | | // } |
| | | // count++; |
| | | //} |
| | | //if (DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull()) |
| | | //{ |
| | | // return; |
| | | //} |
| | | |
| | | //return; |
| | | |
| | | try |
| | | { |
| | |
| | | catch (Exception ex){ |
| | | MainPage.Log("Error", $"读取本地数据异常:{ex.StackTrace}"); |
| | | } |
| | | |
| | | try |
| | | { |
| | | HomePage.LoadEvent_CheckTokenValid(); |
| | | if (IsValidToken && !UserInfo.Current.IsTipedInvalidToken) |
| | | { |
| | | UserInfo.Current.IsTipedInvalidToken = true; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.TokenInvalidTipMsg, StringId.OfflineControl, StringId.GoLogin, () => |
| | | { |
| | | HDLCommon.Current.Logout(); |
| | | }); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"提示登录凭证窗口加载异常:{ex.StackTrace}"); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"更新登录凭证方法调用异常:{ex.StackTrace}"); |
| | | } |
| | | } |
| | | } |
| | | }) |
| | |
| | | { |
| | | lock (FunctionList.List.securities) |
| | | { |
| | | var pack = Ins.HttpRequest.GetSecurityList(); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | try |
| | | { |
| | | var packList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(pack.Data.ToString()); |
| | | Console.WriteLine("安防总数:" + packList.Count); |
| | | var sidList = new List<string>(); |
| | | foreach (var function in packList) |
| | | var pack = Ins.HttpRequest.GetSecurityList(); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | sidList.Add(function.sid); |
| | | } |
| | | var infoListPack = Ins.httpRequest.GetSecurityInfo(sidList, new List<string>()); |
| | | var infoList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(infoListPack.Data.ToString()); |
| | | if (infoList != null) |
| | | { |
| | | var filePathList = FileUtlis.Files.ReadFiles().FindAll((obj) => obj.StartsWith("SecurityData_")); |
| | | if (filePathList != null) |
| | | var packList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(pack.Data.ToString()); |
| | | Console.WriteLine("安防总数:" + packList.Count); |
| | | var sidList = new List<string>(); |
| | | foreach (var function in packList) |
| | | { |
| | | foreach (var file in filePathList) |
| | | sidList.Add(function.sid); |
| | | } |
| | | if (sidList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | var infoListPack = Ins.httpRequest.GetSecurityInfo(sidList, new List<string>()); |
| | | var infoList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(infoListPack.Data.ToString()); |
| | | if (infoList != null) |
| | | { |
| | | var filePathList = FileUtlis.Files.ReadFiles().FindAll((obj) => obj.StartsWith("SecurityData_")); |
| | | if (filePathList != null) |
| | | { |
| | | FileUtlis.Files.DeleteFile(file); |
| | | foreach (var file in filePathList) |
| | | { |
| | | FileUtlis.Files.DeleteFile(file); |
| | | } |
| | | } |
| | | FunctionList.List.securities.Clear(); |
| | | foreach (var function in infoList) |
| | | { |
| | | function.SaveFile(); |
| | | FunctionList.List.IniFunctionList(function.savePath, true); |
| | | } |
| | | } |
| | | FunctionList.List.securities.Clear(); |
| | | foreach (var function in infoList) |
| | | { |
| | | function.SaveFile(); |
| | | FunctionList.List.IniFunctionList(function.savePath, true); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MainPage.Log($"读取安防列表失败:Code:{pack.Code}; Msg:{pack.message}"); |
| | | } |
| | | } |
| | | else |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"读取安防列表失败:Code:{pack.Code}; Msg:{pack.message}"); |
| | | MainPage.Log("Error", $"读取安防列表失败:Code:{ex.StackTrace}"); |
| | | } |
| | | } |
| | | } |
| | |
| | | //6.清空Siri共享数据信息 |
| | | new Other.SkipControl().SetData(false, "", "", "", ""); |
| | | var sDM = new SiriKit.SceneDateManager(); |
| | | Console.WriteLine($"IsLogin:{sDM.IsLgoin};accessToken:{sDM.AccessToken};refreshToken:{sDM.RefreshToken};RegionUrl:{sDM.RegionUrl};HomeId:{sDM.HomeId}"); |
| | | //Console.WriteLine($"IsLogin:{sDM.IsLgoin};accessToken:{sDM.AccessToken};refreshToken:{sDM.RefreshToken};RegionUrl:{sDM.RegionUrl};HomeId:{sDM.HomeId}"); |
| | | #endif |
| | | } |
| | | catch (Exception ex) |
| | |
| | | { |
| | | public static class StringId |
| | | { |
| | | |
| | | /// <summary> |
| | | /// 离线控制 |
| | | /// </summary> |
| | | public const int OfflineControl = 710; |
| | | /// <summary> |
| | | /// 去登录 |
| | | /// </summary> |
| | | public const int GoLogin = 709; |
| | | /// <summary> |
| | | /// 您当前的登录状态已经失效,请重新登录 |
| | | /// </summary> |
| | | public const int TokenInvalidTipMsg = 708; |
| | | /// <summary> |
| | | /// 离线控制中,如需切换至远程控制,点此登录 |
| | | /// </summary> |
| | | public const int TokenInvalidMsg = 707; |
| | | /// <summary> |
| | | /// 新能源 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public List<RegionInfoRes> regionList = new List<RegionInfoRes>(); |
| | | /// <summary> |
| | | /// token是否有效 |
| | | /// </summary> |
| | | public bool ValidToken = false; |
| | | /// <summary> |
| | | /// 是否提示过Token过期 |
| | | /// </summary> |
| | | public bool IsTipedInvalidToken = false; |
| | | /// <summary> |
| | | /// 上一次登录时间 |
| | | /// </summary> |
| | | public DateTime LastTime = DateTime.MinValue; |
| | | //public DateTime LastTime = DateTime.MinValue; |
| | | /// <summary> |
| | | /// 是否是登录状态 |
| | | /// </summary> |
| | | public bool IsLogin |
| | | { |
| | | get |
| | | { |
| | | return (DateTime.Now - LastTime).TotalDays < 7; |
| | | } |
| | | } |
| | | //public bool IsLogin = false; |
| | | //{ |
| | | // get |
| | | // { |
| | | // return (DateTime.Now - LastTime).TotalDays < 7; |
| | | // } |
| | | //} |
| | | |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public DateTime LastTimeOpenDoor = DateTime.MinValue; |
| | |
| | | public void SearchLoaclGateway() |
| | | { |
| | | //2021-01-15 : 住宅没有绑定网关的时候不用搜索,并且不能链接mqtt |
| | | if (DB_ResidenceData.Instance.HomeGateway == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.gatewayId) || |
| | | !UserInfo.Current.IsLogin) |
| | | if (DB_ResidenceData.Instance.HomeGateway == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.gatewayId)) |
| | | //|| !UserInfo.Current.IsLogin) |
| | | { |
| | | return; |
| | | } |
| | |
| | | /// <returns></returns> |
| | | public void ConvertReceiveData(byte[] receiveBytes, string ip) |
| | | { |
| | | if (!UserInfo.Current.IsLogin) |
| | | { |
| | | return; |
| | | } |
| | | //if (!UserInfo.Current.IsLogin) |
| | | //{ |
| | | // return; |
| | | //} |
| | | var reString = Encoding.UTF8.GetString(receiveBytes); |
| | | AnalysisReceiveData(reString, receiveBytes, ip); |
| | | } |
| | |
| | | try |
| | | { |
| | | //账号没登录不回复 |
| | | if ( UserInfo.Current == null || ! UserInfo.Current.IsLogin) |
| | | if ( UserInfo.Current == null )///|| ! UserInfo.Current.IsLogin) |
| | | { |
| | | return; |
| | | } |
| | |
| | | } |
| | | MainPage.LinkHdlMqttCount++; |
| | | |
| | | if (!UserInfo.Current.IsLogin) |
| | | { |
| | | return; |
| | | } |
| | | //if (!UserInfo.Current.IsLogin) |
| | | //{ |
| | | // return; |
| | | //} |
| | | if (DB_ResidenceData.Instance.CurrentRegion == null || DB_ResidenceData.Instance.CurrentRegion.id == null) |
| | | { |
| | | return; |
| | |
| | | return; |
| | | } |
| | | |
| | | if (!UserInfo.Current.IsLogin) |
| | | { |
| | | return; |
| | | } |
| | | //if (!UserInfo.Current.IsLogin) |
| | | //{ |
| | | // return; |
| | | //} |
| | | |
| | | DisConnectRemoteMqttClient("挤下线"); |
| | | |
| | |
| | | UserInfo.Current.LoginTokenString = revertData.headerPrefix + revertData.accessToken; |
| | | UserInfo.Current.AccessToken = revertData.accessToken; |
| | | UserInfo.Current.RefreshToken = revertData.refreshToken; |
| | | UserInfo.Current.LastTime = DateTime.Now; |
| | | UserInfo.Current.ValidToken = true; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | |
| | | #if __IOS__ |
| | |
| | | } |
| | | else if (revertObj.Code == StateCode.PasswrodError) |
| | | { |
| | | UserInfo.Current.LastTime = DateTime.MinValue; |
| | | UserInfo.Current.ValidToken = false; |
| | | } |
| | | #if __IOS__ |
| | | else if (revertObj.Code == "10001") |
| | |
| | | if (canRefresh) |
| | | { |
| | | UserInfo.Current.RefreshToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GRefreshToken); |
| | | //UserInfo.Current.AccessToken = SiriKit.NSUserDefaultsHelper.DataSuite.StringForKey(SiriKit.NSUserDefaultsHelper.StorageKeys.GLOBAL_GAccessToken); |
| | | RefreshToken(false); |
| | | } |
| | | } |
| | |
| | | |
| | | BaseView = Application.MainPage; |
| | | Application.MainPage.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | //Application.MainPage.BackgroundColor = 0xFFFF0000;// CSS_Color.MainBackgroundColor; |
| | | //BaseView = new FrameLayout() |
| | | //{ |
| | | // Y = Application.GetRealHeight(20), |
| | | // Width = Application.GetRealWidth(376), |
| | | // Height = Application.GetRealHeight(667), |
| | | //}; |
| | | //Application.MainPage.AddChidren(BaseView); |
| | | Language.UpdateLanguage(); |
| | | //#region 测试 |
| | | //var ddd = new UI.test.TestDialog(); |
| | | //ddd.InitView(); |
| | | //return; |
| | | //#endregion |
| | | |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.LastLoginUserId)) |
| | | { |
| | | GoLoginPage(); |
| | | GoLoginPage(UserInfo.Current); |
| | | } |
| | | else |
| | | { |
| | | //判断需不需要登录,有没有登录,或者登录是否过期, |
| | | if (UserInfo.Current == null || !UserInfo.Current.IsLogin) |
| | | if (UserInfo.Current == null)// || !UserInfo.Current.IsLogin) |
| | | { |
| | | GoLoginPage(UserInfo.Current); |
| | | } |
| | | else |
| | | { |
| | | //new System.Threading.Thread(() => |
| | | //{ |
| | | // var pm = new DAL.Server.HttpServerRequest(); |
| | | // pm.RefreshToken();//刷新Token |
| | | // pm.GetHomePager();//刷新住宅信息 |
| | | // pm.GetUserInfo();//刷新个人信息 |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | Common.ApiUtlis.Ins.DownloadData(); |
| | | |
| | | GoUserPage(false, true); |
| | | } |
| | | } |
| | |
| | | |
| | | } |
| | | |
| | | //#if __ANDROID__ |
| | | // new System.Threading.Thread(async () => |
| | | // { |
| | | // int i = 10; |
| | | // while (i < 10) { |
| | | // try |
| | | // { |
| | | // var location_android = await HDL_ON_Android.LocationUtils.GetCurrentLocationAsync(); |
| | | // if (location_android != null) |
| | | // { |
| | | // MainPage.cityInfo.lat = location_android.Latitude.ToString(); |
| | | // MainPage.cityInfo.lon = location_android.Longitude.ToString(); |
| | | // new HDL_ON.DAL.Server.HttpServerRequest().GetCityWeatherInfo(MainPage.cityInfo.lon.Replace(",", "."), MainPage.cityInfo.lat.ToString().Replace(",", ".")); |
| | | // i = 100; |
| | | // Application.RunOnMainThread(() => { |
| | | // HomePage.LoadEvent_RefreshAir(); |
| | | // }); |
| | | // } |
| | | // else |
| | | // { |
| | | // i++; |
| | | // } |
| | | // } catch (Exception ex) |
| | | // { |
| | | // Log($"经纬度获取异常: {ex.Message}"); |
| | | // } |
| | | // } |
| | | // }) |
| | | // { IsBackground = true }.Start(); |
| | | //#endif |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | } |
| | | catch { } |
| | | OnAppConfig.Instance.LastLoginUserId = ""; |
| | | UserInfo.Current.ClearUserInfo(); |
| | | BaseView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | var fisrtView = new UI.UI1Login.LoginPage(); |
| | | fisrtView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | |
| | | { |
| | | TipOptionMsg(titleId, Language.StringByID(msgId), callBackAction); |
| | | } |
| | | |
| | | public void TipOptionMsg(int titleId, int msgId,int cancelTextId,int confrimTextId, Action callBackAction) |
| | | { |
| | | TipOptionMsg(titleId, Language.StringByID(msgId), callBackAction, 0,cancelTextId, confrimTextId); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载提示弹窗 |
| | | /// </summary> |
| | | /// <param name="titleId"></param> |
| | | /// <param name="msgId"></param> |
| | | /// <param name="callBackAction"></param> |
| | | public void TipOptionMsg(int titleId, string msg, Action callBackAction,int extraHeight = 0) |
| | | public void TipOptionMsg(int titleId, string msg, Action callBackAction,int extraHeight = 0, int cancelTextId = StringId.Cancel, int confrimTextId = StringId.Confirm) |
| | | { |
| | | Dialog dialog = new Dialog() |
| | | { |
| | |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | //SelectedTextColor = CSS_Color.MainBackgroundColor, |
| | | //SelectedBackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.Cancel, |
| | | TextID = cancelTextId, |
| | | }; |
| | | contentView.AddChidren(btnCancel); |
| | | |
| | |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.Confirm, |
| | | TextID = confrimTextId, |
| | | }; |
| | | contentView.AddChidren(btnConfirm); |
| | | //例:右下圆角 大小为50 |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Common; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | |
| | | /// <summary> |
| | | /// 连接状态提示 |
| | | /// </summary> |
| | | FrameLayout divLinkStateTip; |
| | | FrameLayout linkStateMsgView; |
| | | /// <summary> |
| | | /// 登录状态提示区域 |
| | | /// </summary> |
| | | FrameLayout tokenInvalidMsgView; |
| | | /// <summary> |
| | | /// 安防状态图标 |
| | | /// </summary> |
| | |
| | | }; |
| | | topView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(113),//216), |
| | | Height = Application.GetRealHeight(113) + Application.GetRealWidth(24),//216), |
| | | BackgroundImagePath = DB_ResidenceData.Instance.residenceImage, |
| | | }; |
| | | bodyView.AddChidren(topView); |
| | | #else |
| | | VerticalRefreshLayout refreshLayout = new VerticalRefreshLayout() |
| | | { |
| | | Height = Application.GetRealHeight(113),//216), |
| | | Height = Application.GetRealHeight(113) + Application.GetRealWidth(24),//216), |
| | | BackgroundImagePath = DB_ResidenceData.Instance.residenceImage, |
| | | }; |
| | | bodyView.AddChidren(refreshLayout); |
| | |
| | | }; |
| | | topView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(113),//216), |
| | | Height = Application.GetRealHeight(113) + Application.GetRealWidth(24),//216), |
| | | }; |
| | | refreshLayout.AddChidren(topView); |
| | | #endif |
| | | #region topView |
| | | |
| | | |
| | | |
| | | Button btnTop; |
| | | btnTop = new Button() |
| | | topView.AddChidren(new Button() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor2, |
| | | }; |
| | | topView.AddChidren(btnTop); |
| | | }); |
| | | |
| | | topView.AddChidren( |
| | | new Button() {Y = Application.GetRealHeight(113), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | Height = Application.GetRealWidth(24) }); |
| | | |
| | | #region topView |
| | | |
| | | btnResidenceName = new Button() |
| | | { |
| | |
| | | IsBold = true |
| | | }; |
| | | topView.AddChidren(btnResidenceName); |
| | | //登录凭证是否有效 |
| | | CheckTokenValid(); |
| | | |
| | | divLinkStateTip = new FrameLayout() |
| | | #region 网关连接状态 |
| | | linkStateMsgView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(113) - Application.GetRealWidth(24), |
| | | Y = ApiUtlis.Ins.IsValidToken ? Application.GetRealHeight(113) : Application.GetRealHeight(113) - Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | BackgroundColor = 0xFFFF4747, |
| | | Visible = false, |
| | | }; |
| | | topView.AddChidren(divLinkStateTip); |
| | | topView.AddChidren(linkStateMsgView); |
| | | |
| | | Button btnLinkStateIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | |
| | | Height = Application.GetRealWidth(20), |
| | | UnSelectedImagePath = "Collection/GatewayOnlineTipIcon.png" |
| | | }; |
| | | divLinkStateTip.AddChidren(btnLinkStateIcon); |
| | | linkStateMsgView.AddChidren(btnLinkStateIcon); |
| | | |
| | | var btnLinkStateTip = new Button() |
| | | { |
| | |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextID = StringId.NetworkAnomaly, |
| | | }; |
| | | divLinkStateTip.AddChidren(btnLinkStateTip); |
| | | linkStateMsgView.AddChidren(btnLinkStateTip); |
| | | |
| | | //更新链接状态icon颜色 |
| | | CheckLinkStatus();//2020-12-22 |
| | | #endregion |
| | | |
| | | environmentalView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(1) + btnResidenceName.Bottom, |
| | | Height = Application.GetRealHeight(32), |
| | | }; |
| | | topView.AddChidren(environmentalView); |
| | | CheckLinkStatus();//2020-12-22 |
| | | |
| | | #region 环境数据 |
| | | var tempSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorTemperature); |
| | |
| | | |
| | | #region 功能场景切换 |
| | | |
| | | bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0xFFFF0000 }); |
| | | //bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0xFFFF0000 }); |
| | | |
| | | loadNavView(); |
| | | |
| | |
| | | #if DEBUG |
| | | btnResidenceName.MouseUpEventHandler = (envent, ee) => |
| | | { |
| | | MainPage.Log("sss"); |
| | | |
| | | #if __ANDROID__ |
| | | //HDLLinphoneKit.Instance.MediaPlayerLooping(true); |
| | | Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.PlayRingtone(); |
| | | #elif __IOS__ |
| | | |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Common; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | |
| | | } |
| | | } |
| | | |
| | | void CheckTokenValid() |
| | | { |
| | | //Dome模式 |
| | | if (MainPage.NoLoginMode) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | try |
| | | { |
| | | #region 账号登录状态(登录token是否有效) |
| | | if (ApiUtlis.Ins.IsValidToken) |
| | | { |
| | | if (tokenInvalidMsgView == null) |
| | | { |
| | | tokenInvalidMsgView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(113) - Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | BackgroundColor = 0xFF69A0F7, |
| | | }; |
| | | topView.AddChidren(tokenInvalidMsgView); |
| | | |
| | | Button btnTokenInvalidIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(20), |
| | | Height = Application.GetRealWidth(20), |
| | | UnSelectedImagePath = "Collection/TokenInvalidTipIcon.png" |
| | | }; |
| | | tokenInvalidMsgView.AddChidren(btnTokenInvalidIcon); |
| | | var btnTokenInvalidTip = new Button() |
| | | { |
| | | X = btnTokenInvalidIcon.Right + Application.GetRealWidth(4), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextID = StringId.TokenInvalidMsg, |
| | | }; |
| | | btnTokenInvalidTip.Width = btnTokenInvalidTip.GetTextWidth() + Application.GetRealWidth(8); |
| | | tokenInvalidMsgView.AddChidren(btnTokenInvalidTip); |
| | | btnTokenInvalidTip.MouseUpEventHandler = (sender, e) => { |
| | | new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.TokenInvalidTipMsg,StringId.Cancel,StringId.GoLogin, () => { |
| | | HDLCommon.Current.Logout(); |
| | | }); |
| | | }; |
| | | |
| | | var btnRight = new Button() |
| | | { |
| | | X= btnTokenInvalidTip.Right, |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(8), |
| | | Height = Application.GetMinRealAverage(8), |
| | | UnSelectedImagePath = "Public/RightIcon2.png", |
| | | }; |
| | | |
| | | tokenInvalidMsgView.AddChidren(btnRight); |
| | | |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (tokenInvalidMsgView != null) |
| | | { |
| | | if (tokenInvalidMsgView.Parent != null) |
| | | { |
| | | tokenInvalidMsgView.RemoveAll(); |
| | | tokenInvalidMsgView.RemoveFromParent(); |
| | | tokenInvalidMsgView = null; |
| | | } |
| | | } |
| | | } |
| | | #endregion |
| | | bodyView.linkStateMsgView.Y = ApiUtlis.Ins.IsValidToken ? Application.GetRealHeight(113) : Application.GetRealHeight(113) - Application.GetRealWidth(24); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error", $"HomePage 账号登录状态信息显示异常:{ex.StackTrace}"); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新连接状态图标 |
| | |
| | | return; |
| | | } |
| | | |
| | | bodyView.linkStateMsgView.Y = ApiUtlis.Ins.IsValidToken ? Application.GetRealHeight(113) : Application.GetRealHeight(113) - Application.GetRealWidth(24); |
| | | |
| | | if (!Control.Ins.GatewayOnline_Local && !Control.Ins.GatewayOnline_Cloud) |
| | | { |
| | | bodyView.divLinkStateTip.Visible = true; |
| | | bodyView.linkStateMsgView.Visible = true; |
| | | } |
| | | else |
| | | { |
| | | bodyView.divLinkStateTip.Visible = false; |
| | | bodyView.linkStateMsgView.Visible = false; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | }); |
| | | } |
| | | /// <summary> |
| | | /// 确认Token是否有效 |
| | | /// </summary> |
| | | public static void LoadEvent_CheckTokenValid() |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | bodyView.CheckTokenValid(); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("Error",$"LoadEvent_CheckTokenValid : {ex.StackTrace}"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载功能收藏按钮事件 |
| | |
| | | userEmailInfoView.AddChidren(btnUserEmailRight); |
| | | optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | #endregion |
| | | #region 个人选项-手机信息区域 |
| | | #region 个人选项-手机信息区域 |
| | | /// <summary> |
| | | /// 个人选项-手机信息区域 |
| | | /// </summary> |
| | |
| | | resetPasswordView.AddChidren(btnResetPasswordRight); |
| | | optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | #endregion |
| | | |
| | | |
| | | #region 个人选项-添加住宅 |
| | | addResidenceView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | optionListView.AddChidren(addResidenceView); |
| | | btnAddResidenceScan = new Button() |
| | |
| | | Height = Application.GetRealHeight(8) |
| | | }; |
| | | bodyScrolView.AddChidren(topPaddingView2); |
| | | |
| | | #region 解锁设置区域 |
| | | ///// <summary> |
| | | ///// 解锁设置区域 |
| | | ///// </summary> |
| | | //interpretationSettingsView = new FrameLayout() |
| | | //{ |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Height = Application.GetRealHeight(70), |
| | | //}; |
| | | //bodyScrolView.AddChidren(interpretationSettingsView); |
| | | //if(Language.CurrentLanguage != "Chinese") |
| | | //{ |
| | | // interpretationSettingsView.Height = Application.GetRealHeight(80); |
| | | //} |
| | | |
| | | //btnInterpretationSettingsTitle = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(16), |
| | | // Height = Application.GetRealHeight(32), |
| | | // TextAlignment = TextAlignment.BottomLeft, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | // TextID = StringId.InterpretationSettings, |
| | | //}; |
| | | //interpretationSettingsView.AddChidren(btnInterpretationSettingsTitle); |
| | | |
| | | //btnInterpretationSettingsTip = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(16), |
| | | // Y = btnInterpretationSettingsTitle.Bottom, |
| | | // Height = Application.GetRealHeight(32), |
| | | // Width = Application.GetRealWidth(310), |
| | | // TextAlignment = TextAlignment.TopLeft, |
| | | // TextColor = CSS_Color.PromptingColor1, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextID = StringId.AppUnlockSettingsTip, |
| | | // IsMoreLines = true, |
| | | //}; |
| | | //interpretationSettingsView.AddChidren(btnInterpretationSettingsTip); |
| | | |
| | | //btnInterpretationSettingsRight = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(339), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = Application.GetMinRealAverage(16), |
| | | // Height = Application.GetMinRealAverage(16), |
| | | // UnSelectedImagePath = "Public/Right.png", |
| | | //}; |
| | | //interpretationSettingsView.AddChidren(btnInterpretationSettingsRight); |
| | | //interpretationSettingsView.AddChidren(new LineView(interpretationSettingsView.Height)); |
| | | #endregion |
| | | |
| | | #region 服务器信息 |
| | | ListCellView myServerInfoCellView = new ListCellView() |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region 解锁设置区域 |
| | | #region 解锁设置区域 |
| | | //void LoadEvent_SkipInterpretationSettings() |
| | | //{ |
| | | // EventHandler<MouseEventArgs> eventHandler = (sender, e) => |