wjc
2023-03-06 462c27c1d2618db2fa383a094afeeb0f8622fdee
2023年03月06日19:11:01

备份代码
3个文件已添加
16个文件已修改
1053 ■■■■ 已修改文件
HDL-ON_Android/Assets/Language.ini 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_iOS/Resources/Language.ini 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Common/R.cs 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/DAL/DriverLayer/Control.cs 114 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/DB_ResidenceData.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Enumerative/MyEnum.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/Function/Function.cs 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/Entity/FunctionList.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/HDL_ON.projitems 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI0-Stan/Logic/HdlBluetoothAndroidLogic.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/2-Classification/RoomPage.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/Music/View/SizeClass.cs 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockListPage.cs 242 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs 360 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL_ON/UI/UI2/UserPage.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HDL-ON_Android/Assets/Language.ini
@@ -1110,7 +1110,7 @@
7155=Distress/Normal
7156=Distress
7157=whether to unlock
7158=is
7158=Is
7159=Fall in the alarm
7160=Someone called the police
7161=Warning tone
@@ -1118,9 +1118,20 @@
7163=Video call
7164=Manipulator
7165=Area intrusion alarm
7166=camera
7167=main switch
7166=Camera
7167=Main switch
7168=PM10
8501=Video door lock
8502=Electric quantity
8503=The door is now closed
8504=The door is not closed
8505=RVC
8506=One click to open the lock
8507=Temporary password
8508=History
8509=Fluorite video door lock
@@ -2348,6 +2359,24 @@
7168=PM10
8501=视频门锁
8502=电量
8503=当前门已关
8504=当前门未关
8505=实时视频
8506=一键开锁
8507=临时密码
8508=历史记录
8509=萤石视频门锁
 
9000=请使用新的手机账号登录APP
HDL-ON_iOS/Resources/Language.ini
@@ -1110,7 +1110,7 @@
7155=Distress/Normal
7156=Distress
7157=whether to unlock
7158=is
7158=Is
7159=Fall in the alarm
7160=Someone called the police
7161=Warning tone
@@ -1118,9 +1118,20 @@
7163=Video call
7164=Manipulator
7165=Area intrusion alarm
7166=camera
7167=main switch
7166=Camera
7167=Main switch
7168=PM10
8501=Video door lock
8502=Electric quantity
8503=The door is now closed
8504=The door is not closed
8505=RVC
8506=One click to open the lock
8507=Temporary password
8508=History
8509=Fluorite video door lock
@@ -2348,6 +2359,16 @@
7167=总控开关
7168=PM10
8501=视频门锁
8502=电量
8503=当前门已关
8504=当前门未关
8505=实时视频
8506=一键开锁
8507=临时密码
8508=历史记录
8509=萤石视频门锁
 
HDL_ON/Common/R.cs
@@ -2002,11 +2002,11 @@
        /// <summary>
        /// 循序循环
        /// </summary>
        public const int orderMode =5048;
        public const int orderMode = 5048;
        /// <summary>
        /// 单曲播放
        /// </summary>
        public const int single =5049;
        public const int single = 5049;
@@ -3062,7 +3062,50 @@
        /// <summary>
        /// PM210
        /// </summary>
        public const int pm10= 7168;
        public const int pm10 = 7168;
        /// <summary>
        /// 视频门锁
        /// </summary>
        public const int shipinmensuo = 8501;
        /// <summary>
        /// 电量
        /// </summary>
        public const int dianliang = 8502;
        /// <summary>
        /// 当前门已关
        /// </summary>
        public const int dangqianmenyiguan = 8503;
        /// <summary>
        /// 当前门未关
        /// </summary>
        public const int dangqianmenweiguan = 8504;
        /// <summary>
        /// 实时视频
        /// </summary>
        public const int shishishipin = 8505;
        /// <summary>
        /// 一键开锁
        /// </summary>
        public const int yijiankaisuo = 8506;
        /// <summary>
        /// 临时密码
        /// </summary>
        public const int linshimima1 = 8507;
        /// <summary>
        /// 历史记录
        /// </summary>
        public const int lishijilu = 8508;
        /// <summary>
        /// 萤石视频门锁
        /// </summary>
        public const int yingshishipinmensuo = 8509;
