From 01c46e7bfe9aa8fb20b29f70c83c03a307af548a Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期二, 22 十二月 2020 16:35:16 +0800 Subject: [PATCH] 2020-12-22 1.更新。 --- HDL_ON/UI/UI2/2-Classification/FunctionPage.cs | 166 ++++++------------------------------------------------- 1 files changed, 19 insertions(+), 147 deletions(-) diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs index 0704042..07790c3 100644 --- a/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs +++ b/HDL_ON/UI/UI2/2-Classification/FunctionPage.cs @@ -69,7 +69,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextAlignment = TextAlignment.CenterLeft, - Text = DB_ResidenceData.residenceData.CurFoor, + Text = DB_ResidenceData.Instance.CurFloor.roomName, }; roomFloorChangeView.AddChidren(btnFloor); #endregion @@ -83,29 +83,29 @@ if (titleId == StringId.Lights) { - functionList.AddRange(DB_ResidenceData.functionList.lights); + functionList.AddRange(FunctionList.List.lights); } else if (titleId == StringId.AC) { - functionList.AddRange(DB_ResidenceData.functionList.aCs); + functionList.AddRange(FunctionList.List.aCs); } else if (titleId == StringId.Curtain) { - functionList.AddRange(DB_ResidenceData.functionList.curtains); + functionList.AddRange(FunctionList.List.curtains); } else if (titleId == StringId.FloorHeating) { - functionList.AddRange(DB_ResidenceData.functionList.floorHeatings); + functionList.AddRange(FunctionList.List.floorHeatings); } else if (titleId == StringId.Electric) { - functionList.AddRange(DB_ResidenceData.functionList.electricals); + functionList.AddRange(FunctionList.List.electricals); } else if (titleId == StringId.EnvironmentalScience) { - functionList.AddRange(DB_ResidenceData.functionList.sensorsEnvironmentalScience); + functionList.AddRange(FunctionList.List.sensorsEnvironmentalScience); } - functionList.OrderByDescending(o => o.usageCount).ToList(); + functionList.OrderByDescending(o => o.controlCounter).ToList(); ShowFunctionRow(functionList); @@ -163,146 +163,18 @@ /// </summary> void LoadDialog_ChangeFloor() { - EventHandler<MouseEventArgs> eventHandler = (sender, e) => - { - var dialog = new Dialog(); - var dialogBody = new FrameLayout(); - dialog.AddChidren(dialogBody); - dialogBody.MouseUpEventHandler += (sender1, e1) => - { - dialog.Close(); - }; - - var dispalyView = new FrameLayout() - { - X = Application.GetRealWidth(10), - Y = Application.GetRealHeight(100), - Width = Application.GetRealWidth(160), - Height = Application.GetRealHeight(110), - BackgroundImagePath = "PersonalCenter/HomeList1bg.png", - }; - dialogBody.AddChidren(dispalyView); - - var contentView = new VerticalScrolViewLayout() - { - X = Application.GetRealWidth(8), - Y = Application.GetRealHeight(15), - Width = Application.GetRealWidth(150), - Height = Application.GetRealHeight(45 * 2), - ScrollEnabled = false - }; - dispalyView.AddChidren(contentView); - - if (DB_ResidenceData.Rooms.Count < 2) - { - } - else if (DB_ResidenceData.Rooms.Count < 3) - { - dispalyView = new FrameLayout() - { - X = Application.GetRealWidth(10), - Y = Application.GetRealHeight(100), - Width = Application.GetRealWidth(160), - Height = Application.GetRealHeight(155), - BackgroundImagePath = "PersonalCenter/HomeList2bg.png", - }; - dialogBody.AddChidren(dispalyView); - - contentView.Height = Application.GetRealHeight(45 * 3); - dispalyView.AddChidren(contentView); - } - else if (DB_ResidenceData.Rooms.Count < 4) - { - dispalyView = new FrameLayout() - { - X = Application.GetRealWidth(10), - Y = Application.GetRealHeight(100), - Width = Application.GetRealWidth(160), - Height = Application.GetRealHeight(200), - BackgroundImagePath = "PersonalCenter/HomeList3bg.png", - }; - dialogBody.AddChidren(dispalyView); - - contentView.Height = Application.GetRealHeight(45 * 4); - dispalyView.AddChidren(contentView); - } - else - { - dispalyView = new FrameLayout() - { - X = Application.GetRealWidth(10), - Y = Application.GetRealHeight(100), - Width = Application.GetRealWidth(160), - Height = Application.GetRealHeight(245), - BackgroundImagePath = "PersonalCenter/HomeList4bg.png", - }; - dialogBody.AddChidren(dispalyView); - - contentView.Height = Application.GetRealHeight(45 * 5); - contentView.ScrollEnabled = true; - dispalyView.AddChidren(contentView); - } - - - List<Room> roomList = new List<Room>(); - roomList.Add(new Room() { uid = "", roomName = Language.StringByID(StringId.All) }); - roomList.AddRange(DB_ResidenceData.Rooms); - foreach (var tempRoom in roomList) - { - var roomName = tempRoom.roomName; - if (roomName != Language.StringByID(StringId.All)) - { - contentView.AddChidren(new Button() - { - Gravity = Gravity.CenterHorizontal, - Width = Application.GetRealWidth(112), - Height = Application.GetRealHeight(1), - BackgroundColor = CSS_Color.BackgroundColor - }); - } - var btnHomeName = new Button() - { - Gravity = Gravity.CenterHorizontal, - Width = Application.GetRealWidth(112), - Height = Application.GetRealHeight(44), - TextAlignment = TextAlignment.CenterLeft, - TextColor = CSS_Color.FirstLevelTitleColor, - SelectedTextColor = CSS_Color.MainColor, - Text = roomName, - TextSize = CSS_FontSize.SubheadingFontSize, - IsSelected = btnFloor.Text == roomName, - IsMoreLines = true, - }; - contentView.AddChidren(btnHomeName); - - btnHomeName.MouseUpEventHandler += (senderH, en) => - { - dialog.Close(); - btnFloor.Text = roomName; - if (roomName == Language.StringByID(StringId.All)) - { - ShowFunctionRow(functionList); - } - else - { - var showList = new List<Function>(); - foreach (var sf in functionList) - { - if(sf.roomIds.Contains(tempRoom.uid)) - { - showList.Add(sf); - } - } - ShowFunctionRow(showList); - } - }; - } - - dialog.Show(); + string nowSelectId = null; + btnFloor.MouseUpEventHandler += (sender, e) => + { + //鏄剧ず涓嬫媺鍒楄〃 + var form = new FloorRoomSelectPopupView(); + form.ShowDeviceFunctionView(btnFloor, this.functionList, (selectId, listFunc) => + { + nowSelectId = selectId; + //閲嶆柊鍔犺浇鐣岄潰 + ShowFunctionRow(listFunc); + }, nowSelectId); }; - - btnFloor.MouseUpEventHandler = eventHandler; - btnFloorDownIcon.MouseUpEventHandler = eventHandler; } } } \ No newline at end of file -- Gitblit v1.8.0