From 611786df5108dca0bdcff03834cc285cba4b8e61 Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期二, 13 十月 2020 16:48:43 +0800
Subject: [PATCH] 2020-10-13-1

---
 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs |  121 ++++++++++++++++++++++++++++++++-------
 1 files changed, 98 insertions(+), 23 deletions(-)

diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
index 323ee88..8e96290 100644
--- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
+++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -117,7 +117,7 @@
             contentPageView = new PageLayout()
             {
                 Y = Application.GetRealHeight(64),
-                Height = Application.GetRealHeight(667 - 64-49+20),
+                Height = Application.GetRealHeight(667 - 64-49+30),
                 BackgroundColor = CSS_Color.MainBackgroundColor,
                 IsShowPoint = false
             };
@@ -202,7 +202,7 @@
             {
                 Y = roomFloorChangeView.Bottom,
                 Height = Application.GetRealHeight(497 + 10 + 30),
-                BackgroundColor = CSS_Color.MainBackgroundColor,
+                //BackgroundColor = CSS_Color.MainBackgroundColor,
             };
             roomPageView.AddChidren(roomListView);
             LoadRoomRows();
@@ -225,21 +225,24 @@
                     Gravity = Gravity.CenterHorizontal,
                     Width = Application.GetRealWidth(343),
                     Height = Application.GetRealHeight(184),
-                    Radius = (uint)Application.GetRealHeight(12),
-                    BorderColor = 0x00000000,
-                    BorderWidth = 1,
+                    Radius = (uint)Application.GetRealWidth(12),
+                    BackgroundColor = 0xFFFF0000,
                     Tag = room.sid,
                 };
                 roomListView.AddChidren(roomView);
 
-                var roomViewbg = new Button()
+                var roomViewbg = new ImageView()
                 {
-                    UnSelectedImagePath = room.backgroundImage,
+                    Width = Application.GetRealWidth(343),
+                    Height = Application.GetRealHeight(184),
+                    ImagePath = room.backgroundImage,
+                    Radius = (uint)Application.GetRealWidth(12),
                 };
                 roomView.AddChidren(roomViewbg);
 
                 var roomViewbgColor = new Button()
                 {
+                    Radius = (uint)Application.GetRealWidth(12),
                     BackgroundColor = 0x19333333,
                 };
                 roomView.AddChidren(roomViewbgColor);
@@ -417,7 +420,7 @@
                 FrameLayout functionView = new FrameLayout()
                 {
                     Height = Application.GetRealWidth(161),
-                    Radius = (uint)Application.GetRealHeight(6),
+                    Radius = (uint)Application.GetRealWidth(6),
                     BackgroundColor = CSS_Color.MainBackgroundColor,
                     Tag = item + "_View",
                     Y = index % 2 == 1 ? lastY2 : lastY1
@@ -564,25 +567,90 @@
                         #endregion
                         break;
                     case ShowFunction.FloorHeating:
+                        #region 鍦扮儹
                         btnName.TextID = StringId.FloorHeating;
+                        functionCount = DB_ResidenceData.residenceData.functionList.floorHeatings.Count;
+                        functionOnCount = DB_ResidenceData.residenceData.functionList.floorHeatings.FindAll((obj) => obj.on_off == "on").Count;
+                        Button btnFhPower = new Button()
+                        {
+                            X = Application.GetRealWidth(120),
+                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
+                            Width = Application.GetRealWidth(32),
+                            Height = Application.GetRealWidth(32),
+                            SelectedImagePath = "Public/PowerOpen.png",
+                            UnSelectedImagePath = "Public/PowerClose.png",
+                            IsSelected = functionCount == functionOnCount
+                        };
+                        functionView.AddChidren(btnFhPower);
+                        btnFhPower.MouseUpEventHandler = (sender, e) => {
+                            LoadEvent_SwitchFunction(btnFhPower, item);
+                        };
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+                            var skipView = new FunctionPage();
+                            MainPage.BasePageView.AddChidren(skipView);
+                            skipView.LoadPage(StringId.FloorHeating);
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        };
+                        #endregion
                         break;
                     case ShowFunction.DoorLock:
                         btnName.TextID = StringId.DoorLock;
                         break;
                     case ShowFunction.Electric:
+                        #region 鐢靛櫒
                         btnName.TextID = StringId.Electric;
