From 5f4b040a92e5e1b69d49e531cfa5ac3012c6730a Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 09 五月 2023 14:36:06 +0800
Subject: [PATCH] 备份

---
 HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs |   28 ++++++++++++++++++++--------
 1 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs
index 0f80995..9ac7244 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePage.cs
@@ -449,19 +449,31 @@
                 {
                     DB_ResidenceData.Instance.CurrentRegion.debugPerm = !DB_ResidenceData.Instance.CurrentRegion.debugPerm;
                     btnCommissioningAuthoritySwitchIcon.IsSelected = DB_ResidenceData.Instance.CurrentRegion.debugPerm;
+                    var waitPage = new Loading();
+                    bodyView.AddChidren(waitPage);
+                    waitPage.Start("");
                     new System.Threading.Thread(() =>
                     {
-                        var pack = new DAL.Server.HttpServerRequest().ChangeResidenceDebugPerm(DB_ResidenceData.Instance.CurrentRegion.debugPerm);
-                        if(pack != null)
+                        try
                         {
-                            if(pack.Code == DAL.Server.StateCode.SUCCESS)
+                            var pack = new DAL.Server.HttpServerRequest().ChangeResidenceDebugPerm(DB_ResidenceData.Instance.CurrentRegion.debugPerm);
+                            if (pack != null)
                             {
-                                DB_ResidenceData.Instance.CurrentRegion.debugStatus = DB_ResidenceData.Instance.CurrentRegion.debugPerm ? "SECONDARY_DEBUGGIN" : "Delivered";
-                                Application.RunOnMainThread(() => {
-                                    bodyView.RemoveAll();
-                                    LoadPage();
-                                });
+                                if (pack.Code == DAL.Server.StateCode.SUCCESS)
+                                {
+                                    DB_ResidenceData.Instance.CurrentRegion.debugStatus = DB_ResidenceData.Instance.CurrentRegion.debugPerm ? "SECONDARY_DEBUGGIN" : "Delivered";
+                                    Application.RunOnMainThread(() =>
+                                    {
+                                        bodyView.RemoveAll();
+                                        LoadPage();
+                                    });
+                                }
                             }
+                        }catch(Exception ex)
+                        {
+                            Application.RunOnMainThread(() => {
+                                waitPage.Hide();
+                            });
                         }
                     })
                     { IsBackground = true }.Start();

--
Gitblit v1.8.0