From 66a9965c44ecc32a6696abca876ab9d1cd091584 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期五, 28 二月 2020 15:25:13 +0800 Subject: [PATCH] 2020.2.28 --- ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs | 185 +++++++++++++++++++++++++++++++++++---------- 1 files changed, 143 insertions(+), 42 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs index 3ce4dde..4ce6701 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs @@ -11,13 +11,33 @@ #region 鈻� 鍙橀噺澹版槑___________________________ /// <summary> - /// 鐧借壊鑳屾櫙妗� + /// 涓昏彍鍗曡儗鏅 /// </summary> - private FrameLayout frameWhiteBack = null; + private FrameLayout frameMainMenuBack = null; + /// <summary> + /// 鍏朵粬鑿滃崟鐨勫鍣ㄦ帶浠� + /// </summary> + private FrameListControl frameOtherMenuContr = null; /// <summary> /// 鐢ㄦ埛鍚嶅瓧 /// </summary> private NormalViewControl btnUserName = null; + /// <summary> + /// 鐢ㄦ埛韬唤 + /// </summary> + private NormalViewControl btnAuthority = null; + /// <summary> + /// 鐢ㄦ埛澶村儚 + /// </summary> + private ImageView btnUserIcon = null; + /// <summary> + /// 鐨囧啝 + /// </summary> + private IconViewControl btnImperialCrown = null; + /// <summary> + /// 淇℃伅鎻愮ず鎺т欢 + /// </summary> + private MessageManagementControl msgControl = null; #endregion @@ -61,15 +81,31 @@ btnTitle.Y = Application.GetRealHeight(112); btnTitle.TextColor = UserCenterColor.Current.White; btnTitle.TextSize = 24; + btnTitle.IsBold = true; btnTitle.TextID = R.MyInternationalizationString.UserCenter; bodyFrameLayout.AddChidren(btnTitle); + + var btnBack1 = new PicViewControl(1031, 942); + btnBack1.Y = btnTitle.Bottom - Application.GetRealHeight(10); + btnBack1.UnSelectedImagePath = "Center/MainBack1.png"; + bodyFrameLayout.AddChidren(btnBack1); + var btnBack2 = new PicViewControl(392, 172); + btnBack2.X = Application.GetRealWidth(688); + btnBack2.UnSelectedImagePath = "Center/MainBack2.png"; + bodyFrameLayout.AddChidren(btnBack2); + + //淇℃伅鎻愮ず鎺т欢 + this.msgControl = new MessageManagementControl(); + msgControl.Y = Application.GetRealHeight(127); + msgControl.X = Application.GetRealWidth(953); + bodyFrameLayout.AddChidren(this.msgControl); //鐧芥 var frameBack = new FrameLayout(); frameBack.BackgroundColor = UserCenterColor.Current.BodyFrameLayout; frameBack.Y = Application.GetRealHeight(380); frameBack.Gravity = Gravity.CenterHorizontal; - frameBack.Radius = (uint)Application.GetMinRealAverage(12); + frameBack.Radius = (uint)Application.GetRealHeight(29); frameBack.Width = bodyFrameLayout.Width - Application.GetRealWidth(29 * 2); frameBack.Height = bodyFrameLayout.Height - Application.GetRealHeight(380) + Application.GetRealHeight(100); bodyFrameLayout.AddChidren(frameBack); @@ -95,9 +131,12 @@ private void InitUserInfoControl(FrameLayout frameWhite) { //鐢ㄦ埛澶村儚 - var btnUserIcon = new IconViewControl(280); + this.btnUserIcon = new ImageView(); + btnUserIcon.Height = Application.GetMinRealAverage(280); + btnUserIcon.Width = Application.GetMinRealAverage(280); + btnUserIcon.Radius = (uint)Application.GetMinRealAverage(280) / 2; btnUserIcon.X = Application.GetRealWidth(121); - btnUserIcon.UnSelectedImagePath = UserCenterResourse.UserInfo.UserIconFile; + btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(UserCenterResourse.UserInfo.UserIconFile); bodyFrameLayout.AddChidren(btnUserIcon); btnUserIcon.Y = frameWhite.Y - Application.GetRealHeight(109); btnUserIcon.MouseUpEventHandler += (sender, e) => @@ -106,18 +145,20 @@ form.AddForm(); }; - if (UserCenterResourse.UserInfo.AuthorityNo == 1) + //鐨囧啝 + this.btnImperialCrown = new IconViewControl(60); + btnImperialCrown.X = Application.GetRealWidth(346); + btnImperialCrown.Y = Application.GetRealHeight(475); + btnImperialCrown.UnSelectedImagePath = "Center/ImperialCrown.png"; + bodyFrameLayout.AddChidren(btnImperialCrown); + if (UserCenterResourse.UserInfo.AuthorityNo != 1) { - //鐨囧啝 - var btnImperialCrown = new IconViewControl(60); - btnImperialCrown.X = Application.GetRealWidth(346); - btnImperialCrown.Y = Application.GetRealHeight(475); - btnImperialCrown.UnSelectedImagePath = "Center/ImperialCrown.png"; - bodyFrameLayout.AddChidren(btnImperialCrown); + btnImperialCrown.Visible = false; } //鐢ㄦ埛鏄电О - btnUserName = new NormalViewControl(605, 60, true); + this.btnUserName = new NormalViewControl(605, 60, true); + btnUserName.IsBold = true; btnUserName.X = btnUserIcon.Right + Application.GetRealWidth(5); btnUserName.Y = Application.GetRealHeight(43); if (UserCenterResourse.UserInfo != null) @@ -127,7 +168,7 @@ frameWhite.AddChidren(btnUserName); //鐢ㄦ埛韬唤 - var btnAuthority = new NormalViewControl(605, 60, true); + this.btnAuthority = new NormalViewControl(605, 60, true); btnAuthority.X = btnUserName.X; btnAuthority.Y = btnUserName.Bottom; btnAuthority.TextColor = UserCenterColor.Current.Gray; @@ -149,21 +190,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 = (uint)Application.GetMinRealAverage(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 = (uint)Application.GetRealHeight(17); + frameMainMenuBack.BackgroundColor = UserCenterColor.Current.White; + frameWhite.AddChidren(frameMainMenuBack); } //鏍囬锛氱鐞� @@ -172,7 +213,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; @@ -183,7 +224,7 @@ frameTitle.AddChidren(btnLine); //鍒涘缓鍏ㄩ儴鐨勪富鑿滃崟鎺т欢 - this.CreatAllMainMenuControl(frameWhiteBack); + this.CreatAllMainMenuControl(frameMainMenuBack); } /// <summary> @@ -244,7 +285,7 @@ frame.ButtonClickEvent += (sender, e) => { //浣忓畢鎺ュ彛涓嶉渶瑕佺壒娈婄殑鐧婚檰Token - var form = new Residence.ResidenceManagementForm(); + var form = new Residence.ResidenceListForm(); form.AddForm(); }; } @@ -315,16 +356,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; @@ -340,14 +388,14 @@ btnBackView.X -= ControlCommonResourse.XXLeft / 2; rowback.ButtonClickEvent += (sender, e) => { - var form = new HdlBackup.HdlBackupMenuForm(); + var form = new HdlBackup.HdlBackupListForm(); form.AddForm(); }; } //鎰忚鍙嶉 - 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; @@ -363,13 +411,13 @@ btnSuView.X -= ControlCommonResourse.XXLeft / 2; rowSuggestion.ButtonClickEvent += (sender, e) => { - var form = new DeviceDoorLock.DoorLockHistoryLogForm(); - form.AddForm("澶╀笅绗竴"); + var form = new Suggestion.FeedbackForm(); + form.AddForm(); }; //鍏充簬鎴戜滑 - 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; @@ -388,6 +436,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 @@ -397,12 +470,40 @@ /// <summary> /// 鑷韩鐨勪笂灞傜晫闈㈠叧闂悗,瀹冭嚜韬浜庢渶涓婂眰鏃�,瑙﹀彂鐨勪簨浠� /// </summary> - public override void FormActionAgainEvent() + public override int FormActionAgainEvent() { + //鐢ㄦ埛澶村儚 + if (UserCenterResourse.UserInfo.UserIconFileChanged == true) + { + UserCenterResourse.UserInfo.UserIconFileChanged = false; + btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(UserCenterResourse.UserInfo.UserIconFile); + } //鐢ㄦ埛鍚嶅瓧 btnUserName.Text = UserCenterResourse.UserInfo.UserName; + if (UserCenterResourse.UserInfo != null) + { + //鐢ㄦ埛韬唤 + btnAuthority.Text = UserCenterResourse.UserInfo.AuthorityText; + } + //鐨囧啝 + if (UserCenterResourse.UserInfo.AuthorityNo != 1) + { + this.btnImperialCrown.Visible = false; + } + else + { + this.btnImperialCrown.Visible = true; + } + + //鍒锋柊淇℃伅鎻愮ず鎺т欢 + this.msgControl?.RefreshStatu(); + //鍒濆鍖栦富鑿滃崟鐨勬帶浠� - this.InitMainMenuInfoControl(frameWhiteBack); + this.InitMainMenuInfoControl(null); + //鍒濆鍖栧叾浠栬彍鍗曠殑鎺т欢 + this.InitOtherMenuControl(null); + + return 1; } #endregion -- Gitblit v1.8.0