From 9d65c293924e4edbbc8c6c6091f55d7fc49c23eb Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期二, 06 七月 2021 13:15:46 +0800
Subject: [PATCH] 乐橙子账号token
---
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs | 59 +++++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 41 insertions(+), 18 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 cc90c39..601ccd4 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/AddRoom/AddRoomPage.cs
@@ -264,7 +264,7 @@
btnFunctionManagementTitle = new Button()
{
X = Application.GetRealWidth(16),
- Width = Application.GetRealWidth(120),
+ Width = Application.GetRealWidth(220),
TextAlignment = TextAlignment.CenterLeft,
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = CSS_FontSize.SubheadingFontSize,
@@ -445,30 +445,52 @@
return;
}
}
- var addResult = SpatialInfo.CurrentSpatial.AddRoom(room,out room);//妫�鏌oom鏄惁涓轰簯绔繑鍥炵殑鏈�鏂版暟鎹�
- if (addResult == StateCode.SUCCESS)
+ var waitPage = new Loading();
+ waitPage.Start();
+ new Thread(() =>
{
- var deviceIds = new List<string>();
- foreach (var f in roomFunctions)
+ try
{
- deviceIds.Add(f.deviceId);
- }
- var bindResult = FunctionList.List.FunctionsBindRooms(new List<string>() { room.roomId }, deviceIds);
- if (bindResult == StateCode.SUCCESS)
- {
- foreach(var f in roomFunctions)
+ var addResult = SpatialInfo.CurrentSpatial.AddRoom(room, out room);//妫�鏌oom鏄惁涓轰簯绔繑鍥炵殑鏈�鏂版暟鎹�
+ if (addResult == StateCode.SUCCESS)
{
- f.roomIds.Add(room.roomId);
+ var deviceIds = new List<string>();
+ foreach (var f in roomFunctions)
+ {
+ deviceIds.Add(f.deviceId);
+ }
+ 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);
}
- else
+ catch (Exception ex)
{
- //Utlis.ShowTip(Language.StringByID(StringId.EditFunctionInfoFail) + "\r\nCode:" + pack.Code);
+ MainPage.Log($"娣诲姞鎴块棿澶辫触msg:{ex.Message}");
}
- backAction(room);
- RemoveFromParent();
- }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ waitPage.Hide();
+ });
+ }
+ })
+ { IsBackground = true }.Start();
};
}
@@ -622,6 +644,7 @@
pictureOptionView.Parent.RemoveFromParent();
Action<string> action = (obj) => {
room.backgroundImage = obj;
+ btnRoomBg.ImageBytes = null;//瑙e喅鏈塈mageBytes涓嶅姞杞絀magePath
btnRoomBg.ImagePath = room.backgroundImage;
};
--
Gitblit v1.8.0