From 2ed75b8b337048e5d75e6d9ec8307633134f02fd Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 10 十月 2019 11:33:04 +0800
Subject: [PATCH] 个人中心添加楼层和创建房间,实装二级验证

---
 ZigbeeApp/Shared/Phone/UserView/UserPage.cs |   90 +++++++++++++++++++++++++++++---------------
 1 files changed, 59 insertions(+), 31 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
index 3849b40..aaa7ee1 100755
--- a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
@@ -2,6 +2,7 @@
 using System.Collections.Generic;
 using Shared.Common;
 using ZigBee.Device;
+using Shared.Phone.Device.AC;
 
 namespace Shared.Phone.UserView
 {
@@ -20,25 +21,25 @@
         /// </summary>
         private static readonly int tabBarEnum_Width = CommonPage.AppRealWidth / 3;
         /// <summary>
-        /// 搴曢儴鎸夐挳鍥剧墖鐨勯珮搴�-110
+        /// 搴曢儴鎸夐挳鍥剧墖鐨勯珮搴�
         /// </summary>
-        private static readonly int tabBarEnumIMG_Height = 110;
+        private static readonly int tabBarEnumIMG_Height = 98;
         /// <summary>
-        /// 搴曢儴鎸夐挳鍥剧墖鐨勫搴�-110
+        /// 搴曢儴鎸夐挳鍥剧墖鐨勫搴�
         /// </summary>
-        private static readonly int tabBarEnumIMG_Width = 110;
+        private static readonly int tabBarEnumIMG_Width = 138;
         /// <summary>
-        /// 搴曢儴鎸夐挳鍥剧墖鐨刌鍊� -5
+        /// 搴曢儴鎸夐挳鍥剧墖鐨刌鍊�
         /// </summary>
-        private static readonly int tabBarEnumIMG_Y = 5;
+        private static readonly int tabBarEnumIMG_Y = 3;
         /// <summary>
-        /// 搴曢儴鎸夐挳鏂囧瓧鐨勯珮搴� -50
+        /// 搴曢儴鎸夐挳鏂囧瓧鐨勯珮搴�
         /// </summary>
-        private static readonly int tabBarEnumName_Height = 50;
+        private static readonly int tabBarEnumName_Height = 40;
         /// <summary>
-        /// 搴曢儴鎸夐挳鏂囧瓧鐨刌鍊� 100
+        /// 搴曢儴鎸夐挳鏂囧瓧鐨刌鍊�
         /// </summary>
-        private static readonly int tabBarEnumName_Y = tabBarEnumIMG_Height - 10;
+        private static readonly int tabBarEnumName_Y = 104;
         #endregion
 
         #region 鈼� 鎺ュ彛____________________________
@@ -138,6 +139,23 @@
                                 break;
 
                             case DeviceType.WindowCoveringDevice:
+                                if ((common as ZigBee.Device.Rollershade).DeviceStatusReport.CluterID == 258)
+                                {
+                                    var rollershade = deviceUI.CommonDevice as ZigBee.Device.Rollershade;
+                                    rollershade.DeviceStatusReport = (common as ZigBee.Device.Rollershade).DeviceStatusReport;
+                                    var attriButeList = rollershade.DeviceStatusReport.AttriBute;
+                                    if (attriButeList == null || attriButeList.Count == 0)
+                                    {
+                                        continue;
+                                    }
+                                    switch (attriButeList[0].AttributeId)
+                                    {
+                                        case 0:
+                                            rollershade.WcdType = attriButeList[0].AttriButeData;
+                                            rollershade.LastDateTime = DateTime.Now;
+                                            break;
+                                    }
+                                }
                                 if ((common as ZigBee.Device.Rollershade).DeviceStatusReport.CluterID == 3)
                                 {
                                     var rollershade = deviceUI.CommonDevice as ZigBee.Device.Rollershade;
@@ -175,6 +193,12 @@
                                         case 18:
                                             //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勫埗鐑俯搴︼紝瀹為檯娓╁害涓衡�淗eatingSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
                                             ac.currentHeatingSetpoint = attriButeList[0].AttriButeData / 100;
+                                            ac.LastDateTime = DateTime.Now;
+                                            break;
+
+                                        case 4096:
+                                            //姝ゅ睘鎬ц〃鏄庢璁惧褰撳墠鐨勮嚜鍔ㄦ俯搴︼紝瀹為檯娓╁害涓衡�淎utoSetpoint / 100鈥濓紝鍗曚綅锛氣剝銆�
+                                            ac.currentAutoSetpoint = (attriButeList[0].AttriButeData / 100 > ACControlBase.Temperature_High || attriButeList[0].AttriButeData / 100 < ACControlBase.Temperature_Low) ? attriButeList[0].AttriButeData / 100 : ACControlBase.Temperature_Default;
                                             ac.LastDateTime = DateTime.Now;
                                             break;
 
@@ -368,8 +392,18 @@
         {
             Y = Application.GetRealHeight(CommonPage.AppRealHeight - CommonPage.TabbarHeight),
             Height = Application.GetRealHeight(CommonPage.TabbarHeight),
-            BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor,
+            BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCBottomColor,
         };
+
+        #region 鍒嗗壊绾�
+
+        private Button bottomLine = new Button
+        {
+            Height = 1,
+            BackgroundColor = ZigbeeColor.Current.GXCBottomLineColor
+        };
+
+        #endregion
 
         #region 搴曢儴-涓婚〉鎸夐挳
         /// <summary>
@@ -402,10 +436,11 @@
             Y = Application.GetRealHeight(tabBarEnumName_Y),
             Height = Application.GetRealHeight(tabBarEnumName_Height),
             TextID = R.MyInternationalizationString.HomePage,
-            TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor,
-            SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlueColor,
+            TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor,
+            SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2,
             IsSelected = true,
-            Gravity = Gravity.CenterHorizontal
+            Gravity = Gravity.CenterHorizontal,
+            TextSize = 10
         };
         #endregion
 
@@ -439,10 +474,11 @@
             Y = Application.GetRealHeight(tabBarEnumName_Y),
             Height = Application.GetRealHeight(tabBarEnumName_Height),
             TextID = R.MyInternationalizationString.Category,
-            TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor,
-            SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlueColor,
+            TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor,
+            SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2,
             IsSelected = false,
-            Gravity = Gravity.CenterHorizontal
+            Gravity = Gravity.CenterHorizontal,
+            TextSize=10
         };
         #endregion
 
