黄学彪
2020-06-18 2450c12c825ad4d78d1572da2fa421706db2df2f
ZigbeeApp/Shared/Phone/UserView/UserPage.cs
old mode 100644 new mode 100755
@@ -49,6 +49,10 @@
        /// 控件缓存(看不懂的话,不要动它)
        /// </summary>
        private List<ButtonBase> listButton = new List<ButtonBase>();
        /// <summary>
        /// 如果设置此变量为true,则在单击底部菜单时,强制无条件全部刷新
        /// </summary>
        public bool RefreshForm = false;
        #endregion
@@ -76,10 +80,10 @@
                return;
            }
#if iOS
            if (Shared.Application.PhoneType >= 10)
            {
                //高版本的苹果机型,屏幕底部会有一个黑色的杠
                ControlCommonResourse.BottomFrameHeight = Application.GetRealHeight(242);
            if (Shared.Application.PhoneType >= 10)
            {
                //高版本的苹果机型,屏幕底部会有一个黑色的杠
                ControlCommonResourse.BottomFrameHeight = Application.GetRealHeight(242);
            }
#endif
            //用户主体界面(中间部分)
@@ -214,10 +218,10 @@
            this.BottomMenuClickEvent(MenuSelectEnum.A主页, false);
        }
#endregion
        #endregion
#region ■ 一般方法___________________________
        #region ■ 一般方法___________________________
        /// <summary>
        /// 底部菜单的点击事件
        /// </summary>
@@ -225,11 +229,22 @@
        /// <param name="handClick">是否是手动点击</param>
        private void BottomMenuClickEvent(MenuSelectEnum selectEnum, bool handClick)
        {
            if (selectEnum == this.nowSelectMenu && handClick == true)
            if (this.RefreshForm == false && selectEnum == this.nowSelectMenu && handClick == true)
            {
                //手动点击同一个菜单,则不做处理
                return;
            }
            //如果强制指定刷新界面的话
            if (this.RefreshForm == true)
            {
                //全部刷新
                this.listForm = new List<EditorCommonForm>() { null, null, null };
                this.bodyFrameView.RemoveAll();
                this.RefreshForm = false;
            }
            this.nowSelectMenu = selectEnum;
            //主页
@@ -314,15 +329,47 @@
            //关闭全部界面,直到主页为止
            UserCenterLogic.CloseAllOpenForm();
            //强制显示自动化列表界面
            UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex = 2;
            this.BottomMenuClickEvent(MenuSelectEnum.A分类, 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();
        }
#endregion
        /// <summary>
        /// 获取当前激活的界面
        /// </summary>
        /// <returns></returns>
        public EditorCommonForm GetNowActionForm()
        {
            int index = ((int)this.nowSelectMenu) - 1;
            if (index != -1)
            {
                //调用此界面的激活函数
                return this.listForm[index];
            }
            return null;
        }
#region ■ 结构体_____________________________
        #endregion
        #region ■ 结构体_____________________________
        /// <summary>
        /// 菜单选择的枚举
        /// </summary>
@@ -332,8 +379,8 @@
            A主页 = 1,
            A分类 = 2,
            A个人中心 = 3
        }
#endregion
        }
        #endregion
    }
}