From 28d269d8aa90eca5470fff825a9b9545135a3ec0 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期三, 16 十二月 2020 17:37:26 +0800 Subject: [PATCH] 上传一个初始版本 --- HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs | 53 +++++++++++++++-------------------------------------- 1 files changed, 15 insertions(+), 38 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs index fccf6c8..e57df22 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs @@ -445,52 +445,29 @@ return; } } - var waitPage = new Loading(); - waitPage.Start(); - new Thread(() => + var addResult = SpatialInfo.CurrentSpatial.AddRoom(room,out room);//妫�鏌oom鏄惁涓轰簯绔繑鍥炵殑鏈�鏂版暟鎹� + if (addResult == StateCode.SUCCESS) { - try + var deviceIds = new List<string>(); + foreach (var f in roomFunctions) { - var addResult = SpatialInfo.CurrentSpatial.AddRoom(room, out room);//妫�鏌oom鏄惁涓轰簯绔繑鍥炵殑鏈�鏂版暟鎹� - if (addResult == StateCode.SUCCESS) + deviceIds.Add(f.deviceId); + } + if (deviceIds.Count > 0) + { + var bindResult = FunctionList.List.FunctionsBindRooms(new List<string>() { room.roomId }, deviceIds); + if (bindResult == StateCode.SUCCESS) { - var deviceIds = new List<string>(); foreach (var f in roomFunctions) { - deviceIds.Add(f.deviceId); + f.roomIds.Add(room.roomId); } - if (deviceIds.Count > 0) - { - var bindResult = FunctionList.List.FunctionsBindRooms(new List<string>() { room.roomId }, deviceIds); - if (bindResult == StateCode.SUCCESS) - { - foreach (var f in roomFunctions) - { - f.roomIds.Add(room.roomId); - } - room.GetRoomFunctions(true); - } - } - Application.RunOnMainThread(() => - { - backAction(room); - RemoveFromParent(); - }); + room.GetRoomFunctions(true); } } - catch (Exception ex) - { - MainPage.Log($"娣诲姞鎴块棿澶辫触msg:{ex.Message}"); - } - finally - { - Application.RunOnMainThread(() => - { - waitPage.Hide(); - }); - } - }) - { IsBackground = true }.Start(); + backAction(room); + RemoveFromParent(); + } }; } -- Gitblit v1.8.0