@@ -476,22 +512,14 @@
             Y = Application.GetRealHeight(tabBarEnumName_Y),
             Height = Application.GetRealHeight(tabBarEnumName_Height),
             TextID = R.MyInternationalizationString.Me,
-            TextColor = ZigbeeColor.Current.GXCTextBlackColor,
-            SelectedTextColor = ZigbeeColor.Current.GXCTextBlueColor,
+            TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor,
+            SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2,
             IsSelected = false,
-            Gravity = Gravity.CenterHorizontal
+            Gravity = Gravity.CenterHorizontal,
+            TextSize = 10
         };
         #endregion
 
-        #region 鍒嗗壊绾�
-
-        private FrameLayout bottomLine = new FrameLayout
-        {
-            Height = 3,
-            BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor
-        };
-
-        #endregion
 
         EventHandler<MouseEventArgs> BottomEventHandler = (sender, e) =>
         {
@@ -557,6 +585,8 @@
             AddChidren(BodyView);
             AddChidren(BottomMenuView);
 
+            BottomMenuView.AddChidren(Instance.bottomLine);
+
             Instance.homePageFL.AddChidren(Instance.homePageIMG);
             Instance.homePageFL.AddChidren(Instance.homePageName);
             BottomMenuView.AddChidren(Instance.homePageFL);
@@ -568,8 +598,6 @@
             Instance.settingFL.AddChidren(Instance.settingIMG);
             Instance.settingFL.AddChidren(Instance.settingName);
             BottomMenuView.AddChidren(Instance.settingFL);
-
-            BottomMenuView.AddChidren(Instance.bottomLine);
 
             homePageIMG.MouseUpEventHandler += BottomEventHandler;
             homePageName.MouseUpEventHandler += BottomEventHandler;

--
Gitblit v1.8.0