From 166c81e63cd1d0a1649823e4299daeaaf1ea0987 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期六, 29 七月 2023 11:11:01 +0800
Subject: [PATCH] 2.0bug修复

---
 HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs |   39 +++++++++++++++++++++++++++++++++++++--
 1 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs
index 23b4816..c126685 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/ChooseRoomPageBLL.cs
@@ -60,9 +60,44 @@
                         }
                     }
                 }
+                var waitPage = new Loading();
+                bodyView.AddChidren(waitPage);
+                new System.Threading.Thread(async() =>
+                {
+                    //function.UpdataRoomIds();
+                    var pack = ApiUtlis.Ins.HttpRequest.UpdataDevcieBindRoomInfo(function);
+                    //鐩存帴淇濆瓨鏈湴锛�
+                    function.SaveFunctionFile();
+                    if (pack.Code == StateCode.SUCCESS)
+                    {
+                        if (UI.RoomPage.bodyView != null)
+                        {
+                            Application.RunOnMainThread(() =>
+                            {
+                                UI.RoomPage.bodyView.ReLoadPage();
+                            });
+                        }
+                        Entity.SpatialInfo.CurrentSpatial.InitRoomListFunctions();
+                        try
+                        {
+                            //鍒濆鍖栦綇瀹呮墍鏈夋埧闂村姛鑳芥暟鎹�
+                            foreach (var r in Entity.SpatialInfo.CurrentSpatial.RoomList)
+                            {
+                                Entity.SpatialInfo.CurrentSpatial.InitRoomFuntion(r);
+                            }
+                        }
+                        catch (Exception ex)
+                        {
+                            MainPage.Log($"Init room function error : {ex.Message}");
+                        }
+                    }
+                    else
+                    {
+                        IMessageCommon.Current.ShowErrorInfoAlter(pack.Code);
+                    }
 
-                function.UpdataRoomIds();
-                Entity.SpatialInfo.CurrentSpatial.InitRoomListFunctions();
+                })
+                { IsBackground = true }.Start();
             };
         }
 

--
Gitblit v1.8.0