From 4ae231112f6d8931dd4850f8de382638a032d614 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 28 四月 2023 17:45:46 +0800
Subject: [PATCH] IOS升级xcode14,修复增加远程闪退问题,修复灯光场景(组合调光)无法加载的问题

---
 HDL_ON/UI/UI2/2-Classification/FunctionPage.cs |   48 +++++++++++++++++++++---------------------------
 1 files changed, 21 insertions(+), 27 deletions(-)

diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
index 1b48b0d..4427d20 100644
--- a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
@@ -28,6 +28,7 @@
         #endregion
 
         List<Function> functionList;
+        int titleId;
 
         public FunctionPage()
         {
@@ -35,8 +36,9 @@
             functionList = new List<Function>();
         }
 
-        public void LoadPage(int titleId)
+        public void LoadPage(int titleId_out)
         {
+            this.titleId = titleId_out;
 
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
             if (titleId == StringId.Lights && !DB_ResidenceData.Instance.HomeGateway.isSupportGroupControl)
@@ -145,16 +147,7 @@
                 functionList.AddRange(FunctionList.List.GetLightList());
 
 
-                var lightScene = FunctionList.List.scenes.FindAll((obj) => obj.sceneType == SceneType.LightScene);
 
-                foreach (var scene in lightScene)
-                {
-                    functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) });
-
-                    var sceneRow = new SceneControlZone(scene);
-                    functionListView.AddChidren(sceneRow);
-                    sceneRow.LoadView();
-                }
 
             }
             else if (titleId == StringId.AC)
@@ -200,22 +193,7 @@
             LoadDialog_ChangeFloor();
 
 
-            #region 鍔犺浇缁勫悎璋冨厜鍦烘櫙
-            if (titleId == StringId.Lights)
-            {
-                foreach (var lightScene in FunctionList.List.scenes)
-                {
-                    if (lightScene.sceneType == SceneType.LightScene)
-                        if (lightScene != null)
-                        {
-                            functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) });
-                            var sceneRow = new SceneControlZone(lightScene);
-                            functionListView.AddChidren(sceneRow);
-                            sceneRow.LoadView();
-                        }
-                }
-            }
-            #endregion
+        
 
         }
         /// <summary>
@@ -241,8 +219,24 @@
                         {
                             showCount = -1;
                             functionListView.RemoveAll();
+                            #region 鍔犺浇缁勫悎璋冨厜鍦烘櫙
+                            if (titleId == StringId.Lights)
+                            {
+                                foreach (var lightScene in FunctionList.List.scenes)
+                                {
+                                    if (lightScene.sceneType == SceneType.LightScene)
+                                        if (lightScene != null)
+                                        {
+                                            var sceneRow = new SceneControlZone(lightScene);
+                                            functionListView.AddChidren(sceneRow);
+                                            sceneRow.LoadView();
+                                            functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(12) });
+                                        }
+                                }
+                            }
+                            #endregion
                         }
-                        for(var i = 0;i<50;i++)
+                        for (var i = 0;i<50;i++)
                         //foreach (var function in showList)
                         {
                             showCount++;

--
Gitblit v1.8.0