HDL Home App 第二版本 旧平台金堂用 正在使用
hxb
2022-08-30 25429f085093d89d543a0b90e30d0d62d1b7dac9
ZigbeeApp/Shared/Phone/MainPage/Controls/SceneCardControl.cs
@@ -60,6 +60,7 @@
            this.ButtonClickEvent += (sender, e) =>
            {
                //调用场景
                this.CanClick = false;
                this.SetSceneAction();
            };
        }
@@ -86,7 +87,7 @@
            //场景背景图控件
            this.btnSceneBackGroud = new PicViewControl(this.Width, this.Height, false);
            btnSceneBackGroud.UnSelectedImagePath = "Scene/Background.png";
            this.AddChidren(btnSceneBackGroud, ChidrenBindMode.BindEventOnly);
            this.AddChidren(btnSceneBackGroud, ChidrenBindMode.BindEvent);
            //延时时间显示控件
            this.btnTimeView = new NormalViewControl(HdlControlLogic.Current.GetPictrueRealSize(280), HdlControlLogic.Current.GetPictrueRealSize(63), false);
@@ -98,7 +99,7 @@
            {
                btnTimeView.Text= this.GetTimeString(i_scene.SceneDelayTime, hourText, minuText, secondText);
            }
            this.AddChidren(btnTimeView, ChidrenBindMode.BindEventOnly);
            this.AddChidren(btnTimeView, ChidrenBindMode.BindEvent);
            //时间图标控件
            this.btnTimeIcon = new IconViewControl(63);
@@ -125,12 +126,17 @@
                timeSelect.Init();
                timeSelect.TimeAction = (time) =>
                {
                    //选择的是不开启
                    if (time == 0) { return; }
                    i_scene.SceneDelayTime = time;
                   //时间图标不显示
                   this.btnTimeIcon.Visible = false;
                   //显示剩余的时间
                   this.btnTimeView.Text = this.GetTimeString(time, hourText, minuText, secondText);
                    //选择延时时,需要刷新主页
                    UserView.UserPage.Instance.RefreshAllForm = true;
                };
            };
@@ -150,7 +156,7 @@
                {
                    //取消收藏
                    HdlSceneLogic.Current.DeleteLoveScene(i_scene);
                    if (HdlRoomLogic.Current.CurrentRoom.IsLove == true)
                    if (HdlRoomLogic.Current.NowMainPageRoom.IsLove == true)
                    {
                        //如果当前房间是我的喜爱的话,回调卡片被删除的事件
                        this.CardNeedRemoveEvent?.Invoke();
@@ -169,7 +175,7 @@
            btnSceneName.Y = HdlControlLogic.Current.GetPictrueRealSize(236);
            btnSceneName.IsBold = true;
            btnSceneName.TextColor = UserCenterColor.Current.White;
            this.AddChidren(btnSceneName, ChidrenBindMode.BindEventOnly);
            this.AddChidren(btnSceneName, ChidrenBindMode.BindEvent);
            //刷新控件状态
            this.RefreshControlInfo(i_scene);
@@ -195,7 +201,13 @@
            var result = await HdlSceneLogic.Current.ControlScene(scene);
            if (result == false)
            {
                this.CanClick = true;
                return;
            }
            if (scene.SceneDelayTime > 0)
            {
                //调用有延时的场景,需要刷新主页
                UserView.UserPage.Instance.RefreshAllForm = true;
            }
            //修改时间
            scene.RemainTime = scene.SceneDelayTime;
@@ -236,6 +248,7 @@
            }
            //开启延时倒计时特效
            this.CanClick = false;
            this.StartRemainTimeApreal(i_scene);
        }
@@ -251,6 +264,7 @@
        {
            if (i_scene.RemainTime <= 0)
            {
                this.CanClick = true;
                return;
            }
            int remainTine = i_scene.RemainTime;
@@ -271,20 +285,21 @@
                while (remainTine > 0 && this.Parent != null)
                {
                    System.Threading.Thread.Sleep(1000);
                    Application.RunOnMainThread(() =>
                    HdlThreadLogic.Current.RunMain(() =>
                    {
                        this.btnTimeView.Text = this.GetTimeString(remainTine, hourText, minuText, secondText);
                    });
                    }, ShowErrorMode.NO);
                    remainTine--;
                }
                Application.RunOnMainThread(() =>
                HdlThreadLogic.Current.RunMain(() =>
                {
                    //倒计时结束时,时间图标显示
                    this.btnTimeIcon.Visible = true;
                    this.btnTimeView.Text = string.Empty;
                    //直接开启Loading特效
                    this.StartLoadingApreal();
                });
                    this.CanClick = true;
                }, ShowErrorMode.NO);
            })
            { IsBackground = true }.Start();
        }