From 77e7b5223dd04a6e036dc952efb38f2b770a6828 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 09 六月 2020 13:50:43 +0800
Subject: [PATCH] 2020--6-9
---
HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditFunctionPage.cs | 69 ++++++++++++++++++++--------------
1 files changed, 40 insertions(+), 29 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditFunctionPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditFunctionPage.cs
index cfc181b..88c6d5b 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditFunctionPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/ResidentialManage/RoomEditFunctionPage.cs
@@ -1,4 +1,5 @@
锘縰sing System;
+using System.Collections.Generic;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
using Shared;
@@ -44,14 +45,16 @@
#region 鍖哄煙鍙橀噺
int showdFunctionCount = 0;
- string roomId;
+ Room room;
string showedFunctionRoomId = "0";
+ List<Function> unallocatedList = new List<Function>();
+ List<Function> allocatedList = new List<Function>();
#endregion
- public RoomEditFunctionPage(string rId)
+ public RoomEditFunctionPage(Room r)
{
bodyView = this;
- roomId = rId;
+ room = r;
}
/// <summary>
@@ -134,7 +137,20 @@
};
bodyView.AddChidren(functionListView);
- LoadFunctionListRow(true);
+ foreach (var function in DB_ResidenceData.residenceData.functionList.functions)
+ {
+ function.roomIdList.Remove(null);
+ if (function.roomIdList.Count > 0 )
+ {
+ allocatedList.Add(function);
+ }
+ else
+ {
+ unallocatedList.Add(function);
+ }
+ }
+
+ LoadFunctionListRow(unallocatedList);
btnConfrim = new Button()
@@ -161,24 +177,13 @@
/// 鏄剧ず鍔熻兘Row
/// </summary>
/// <param name="showUnallocated">鏄惁鏄樉绀烘湭鍒嗛厤</param>
- void LoadFunctionListRow(bool showUnallocated)
+ void LoadFunctionListRow(List<Function> functions)
{
showdFunctionCount = 0;
functionListView.RemoveAll();
- foreach (var function in DB_ResidenceData.residenceData.functionList.functions)
+ foreach (var function in functions)
{
- if (function.roomIdList.Count > 0 && !function.roomIdList.Contains(roomId) && showUnallocated)
- {
- continue;
- }
- if (!showUnallocated && showedFunctionRoomId != null)//濡傛灉闇�瑕佹樉绀哄凡缁忓垎閰嶇殑鍔熻兘锛屽苟涓旀寚瀹氭樉绀哄垎鍒扮殑鎴块棿
- {
- if (!function.roomIdList.Contains(showedFunctionRoomId))//濡傛灉褰撳墠鍔熻兘涓嶆槸闇�瑕佹樉绀虹殑
- {
- continue;
- }
- }
functionListView.AddChidren(new Button()
{
Gravity = Gravity.CenterHorizontal,
@@ -204,8 +209,16 @@
functionRow.AddChidren(btnFunctionIcon);
switch (function.functionCategory)
{
- case FunctionCategory.AC:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon.png";
+ case FunctionCategory.Thermostat:
+ switch (function.functionType)
+ {
+ case FunctionType.AC:
+ btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/AC/AcThinIcon.png";
+ break;
+ case FunctionType.FloorHeating:
+ btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/FloorHeating/FloorHeatingThinIcon.png";
+ break;
+ }
break;
case FunctionCategory.Curtain:
btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Curtain/CurtainThinIcon.png";
@@ -213,12 +226,9 @@
case FunctionCategory.Light:
btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/Light/LightThinIcon.png";
break;
- case FunctionCategory.FloorHeating:
- btnFunctionIcon.UnSelectedImagePath = "FunctionIcon/FloorHeating/FloorHeatingThinIcon.png";
- break;
}
- if (showUnallocated)
+ if (!btnAllocated.IsSelected)
{
var btnFunctionName = new Button()
{
@@ -257,7 +267,6 @@
TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
};
functionRow.AddChidren(btnFunctionFloorName);
-
}
Button btnChooseIcon = new Button()
@@ -266,9 +275,9 @@
X = Application.GetRealWidth(335),
Width = Application.GetRealWidth(28),
Height = Application.GetRealWidth(28),
- SelectedImagePath = "Public/SelectionIcon.png",
- UnSelectedImagePath = "Public/UnSelectionIcon.png",
- IsSelected = function.roomIdList.Contains(roomId)
+ UnSelectedImagePath = "Public/ChooseIcon.png",
+ SelectedImagePath = "Public/ChooseOnIcon.png",
+ IsSelected = function.roomIdList.Contains(room.sid)
};
functionRow.AddChidren(btnChooseIcon);
LoadEvent_ChangeRoomFunctionList(functionRow, btnChooseIcon, function);
@@ -279,12 +288,14 @@
if (showdFunctionCount < 9)
{
functionListView.Height = Application.GetRealHeight(51 * showdFunctionCount);
+ }else
+ {
+ functionListView.Height = Application.GetRealHeight(518 - 40 - 62);
}
-
}
/// <summary>
- /// 鏄剧ず鎴块棿閫変腑寮圭獥
+ /// 鏄剧ず鎴块棿閫夐�夋嫨寮圭獥
/// </summary>
void LoadPage_LoadChooseRoomDialog()
{
--
Gitblit v1.8.0