From b3e96fce4cc01113128ddf8e0a18fc19594a9e56 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 05 十二月 2019 18:38:30 +0800
Subject: [PATCH] 一个新的版本

---
 ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs |   88 +++++++++++++++++++++++++++++++------------
 1 files changed, 63 insertions(+), 25 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs
index a6f1f12..008e1fd 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs
@@ -11,9 +11,13 @@
         #region 鈻� 鍙橀噺澹版槑___________________________
 
         /// <summary>
-        /// 鐧借壊鑳屾櫙妗�
+        /// 涓昏彍鍗曡儗鏅
         /// </summary>
-        private FrameLayout frameWhiteBack = null;
+        private FrameLayout frameMainMenuBack = null;
+        /// <summary>
+        /// 鍏朵粬鑿滃崟鐨勫鍣ㄦ帶浠�
+        /// </summary>
+        private FrameListControl frameOtherMenuContr = null;
         /// <summary>
         /// 鐢ㄦ埛鍚嶅瓧
         /// </summary>
@@ -174,21 +178,21 @@
         /// <param name="frameWhite">鑳屾櫙</param>
         private void InitMainMenuInfoControl(FrameLayout frameWhite)
         {
-            if (frameWhiteBack != null)
+            if (frameMainMenuBack != null)
             {
-                frameWhiteBack.RemoveAll();
+                frameMainMenuBack.RemoveAll();
             }
             else
             {
                 //鑳屾櫙妗�
-                frameWhiteBack = new FrameLayout();
-                frameWhiteBack.Y = Application.GetRealHeight(288);
-                frameWhiteBack.Gravity = Gravity.CenterHorizontal;
-                frameWhiteBack.Height = Application.GetRealHeight(371);
-                frameWhiteBack.Width = frameWhite.Width - Application.GetRealWidth(29 * 2);
-                frameWhiteBack.Radius = 10;
-                frameWhiteBack.BackgroundColor = UserCenterColor.Current.White;
-                frameWhite.AddChidren(frameWhiteBack);
+                frameMainMenuBack = new FrameLayout();
+                frameMainMenuBack.Y = Application.GetRealHeight(288);
+                frameMainMenuBack.Gravity = Gravity.CenterHorizontal;
+                frameMainMenuBack.Height = Application.GetRealHeight(371);
+                frameMainMenuBack.Width = frameWhite.Width - Application.GetRealWidth(29 * 2);
+                frameMainMenuBack.Radius = 10;
+                frameMainMenuBack.BackgroundColor = UserCenterColor.Current.White;
+                frameWhite.AddChidren(frameMainMenuBack);
             }
 
             //鏍囬锛氱鐞�
@@ -197,7 +201,7 @@
             frameTitle.Width = Application.GetRealWidth(907);
             frameTitle.Height = Application.GetRealHeight(121);
             frameTitle.Gravity = Gravity.CenterHorizontal;
-            frameWhiteBack.AddChidren(frameTitle);
+            frameMainMenuBack.AddChidren(frameTitle);
             var btnTitle = new NormalViewControl(500, 60, true);
             btnTitle.Gravity = Gravity.CenterVertical;
             btnTitle.TextID = R.MyInternationalizationString.uManagement;
@@ -208,7 +212,7 @@
             frameTitle.AddChidren(btnLine);
 
             //鍒涘缓鍏ㄩ儴鐨勪富鑿滃崟鎺т欢
-            this.CreatAllMainMenuControl(frameWhiteBack);
+            this.CreatAllMainMenuControl(frameMainMenuBack);
         }
 
         /// <summary>
