xm
2020-05-08 6bca8fcd37a48808a0b9c9342fc1be0adddfece6
ZigbeeApp/Shared/Phone/UserCenter/UserMain/UserMainForm.cs
@@ -59,8 +59,7 @@
            //body占完整个屏幕,除了底部菜单
            bodyFrameLayout.Y = 0;
            bodyFrameLayout.Height = ControlCommonResourse.TopMenuFrameHeight + ControlCommonResourse.TopFrameHeight
                + ControlCommonResourse.BodyFrameHeight - ControlCommonResourse.BottomFrameHeight;
            bodyFrameLayout.Height = this.Height;
            bodyFrameLayout.BackgroundColor = UserCenterColor.Current.BlackBackGround;
            //初始化中部控件
@@ -132,15 +131,33 @@
        {
            //用户头像
            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();
            };
@@ -247,6 +264,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();
                };
@@ -262,13 +284,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();
                    }
@@ -300,6 +325,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();
                };
@@ -388,6 +418,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();
                };
@@ -433,6 +468,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();
            };
@@ -472,6 +512,11 @@
        /// </summary>
        public override int FormActionAgainEvent()
        {
            //虚拟住宅不需要刷新
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                return -1;
            }
            //用户头像
            if (UserCenterResourse.UserInfo.UserIconFileChanged == true)
            {