wxr
2024-09-24 691dbe24f5724f153e07947c7b75bdfea5f0b6d5
离线控制模式

离线控制分成有网,无网的情况了
4个文件已添加
18个文件已修改
546 ■■■■■ 已修改文件
HDL-ON_Android/Assets/Language.ini 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/Collection/TokenInvalidTipIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Phone/Public/RightIcon2.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/HDL-ON_Android.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/HDL-ON_iOS.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Language.ini 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/Collection/TokenInvalidTipIcon.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Phone/Public/RightIcon2.png 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/ApiUtlis.cs 110 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/HDLCommon.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/R.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/UserInfo.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control_Udp.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Mqtt/MqttClient.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/Server/HttpServerRequest.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/MainPage.cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Public/PublicAssmebly.cs 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePage.cs 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Language.ini
@@ -691,6 +691,10 @@
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
@@ -2097,9 +2101,10 @@
704=非中国用户选择
705=请选择服务器
706=新能源
707=离线控制中,如需切换至远程控制,点此登录
708=您当前的登录状态已经失效,请重新登录
709=去登录
710=离线控制
@@ -3500,7 +3505,10 @@
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
@@ -4898,7 +4906,10 @@
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
@@ -6284,7 +6295,10 @@
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
@@ -7688,7 +7702,10 @@
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
HDL-ON_Android/Assets/Phone/Collection/TokenInvalidTipIcon.png
HDL-ON_Android/Assets/Phone/Public/RightIcon2.png
HDL-ON_Android/HDL-ON_Android.csproj
@@ -669,6 +669,8 @@
    <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" />
HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -1847,6 +1847,8 @@
      <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" />
HDL-ON_iOS/Resources/Language.ini
@@ -691,6 +691,10 @@
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
@@ -2097,9 +2101,10 @@
704=非中国用户选择
705=请选择服务器
706=新能源
707=离线控制中,如需切换至远程控制,点此登录
708=您当前的登录状态已经失效,请重新登录
709=去登录
710=离线控制
@@ -3500,7 +3505,10 @@
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
@@ -4898,7 +4906,10 @@
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
@@ -6284,7 +6295,10 @@
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
@@ -7688,7 +7702,10 @@
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
HDL-ON_iOS/Resources/Phone/Collection/TokenInvalidTipIcon.png
HDL-ON_iOS/Resources/Phone/Public/RightIcon2.png
HDL_ON/Common/ApiUtlis.cs
@@ -4,6 +4,7 @@
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;
@@ -104,7 +105,7 @@
            string code = StateCode.SUCCESS;
            Inverter.Ins.H5Page = null;//重置光伏页面
            var downloadDataThread = new System.Threading.Thread(async() =>
            var downloadDataThread = new System.Threading.Thread(() =>
            {
                try
                {
@@ -279,26 +280,6 @@
                    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
                {
@@ -746,6 +727,34 @@
                        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}");
                        }
                    }
                }
            })
@@ -778,39 +787,50 @@
        {
            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}");
                }
            }
        }
HDL_ON/Common/HDLCommon.cs
@@ -602,7 +602,7 @@
                            //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)
HDL_ON/Common/R.cs
@@ -5,6 +5,23 @@
{
    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>
HDL_ON/Common/UserInfo.cs
@@ -164,19 +164,27 @@
        /// </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;
HDL_ON/DAL/DriverLayer/Control.cs
@@ -276,8 +276,8 @@
        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;
            }
@@ -978,10 +978,10 @@
        /// <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);
        }
HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -104,7 +104,7 @@
            try
            {
                //账号没登录不回复
                if ( UserInfo.Current == null || ! UserInfo.Current.IsLogin)
                if ( UserInfo.Current == null )///|| ! UserInfo.Current.IsLogin)
                {
                    return;
                }
HDL_ON/DAL/Mqtt/MqttClient.cs
@@ -353,10 +353,10 @@
            }
            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;
@@ -868,10 +868,10 @@
                    return;
            }
            if (!UserInfo.Current.IsLogin)
            {
                return;
            }
            //if (!UserInfo.Current.IsLogin)
            //{
            //    return;
            //}
            DisConnectRemoteMqttClient("挤下线");
HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -171,7 +171,7 @@
                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__
