wjc
2023-08-24 58d4ef9af9c906acf2e9f65a3e65092363c8e1cd
HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
@@ -29,6 +29,11 @@
        /// </summary>
        private Button btnRoomName;
        /// <summary>
        /// 上一级界面的收藏控件
        /// </summary>
        private Button btnCollectionIcon;
        /// <summary>
        /// 头部布局
        /// </summary>
        private TopView topView;
@@ -83,12 +88,14 @@
        /// </summary>
        /// <param name="function">设备</param>
        /// <param name="btnDeviceName">上一级界面的设备名字控件(注:不能传null,没有可以传new Button())</param>
        /// <param name="btnRoomName">上一级界面的房间名字控件(注:不能传null,没有可以传new Button())</param>
        public HisenseTvPage(Function function, Button btnDeviceName, Button btnRoomName, CommonMethod.Comerom comerom, Action action)
        /// <param name="btnRoomName">上一级界面的房间名字控件(注:不能传null,没有可以传new Button())</param>
        /// <param name="btnCollectionIcon">上一级界面的房间名字控件(注:不能传null,没有可以传new Button())</param>
        public HisenseTvPage(Function function, Button btnDeviceName, Button btnRoomName, Button btnCollectionIcon, CommonMethod.Comerom comerom, Action action)
        {
            this.device = function;
            this.btnDeviceName = btnDeviceName;
            this.btnRoomName = btnRoomName;
            this.btnCollectionIcon = btnCollectionIcon;
            this.comerom = comerom;
            this.action = action;
@@ -159,6 +166,8 @@
            {
                btnOpenCollectIcon.IsSelected = this.device.collect = !btnOpenCollectIcon.IsSelected;
                this.device.CollectFunction();
                btnCloseCollectIcon.IsSelected = btnOpenCollectIcon.IsSelected;
                this.btnCollectionIcon.IsSelected = btnOpenCollectIcon.IsSelected;
            };
            //首页
@@ -169,7 +178,7 @@
            //关机
            kaiguanFL.SetClickListener((fl, btnImage, btnText) =>
            {
                ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "0", (isBool) =>
                ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "off", (isBool) =>
                {
                    if (isBool)
                    {
@@ -291,11 +300,13 @@
            {
                btnCloseCollectIcon.IsSelected = this.device.collect = !btnCloseCollectIcon.IsSelected;
                this.device.CollectFunction();
                btnOpenCollectIcon.IsSelected = btnCloseCollectIcon.IsSelected;
                this.btnCollectionIcon.IsSelected = btnCloseCollectIcon.IsSelected;
            };
            //开机
            clickBtn.MouseDownEventHandler += (sen, e) =>
            {
                ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "1", (isBool) =>
                ControlCommand(HisenseTVFunctionalAttributeConstant.on_off, "on", (isBool) =>
                {
                    if (isBool)
                    {
@@ -331,7 +342,7 @@
            catch { }
        }
        /// <summary>
        /// 初始数据
        /// 初始化数据
        /// </summary>
        private void ReadData()
        {
@@ -743,29 +754,32 @@
            this.AddChidren(topView.TopFLayoutView());
        }
        /// <summary>
        /// 根据设备开关状态显示指定显示界面
        /// 根据设备开关状态显示指定界面
        /// (进来的时候用到)
        /// </summary>
        /// <returns></returns>
        private void CurrentAssignPage()
        {
            CommonMethod.Current.MainThread(() =>
            {
            if (this.device == null)
            {
                vv.Visible = false;
                baseCloseFFL.Visible = true;
                return;
            }
            if (this.device.GetAttrState("on_off") == "on")
            {
                vv.Visible = true;
                baseCloseFFL.Visible = false;
            }
            else
            {
                vv.Visible = false;
                baseCloseFFL.Visible = true;
            }
                if (this.device == null)
                {
                    vv.Visible = false;
                    baseCloseFFL.Visible = true;
                    return;
                }
                if (this.device.GetAttrState("on_off") == "on" || this.device.GetAttrState("on_off") == "1")
                {
                    vv.Visible = true;
                    baseCloseFFL.Visible = false;
                }
                else
                {
                    vv.Visible = false;
                    baseCloseFFL.Visible = true;
                }
            });
        }
@@ -875,7 +889,7 @@
        {
            EventHandler<MouseEventArgs> DownClick = (sender, e) =>
            {
                this.BackgroundColor = 0xFFF2F3F7;
                //this.BackgroundColor = 0xFFF2F3F7;
                action?.Invoke(this, btnImage, btnText);
            };
            this.MouseDownEventHandler += DownClick;
@@ -885,7 +899,7 @@
            EventHandler<MouseEventArgs> UpClick = (sender, e) =>
             {
                 this.BackgroundColor = 0x00000000;
                 //this.BackgroundColor = 0x00000000;
             };
            this.MouseUpEventHandler += UpClick;
            btnImage.MouseUpEventHandler += UpClick;