@@ -340,16 +344,23 @@
         /// <param name="frameWhite">鑳屾櫙</param>
         private void InitOtherMenuControl(FrameLayout frameWhite)
         {
-            var frameList = new FrameListControl(26);
-            frameList.Y = Application.GetRealHeight(698);
-            frameList.Height = ControlCommonResourse.ListViewRowHeight * 3 + Application.GetRealHeight(26 * 3);
-            frameWhite.AddChidren(frameList);
+            if (this.frameOtherMenuContr != null)
+            {
+                frameOtherMenuContr.RemoveAll();
+            }
+            else
+            {
+                frameOtherMenuContr = new FrameListControl(26);
+                frameOtherMenuContr.Y = Application.GetRealHeight(698);
+                frameOtherMenuContr.Height = ControlCommonResourse.ListViewRowHeight * 4 + Application.GetRealHeight(26 * 4);
+                frameWhite.AddChidren(frameOtherMenuContr);
+            }
 
             if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
             {
                 //鏁版嵁澶囦唤
-                var rowback = new FrameRowControl(frameList.rowSpace / 2);
-                frameList.AddChidren(rowback);
+                var rowback = new FrameRowControl(frameOtherMenuContr.rowSpace / 2);
+                frameOtherMenuContr.AddChidren(rowback);
                 //鍚戝彸鍥炬爣
                 var btnBackRight = rowback.AddRightArrow();
                 btnBackRight.X -= ControlCommonResourse.XXLeft / 2;
@@ -371,8 +382,8 @@
             }
 
             //鎰忚鍙嶉
-            var rowSuggestion = new FrameRowControl(frameList.rowSpace / 2);
-            frameList.AddChidren(rowSuggestion);
+            var rowSuggestion = new FrameRowControl(frameOtherMenuContr.rowSpace / 2);
+            frameOtherMenuContr.AddChidren(rowSuggestion);
             //鍚戝彸鍥炬爣
             var btnSuRight = rowSuggestion.AddRightArrow();
             btnSuRight.X -= ControlCommonResourse.XXLeft / 2;
@@ -393,8 +404,8 @@
             };
 
             //鍏充簬鎴戜滑
-            var rowAbount = new FrameRowControl(frameList.rowSpace / 2);
-            frameList.AddChidren(rowAbount);
+            var rowAbount = new FrameRowControl(frameOtherMenuContr.rowSpace / 2);
+            frameOtherMenuContr.AddChidren(rowAbount);
             //鍚戝彸鍥炬爣
             var btnAbountRight = rowAbount.AddRightArrow();
             btnAbountRight.X -= ControlCommonResourse.XXLeft / 2;
@@ -413,6 +424,31 @@
                 var form = new Abount.AbountForm();
                 form.AddForm();
             };
+
+            if (UserCenterResourse.HideOption.CenterHideMenu == 1)
+            {
+                //闅愬尶鑿滃崟
+                var rowHide = new FrameRowControl(frameOtherMenuContr.rowSpace / 2);
+                frameOtherMenuContr.AddChidren(rowHide);
+                //鍚戝彸鍥炬爣
+                var btnHideRight = rowHide.AddRightArrow();
+                btnHideRight.X -= ControlCommonResourse.XXLeft / 2;
+                //鍥炬爣
+                var btnHideIcon = rowHide.AddLeftIcon();
+                btnHideIcon.X -= ControlCommonResourse.XXLeft / 2;
+                btnHideIcon.UnSelectedImagePath = "Center/Abount.png";
+                //搴曠嚎
+                var btnHideLine = rowHide.AddBottomLine();
+                btnHideLine.X -= ControlCommonResourse.XXLeft / 2;
+                //闅愬尶鑿滃崟View
+                var btnHideView = rowHide.AddLeftCaption("闅愬尶鑿滃崟", 300);
+                btnHideView.X -= ControlCommonResourse.XXLeft / 2;
+                rowHide.ButtonClickEvent += (sender, e) =>
+                {
+                    var from = new HideOption.HideOptionMainForm();
+                    from.AddForm();
+                };
+            }
         }
 
         #endregion
@@ -454,7 +490,9 @@
             this.msgControl?.RefreshStatu();
 
             //鍒濆鍖栦富鑿滃崟鐨勬帶浠�
-            this.InitMainMenuInfoControl(frameWhiteBack);
+            this.InitMainMenuInfoControl(null);
+            //鍒濆鍖栧叾浠栬彍鍗曠殑鎺т欢
+            this.InitOtherMenuControl(null);
 
             return 1;
         }

--
Gitblit v1.8.0