@@ -182,7 +182,7 @@
            }
            else if (revertObj.Code == StateCode.PasswrodError)
            {
                UserInfo.Current.LastTime = DateTime.MinValue;
                UserInfo.Current.ValidToken = false;
            }
#if __IOS__
            else if (revertObj.Code == "10001")
@@ -190,7 +190,6 @@
                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);
                }
            }
HDL_ON/UI/MainPage.cs
@@ -171,44 +171,22 @@
                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);
                    }
                }
@@ -239,36 +217,6 @@
            }
//#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>
@@ -284,6 +232,8 @@
                }
            }
            catch { }
            OnAppConfig.Instance.LastLoginUserId = "";
            UserInfo.Current.ClearUserInfo();
            BaseView.BackgroundColor = CSS_Color.BackgroundColor;
            var fisrtView = new UI.UI1Login.LoginPage();
            fisrtView.BackgroundColor = CSS_Color.MainBackgroundColor;
HDL_ON/UI/UI0-Public/PublicAssmebly.cs
@@ -244,13 +244,19 @@
        {
            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()
            {
@@ -314,7 +320,7 @@
                TextSize = CSS_FontSize.SubheadingFontSize,
                //SelectedTextColor = CSS_Color.MainBackgroundColor,
                //SelectedBackgroundColor = CSS_Color.MainColor,
                TextID = StringId.Cancel,
                TextID = cancelTextId,
            };
            contentView.AddChidren(btnCancel);
@@ -329,7 +335,7 @@
                TextSize = CSS_FontSize.SubheadingFontSize,
                TextColor = CSS_Color.MainBackgroundColor,
                BackgroundColor = CSS_Color.MainColor,
                TextID = StringId.Confirm,
                TextID = confrimTextId,
            };
            contentView.AddChidren(btnConfirm);
            //例:右下圆角 大小为50
HDL_ON/UI/UI2/1-HomePage/HomePage.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using HDL_ON.Common;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
@@ -24,7 +25,11 @@
        /// <summary>
        /// 连接状态提示
        /// </summary>
        FrameLayout divLinkStateTip;
        FrameLayout linkStateMsgView;
        /// <summary>
        /// 登录状态提示区域
        /// </summary>
        FrameLayout tokenInvalidMsgView;
        /// <summary>
        /// 安防状态图标
        /// </summary>
@@ -159,14 +164,14 @@
                };
                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);
@@ -179,20 +184,21 @@
                };
                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()
                {
@@ -207,15 +213,19 @@
                    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),
@@ -224,7 +234,7 @@
                    Height = Application.GetRealWidth(20),
                    UnSelectedImagePath = "Collection/GatewayOnlineTipIcon.png"
                };
                divLinkStateTip.AddChidren(btnLinkStateIcon);
                linkStateMsgView.AddChidren(btnLinkStateIcon);
                var btnLinkStateTip = new Button()
                {
@@ -234,15 +244,18 @@
                    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);
@@ -535,7 +548,7 @@
                #region 功能场景切换
                bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0xFFFF0000 });
                //bodyView.AddChidren(new Button() { Height = Application.GetRealHeight(20), BackgroundColor = 0xFFFF0000 });
                loadNavView();
@@ -553,10 +566,7 @@
#if DEBUG
                btnResidenceName.MouseUpEventHandler = (envent, ee) =>
                {
                    MainPage.Log("sss");
#if __ANDROID__
                    //HDLLinphoneKit.Instance.MediaPlayerLooping(true);
                    Com.Hdl.Hdllinphonesdk.HDLLinphoneKit.Instance.PlayRingtone();
#elif __IOS__
HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs
@@ -1,8 +1,10 @@
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
@@ -254,7 +256,87 @@
            }
        }
        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>
        /// 更新连接状态图标
@@ -267,13 +349,15 @@
                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;
            }
        }
@@ -296,6 +380,26 @@
                }
            });
        }
        /// <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>
        /// 加载功能收藏按钮事件
HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs
@@ -444,7 +444,7 @@
            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>
@@ -559,11 +559,11 @@
            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()
@@ -765,58 +765,6 @@
                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()
HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs
@@ -420,7 +420,7 @@
        }
#endregion
#region 解锁设置区域
        #region 解锁设置区域
        //void LoadEvent_SkipInterpretationSettings()
        //{
        //    EventHandler<MouseEventArgs> eventHandler = (sender, e) =>