From a5ae6e497c9e1398220949e028d44fa15cb274c6 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期一, 11 九月 2023 14:17:24 +0800
Subject: [PATCH] 2023年09月11日14:15:05

---
 HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs |   63 ++++++++++++++++++++++++-------
 1 files changed, 48 insertions(+), 15 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
index 9685f89..83623d5 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/HisenseTV /HisenseTvPage.cs
@@ -93,7 +93,7 @@
             this.btnRoomName = btnRoomName;
             this.btnCollectionIcon = btnCollectionIcon;
             this.comerom = comerom;
-            this.action = action; 
+            this.action = action;
 
         }
 
@@ -105,7 +105,7 @@
             //鍒濆鍖栦簨浠�
             this.EventListener();
             //璇诲彇鏁版嵁
-            //this.ReadData();
+            this.ReadData();
 
         }
 
@@ -192,11 +192,11 @@
                 ControlCommand(HisenseTVFunctionalAttributeConstant.volume_subtract, "");
             };
             //鑿滃崟
-           caidanBtn.SetClickListener((btn) =>
-            {
-                ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "11");
+            caidanBtn.SetClickListener((btn) =>
+             {
+                 ControlCommand(HisenseTVFunctionalAttributeConstant.operation, "11");
 
-            });
+             });
             //鎾斁
             bofangBtn.SetClickListener((btn) =>
             {
@@ -293,6 +293,26 @@
         {
             try
             {
+                if (this.device == null)
+                {
+                    //璁惧涓嶅湪绾挎帶鍒跺け璐�
+                    Application.RunOnMainThread(() =>
+                    {
+                        CommonMethod.Current.ShowTip(Language.StringByID(StringId.shebeibuzaixian), 3);
+                    });
+                    return;
+                }
+
+                if (!this.device.online)
+                {
+                    //璁惧涓嶅湪绾挎帶鍒跺け璐�
+                    Application.RunOnMainThread(() =>
+                    {
+                        CommonMethod.Current.ShowTip(Language.StringByID(StringId.shebeibuzaixian), 3);
+                    });
+                    return;
+                }
+
                 Dictionary<string, string> dic = new Dictionary<string, string>();
                 dic.Add(key, value);
                 Send.Current.SendControlCommand(this.device, dic, action);
@@ -304,14 +324,27 @@
         /// </summary>
         private void ReadData()
         {
+            if (this.device == null)
+            {
+                return;
+            }
             CommonMethod.Current.Loading.Start();
             CommonMethod.Current.SunThread(() =>
             {
                 try
                 {
-                    CommonMethod.Current.MainThread(() =>
+
+                    var isRefreshDeviceStatus = Send.Current.RefreshDeviceStatus(new List<string> { this.device.deviceId });
+                    if (isRefreshDeviceStatus)
                     {
-                    });
+                        var fun = Send.Current.GetDeviceInfo(this.device.deviceId);
+                        if (fun != null)
+                        {
+                            //鏇存柊鐪熷疄鍦ㄧ嚎鐘舵��
+                            this.device.online = fun.online;
+                        }
+
+                    }
                 }
                 catch { }
                 finally
@@ -413,7 +446,7 @@
             kaijiFL.GetImageButton().SelectedImagePath = "HisenseTv/kaiguanSelected.png";
             kaijiFL.GetTextButton().TextID = StringId.kaiji;
 
-            guanFL = new CustomFrameLayout(); 
+            guanFL = new CustomFrameLayout();
             backgroundOpenFl.AddChidren(guanFL);
             guanFL.X = kaijiFL.Right + Application.GetRealWidth(37);
             guanFL.Y = yHeight;
@@ -580,7 +613,7 @@
             #endregion
 
         }
-     
+
         /// <summary>
         /// 鍒濆鍖栧ご閮�
         /// </summary>
@@ -592,7 +625,7 @@
             this.topView.topNameBtn.TextID = StringId.dianshi;
             this.AddChidren(topView.TopFLayoutView());
         }
-       
+
 
         /// <summary>
         /// 閲嶆柊璁$畻瀹藉害(璁惧鍚嶇О,鎴块棿鎺т欢)
@@ -650,7 +683,7 @@
             TextID = StringId.dangqianmenweiguan,
             TextSize = TextSize.Text14,
             TextColor = MusicColor.TextColor,
-            SelectedTextColor= MusicColor.MusicTxet14SelectedColor,
+            SelectedTextColor = MusicColor.MusicTxet14SelectedColor,
             TextAlignment = TextAlignment.Center,
             Gravity = Gravity.CenterHorizontal,
             Name = "btnText",
@@ -724,7 +757,7 @@
             this.BackgroundColor = 0xffECEDEE;
             this.SelectedBackgroundColor = 0xFFF2F3F7;
             this.Radius = (uint)Application.GetRealHeight(19);
-            this.Padding = new Padding(0,0,0,0);
+            this.Padding = new Padding(0, 0, 0, 0);
         }
 
 
@@ -817,8 +850,8 @@
             TextColor = MusicColor.TextColor,
             SelectedTextColor = MusicColor.MusicTxet14SelectedColor,
             TextSize = TextSize.Text16,
-            TextID =StringId.xinhaoyuan,
-            Padding=new Padding(0,0,0,0),
+            TextID = StringId.xinhaoyuan,
+            Padding = new Padding(0, 0, 0, 0),
             IsBold = true,
         };
 

--
Gitblit v1.8.0