From cca9ba03381aaf0ddb599eaa0e0c632c2cfff09a Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期二, 22 九月 2020 10:36:44 +0800
Subject: [PATCH] 代码还原回来
---
ZigbeeApp/Shared/Phone/UserView/UserPage.cs | 665 ++++++++++++++++++++++++++++++-------------------------
1 files changed, 364 insertions(+), 301 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserView/UserPage.cs b/ZigbeeApp/Shared/Phone/UserView/UserPage.cs
index 8df13b5..e3904ea 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 System.Text;
+using Shared.Phone.UserCenter;
namespace Shared.Phone.UserView
{
@@ -9,38 +10,17 @@
/// User page.
/// </summary>
public class UserPage : FrameLayout
- {
- #region 鈼� 鍙橀噺_______________________
- /// <summary>
- /// The user menu page.
- /// </summary>
- static UserPage userMenuPage;
- /// <summary>
- /// 搴曢儴鍗曠嫭鑿滃崟鐨勫搴�-360
- /// </summary>
- private static readonly int tabBarEnum_Width = CommonPage.AppRealWidth / 3;
- /// <summary>
- /// 搴曢儴鎸夐挳鍥剧墖鐨勯珮搴�
- /// </summary>
- private static readonly int tabBarEnumIMG_Height = 98;
- /// <summary>
- /// 搴曢儴鎸夐挳鍥剧墖鐨勫搴�
- /// </summary>
- private static readonly int tabBarEnumIMG_Width = 138;
- /// <summary>
- /// 搴曢儴鎸夐挳鍥剧墖鐨刌鍊�
- /// </summary>
- private static readonly int tabBarEnumIMG_Y = 3;
- /// <summary>
- /// 搴曢儴鎸夐挳鏂囧瓧鐨勯珮搴�
- /// </summary>
- private static readonly int tabBarEnumName_Height = 40;
- /// <summary>
- /// 搴曢儴鎸夐挳鏂囧瓧鐨刌鍊�
- /// </summary>
- private static readonly int tabBarEnumName_Y = 98;
- #endregion
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+ /// <summary>
+ /// 褰撳墠閫夋嫨鐨勮彍鍗�
+ /// </summary>
+ private MenuSelectEnum nowSelectMenu = MenuSelectEnum.A鏈�夋嫨;
+ /// <summary>
+ /// 鐢ㄦ埛鐣岄潰
+ /// </summary>
+ private static UserPage userMenuPage = null;
/// <summary>
/// 鐢ㄦ埛鐣岄潰
/// </summary>
@@ -55,292 +35,375 @@
}
return userMenuPage;
}
- }
-
+ }
+
+ /// <summary>
+ /// 鐢ㄦ埛涓讳綋鐣岄潰锛堜腑闂撮儴鍒嗭級
+ /// </summary>
+ private NormalFrameLayout bodyFrameView = null;
+ /// <summary>
+ /// 鐣岄潰缂撳瓨(2020.05.07:鍒囨崲鏃朵笉绉婚櫎鐣岄潰,鐩存帴闅愯棌)
+ /// </summary>
+ private List<EditorCommonForm> listForm = new List<EditorCommonForm>() { null, null, null };
+ /// <summary>
+ /// 鎺т欢缂撳瓨(鐪嬩笉鎳傜殑璇�,涓嶈鍔ㄥ畠)
+ /// </summary>
+ private List<ButtonBase> listButton = new List<ButtonBase>();
+ /// <summary>
+ /// 濡傛灉璁剧疆姝ゅ彉閲忎负true,鍒欏湪鍗曞嚮搴曢儴鑿滃崟鏃�,寮哄埗鏃犳潯浠跺叏閮ㄥ埛鏂�
+ /// </summary>
+ public bool RefreshAllForm = false;
+ /// <summary>
+ /// 鍒锋柊涓婚〉
+ /// </summary>
+ public bool RefreshMainPageForm = false;
+ /// <summary>
+ /// 鍒锋柊鍒嗙被
+ /// </summary>
+ public bool RefreshCategoryForm = false;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
/// <summary>
- /// Initializes a new instance of the <see cref="T:Shared.Phone.UserView.UserPage"/> class.
+ /// 鍒濆鍖�
/// </summary>
public UserPage()
{
BackgroundColor = Shared.Common.ZigbeeColor.Current.MainColor;
Shared.Application.LocationAction += (lon, lat) =>
{
+ //涓婃姤缁忕含搴�
Login.AccountLogic.Instance.ReceiveAppLatAndLon(lon.ToString(), lat.ToString());
};
- }
-
- /// <summary>
- /// 鐢ㄦ埛涓讳綋鐣岄潰锛堜腑闂撮儴鍒嗭級
- /// </summary>
- public FrameLayout BodyView = new FrameLayout
- {
- Height = Application.GetRealHeight(CommonPage.AppRealHeight - CommonPage.TabbarHeight),
- BackgroundColor = Shared.Common.ZigbeeColor.Current.MainColor,
- };
- /// <summary>
- /// 鐢ㄦ埛鑿滃崟鐣岄潰锛堝簳閮ㄩ儴鍒嗭級
- /// </summary>
- public FrameLayout BottomMenuView = new FrameLayout
- {
- Y = Application.GetRealHeight(CommonPage.AppRealHeight - CommonPage.TabbarHeight),
- Height = Application.GetRealHeight(CommonPage.TabbarHeight),
- BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCBottomColor,
- };
-
- #region 鍒嗗壊绾�
-
- private Button bottomLine = new Button
- {
- Height = 1,
- BackgroundColor = ZigbeeColor.Current.GXCBottomLineColor
- };
-
- #endregion
-
- #region 搴曢儴-涓婚〉鎸夐挳
- /// <summary>
- /// 搴曢儴-涓婚〉鎸夐挳
- /// </summary>
- public FrameLayout homePageFL = new FrameLayout
- {
- Width = Application.GetRealWidth(tabBarEnum_Width),
- Height = Application.GetRealHeight(CommonPage.TabbarHeight),
-
- };
- /// <summary>
- /// The home page image.
- /// </summary>
- public Button homePageIMG = new Button
- {
- Y = Application.GetRealHeight(tabBarEnumIMG_Y),
- Height = Application.GetMinRealAverage(tabBarEnumIMG_Height),
- Width = Application.GetMinRealAverage(tabBarEnumIMG_Width),
- UnSelectedImagePath = "Navigation/Home.png",
- SelectedImagePath = "Navigation/HomeSelected.png",
- Gravity = Gravity.CenterHorizontal
- };
- /// <summary>
- /// The name of the home page.
- /// </summary>
- public Button homePageName = new Button
- {
- Y = Application.GetRealHeight(tabBarEnumName_Y),
- Height = Application.GetRealHeight(tabBarEnumName_Height),
- TextID = R.MyInternationalizationString.HomePage,
- TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor,
- SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2,
- Gravity = Gravity.CenterHorizontal,
- TextSize = 10
- };
- #endregion
-
- #region 鍒嗙被-搴曢儴鎸夐挳
- /// <summary>
- /// 鍒嗙被-搴曢儴鎸夐挳
- /// </summary>
- public FrameLayout categoryFL = new FrameLayout
- {
- X = Application.GetRealWidth(tabBarEnum_Width),
- Width = Application.GetRealWidth(tabBarEnum_Width),
- Height = Application.GetRealHeight(CommonPage.TabbarHeight)
- };
- /// <summary>
- /// The category image.
- /// </summary>
- public Button categoryIMG = new Button
- {
- Y = Application.GetRealHeight(tabBarEnumIMG_Y),
- Height = Application.GetMinRealAverage(tabBarEnumIMG_Height),
- Width = Application.GetMinRealAverage(tabBarEnumIMG_Width),
- UnSelectedImagePath = "Navigation/Category.png",
- SelectedImagePath = "Navigation/CategorySelected.png",
- Gravity = Gravity.CenterHorizontal
- };
- /// <summary>
- /// The name of the category.
- /// </summary>
- public Button categoryName = new Button
- {
- Y = Application.GetRealHeight(tabBarEnumName_Y),
- Height = Application.GetRealHeight(tabBarEnumName_Height),
- TextID = R.MyInternationalizationString.Category,
- TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor,
- SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2,
- Gravity = Gravity.CenterHorizontal,
- TextSize = 10
- };
- #endregion
-
- #region 涓汉涓績-搴曢儴鎸夐挳
- /// <summary>
- /// 涓汉涓績-搴曢儴鎸夐挳
- /// </summary>
- public FrameLayout settingFL = new FrameLayout
- {
- X = Application.GetRealWidth(tabBarEnum_Width * 2),
- Width = Application.GetRealWidth(tabBarEnum_Width),
- Height = Application.GetRealHeight(CommonPage.TabbarHeight)
- };
- /// <summary>
- /// The setting image.
- /// </summary>
- public Button settingIMG = new Button
- {
- Y = Application.GetRealHeight(tabBarEnumIMG_Y),
- Height = Application.GetMinRealAverage(tabBarEnumIMG_Height),
- Width = Application.GetMinRealAverage(tabBarEnumIMG_Width),
- UnSelectedImagePath = "Navigation/Setting.png",
- SelectedImagePath = "Navigation/SettingSelected.png",
- Gravity = Gravity.CenterHorizontal
- };
- /// <summary>
- /// 涓汉涓績
- /// </summary>
- public Button settingName = new Button
- {
- Y = Application.GetRealHeight(tabBarEnumName_Y),
- Height = Application.GetRealHeight(tabBarEnumName_Height),
- TextID = R.MyInternationalizationString.Me,
- TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor,
- SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2,
- Gravity = Gravity.CenterHorizontal,
- TextSize = 10
- };
- #endregion
+ }
- #region 寮哄埗鏄剧ず鑷姩鍖栫晫闈�
-
- /// <summary>
- /// 寮哄埗鏄剧ず鑷姩鍖栧垪琛ㄧ晫闈�
- /// </summary>
- public void ShowCategoryAutoListForm()
- {
- //鍏抽棴鍏ㄩ儴鐣岄潰,鐩村埌涓婚〉涓烘
- UserCenter.UserCenterLogic.CloseAllOpenForm();
- //寮哄埗鏄剧ず鑷姩鍖栧垪琛ㄧ晫闈�
- UserCenter.UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex = 2;
- BottomEventHandler(Instance.categoryIMG, null);
- }
-
- #endregion
-
- EventHandler<MouseEventArgs> BottomEventHandler = (sender, e) =>
- {
- if (sender == Instance.homePageIMG || sender == Instance.homePageName)
- {
- if (Instance.homePageName.IsSelected == true && e != null)
- {
- //鍙湁鏄墜鍔ㄧ偣鍑荤殑鏃跺�欐墠澶勭悊
- return;
- }
- Instance.BodyView.RemoveAll();
- //涓婚〉
- CommonPage.Instance.IsDrawerLockMode = false;
- Instance.homePageName.IsSelected = true;
- Instance.homePageIMG.IsSelected = true;
-
- Instance.categoryName.IsSelected = false;
- Instance.categoryIMG.IsSelected = false;
-
- Instance.settingName.IsSelected = false;
- Instance.settingIMG.IsSelected = false;
-
- var home = new MainPage.HomeMainPageForm();
- Instance.BodyView.AddChidren(home);
- home.ShowForm();
-
- }
- else if (sender == Instance.categoryIMG || sender == Instance.categoryName)
- {
- if (Instance.categoryName.IsSelected == true && e != null)
- {
- //鍙湁鏄墜鍔ㄧ偣鍑荤殑鏃跺�欐墠澶勭悊
- return;
- }
-
- Instance.BodyView.RemoveAll();
- //鍒嗙被
- CommonPage.Instance.IsDrawerLockMode = true;
- Instance.categoryName.IsSelected = true;
- Instance.categoryIMG.IsSelected = true;
-
- Instance.homePageName.IsSelected = false;
- Instance.homePageIMG.IsSelected = false;
-
- Instance.settingName.IsSelected = false;
- Instance.settingIMG.IsSelected = false;
-
- var category = new Category.CategoryMainForm { };
- Instance.BodyView.AddChidren(category);
- category.ShowForm();
- }
- else if (sender == Instance.settingIMG || sender == Instance.settingName)
- {
- if (Instance.settingName.IsSelected == true && e != null)
- {
- return;
- }
- Instance.BodyView.RemoveAll();
- //涓汉涓績
- CommonPage.Instance.IsDrawerLockMode = true;
- Instance.settingName.IsSelected = true;
- Instance.settingIMG.IsSelected = true;
-
- Instance.homePageName.IsSelected = false;
- Instance.homePageIMG.IsSelected = false;
-
- Instance.categoryName.IsSelected = false;
- Instance.categoryIMG.IsSelected = false;
-
- var form = new UserCenter.UserMain.UserMainForm();
- Instance.BodyView.AddChidren(form);
- form.ShowForm();
- }
- };
-
/// <summary>
- /// Fresh this instance.
- /// </summary>
- public void Fresh()
- {
- BottomEventHandler(Instance.homePageIMG, null);
- }
-
- /// <summary>
- /// Inits the page.
+ /// 鍒濆鍖�
/// </summary>
public void InitPage()
{
- if (0 < ChildrenCount)
+ if (this.ChildrenCount > 0)
{
return;
+ }
+#if iOS
+ if (Shared.Application.IsFullScreen == true)
+ {
+ //楂樼増鏈殑鑻规灉鏈哄瀷锛屽睆骞曞簳閮ㄤ細鏈変竴涓粦鑹茬殑鏉�
+ ControlCommonResourse.BottomFrameHeight = Application.GetRealHeight(180);
+ }
+#endif
+ //鐢ㄦ埛涓讳綋鐣岄潰锛堜腑闂撮儴鍒嗭級
+ this.bodyFrameView = new NormalFrameLayout();
+ bodyFrameView.Height = this.Height - UserCenter.ControlCommonResourse.BottomFrameHeight;
+ bodyFrameView.BackgroundColor = Shared.Common.ZigbeeColor.Current.MainColor;
+ this.AddChidren(bodyFrameView);
+
+ //鐢ㄦ埛鑿滃崟鐣岄潰锛堝簳閮ㄩ儴鍒嗭級
+ var bottomMenuFrame = new FrameLayout();
+ bottomMenuFrame.Gravity = Gravity.BottomCenter;
+ bottomMenuFrame.Height = ControlCommonResourse.BottomFrameHeight;
+ bottomMenuFrame.BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCBottomColor;
+ this.AddChidren(bottomMenuFrame);
+ //搴曢儴鑿滃崟鐨勫ご閮ㄧ嚎
+ var bottomLine = new NormalViewControl(bottomMenuFrame.Width, ControlCommonResourse.BottomLineHeight, false);
+ bottomLine.BackgroundColor = 0xffc8c8c9;
+ bottomMenuFrame.AddChidren(bottomLine);
+
+ //涓婚〉瀹瑰櫒
+ var frameHomePage = new FrameLayout();
+ frameHomePage.Width = bottomMenuFrame.Width / 3;
+ frameHomePage.Height = bottomMenuFrame.Height;
+ bottomMenuFrame.AddChidren(frameHomePage);
+ //涓婚〉鍥炬爣
+ var btnHomeIcon = new PicViewControl(138, 98);
+ btnHomeIcon.Y = Application.GetRealHeight(3);
+ btnHomeIcon.UnSelectedImagePath = "Navigation/Home.png";
+ btnHomeIcon.SelectedImagePath = "Navigation/HomeSelected.png";
+ btnHomeIcon.Gravity = Gravity.CenterHorizontal;
+ frameHomePage.AddChidren(btnHomeIcon);
+ this.listButton.Add(btnHomeIcon);
+ btnHomeIcon.ButtonClickEvent += (sender, e) =>
+ {
+ this.BottomMenuClickEvent(MenuSelectEnum.A涓婚〉, true);
+ };
+ //涓婚〉
+ var btnHomeName = new NormalViewControl(btnHomeIcon.Width, Application.GetRealHeight(40), false);
+ btnHomeName.Y = btnHomeIcon.Bottom;
+ btnHomeName.TextID = R.MyInternationalizationString.HomePage;
+ btnHomeName.TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor;
+ btnHomeName.SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2;
+ btnHomeName.TextSize = 10;
+ btnHomeName.Gravity = Gravity.CenterHorizontal;
+ btnHomeName.TextAlignment = TextAlignment.Center;
+ frameHomePage.AddChidren(btnHomeName);
+ this.listButton.Add(btnHomeName);
+ btnHomeName.ButtonClickEvent += (sender, e) =>
+ {
+ this.BottomMenuClickEvent(MenuSelectEnum.A涓婚〉, true);
+ };
+
+ //鍒嗙被瀹瑰櫒
+ var frameCategory = new FrameLayout();
+ frameCategory.X = frameHomePage.Right;
+ frameCategory.Width = bottomMenuFrame.Width / 3;
+ frameCategory.Height = bottomMenuFrame.Height;
+ bottomMenuFrame.AddChidren(frameCategory);
+ //鍒嗙被鍥炬爣
+ var btnCategoryIcon = new PicViewControl(138, 98);
+ btnCategoryIcon.Y = Application.GetRealHeight(3);
+ btnCategoryIcon.UnSelectedImagePath = "Navigation/Category.png";
+ btnCategoryIcon.SelectedImagePath = "Navigation/CategorySelected.png";
+ btnCategoryIcon.Gravity = Gravity.CenterHorizontal;
+ frameCategory.AddChidren(btnCategoryIcon);
+ this.listButton.Add(btnCategoryIcon);
+ btnCategoryIcon.ButtonClickEvent += (sender, e) =>
+ {
+ this.BottomMenuClickEvent(MenuSelectEnum.A鍒嗙被, true);
+ };
+ //鍒嗙被
+ var btnCategoryName = new NormalViewControl(btnCategoryIcon.Width, Application.GetRealHeight(40), false);
+ btnCategoryName.Y = btnCategoryIcon.Bottom;
+ btnCategoryName.TextID = R.MyInternationalizationString.Category;
+ btnCategoryName.TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor;
+ btnCategoryName.SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2;
+ btnCategoryName.TextSize = 10;
+ btnCategoryName.Gravity = Gravity.CenterHorizontal;
+ btnCategoryName.TextAlignment = TextAlignment.Center;
+ frameCategory.AddChidren(btnCategoryName);
+ this.listButton.Add(btnCategoryName);
+ btnCategoryName.ButtonClickEvent += (sender, e) =>
+ {
+ this.BottomMenuClickEvent(MenuSelectEnum.A鍒嗙被, true);
+ };
+
+
+ //鎴戠殑瀹瑰櫒
+ var frameSetting = new FrameLayout();
+ frameSetting.X = frameCategory.Right;
+ frameSetting.Width = bottomMenuFrame.Width / 3;
+ frameSetting.Height = bottomMenuFrame.Height;
+ bottomMenuFrame.AddChidren(frameSetting);
+ //鎴戠殑鍥炬爣
+ var btnSettingIcon = new PicViewControl(138, 98);
+ btnSettingIcon.Y = Application.GetRealHeight(3);
+ btnSettingIcon.UnSelectedImagePath = "Navigation/Setting.png";
+ btnSettingIcon.SelectedImagePath = "Navigation/SettingSelected.png";
+ btnSettingIcon.Gravity = Gravity.CenterHorizontal;
+ frameSetting.AddChidren(btnSettingIcon);
+ this.listButton.Add(btnSettingIcon);
+ btnSettingIcon.ButtonClickEvent += (sender, e) =>
+ {
+ this.BottomMenuClickEvent(MenuSelectEnum.A涓汉涓績, true);
+ };
+ //鎴戠殑
+ var btnSettingName = new NormalViewControl(btnCategoryIcon.Width, Application.GetRealHeight(40), false);
+ btnSettingName.Y = btnSettingIcon.Bottom;
+ btnSettingName.TextID = R.MyInternationalizationString.Me;
+ btnSettingName.TextColor = Shared.Common.ZigbeeColor.Current.GXCTextBottomUnSelectedColor;
+ btnSettingName.SelectedTextColor = Shared.Common.ZigbeeColor.Current.GXCTextBlackColor2;
+ btnSettingName.TextSize = 10;
+ btnSettingName.Gravity = Gravity.CenterHorizontal;
+ btnSettingName.TextAlignment = TextAlignment.Center;
+ frameSetting.AddChidren(btnSettingName);
+ this.listButton.Add(btnSettingName);
+ btnSettingName.ButtonClickEvent += (sender, e) =>
+ {
+ this.BottomMenuClickEvent(MenuSelectEnum.A涓汉涓績, true);
+ };
+ }
+
+ /// <summary>
+ /// 鍒锋柊鎺т欢
+ /// </summary>
+ public void ReFreshControl()
+ {
+ //杩欓噷鍋氬叏鍒锋柊澶勭悊
+ this.listForm = new List<EditorCommonForm>() { null, null, null };
+ this.bodyFrameView.RemoveAll();
+
+ this.BottomMenuClickEvent(MenuSelectEnum.A涓婚〉, false);
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 搴曢儴鑿滃崟鐨勭偣鍑讳簨浠�
+ /// </summary>
+ /// <param name="selectEnum">鑿滃崟閫夋嫨鏋氫妇</param>
+ /// <param name="handClick">鏄惁鏄墜鍔ㄧ偣鍑�</param>
+ private void BottomMenuClickEvent(MenuSelectEnum selectEnum, bool handClick)
+ {
+ if (this.RefreshAllForm == false && selectEnum == this.nowSelectMenu && handClick == true)
+ {
+ //鎵嬪姩鐐瑰嚮鍚屼竴涓彍鍗�,鍒欎笉鍋氬鐞�
+ return;
+ }
+
+ //濡傛灉寮哄埗鎸囧畾鍒锋柊鐣岄潰鐨勮瘽
+ if (this.RefreshAllForm == true)
+ {
+ //鍏ㄩ儴鍒锋柊
+ this.listForm = new List<EditorCommonForm>() { null, null, null };
+ this.bodyFrameView.RemoveAll();
+
+ this.RefreshAllForm = false;
+ }
+
+ this.nowSelectMenu = selectEnum;
+
+ //涓婚〉
+ if (selectEnum == MenuSelectEnum.A涓婚〉)
+ {
+ //宸︽粦鑿滃崟鍙�
+ CommonPage.Instance.IsDrawerLockMode = false;
+ if (this.RefreshMainPageForm == true)
+ {
+ //鍒锋柊涓婚〉
+ listForm[0]?.CloseForm();
+ listForm[0] = null;
+ this.RefreshMainPageForm = false;
+ }
+ if (listForm[0] == null)
+ {
+ var form = new MainPage.HomeMainPageForm();
+ this.bodyFrameView.AddChidren(form);
+ form.ShowForm();
+ //鍔犵紦瀛�
+ listForm[0] = form;
+ }
}
-
- AddChidren(BodyView);
- AddChidren(BottomMenuView);
-
- BottomMenuView.AddChidren(Instance.bottomLine);
-
- Instance.homePageFL.AddChidren(Instance.homePageIMG);
- Instance.homePageFL.AddChidren(Instance.homePageName);
- BottomMenuView.AddChidren(Instance.homePageFL);
-
- Instance.categoryFL.AddChidren(Instance.categoryIMG);
- Instance.categoryFL.AddChidren(Instance.categoryName);
- BottomMenuView.AddChidren(Instance.categoryFL);
-
- Instance.settingFL.AddChidren(Instance.settingIMG);
- Instance.settingFL.AddChidren(Instance.settingName);
- BottomMenuView.AddChidren(Instance.settingFL);
-
- homePageIMG.MouseUpEventHandler += BottomEventHandler;
- homePageName.MouseUpEventHandler += BottomEventHandler;
-
- categoryIMG.MouseUpEventHandler += BottomEventHandler;
- categoryName.MouseUpEventHandler += BottomEventHandler;
-
- settingIMG.MouseUpEventHandler += BottomEventHandler;
- settingName.MouseUpEventHandler += BottomEventHandler;
- }
+ else if (selectEnum == MenuSelectEnum.A鍒嗙被)
+ {
+ //宸︽粦鑿滃崟涓嶅彲
+ CommonPage.Instance.IsDrawerLockMode = true;
+ if (this.RefreshCategoryForm == true)
+ {
+ //鍒锋柊鍒嗙被
+ listForm[1]?.CloseForm();
+ listForm[1] = null;
+ this.RefreshCategoryForm = false;
+ }
+ if (listForm[1] == null)
+ {
+ var form = new Category.CategoryMainForm();
+ this.bodyFrameView.AddChidren(form);
+ form.ShowForm();
+ //鍔犵紦瀛�
+ listForm[1] = form;
+ }
+ }
+ else if (selectEnum == MenuSelectEnum.A涓汉涓績)
+ {
+ //宸︽粦鑿滃崟涓嶅彲
+ CommonPage.Instance.IsDrawerLockMode = true;
+ if (listForm[2] == null)
+ {
+ var form = new UserCenter.UserMain.UserMainForm();
+ this.bodyFrameView.AddChidren(form);
+ form.ShowForm();
+ //鍔犵紦瀛�
+ listForm[2] = form;
+ }
+ }
+ //璁剧疆鍏ㄩ儴鎺т欢鐨勫悇绉嶇姸鎬佺姸鎬�
+ this.SetAllControlStatu();
+ }
+
+ /// <summary>
+ /// 璁剧疆鍏ㄩ儴鎺т欢鐨勫悇绉嶇姸鎬佺姸鎬�
+ /// </summary>
+ private void SetAllControlStatu()
+ {
+ int index = (int)this.nowSelectMenu - 1;
+ for (int i = 0; i < listForm.Count; i++)
+ {
+ if (i == index)
+ {
+ //褰撳墠閫夋嫨鐨勮彍鍗曠殑璇�,鍒欏叏閮ㄥ彲瑙�
+ listForm[i].Visible = true;
+ //鎺т欢鍥剧墖鍜岄鑹插彉鏇�
+ this.listButton[i * 2].IsSelected = true;
+ this.listButton[i * 2 + 1].IsSelected = true;
+ }
+ else
+ {
+ //涓嶆槸褰撳墠閫夋嫨鐨勮彍鍗曠殑璇�,鍏ㄩ儴涓嶅彲瑙�
+ if (listForm[i] != null)
+ {
+ listForm[i].Visible = false;
+ }
+ //鎺т欢鍥剧墖鍜岄鑹插彉鏇�
+ this.listButton[i * 2].IsSelected = false;
+ this.listButton[i * 2 + 1].IsSelected = false;
+ }
+ }
+ }
+
+ /// <summary>
+ /// 寮哄埗鏄剧ず鑷姩鍖栧垪琛ㄧ晫闈�
+ /// </summary>
+ public void ShowCategoryAutoListForm()
+ {
+ //鍏抽棴鍏ㄩ儴鐣岄潰,鐩村埌涓婚〉涓烘
+ UserCenterLogic.CloseAllOpenForm(null, false);
+ //寮哄埗鏄剧ず鑷姩鍖栧垪琛ㄧ晫闈�
+ UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex = 2;
+
+ this.nowSelectMenu = MenuSelectEnum.A鍒嗙被;
+
+ //宸︽粦鑿滃崟涓嶅彲
+ CommonPage.Instance.IsDrawerLockMode = true;
+ if (listForm[1] == null)
+ {
+ var form = new Category.CategoryMainForm();
+ this.bodyFrameView.AddChidren(form);
+ form.ShowForm();
+ //鍔犵紦瀛�
+ listForm[1] = form;
+ }
+ else
+ {
+ ((Category.CategoryMainForm)listForm[1]).RefreshBodyView();
+ }
+ //璁剧疆鍏ㄩ儴鎺т欢鐨勫悇绉嶇姸鎬佺姸鎬�
+ this.SetAllControlStatu();
+ }
+
+ /// <summary>
+ /// 鑾峰彇褰撳墠婵�娲荤殑鐣岄潰
+ /// </summary>
+ /// <returns></returns>
+ public EditorCommonForm GetNowActionForm()
+ {
+ int index = ((int)this.nowSelectMenu) - 1;
+ if (index != -1)
+ {
+ //璋冪敤姝ょ晫闈㈢殑婵�娲诲嚱鏁�
+ return this.listForm[index];
+ }
+ return null;
+ }
+
+ #endregion
+
+ #region 鈻� 缁撴瀯浣揰____________________________
+
+ /// <summary>
+ /// 鑿滃崟閫夋嫨鐨勬灇涓�
+ /// </summary>
+ private enum MenuSelectEnum
+ {
+ A鏈�夋嫨 = 0,
+ A涓婚〉 = 1,
+ A鍒嗙被 = 2,
+ A涓汉涓績 = 3
+ }
+
+ #endregion
}
}
--
Gitblit v1.8.0