From 23ee4f8c373f9abecf079ef9d4297d8b6cd8d5e6 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 16 十二月 2020 15:16:00 +0800
Subject: [PATCH] Merge branch 'NewFilePath'

---
 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs |   42 +++++++++++++++++++++++++++++++++---------
 1 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs
index 424a911..4b4d2fe 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditPageBLL.cs
@@ -31,24 +31,48 @@
             {
                 Action action = () =>
                 {
-                    var delResult = SpatialInfo.CurrentSpatial.DelRoom(room);
-                    if (delResult == StateCode.SUCCESS)
+                    var waitPage = new Loading();
+                    waitPage.Start();
+                    new Thread(() =>
                     {
-                        foreach (var f in FunctionList.List.GetDeviceFunctionList())
+                        try
                         {
-                            if (f.roomIds.Contains(room.roomId))
+                            var delResult = SpatialInfo.CurrentSpatial.DelRoom(room);
+                            if (delResult == StateCode.SUCCESS)
                             {
-                                f.roomIds.Remove(room.roomId);
+                                foreach (var f in FunctionList.List.GetDeviceFunctionList())
+                                {
+                                    if (f.roomIds.Contains(room.roomId))
+                                    {
+                                        f.roomIds.Remove(room.roomId);
+                                    }
+                                }
+                                Application.RunOnMainThread(() =>
+                                {
+                                    //鍒犻櫎浜嬩欢鍥炶皟
+                                    this.deleteAction?.Invoke();
+                                    this.RemoveFromParent();
+                                });
                             }
                         }
-                        //鍒犻櫎浜嬩欢鍥炶皟
-                        this.deleteAction?.Invoke();
-                        this.RemoveFromParent();
-                    }
+                        catch (Exception ex)
+                        {
+                            MainPage.Log($"娣诲姞鎴块棿澶辫触msg:{ex.Message}");
+                        }
+                        finally
+                        {
+                            Application.RunOnMainThread(() =>
+                            {
+                                waitPage.Hide();
+                            });
+                        }
+                    })
+                    { IsBackground = true }.Start();
                 };
                 new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.DeleteRoomTip, action);
             };
         }
+            
 
         /// <summary>
         /// 鏄剧ず鑳屾櫙鍥鹃�夋嫨閫夐」

--
Gitblit v1.8.0