From 9a4b76398009cf76c508d61f7e48fb6f5cb7ac2d Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期二, 21 七月 2020 09:46:53 +0800 Subject: [PATCH] 请合并最新多功能面板代码 --- ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs | 126 ++++++++++++++++++++++++++++++----------- 1 files changed, 91 insertions(+), 35 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs index 591c299..db897ce 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs @@ -13,7 +13,7 @@ /// <summary> /// 涓昏彍鍗曡儗鏅 /// </summary> - private FrameLayout frameMainMenuBack = null; + private NormalFrameLayout frameMainMenuBack = null; /// <summary> /// 鍏朵粬鑿滃崟鐨勫鍣ㄦ帶浠� /// </summary> @@ -50,17 +50,20 @@ /// </summary> public void ShowForm() { + this.FormID = "UserMainForm"; + //鐗规畩澶勭悊锛氭仮澶嶅彲鍏抽棴杩涘害鏉★紝鍒棶涓轰粈涔堬紝鎴戜篃涓嶇煡閬撲负浠�涔堬紝浠ラ槻涓囦竴鑰屽凡 ProgressBar.SetCloseBarFlag(false); - //鍒濆鍖栨鏋� - this.InitForm(); + //鍒濆鍖栧ご閮ㄦ帶浠� + this.InitTopFrameLayout(); + //鍒濆鍖栦腑閮ㄦ帶浠� + this.InitBodyFrameLayout(); //绉婚櫎杩斿洖閿� base.RemoveBackButton(); //body鍗犲畬鏁翠釜灞忓箷,闄や簡搴曢儴鑿滃崟 bodyFrameLayout.Y = 0; - bodyFrameLayout.Height = ControlCommonResourse.TopMenuFrameHeight + ControlCommonResourse.TopFrameHeight - + ControlCommonResourse.BodyFrameHeight - ControlCommonResourse.BottomFrameHeight; + bodyFrameLayout.Height = this.Height; bodyFrameLayout.BackgroundColor = UserCenterColor.Current.BlackBackGround; //鍒濆鍖栦腑閮ㄦ帶浠� @@ -75,12 +78,6 @@ //娓呯┖bodyFrame this.ClearBodyFrame(); - //淇℃伅鎻愮ず鎺т欢 - this.msgControl = new MessageManagementControl(); - msgControl.Y = Application.GetRealHeight(127); - msgControl.X = Application.GetRealWidth(953); - bodyFrameLayout.AddChidren(this.msgControl); - //涓汉涓績 var btnTitle = new NormalViewControl(350, 100, true); btnTitle.X = ControlCommonResourse.XXLeft; @@ -90,6 +87,21 @@ 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(); @@ -123,27 +135,46 @@ { //鐢ㄦ埛澶村儚 this.btnUserIcon = new ImageView(); - btnUserIcon.Height = Application.GetMinRealAverage(280); - btnUserIcon.Width = Application.GetMinRealAverage(280); - btnUserIcon.Radius = (uint)Application.GetMinRealAverage(280) / 2; + btnUserIcon.Height = this.GetPictrueRealSize(280); + btnUserIcon.Width = this.GetPictrueRealSize(280); + btnUserIcon.Radius = (uint)this.GetPictrueRealSize(280) / 2; btnUserIcon.X = Application.GetRealWidth(121); - btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(UserCenterResourse.UserInfo.UserIconFile); + if (Common.Config.Instance.Home.IsVirtually == false) + { + btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(UserCenterResourse.UserInfo.UserIconFile); + } + else + { + btnUserIcon.ImagePath = "Account/Cat.png"; + } bodyFrameLayout.AddChidren(btnUserIcon); btnUserIcon.Y = frameWhite.Y - Application.GetRealHeight(109); btnUserIcon.MouseUpEventHandler += (sender, e) => { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欑洿鎺ユ彁绀�:纭畾閫�鍑哄綋鍓嶈处鍙凤紵 + string msg = Language.StringByID(R.MyInternationalizationString.uLogoutAccountMsg); + this.ShowMassage(ShowMsgType.Confirm, msg, () => + { + //閫�鍑鸿处鍙� + UserCenterLogic.ReLoginAgain(Common.Config.Instance.Account); + }); + return; + } var form = new UserInformationForm(); 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) { - //鐨囧啝 - this.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; } //鐢ㄦ埛鏄电О @@ -161,7 +192,7 @@ this.btnAuthority = new NormalViewControl(605, 60, true); btnAuthority.X = btnUserName.X; btnAuthority.Y = btnUserName.Bottom; - btnAuthority.TextColor = UserCenterColor.Current.Gray; + btnAuthority.TextColor = UserCenterColor.Current.TextGrayColor3; btnAuthority.TextSize = 12; if (UserCenterResourse.UserInfo != null) { @@ -187,7 +218,7 @@ else { //鑳屾櫙妗� - frameMainMenuBack = new FrameLayout(); + frameMainMenuBack = new NormalFrameLayout(); frameMainMenuBack.Y = Application.GetRealHeight(288); frameMainMenuBack.Gravity = Gravity.CenterHorizontal; frameMainMenuBack.Height = Application.GetRealHeight(371); @@ -237,6 +268,11 @@ var frame = this.CreatMainMenuControl(frameMenu, TextID, unSelectPic); frame.ButtonClickEvent += (sender, e) => { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + return; + } var form = new Member.MemberListForm(); form.AddForm(); }; @@ -252,13 +288,16 @@ frame.ButtonClickEvent += (sender, e) => { HdlGatewayLogic.Current.RefreshAppOldSelectGatewayId(); - if (string.IsNullOrEmpty(GatewayResourse.AppOldSelectGatewayId) == false) + //鎷ユ湁缃戝叧,鎴栬�呮槸铏氭嫙浣忓畢,鍒欒繘鍏ヨ澶囧垪琛ㄧ晫闈� + if (string.IsNullOrEmpty(GatewayResourse.AppOldSelectGatewayId) == false + || Common.Config.Instance.Home.IsVirtually == true) { var form = new Device.DeviceListMainForm(); form.AddForm(); } else { + //娌℃湁缃戝叧,鍒欒繘鍏ョ綉鍏冲垪琛ㄧ晫闈� var form = new GatewayManage.GatewayListForm(); form.AddForm(); } @@ -290,6 +329,11 @@ var frame = this.CreatMainMenuControl(frameMenu, TextID, unSelectPic); frame.ButtonClickEvent += (sender, e) => { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + return; + } var form = new Safety.SafetyManagementMainForm(); form.AddForm(); }; @@ -378,6 +422,11 @@ btnBackView.X -= ControlCommonResourse.XXLeft / 2; rowback.ButtonClickEvent += (sender, e) => { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + return; + } var form = new HdlBackup.HdlBackupListForm(); form.AddForm(); }; @@ -423,6 +472,11 @@ btnAbountView.X -= ControlCommonResourse.XXLeft / 2; rowAbount.ButtonClickEvent += (sender, e) => { + if (Common.Config.Instance.Home.IsVirtually == true) + { + //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥 + return; + } var form = new Abount.AbountForm(); form.AddForm(); }; @@ -462,6 +516,11 @@ /// </summary> public override int FormActionAgainEvent() { + //铏氭嫙浣忓畢涓嶉渶瑕佸埛鏂� + if (Common.Config.Instance.Home.IsVirtually == true) + { + return -1; + } //鐢ㄦ埛澶村儚 if (UserCenterResourse.UserInfo.UserIconFileChanged == true) { @@ -475,17 +534,14 @@ //鐢ㄦ埛韬唤 btnAuthority.Text = UserCenterResourse.UserInfo.AuthorityText; } - if (this.btnImperialCrown != null) + //鐨囧啝 + if (UserCenterResourse.UserInfo.AuthorityNo != 1) { - //鐨囧啝 - if (UserCenterResourse.UserInfo.AuthorityNo != 1) - { - this.btnImperialCrown.Visible = false; - } - else - { - this.btnImperialCrown.Visible = true; - } + this.btnImperialCrown.Visible = false; + } + else + { + this.btnImperialCrown.Visible = true; } //鍒锋柊淇℃伅鎻愮ず鎺т欢 -- Gitblit v1.8.0