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();
            };
        }
@@ -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;
                };
            };
@@ -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();
        }