+                        functionCount = DB_ResidenceData.residenceData.functionList.electricals.Count;
+                        functionOnCount = DB_ResidenceData.residenceData.functionList.electricals.FindAll((obj) => obj.on_off == "on").Count;
+                        Button btnElectricPower = new Button()
+                        {
+                            X = Application.GetRealWidth(120),
+                            Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117),
+                            Width = Application.GetRealWidth(32),
+                            Height = Application.GetRealWidth(32),
+                            SelectedImagePath = "Public/PowerOpen.png",
+                            UnSelectedImagePath = "Public/PowerClose.png",
+                            IsSelected = functionCount == functionOnCount
+                        };
+                        functionView.AddChidren(btnElectricPower);
+                        btnElectricPower.MouseUpEventHandler = (sender, e) => {
+                            LoadEvent_SwitchFunction(btnElectricPower, item);
+                        };
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+                            var skipView = new FunctionPage();
+                            MainPage.BasePageView.AddChidren(skipView);
+                            skipView.LoadPage(StringId.Electric);
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        };
+                        #endregion
                         break;
                     case ShowFunction.EnergyMonitoring:
                         btnName.TextID = StringId.EnergyMonitoring;
                         break;
                     case ShowFunction.Environmental:
-                        btnName.TextID = StringId.Environmental;
+                        #region 鐜鏁版嵁
+                        btnName.TextID = StringId.EnvironmentalData;
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) => {
+                            var skipView = new EnvironmentalSciencePage();
+                            MainPage.BasePageView.AddChidren(skipView);
+                            skipView.LoadPage();
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        };
+                        #endregion
                         break;
                     case ShowFunction.FreshAir:
                         btnName.TextID = StringId.FreshAir;
                         break;
                     case ShowFunction.Music:
                         btnName.TextID = StringId.Music;
+                        functionCount = Music.A31MusicModel.A31MusicModelList.Count;
+                        functionOnCount = Music.A31MusicModel.A31MusicModelList.FindAll((obj) => obj.on_off == "on").Count;
+                        btnFunctionViewBg.MouseUpEventHandler = (sender, e) =>
+                        {
+                            var musicMain = new Music.MusicMain();
+                            MainPage.BasePageView.AddChidren(musicMain);
+                            musicMain.Show();
+                            MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+                        };
                         break;
                     case ShowFunction.Panel:
                         btnName.TextID = StringId.Panel;
@@ -592,26 +660,30 @@
                         break;
                     case ShowFunction.Sensor:
                         btnName.TextID = StringId.Sensor;
+
                         break;
                     case ShowFunction.VideoIntercom:
                         btnName.TextID = StringId.VideoIntercom;
                         break;
 
                 }
-
-                Button btnFunctionCount = new Button()
+                if (item != ShowFunction.Environmental)
                 {
-                    X = Application.GetRealWidth(16),
-                    Y = btnName.Bottom,
-                    Width = Application.GetRealWidth(120),
-                    Height = Application.GetRealHeight(24),
-                    TextColor = CSS_Color.FirstLevelTitleColor,
-                    TextSize = CSS_FontSize.TextFontSize,
-                    TextAlignment = TextAlignment.CenterLeft,
-                    Text = functionOnCount + "/" + functionCount,
-                    Tag = item + "_onCount"
-                };
-                functionView.AddChidren(btnFunctionCount);
+                    Button btnFunctionCount = new Button()
+                    {
+                        X = Application.GetRealWidth(16),
+                        Y = btnName.Bottom,
+                        Width = Application.GetRealWidth(120),
+                        Height = Application.GetRealHeight(24),
+                        TextColor = CSS_Color.FirstLevelTitleColor,
+                        TextSize = CSS_FontSize.TextFontSize,
+                        TextAlignment = TextAlignment.CenterLeft,
+                        Text = functionOnCount + "/" + functionCount,
+                        Tag = item + "_onCount"
+                    };
+                    functionView.AddChidren(btnFunctionCount);
+
+                }
                 index++;
             }
             #endregion
@@ -652,7 +724,10 @@
 
                 List<string> chooseList = new List<string>();
                 chooseList.Add(Language.StringByID(StringId.All));
-                chooseList.AddRange(DB_ResidenceData.residenceData.floors);
+                foreach (var f in DB_ResidenceData.residenceData.floors)
+                {
+                    chooseList.Add(f.name);
+                }
 
                 foreach (var floor in chooseList)
                 {

--
Gitblit v1.8.0