From a2b0218c104808fc686a40f258b48dc70bdd7170 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期五, 20 十二月 2019 15:57:31 +0800
Subject: [PATCH] 2019.12.20

---
 ZigbeeApp/Shared/Phone/Device/Category/SelectScene.cs |   29 ++++++++++++++++++-----------
 1 files changed, 18 insertions(+), 11 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Category/SelectScene.cs b/ZigbeeApp/Shared/Phone/Device/Category/SelectScene.cs
index 65094ac..74a7512 100644
--- a/ZigbeeApp/Shared/Phone/Device/Category/SelectScene.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Category/SelectScene.cs
@@ -40,7 +40,10 @@
         /// sceneUI
         /// </summary>
         public SceneUI sceneUI;
-
+        /// <summary>
+        /// 褰撳墠鍦烘櫙鏈韩锛屾坊鍔犲満鏅椂浣跨敤
+        /// </summary>
+        public SceneUI currentSceneUI;
 
         #endregion
 
@@ -66,7 +69,7 @@
 
             AddBodyView();
 
-            RefreshBodyView();
+            RefreshBodyView(Config.Instance.Home.CurrentFloorId);
         }
 
 
@@ -124,10 +127,10 @@
             var floors = new SelectFloor();
             AddChidren(floors);
             floors.Init(580, 184, Direction.Right);
-            floors.FloorAction += (floorName) =>
+            floors.FloorAction += (floorId) =>
             {
-                floorBtn.Text = floorName;
-                RefreshBodyView();
+                floorBtn.Text = Config.Instance.Home.GetFloorNameById(floorId);
+                RefreshBodyView(floorId);
             };
         }
         /// <summary>
@@ -161,15 +164,15 @@
         /// <summary>
         /// RefreshBodyView
         /// </summary>
-        private void RefreshBodyView()
+        private void RefreshBodyView(string floorId)
         {
-            AddRoomView();
+            AddRoomView(floorId);
         }
 
         /// <summary>
         /// AddRoomView
         /// </summary>
-        private void AddRoomView()
+        private void AddRoomView(string floorId)
         {
             var roomFL = new HorizontalScrolViewLayout()
             {
@@ -190,7 +193,7 @@
             bodyFrameLayout.AddChidren(functionSceneBodyView);
 
             Button curBtn = new Button();
-            foreach (var room in Common.Room.CurrentRoom.GetRoomsByCurrentFloorIdAppendLoveRoom())
+            foreach (var room in Common.Room.CurrentRoom.GetRoomsByFloorIdAppendLoveRoom(floorId))
             {
                 var row = new FrameLayout()
                 {
@@ -270,6 +273,10 @@
                 for (int i = 0; i < sceneList.Count; i++)
                 {
                     var scene = sceneList[i];
+                    if (currentSceneUI?.Id == scene.Id)
+                    {
+                        continue;
+                    }
                     if (beforeSceneTargetDeviceUIs.Find((obj) => obj.SceneUI.Id == scene.Id) != null)
                     {
                         continue;
@@ -286,7 +293,7 @@
                     sceneRowLayout.Init();
                     sceneRowLayout.SetTitle(scene.Name);
                     sceneRowLayout.ClickButton.Tag = scene;
-                    if(sceneUI==null)
+                    if (sceneUI == null)
                     {
                         if (i == 0)
                         {
@@ -297,7 +304,7 @@
                     }
                     else
                     {
-                        if(sceneUI.Id==scene.Id)
+                        if (sceneUI.Id == scene.Id)
                         {
                             tempSceneRow = sceneRowLayout;
                             sceneUI = scene;

--
Gitblit v1.8.0