HDL_ON/DAL/DriverLayer/Control.cs
@@ -83,8 +83,10 @@
        /// <summary>
        /// 判断是否本地加密并且加密key不为空
        /// </summary>
        public bool IsLocalEncryptAndGetAesKey {
            get {
        public bool IsLocalEncryptAndGetAesKey
        {
            get
            {
                return IsLocalEncrypt && (!string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.localSecret));
            }
        }
@@ -139,7 +141,7 @@
                if (_GatewayOnline_Cloud != value)
                {
                    _GatewayOnline_Cloud = value;
                    if(GatewayOnline_Local)
                    if (GatewayOnline_Local)
                    {
                        return;
                    }
@@ -249,7 +251,7 @@
        public void SearchLoaclGateway()
        {
            //2021-01-15 : 住宅没有绑定网关的时候不用搜索,并且不能链接mqtt
            if(DB_ResidenceData.Instance.HomeGateway == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.gatewayId))
            if (DB_ResidenceData.Instance.HomeGateway == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.gatewayId))
            {
                return;
            }
@@ -308,9 +310,10 @@
        /// </summary>
        public void LoginGateway()
        {
            if(loginGatewayThread== null)
            if (loginGatewayThread == null)
            {
                loginGatewayThread = new System.Threading.Thread(() => {
                loginGatewayThread = new System.Threading.Thread(() =>
                {
                    while (!Ins.myTcpClient.isConnected)
                    {
                        if (Ins.GatewayOnline_Local && myTcpClient.isConnected)
@@ -337,7 +340,8 @@
                try
                {
                    loginGatewayThread?.Abort();
                }catch (Exception ex)
                }
                catch (Exception ex)
                {
                    MainPage.Log($"重启登录网关线程异常:{ex.Message}");
                }
@@ -347,7 +351,7 @@
                    LoginGateway();
                }
            }
        }
@@ -357,9 +361,9 @@
        public void ControlScene(Scene scene)
        {
            //体验模式
            if(MainPage.NoLoginMode)
            if (MainPage.NoLoginMode)
            {
                foreach(var sceneFunction in scene.functions)
                foreach (var sceneFunction in scene.functions)
                {
                    var revString = "";
                    var upDataObj = new AlinkFunctionStatusObj();
@@ -406,7 +410,7 @@
        /// <param name="function"></param>
        /// <param name="useRemote">是否直接使用远程发送</param>
        /// <returns></returns>
        public bool SendWriteCommand(Function function, Dictionary<string, string> commandDictionary, bool useRemote = false,int resend = 3)
        public bool SendWriteCommand(Function function, Dictionary<string, string> commandDictionary, bool useRemote = false, int resend = 3)
        {
            function.controlCounter++;
            function.refreshTime = DateTime.Now;
@@ -504,7 +508,7 @@
                        var functionControlDataObj = function.GetGatewayAlinkControlData(commandDictionary);
                        var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(functionControlDataObj);
                        var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlFunctionTopic, functionControlDataJson);
                        new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id,resend);
                        new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id, resend);
                        MainPage.Log($"本地通讯 发送HDL-Link数据:{functionControlDataJson}");
                    }
                }
@@ -522,7 +526,7 @@
                                commandDictionary.Add(FunctionAttributeKey.OnOff, commandDictionary[FunctionAttributeKey.Brightness] == "0" ? "off" : "on");
                            }
                        }
                        if(function.spk == SPK.LightCCT)
                        if (function.spk == SPK.LightCCT)
                        {
                            if (!commandDictionary.ContainsKey(FunctionAttributeKey.CCT))
                            {
@@ -546,10 +550,10 @@
        /// <summary>
        /// 全开全关功能
        /// </summary>
        public void SwtichFunctions(bool open,List<Function> functions)
        public void SwtichFunctions(bool open, List<Function> functions)
        {
            //dome模式控制
            if(MainPage.NoLoginMode)
            if (MainPage.NoLoginMode)
            {
                new System.Threading.Thread(() =>
                {
@@ -557,7 +561,7 @@
                    {
                        Dictionary<string, string> d1 = new Dictionary<string, string>();
                        d1.Add(FunctionAttributeKey.OnOff, open ? "on" : "off");
                         if (function.spk == SPK.PanelSocket)
                        if (function.spk == SPK.PanelSocket)
                        {
                            if (function.attributes.Find((obj) => obj.key == "on_off_usb") != null)
                            {
@@ -623,16 +627,16 @@
        {
            var pm = new DAL.Server.HttpServerRequest();
            var pack = pm.GetDeviceInfoList(functionIds);
            if(pack!= null&& pack.Data!=null)
            if (pack != null && pack.Data != null)
            {
                //待测试2021-03-04
                var ddd = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AlinkStatusData>>(pack.Data.ToString());
                if(ddd!= null)
                if (ddd != null)
                {
                    foreach(var function in ddd)
                    foreach (var function in ddd)
                    {
                        var temp = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.deviceId == function.deviceId);
                        if(temp!= null)
                        if (temp != null)
                        {
                            if (SPK.Get3tySpk(SPK.BrandType.Tuya).Contains(temp.spk))
                            {
@@ -648,7 +652,7 @@
        /// 发送读取命令
        /// 自动判断是否为A协议设备
        /// </summary>
        public void SendReadCommand(Function function ,bool forceRemote = false)
        public void SendReadCommand(Function function, bool forceRemote = false)
        {
            function.refreshTime = DateTime.Now;
            if (forceRemote)
@@ -732,7 +736,7 @@
                            {
                                busClient.ReadBusData(function);
                            }
                        }
                        catch (Exception ex)
                        {
@@ -776,7 +780,7 @@
        /// <summary>
        /// 安防控制
        /// </summary>
        public void ControlSecurity(SecurityAlarm securityAlarm,string state)
        public void ControlSecurity(SecurityAlarm securityAlarm, string state)
        {
            if (!Ins.GatewayOnline_Local)//网关本地不在线
            {
@@ -834,7 +838,7 @@
                };
                var aLinkJson = Newtonsoft.Json.JsonConvert.SerializeObject(aLinkData);
                var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlScene, aLinkJson);
                new Control_Udp().SendLocalHdlLinkData(sendBytes, aLinkData.id,0);
                new Control_Udp().SendLocalHdlLinkData(sendBytes, aLinkData.id, 0);
            }
        }
@@ -928,10 +932,10 @@
        /// 转换接收到的数据
        /// </summary>
        /// <returns></returns>
        public void ConvertReceiveData(byte[] receiveBytes,string ip)
        public void ConvertReceiveData(byte[] receiveBytes, string ip)
        {
            var reString = Encoding.UTF8.GetString(receiveBytes);
            AnalysisReceiveData(reString, receiveBytes,ip);
            AnalysisReceiveData(reString, receiveBytes, ip);
        }
        /// <summary>
        /// 转换接收到的数据
@@ -939,7 +943,7 @@
        /// <param name="receiveString">转String后的数据</param>
        /// <param name="originalReceiveBytes"原始Bytes数据</param>
        /// <returns></returns>
        public LocalCommunicationData AnalysisReceiveData(string receiveString, byte[] originalReceiveBytes , string sIp = null)
        public LocalCommunicationData AnalysisReceiveData(string receiveString, byte[] originalReceiveBytes, string sIp = null)
        {
            LocalCommunicationData receiveObj = new LocalCommunicationData();
@@ -1118,7 +1122,8 @@
                        MainPage.Log($"安防局域网异常:{ex.Message}");
                    }
                }
                else if (receiveObj.Topic == $"/user/{GatewayId}/custom/gateway/login_reply") {
                else if (receiveObj.Topic == $"/user/{GatewayId}/custom/gateway/login_reply")
                {
                    var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<JObject>(receiveObj.BodyDataString);
                    if (temp.GetValue("objects").ToString().Contains("success"))
                    {
@@ -1161,7 +1166,7 @@
            }
            else
            {
                if(processedDataList.Count> 50)
                if (processedDataList.Count > 50)
                {
                    processedDataList.RemoveAt(0);
                }
@@ -1175,7 +1180,7 @@
        /// A协议数据
        /// </summary>
        /// <param name="updateBytes"></param>
        public void UpdataFunctionStatus(string revString, byte[] usefulBytes,bool isCloudData = false)
        public void UpdataFunctionStatus(string revString, byte[] usefulBytes, bool isCloudData = false)
        {
            ////test 云端连接成功时,不适用本地数据更新
            //if (Ins.GatewayOnline_Cloud && !isCloudData)
@@ -1218,7 +1223,7 @@
                        if (Ins.GatewayOnline_Local && isCloudData)//本地链接,除了涂鸦设备数据之外的云端数据不处理
                        {
                            if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(localFunction.spk) && !SPK.MusicSpkList().Contains( localFunction.spk))
                            if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(localFunction.spk) && !SPK.MusicSpkList().Contains(localFunction.spk))
                            {
                                //MainPage.Log($"A协议更新状态:本地链接,除了涂鸦设备数据之外的云端数据不处理........");
@@ -1226,21 +1231,21 @@
                            }
                        }
                        //if (SPK.MusicSpkList().Contains(localFunction.spk))
                        //{
                        //    if (updateTemp.status.Count < 3)
                        //    {
                        //        ///是音乐功能的
                        //        ///上报属性少3条不做处理
                        //        return;
                        //    }
                        //}
                        MainPage.Log($"音乐收到数据:{revString}");
                        if (SPK.MusicSpkList().Contains(localFunction.spk))
                        {
                            MainPage.Log($"音乐收到数据:{revString}");
                        }
                        foreach (var attr in updateTemp.status)
                        {
                            localFunction.time_stamp = temp.time_stamp;
                            localFunction.SetAttrState(attr.key, attr.value);
                            Console.WriteLine("音乐播放器添加缓存数据=======" + revString);
                            if (SPK.MusicSpkList().Contains(localFunction.spk))
                            {
                                Console.WriteLine("音乐播放器添加缓存数据=======" + revString);
                            }
                        }
@@ -1256,7 +1261,7 @@
                                break;
                            case SPK.AirSwitch:
                                AirSwitchPage.UpdataState(localFunction);
                                if(localFunction.GetAttribute(FunctionAttributeKey.Power)!=null)//如果是带电量的空开也要更新能源界面
                                if (localFunction.GetAttribute(FunctionAttributeKey.Power) != null)//如果是带电量的空开也要更新能源界面
                                {
                                    EnergyMainPage.UpdataStatus(localFunction);
                                }
@@ -1295,7 +1300,7 @@
                                CurtainModulePage.UpdataState(localFunction);
                                break;
                            case SPK.CurtainDream:
                                if(localFunction.GetAttrState(FunctionAttributeKey.Percent) == "0")
                                if (localFunction.GetAttrState(FunctionAttributeKey.Percent) == "0")
                                {
                                    localFunction.SetAttrState(FunctionAttributeKey.OnOff, "off");
                                }
@@ -1388,7 +1393,7 @@
                            case SPK.SensorTemperature:
                            case SPK.SensorHumidity:
                            case SPK.SensorHcho:
                                if(localFunction.spk == SPK.SensorTemperature)
                                if (localFunction.spk == SPK.SensorTemperature)
                                {
                                    HomePage.LoadEvent_RefreshEnvirIndoorTemp();
                                }
@@ -1490,7 +1495,7 @@
                            case SPK.AvMusic:
                            case SPK.MusicStandard:
                                //UI.Music.MusicMain.mMusicMain.RefreshView(updateTemp);
                                Console.WriteLine("音乐播放器显示状态======="+ revString);
                                Console.WriteLine("音乐播放器显示状态=======" + revString);
                                //wjc
                                break;
                            case SPK.Inverter:
@@ -1524,12 +1529,12 @@
        /// <summary>
        /// //一键(远程)开锁
        /// </summary>
        public void OneKeyUnlocking(Function doorlock,string extStr)
        public void OneKeyUnlocking(Function doorlock, string extStr)
        {
            if (Ins.GatewayOnline_Local)
            {
                Dictionary<string, string> dic = new Dictionary<string, string>();
                var functionControlDataObj = doorlock.GetGatewayAlinkDoorlockData(UserInfo.Current.ID,extStr);
                var functionControlDataObj = doorlock.GetGatewayAlinkDoorlockData(UserInfo.Current.ID, extStr);
                var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(functionControlDataObj);
                var sendBytes = Ins.ConvertSendBodyData($"/base/{Control.Ins.GatewayId}/thing/service/doorRemoteOpen/down", functionControlDataJson);
                new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id, 0);
@@ -1544,7 +1549,7 @@
        /// </summary>
        /// <param name="functionId"></param>
        /// <param name="pwd"></param>
        public void ConfirmUnlocking(string functionId,string pwd)
        public void ConfirmUnlocking(string functionId, string pwd)
        {
            Loading loading = new Loading();
            MainPage.BaseView.AddChidren(loading);
@@ -1580,8 +1585,10 @@
                        //{
                        //    return false;
                        //}
                        if (pack.Code != StateCode.SUCCESS) {
                            Application.RunOnMainThread(() => {
                        if (pack.Code != StateCode.SUCCESS)
                        {
                            Application.RunOnMainThread(() =>
                            {
                                new PublicAssmebly().TipMsg(Language.StringByID(StringId.Tip), pack.message);
                                UserInfo.Current.doorPasswordString = "";//
                                UserInfo.Current.LastTimeOpenDoor = DateTime.MinValue;
@@ -1590,8 +1597,9 @@
                    }
                    if (pack.Code != StateCode.SUCCESS)
                    {
                        Application.RunOnMainThread(() => {
                            if(string.IsNullOrEmpty(pack.message))
                        Application.RunOnMainThread(() =>
                        {
                            if (string.IsNullOrEmpty(pack.message))
                            {
                                new PublicAssmebly().TipMsg(Language.StringByID(StringId.Tip),
                                    Language.StringByID(StringId.OperationFailed));
HDL_ON/Entity/DB_ResidenceData.cs
@@ -76,7 +76,9 @@
                                    ShowFunction.Sensor,ShowFunction.VideoIntercom,
                                    ShowFunction.SecurityCenter,ShowFunction.Acst,
                                    ShowFunction.MechanicalArm ,
                                    ShowFunction.SecurityMonitoring,};
                                    ShowFunction.SecurityMonitoring,
                                    ShowFunction.VideoDoorLock,
                    };
                }
                return dddd;
            }
HDL_ON/Entity/Enumerative/MyEnum.cs
@@ -185,6 +185,10 @@
        /// ip摄像头
        /// </summary>
        IpCam = 0x25,
        /// <summary>
        /// 萤石视频门锁
        /// </summary>
        VideoDoorLock = 0x26,
    }
HDL_ON/Entity/Function/Function.cs
@@ -1372,8 +1372,20 @@
            list.Add(DoorLock);
            return list;
        }
        /// <summary>
        /// 萤石视频门锁
        /// </summary>
        public const string VideoDoorLock= "萤石视频门锁";
        /// <summary>
        /// 萤石视频门锁spk列表
        /// </summary>
        /// <returns></returns>
        public static List<string> GetVideoDoorLockSPKList()
        {
            var list = new List<string>();
            list.Add(VideoDoorLock);
            return list;
        }
        #region 灯光
        /// <summary>
HDL_ON/Entity/FunctionList.cs
@@ -148,6 +148,15 @@
            var spkList = SPK.GetDoorLockSPKList();
            return Functions.FindAll((obj) => spkList.Contains(obj.spk));
        }
        /// <summary>
        /// 获取萤石视频门锁
        /// </summary>
        /// <returns></returns>
        public List<Function> GetVideoDoorLockList()
        {
            var spkList = SPK.GetVideoDoorLockSPKList();
            return Functions.FindAll((obj) => spkList.Contains(obj.spk));
        }
        /// <summary>
        /// 新风列表
HDL_ON/HDL_ON.projitems
@@ -528,6 +528,9 @@
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\A31UsbMusicList.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\CommonMethod.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Music\A31FlieList.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorLockListPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\VideoDoorLockPage.cs" />
    <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\CommonMethod.cs" />
  </ItemGroup>
  <ItemGroup>
    <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
@@ -555,5 +558,6 @@
    <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Light\LightScene\" />
    <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\FaceManagement\" />
    <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Acst\" />
    <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\VideoDoorLock\" />
  </ItemGroup>
</Project>
HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
@@ -307,6 +307,14 @@
                        }
#endif
                        break;
                    case SPK.VideoDoorLock: {
                            //萤石视频门锁
                            var form = new VideoDoorLockPage(function, btnName, btnFromFloor, Comerom.room);
                            MainPage.BasePageView.AddChidren(form);
                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                            form.Show();
                        }
                        break;
                }
            };
            return eventHandler;
HDL_ON/UI/UI0-Stan/Logic/HdlBluetoothAndroidLogic.cs
@@ -379,6 +379,8 @@
            }
        }
        /// <summary>
        /// 抄SDK的,我也不知道这个是什么
        /// </summary>
HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -745,6 +745,14 @@
                        functionCount = FunctionList.List.GetAcstParentList().Count;
                        functionOnCount = FunctionList.List.GetAcstParentList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count;
                        break;
                    case ShowFunction.VideoDoorLock:
                        functionCount = FunctionList.List.GetVideoDoorLockList().Count;
#if DEBUG
                        functionCount = 1;
#endif
                        functionOnCount = 1;
                        break;
                }
@@ -1143,16 +1151,32 @@
                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                        };
                        break;
                    case ShowFunction.VideoDoorLock:
                        //萤石视频门锁
                        btnName.TextID = StringId.yingshishipinmensuo;
                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
                        {
                            var list = HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.GetVideoDoorLockList();
                            var form = new UI2.FuntionControlView.VideoDoorLock.VideoDoorLockListPage();
                            form.AddForm(list);
                        };
                        break;
                }
                //界面跳转--音乐跳转自己的界面--环境跳转自己的界面
                if (item != ShowFunction.Music && item != ShowFunction.Environmental && item != ShowFunction.SecurityMonitoring && item != ShowFunction.DoorLock
                    && ShowFunction.EnergyMonitoring != item && ShowFunction.VideoIntercom != item && ShowFunction.SecurityCenter != item
                //界面跳转--音乐跳转自己的界面--环境跳转自己的界面--(萤石视频门锁)跳转自己的界面
                if (item != ShowFunction.VideoDoorLock
                    && item != ShowFunction.Music
                    && item != ShowFunction.Environmental
                    && item != ShowFunction.SecurityMonitoring
                    && item != ShowFunction.DoorLock
                    && ShowFunction.EnergyMonitoring != item
                    && ShowFunction.VideoIntercom != item &&
                    ShowFunction.SecurityCenter != item
                    && ShowFunction.Acst != item)
                {
                    btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
                    {
                        var skipView = new FunctionPage();
                        MainPage.BasePageView.AddChidren(skipView);
                        skipView.LoadPage(functionPageTitleId);
HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs
@@ -186,6 +186,10 @@
            {
                btnIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/DoorLock.png";
            }
            else if (function.spk == SPK.VideoDoorLock)
            {
                btnIcon.UnSelectedImagePath = UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.GetVideoDoorLockIcon;
            }
            else if (function.spk == SPK.HvacCac)
            {
                var btnHumidityIcon = new Button()
HDL_ON/UI/UI2/2-Classification/RoomPage.cs
@@ -78,6 +78,7 @@
            };
            bodyView.AddChidren(functionListView);
            foreach (var function in room.GetRoomFunctions(false))
            {
                if (MainPage.RoomNotSupportFunctionList.Contains( function.spk))
HDL_ON/UI/UI2/FuntionControlView/Music/View/SizeClass.cs
@@ -1,93 +1,94 @@
using System;
namespace HDL_ON.UI.Music
{
    public static class TextSize
    public class TextSize
    {
        public static int TopLine = 1;
        public static int MiddleLine =1;
        public static int DownLine = 1;
        public const int TopLine = 1;
        public const int MiddleLine = 1;
        public const int DownLine = 1;
        public static int Text24 = 24;
        public static int Text20 = 20;
        public static int Text18 = 18;
        public static int Text16 = 16;
        public static int Text14 = 14;
        public static int Text12 = 12;
        public static int Text10 = 10;
        public const int Text24 = 24;
        public const int Text20 = 20;
        public const int Text18 = 18;
        public const int Text16 = 16;
        public const int Text14 = 14;
        public const int Text12 = 12;
        public const int Text10 = 10;
    }
    public static class MusicColor
    public class MusicColor
    {
        /// <summary>
        /// 顶部背景颜色
        /// </summary>
        public static uint TopViewColor = 0xFFF7F7F7;
        public const uint TopViewColor = 0xFFF7F7F7;
        /// <summary>
        /// 界面背景颜色
        /// </summary>
        public static uint ViewColor = 0xFFF2F3F7;
        public const uint ViewColor = 0xFFF2F3F7;
        /// <summary>
        /// 白色背景颜色
        /// </summary>
        public static uint WhiteColor = 0xFFFFFFFF;
        public const uint WhiteColor = 0xFFFFFFFF;
        /// <summary>
        /// 红色背景颜色
        /// </summary>
        public static uint RedColor = 0xFFFF4747;
        /// <summary>
        /// 线条颜色
        /// </summary>
        public static uint LineColor =0xFFECEDEE;
        /// <summary>
        /// 弹窗背景颜色
        /// </summary>
        public static uint PopupBackgroundColor = 0x90000000;
        public const uint RedColor = 0xFFFF4747;
        /// <summary>
        /// 线条颜色
        /// </summary>
        public static uint MusicEditColor = 0xFFFC9C04;
        public const uint LineColor = 0xFFECEDEE;
        /// <summary>
        /// 弹窗背景颜色
        /// </summary>
        public static uint MusicDelColor = 0xFFFF7474;
        public const uint PopupBackgroundColor = 0x90000000;
        public static uint Text18Color = 0xFF1B2D4D;
        public static uint MusicTxet14SelectedColor = 0xFF4484F4;
        public static uint MusicTxet14Color = 0xFF1B2D4D;
        public static uint MusicTxet12SelectedColor = 0xFF4484F4;
        public static uint MusicNoTxetColor = 0xFFC0C7D4;
        public static uint TextColor = 0xFF1B2D4D;
        public static uint SelectedColor = 0xFF4484F4;
        /// <summary>
        /// 线条颜色
        /// </summary>
        public const uint MusicEditColor = 0xFFFC9C04;
        /// <summary>
        /// 弹窗背景颜色
        /// </summary>
        public const uint MusicDelColor = 0xFFFF7474;
        public static uint TextTimeColor = 0xFF798394;
        public const uint Text18Color = 0xFF1B2D4D;
        public const uint MusicTxet14SelectedColor = 0xFF4484F4;
        public const uint MusicTxet14Color = 0xFF1B2D4D;
        public const uint MusicTxet12SelectedColor = 0xFF4484F4;
        public static uint TextCancelColor = 0xFF798394;
        public const uint MusicNoTxetColor = 0xFFC0C7D4;
        public const uint TextColor = 0xFF1B2D4D;
        public const uint SelectedColor = 0xFF4484F4;
        public const uint TextTimeColor = 0xFF798394;
        public const uint TextCancelColor = 0xFF798394;
    }
    public static class H_W {
    public class H_W
    {
        /// <summary>
        /// app高度
        /// </summary>
        public static int H = 667;
        public const int H = 667;
        /// <summary>
        /// app宽度
        /// </summary>
        public static int W = 375;
        public const int W = 375;
        /// <summary>
        /// 顶部高度
        /// </summary>
        public static int T_Height = 64;
        public const int T_Height = 64;
        /// <summary>
        /// 线高度
        /// </summary>
        public static int Line = 1;
        public const int Line = 1;
    }
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/CommonMethod.cs
New file
@@ -0,0 +1,54 @@
using System;
using HDL_ON.Entity;
using System.Collections.Generic;
namespace HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock
{
    public class CommonMethod
    {
        public CommonMethod()
        {
        }
        private static CommonMethod commonMethod = null;
        public static CommonMethod Current
        {
            get
            {
                if (commonMethod == null)
                {
                    commonMethod = new CommonMethod();
                }
                return commonMethod;
            }
        }
        /// <summary>
        /// 萤石视频门锁的图标
        /// </summary>
        public string GetVideoDoorLockIcon{
            get {
                return "FunctionIcon/DoorLock/DoorLock.png";
            }
        }
        /// <summary>
        /// 获取萤石视频门锁列表
        /// </summary>
        /// <returns></returns>
        public List<Function> GetVideoDoorLockList()
        {
            var list = FunctionList.List.GetVideoDoorLockList();
#if DEBUG
            list.Add(new Function { name = "视频门锁一", sid = "23456789", spk = SPK.VideoDoorLock });
            list.Add(new Function { name = "视频门锁二", sid = "2345678922", spk = SPK.VideoDoorLock });
#endif
            return list;
        }
    }
}
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockListPage.cs
New file
@@ -0,0 +1,242 @@
using Shared;
using HDL_ON.Stan;
using System;
using System.Collections.Generic;
using System.Text;
using HDL_ON.UI.CSS;
using HDL_ON.Entity;
namespace HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock
{
    /// <summary>
    /// 视频门锁列表界面
    /// </summary>
    public class VideoDoorLockListPage : EditorCommonForm
    {
        #region ■ 变量声明___________________________
        /// <summary>
        /// 门锁设备列表
        /// </summary>
        private List<Function> listDevice = new List<Function>();
        /// <summary>
        /// 电池控件列表(key:设备的sid)
        /// </summary>
        private Dictionary<string, BatteryPersentControl> dicBatteryContr = new Dictionary<string, BatteryPersentControl>();
        /// <summary>
        /// 列表控件
        /// </summary>
        private VerticalListControl listView = null;
        #endregion
        #region ■ 初始化_____________________________
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
        /// <param name="i_listDevice">门锁设备列表</param>
        public void ShowForm(List<Function> i_listDevice)
        {
            this.listDevice.AddRange(i_listDevice);
            //智能门锁
            base.SetTitleText(Language.StringByID(StringId.shipinmensuo));
            //初始化头部历史记录控件
            //this.InitTopHistoryControl();
            //初始化中部信息
            this.InitMiddleFrame();
        }
        /// <summary>
        /// 初始化中部信息
        /// </summary>
        private void InitMiddleFrame()
        {
            //清空bodyFrame
            this.ClearBodyFrame();
            string nowSelectId = string.Empty;
            //楼层下拉图标
            var btnFloor = new NormalViewControl(500, Application.GetRealHeight(16), false);
            var btnFloorIcon = new IconViewControl(16);
            btnFloorIcon.X = HdlControlResourse.XXLeft;
            btnFloorIcon.Y = Application.GetRealHeight(18);
            btnFloorIcon.UnSelectedImagePath = "Public/DownIcon.png";
            bodyFrameLayout.AddChidren(btnFloorIcon);
            btnFloorIcon.ButtonClickEvent += (sender, e) =>
            {
                //显示下拉列表
                var form = new FloorRoomSelectPopupView();
                form.ShowDeviceFunctionView(btnFloor, this.listDevice, (selectId, listFunc) =>
                {
                    btnFloor.Width = btnFloor.GetRealWidthByText();//重置文本宽度
                    nowSelectId = selectId;
                    //重新初始化门锁列表控件
                    this.InitDoorListControl(listFunc);
                }, nowSelectId);
            };
            //楼层
            btnFloor.X = btnFloorIcon.Right + Application.GetRealWidth(2);
            btnFloor.TextColor = CSS_Color.FirstLevelTitleColor;
            btnFloor.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
            btnFloor.Text = DB_ResidenceData.Instance.CurFloor.roomName;
            //btnFloor.Width = btnFloor.GetRealWidthByText();
            bodyFrameLayout.AddChidren(btnFloor);
            //让它相对图标居中
            btnFloor.Y = btnFloorIcon.Y + (btnFloorIcon.Height - btnFloor.Height) / 2;
            btnFloor.ButtonClickEvent += (sender, e) =>
            {
                btnFloorIcon.ButtonClickEvent(null, null);
            };
            //列表控件
            this.listView = new VerticalListControl();
            listView.Y = Application.GetRealHeight(53);
            listView.Height = bodyFrameLayout.Height - Application.GetRealHeight(53);
            bodyFrameLayout.AddChidren(listView);
            //初始化门锁列表控件
            this.InitDoorListControl(this.listDevice);
        }
        #endregion
        #region ■ 添加门锁控件_______________________
        /// <summary>
        /// 初始化门锁列表控件
        /// </summary>
        private void InitDoorListControl(List<Function> i_listDevice)
        {
            this.listView.RemoveAll();
            this.dicBatteryContr = new Dictionary<string, BatteryPersentControl>();
            //生成门锁控件
            foreach (var device in i_listDevice)
            {
                this.AddDoorControl(device);
            }
        }
        /// <summary>
        /// 添加门锁控件
        /// </summary>
        /// <param name="i_device">门锁对象</param>
        private void AddDoorControl(Function i_device)
        {
            //白色背景容器
            var frameBack = new FrameLayoutStatuControl();
            frameBack.Width = Application.GetRealWidth(343);
            frameBack.Height = Application.GetRealHeight(96);
            frameBack.Radius = (uint)Application.GetRealWidth(12);
            frameBack.Gravity = Gravity.CenterHorizontal;
            frameBack.BackgroundColor = CSS_Color.MainBackgroundColor;
            this.listView.AddChidren(frameBack);
            //门锁图标
            var btnIcon = new IconViewControl(32);
            btnIcon.X = Application.GetRealWidth(10);
            btnIcon.Y = Application.GetRealHeight(15);
            btnIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/DoorLock.png";
            frameBack.AddChidren(btnIcon, ChidrenBindMode.BindEvent);
            //设备名字
            var btnName = new Button();
            btnName.X = btnIcon.Right + Application.GetRealWidth(12);
            btnName.Y = Application.GetRealHeight(12);
            btnName.Width = Application.GetRealWidth(150);
            btnName.Height = Application.GetRealHeight(20);
            btnName.TextColor = CSS_Color.FirstLevelTitleColor;
            btnName.TextAlignment = TextAlignment.CenterLeft;
            btnName.Text = i_device.name;
            frameBack.AddChidren(btnName, ChidrenBindMode.BindEvent);
            //房间
            var btnRoom = new Button();
            btnRoom.X = btnName.X;
            btnRoom.Y = btnName.Bottom + Application.GetRealHeight(4);
            btnRoom.Width = Application.GetRealWidth(150);
            btnRoom.Height = Application.GetRealHeight(15);
            btnRoom.TextColor = CSS_Color.PromptingColor1;
            btnRoom.TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel;
            btnRoom.TextAlignment = TextAlignment.CenterLeft;
            btnRoom.Text = i_device.GetRoomListName();
            frameBack.AddChidren(btnRoom, ChidrenBindMode.BindEvent);
            //电池图标
            var btnBattery = new BatteryPersentControl();
            btnBattery.Y = Application.GetRealHeight(62);
            //frameBack.AddChidren(btnBattery, ChidrenBindMode.BindEvent);
            btnBattery.InitControl();
            btnBattery.SetValue(80);
            btnBattery.X = frameBack.Width - btnBattery.Width - Application.GetRealWidth(12);
            this.dicBatteryContr[i_device.sid] = btnBattery;
            frameBack.ButtonClickEvent += (sender, e) =>
            {
                var form = new VideoDoorLockPage(i_device, btnName, btnRoom,Comerom.function);
                MainPage.BasePageView.AddChidren(form);
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
                form.Show();
                //var form = new VideoDoorLockPage();
                //form.AddForm(i_device, new Button(), btnName, btnRoom);
            };
            //底部再加个间距
            var frameSpace = new FrameLayout();
            frameSpace.Height = Application.GetRealHeight(12);
            this.listView.AddChidren(frameSpace);
        }
        #endregion
        public void SkipViewPage(Comerom comerom) {
            //var form = new VideoDoorLockPage(i_device, btnName, btnRoom, Comerom.function);
            //MainPage.BasePageView.AddChidren(form);
            //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            //form.Show();
        }
        #region ■ 初始化头部历史记录图标_____________
        /// <summary>
        /// 初始化头部历史记录控件
        /// </summary>
        private void InitTopHistoryControl()
        {
            //历史记录图标
            var btnIcon = new IconViewControl(28);
            btnIcon.X = Application.GetRealWidth(337);
            btnIcon.Y = Application.GetRealHeight(9);
            btnIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/History.png";
            topFrameLayout.AddChidren(btnIcon);
            btnIcon.ButtonClickEvent += (sender, e) =>
            {
                var form = new DoorLockHistoryInfoPage();
                form.AddForm(this.listDevice);
            };
        }
        #endregion
        #region ■ 设备状态推送_______________________
        /// <summary>
        /// 设备状态推送
        /// </summary>
        /// <param name="i_LocalDevice"></param>
        public override void DeviceStatuPush(Function i_LocalDevice)
        {
            //不是目标设备
            if (this.dicBatteryContr.ContainsKey(i_LocalDevice.sid) == false)
            {
                return;
            }
        }
        #endregion
        #region ■ 一般方法___________________________
        #endregion
    }
}
HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockPage.cs
New file
@@ -0,0 +1,360 @@
using Shared;
using System;
using System.Collections.Generic;
using System.Text;
using HDL_ON.UI.CSS;
using HDL_ON.Entity;
using HDL_ON.DriverLayer;
using HDL_ON.UI.Music;
namespace HDL_ON.UI
{
    /// <summary>
    /// 视频门锁的控制界面
    /// </summary>
    public class VideoDoorLockPage : FrameLayout
    {
        #region ■ 变量声明___________________________
        /// <summary>
        /// 设备
        /// </summary>
        private Function device;
        /// <summary>
        /// 上一级界面的设备名字控件
        /// </summary>
        private Button btnDeviceName;
        /// <summary>
        /// 上一级界面的房间名字控件
        /// </summary>
        private Button btnRoomName;
        /// <summary>
        /// 头部布局
        /// </summary>
        private TopView topView;
        /// <summary>
        ///收藏图标
        /// </summary>
        private Button btnCollectIcon;
        /// <summary>
        /// 门锁状态
        /// </summary>
        private CustomFrameLayout doorLockFL;
        /// <summary>
        /// 实时视频
        /// </summary>
        private CustomFrameLayout rtvFL;
        /// <summary>
        /// 一键开锁
        /// </summary>
        private CustomFrameLayout openFL;
        /// <summary>
        /// 临时密码
        /// </summary>
        private CustomFrameLayout pswFL;
        /// <summary>
        /// 历史记录
        /// </summary>
        private CustomFrameLayout recordFL;
        /// <summary>
        /// 表示来自那个界面
        /// </summary>
        private Comerom Comerom;
        #endregion
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="function">设备</param>
        /// <param name="btnDeviceName">上一级界面的设备名字控件</param>
        /// <param name="btnRoomName">上一级界面的房间名字控件</param>
        public VideoDoorLockPage(Function function, Button btnDeviceName, Button btnRoomName, Comerom comerom)
        {
            this.device = function;
            this.btnDeviceName = btnDeviceName;
            this.btnRoomName = btnRoomName;
            this.Comerom = comerom;
        }
        public void Show()
        {
            //初始化UI
            this.InitUI();
            //初始化事件
            this.Events();
        }
        /// <summary>
        /// 初始化界面
        /// </summary>
        private void InitUI()
        {
            #region   ---界面布局---
            this.BackgroundColor = MusicColor.ViewColor;
            this.topView = new TopView();
            this.topView.setBtn.Visible = true;
            this.topView.topNameBtn.Text = this.device.name;
            this.AddChidren(topView.TopFLayoutView());
            var middLayout = new FrameLayout
            {
                Y = topView.fLayout.Bottom,
                Height = Application.GetRealHeight(H_W.H - H_W.T_Height),
            };
            this.AddChidren(middLayout);
            btnCollectIcon = new Button
            {
                X = Application.GetRealWidth(273),
                Y = Application.GetRealHeight(14),
                Width = Application.GetRealWidth(40),
                Height = Application.GetRealWidth(40),
                UnSelectedImagePath = "MusicIcon/collect.png",
                SelectedImagePath = "MusicIcon/collectSelected.png",
                IsSelected= this.device.collect,
                Name = "collect"
            };
            middLayout.AddChidren(btnCollectIcon);
            //门锁状态
            doorLockFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
            middLayout.AddChidren(doorLockFL);
            doorLockFL.X = Application.GetRealWidth(40);
            doorLockFL.Y = btnCollectIcon.Bottom + Application.GetRealHeight(20);
            doorLockFL.AddImageView();
            doorLockFL.AddTextButtonView();
            doorLockFL.GetTextButton().TextID = StringId.shishishipin;
            //实时视频
            rtvFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
            middLayout.AddChidren(rtvFL);
            rtvFL.X = Application.GetRealWidth(20);
            rtvFL.Y = Application.GetRealHeight(300);
            rtvFL.AddImageView();
            rtvFL.AddTextButtonView();
            rtvFL.GetTextButton().TextID = StringId.shishishipin;
            //一键开锁
            openFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
            middLayout.AddChidren(openFL);
            openFL.X = rtvFL.Right + Application.GetRealWidth(20);
            openFL.Y = Application.GetRealHeight(300);
            openFL.AddImageView();
            openFL.AddTextButtonView();
            openFL.GetTextButton().TextID = StringId.yijiankaisuo;
            //临时密码
            pswFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
            middLayout.AddChidren(pswFL);
            pswFL.X = openFL.Right + Application.GetRealWidth(20);
            pswFL.Y = Application.GetRealHeight(300);
            pswFL.AddImageView();
            pswFL.AddTextButtonView();
            pswFL.GetTextButton().TextID = StringId.linshimima1;
            //历史记录
            recordFL = new CustomFrameLayout(CustomFrameLayout.widthFrameLayout, CustomFrameLayout.heightFrameLayout);
            middLayout.AddChidren(recordFL);
            recordFL.X = Application.GetRealWidth(20);
            recordFL.Y = Application.GetRealHeight(300 + 100);
            recordFL.AddImageView();
            recordFL.AddTextButtonView();
            recordFL.GetTextButton().TextID = StringId.lishijilu;
            #endregion
        }
        /// <summary>
        /// 注册事件
        /// </summary>
        private void Events()
        {
            //返回
            this.topView.clickBackBtn.MouseUpEventHandler += (sender, e) =>
            {
                RemoveFromParent();
            };
            //设置
            this.topView.clickSetBtn.MouseUpEventHandler += (sender, e) =>
            {
                //调用秀绕的界面
                var infoView = new UI.FunctionBaseInfoSetPage(this.device, () =>
                {
                    if (this.btnDeviceName == null || this.btnRoomName == null)
                    {
                        return;
                    }
                    ////刷新显示
                    this.btnDeviceName.Text = this.device.name;
                    this.btnRoomName.Text = this.device.GetRoomListName();
                    this.topView.topNameBtn.Text = this.device.name;
                    ////从新计算宽度
                    //this.btnDeviceName.Text = btnDeviceName.Text;
                    //this.btnDeviceName.Width = this.btnDeviceName.GetTextWidth();
                    //this.btnRoomName.Text = btnRoomName.Text;
                    //this.btnRoomName.Width = this.btnRoomName.GetTextWidth();
                    ////回调事件
                    //this.SettionFinishEvent?.Invoke();
                });
                MainPage.BasePageView.AddChidren(infoView);
                infoView.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            //收藏
            btnCollectIcon.MouseUpEventHandler += (sender, e) =>
            {
                btnCollectIcon.IsSelected = this.device.collect = !btnCollectIcon.IsSelected;
                this.device.CollectFunction();
            };
            //实时视频
            rtvFL.SetClickListener((fl, btnStateImage, btnStateText) => { });
            //一键开锁
            openFL.SetClickListener((fl, btnStateImage, btnStateText) => { });
            //临时密码
            pswFL.SetClickListener((fl, btnStateImage, btnStateText) => { });
            //历史记录
            recordFL.SetClickListener((fl, btnStateImage, btnStateText) => { });
        }
    }
    /// <summary>
    /// 自己弄一个FrameLayout
    /// </summary>
    class CustomFrameLayout : FrameLayout
    {
        public const int widthFrameLayout = 100;
        public const int heightFrameLayout = 80;
        public const int yFrameLayout = 300;
        public const int xFrameLayout = 20;
        public const int interval = 20;//行中的列间隔值
        public CustomFrameLayout(int width, int height, int x = 0, int y = 0)
        {
            this.Width = Application.GetRealWidth(width);
            this.Height = Application.GetRealHeight(height);
            this.X = Application.GetRealWidth(x);
            this.Y = Application.GetRealHeight(y);
        }
        Button btnStateImage = new Button
        {
            Width = Application.GetRealWidth(40),
            Height = Application.GetRealWidth(40),
            UnSelectedImagePath = "MusicIcon/collect.png",
            SelectedImagePath = "MusicIcon/collectSelected.png",
            Gravity = Gravity.CenterHorizontal,
            Name = "btnStateImage",
        };
        Button btnStateText = new Button
        {
            Y = Application.GetRealHeight(20),
            Width = Application.GetRealWidth(100),
            Height = Application.GetRealWidth(20),
            TextID = StringId.dangqianmenweiguan,
            TextSize = TextSize.Text14,
            TextColor = MusicColor.TextColor,
            Gravity = Gravity.CenterHorizontal,
            Name = "btnStateText"
        };
        public void AddImageView()
        {
            this.AddChidren(btnStateImage);
        }
        public void AddTextButtonView()
        {
            btnStateText.Y += btnStateImage.Bottom;
            this.AddChidren(btnStateText);
        }
        public Button GetImageButton()
        {
            //if (!this.AddWithout(this.btnStateImage))
            //{
            //    this.AddImageView();
            //}
            return this.btnStateImage;
        }
        public Button GetTextButton()
        {
            //if (!this.AddWithout(this.btnStateText))
            //{
            //    this.AddTextButtonView();
            //}
            return this.btnStateText;
        }
        /// <summary>
        /// 事件监听方法
        /// </summary>
        /// <param name="action">回调(第一个是父类对象;第二个是图标对象;第三个是状态对象</param>
        /// <param name="button1">注意:在SetClickListener()前面调用AddImageView()才有效</param>
        /// <param name="button2">注意:在SetClickListener()前面调用AddImageView()才有效</param>
        public void SetClickListener(Action<FrameLayout, Button, Button> action)
        {
            EventHandler<MouseEventArgs> click = (sender, e) =>
                    {
                        if (action == null)
                        {
                            return;
                        }
                        action(this, btnStateImage, btnStateText);
                    };
            this.MouseUpEventHandler += click;
            btnStateImage.MouseUpEventHandler += click;
            btnStateText.MouseUpEventHandler += click;
        }
        /// <summary>
        /// 在父布局查找子控件是否存在
        /// </summary>
        /// <param name="btn">查找对象</param>
        /// <returns>存在为true,否则为false</returns>
        private bool AddWithout(View btn)
        {
            if (this.ChildrenCount <= 0 || btn == null)
            {
                return false;
            }
            for (int i = 0; i < this.ChildrenCount; i++)
            {
                View view = this.GetChildren(i);
                if (view == null)
                {
                    continue;
                }
                if (view is Button)
                {
                    if (view.Name == btn.Name)
                    {
                        return true;
                    }
                }
            }
            return false;
        }
    }
    /// <summary>
    /// 表示来自那个界面
    /// </summary>
    public enum Comerom
    {
        function,//功能
        collect,//收藏
        room,//房间
    }
}
HDL_ON/UI/UI2/UserPage.cs
@@ -485,9 +485,10 @@
                {
                    btnNavigationSelectionIcon.SetRotation(0f);
                    ContextView.RemoveAll();
                    var classificaitionView = new ClassificationPage();
                    var classificaitionView = new ClassificationPage();
                    ContextView.AddChidren(classificaitionView);
                    classificaitionView.LoadPage();
                });
            })
            { IsBackground = true, Priority = System.Threading.ThreadPriority.Lowest }.Start();