From 31ba5fce06bd88300178050afdeb1625624ec307 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 01 七月 2021 15:42:55 +0800
Subject: [PATCH] 1
---
HDL_ON/UI/UI2/4-PersonalCenter/SmartSpeaker/SmartSpeakerSelectDevicesPage.cs | 52 ++++++++++++++++++++++++----------------------------
1 files changed, 24 insertions(+), 28 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/SmartSpeaker/SmartSpeakerSelectDevicesPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/SmartSpeaker/SmartSpeakerSelectDevicesPage.cs
index b06bea9..ce32f35 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/SmartSpeaker/SmartSpeakerSelectDevicesPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/SmartSpeaker/SmartSpeakerSelectDevicesPage.cs
@@ -2,19 +2,18 @@
using Shared;
using HDL_ON.UI.CSS;
using System.Collections.Generic;
-using System.Threading;
using HDL_ON.DAL.Server;
namespace HDL_ON.UI
{
/// <summary>
- /// 绠$悊閰嶇疆缁欓煶绠辩殑璁惧鍒楄〃
+ /// 绠$悊閰嶇疆缁欓煶绠辩殑璁惧鎴栫潃鍦烘櫙鍒楄〃
/// </summary>
public class SmartSpeakerSelectDevicesPage : FrameLayout
{
/// <summary>
- ///
+ /// bodyView
/// </summary>
FrameLayout bodyView;
/// <summary>
@@ -46,10 +45,10 @@
List<SpeakerTargetInfo> roomFunctionOrSceneList = new List<SpeakerTargetInfo>();
/// <summary>
- ///
+ /// 绠$悊閰嶇疆缁欓煶绠辩殑璁惧鎴栫潃鍦烘櫙鍒楄〃
/// </summary>
- /// <param name="speakerInfo"></param>
- /// <param name="roomFunctionOrSceneList"></param>
+ /// <param name="speakerInfo">闊崇鍙傛暟</param>
+ /// <param name="roomFunctionOrSceneList">褰撳墠鎴块棿鐨勫姛鑳芥垨鑰呭満鏅�</param>
public SmartSpeakerSelectDevicesPage(SpeakerInfo speakerInfo, List<SpeakerTargetInfo> roomFunctionOrSceneList)
{
bodyView = this;
@@ -59,20 +58,20 @@
}
/// <summary>
- ///
+ /// 鍔犺浇瑙嗗浘
/// </summary>
public void LoadPage()
{
+ //鍔犺浇椤堕儴鑿滃崟鏍�
new TopViewDiv(bodyView, Language.StringByID(StringId.DataManagement)).LoadTopView();
-
//椤堕儴鍏ㄩ�夋寜閽�
- var allRoomView = new FrameLayout()
+ var allView = new FrameLayout()
{
Y = Application.GetRealHeight(64),
Height = Application.GetRealHeight(50),
BackgroundColor = CSS_Color.MainBackgroundColor,
};
- bodyView.AddChidren(allRoomView);
+ bodyView.AddChidren(allView);
Button btnAllRoomText = new Button()
{
@@ -83,7 +82,7 @@
TextColor = CSS_Color.FirstLevelTitleColor,
TextAlignment = TextAlignment.CenterLeft,
};
- allRoomView.AddChidren(btnAllRoomText);
+ allView.AddChidren(btnAllRoomText);
btnChooseAll = new Button()
{
@@ -93,11 +92,10 @@
Height = Application.GetMinRealAverage(28),
UnSelectedImagePath = "Public/ChooseIcon.png",
SelectedImagePath = "Public/ChooseOnIcon.png",
- //IsSelected = true,
};
- allRoomView.AddChidren(btnChooseAll);
+ allView.AddChidren(btnChooseAll);
- allRoomView.AddChidren(new Button()
+ allView.AddChidren(new Button()
{
Gravity = Gravity.CenterHorizontal,
Y = Application.GetRealHeight(49),
@@ -108,7 +106,7 @@
bodyScrolView = new VerticalScrolViewLayout()
{
- Y = allRoomView.Bottom,
+ Y = allView.Bottom,
Height = Application.GetRealHeight(450),
};
bodyView.AddChidren(bodyScrolView);
@@ -121,9 +119,10 @@
bodyView.AddChidren(btnSave);
//鍏ㄩ�夋寜閽偣鍑讳簨浠�
- LoadEvent_AllSharedDataChange(allRoomView, btnChooseAll);
+ LoadEvent_AllSharedDataChange(allView, btnChooseAll);
+ //淇濆瓨鎸夐挳鐐瑰嚮浜嬩欢
LoadEvent_Save(btnSave);
-
+ //鍔犺浇鎴块棿鐨勫姛鑳藉拰鍦烘櫙锛屽苟姣旇緝閰嶇疆杩囩殑鏁版嵁瀹炵幇閫変腑鏁堟灉
GetDeviceAndSceneList();
}
@@ -131,22 +130,22 @@
/// <summary>
/// 鍏ㄩ�夋寜閽偣鍑讳簨浠�
/// </summary>
- void LoadEvent_AllSharedDataChange(FrameLayout allRoomView, Button btnChooseAll)
+ void LoadEvent_AllSharedDataChange(FrameLayout allView, Button btnChooseAll)
{
EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
{
btnChooseAll.IsSelected = !btnChooseAll.IsSelected;
var IsSelected = btnChooseAll.IsSelected;
-
+ //鍏ㄩ儴鏁版嵁閫変腑鐘舵�佽缃负true鎴栬�協alse
foreach (var info in roomFunctionOrSceneList)
{
info.IsSelect = IsSelected;
}
-
+ //鍒锋柊涓�娆″垪琛�
RefreshListView();
};
btnChooseAll.MouseUpEventHandler = eventHandler;
- allRoomView.MouseUpEventHandler = eventHandler;
+ allView.MouseUpEventHandler = eventHandler;
}
@@ -165,9 +164,9 @@
}
/// <summary>
- ///
+ /// 鍏ㄩ噺鏇存柊閰嶇疆鏁版嵁锛堝姛鑳藉拰鍦烘櫙鍚屾椂鏇存柊锛�
/// </summary>
- /// <param name="updateList"></param>
+ /// <param name="updateList">鏈�鏂扮殑閰嶇疆鏁版嵁</param>
void AddDevicesSceneList(List<SpeakerTargetInfo> updateList)
{
var waitPage = new Loading();
@@ -188,7 +187,6 @@
{
updateList.Add(info);
}
-
}
else
{
@@ -197,18 +195,16 @@
updateList.Remove(targetData);
}
}
-
-
}
-
+ //鏋勫缓璇锋眰鍙傛暟
var updateSpeakerDeviceListObj = new UpdateSpeakerDeviceListObj()
{
homeId = speakerInfo.homeId,
tokenId = speakerInfo.tokenId,
targetInfos = updateList
};
-
+ //鍙戣捣璇锋眰
var revertObj = new HttpServerRequest().UpdateSpeakerDeviceList(updateSpeakerDeviceListObj);
if (revertObj.Code == StateCode.SUCCESS)
{
--
Gitblit v1.8.0