HDL Home App 第二版本 旧平台金堂用 正在使用
hxb
2022-08-30 25429f085093d89d543a0b90e30d0d62d1b7dac9
ZigbeeApp/Shared/Phone/UserCenter/Member/AddMemberSuccessForm.cs
@@ -13,16 +13,16 @@
        /// <summary>
        /// 界面关闭事件
        /// </summary>
        public Action FormCloseEvent = null;
        /// <summary>
        /// 成员账号信息
        /// </summary>
        private AccountInfoResult memberAccountResult = null;
        public Action FormCloseEvent = null;
        /// <summary>
        /// 成员信息
        /// </summary>
        private MemberInfoRes memberResult = null;
        /// <summary>
        /// 清空事件
        /// </summary>
        private bool clearEvent = true;
        #endregion
@@ -31,22 +31,21 @@
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
        /// <param name="i_accountInfoResult">成员账号信息</param>
        /// <param name="i_memberResult">成员信息</param>
        public void ShowForm(AccountInfoResult i_accountInfoResult, MemberInfoRes i_memberResult)
        {
            this.memberAccountResult = i_accountInfoResult;
            this.memberResult = i_memberResult;
            //初始化中部控件
            this.InitMiddleFrame();
        }
        /// <param name="i_memberResult">成员信息</param>
        /// <param name="i_iconMark">头像的Mark</param>
        public void ShowForm(MemberInfoRes i_memberResult, string i_iconMark)
        {
            this.memberResult = i_memberResult;
            //初始化中部控件
            this.InitMiddleFrame(i_iconMark);
        }
        /// <summary>
        /// 初始化中部控件
        /// </summary>
        private void InitMiddleFrame()
        /// </summary>
        private void InitMiddleFrame(string i_iconMark)
        {
            //背景框
            var frame = new FrameLayout();
@@ -54,23 +53,35 @@
            frame.Height = Application.GetRealHeight(1097);
            frame.BackgroundColor = UserCenterColor.Current.White;
            frame.Gravity = Gravity.Center;
            frame.Radius = (uint)Application.GetMinRealAverage(6);
            frame.Radius = (uint)Application.GetRealHeight(17);
            bodyFrameLayout.AddChidren(frame);
            //用户图标
            var btnUserIcon = new PicViewControl(207, 207);
            btnUserIcon.Y = Application.GetRealHeight(104);
            string iconPath = System.IO.Path.Combine(UserCenterResourse.AccountOption.UserPictruePath, i_iconMark + ".png");
            var btnUserIcon = new ImageView();
            btnUserIcon.Height = this.GetPictrueRealSize(207);
            btnUserIcon.Width = this.GetPictrueRealSize(207);
            btnUserIcon.Radius = (uint)this.GetPictrueRealSize(207) / 2;
            btnUserIcon.Y = Application.GetRealHeight(104);
            btnUserIcon.Gravity = Gravity.CenterHorizontal;
            btnUserIcon.UnSelectedImagePath = "Center/Admin.png";
            if (System.IO.File.Exists(iconPath) == true)
            {
                btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(iconPath);
            }
            else
            {
                btnUserIcon.ImagePath = "Center/Admin.png";
            }
            frame.AddChidren(btnUserIcon);
            //昵称
            var btnName = new NormalViewControl(frame.Width, Application.GetRealHeight(55), false);
            btnName.TextAlignment = TextAlignment.Center;
            btnName.Y = Application.GetRealHeight(334);
            btnName.TextColor = UserCenterColor.Current.TextColor2;
            btnName.TextSize = 16;
            btnName.Text = memberResult.UserName;
            btnName.IsBold = true;
            btnName.TextAlignment = TextAlignment.Center;
            btnName.Y = Application.GetRealHeight(334);
            btnName.TextColor = UserCenterColor.Current.TextColor2;
            btnName.TextSize = 16;
            btnName.Text = memberResult.UserName;
            if (string.IsNullOrEmpty(memberResult.UserName) == true)
            {
                btnName.Text = memberResult.Account;
@@ -79,51 +90,21 @@
            //权限
            var btnAuthority = new NormalViewControl(frame.Width, Application.GetRealHeight(50), false);
            btnAuthority.TextAlignment = TextAlignment.Center;
            btnAuthority.Y = Application.GetRealHeight(400);
            btnAuthority.TextColor = UserCenterColor.Current.TextGrayColor;
            btnAuthority.TextAlignment = TextAlignment.Center;
            btnAuthority.Y = Application.GetRealHeight(400);
            btnAuthority.TextColor = UserCenterColor.Current.TextGrayColor1;
            btnAuthority.TextID = R.MyInternationalizationString.uMember;
            btnAuthority.TextSize = 12;
            frame.AddChidren(btnAuthority);
            //家族成员添加成功
            var btnSuccess = new NormalViewControl(frame.Width, Application.GetRealHeight(82), false);
            btnSuccess.IsBold = true;
            btnSuccess.Y = Application.GetRealHeight(547);
            btnSuccess.TextAlignment = TextAlignment.Center;
            btnSuccess.TextID = R.MyInternationalizationString.uAddMemberSuccess;
            btnSuccess.TextSize = 20;
            frame.AddChidren(btnSuccess);
            //房间里面有设备才会显示共享设备菜单
            if (this.CheckIsCanShard() == true)
            {
                //配置共享内容
                var btnmsg = new NormalViewControl(frame.Width, Application.GetRealHeight(50), false);
                btnmsg.Y = Application.GetRealHeight(783);
                btnmsg.TextSize = 12;
                btnmsg.TextAlignment = TextAlignment.Center;
                btnmsg.TextColor = UserCenterColor.Current.TextOrangeColor;
                btnmsg.Text = Language.StringByID(R.MyInternationalizationString.uConfigureSharedContent);
                btnmsg.ButtonClickEvent += (sender, e) =>
                {
                    //先清空共享文件夹
                    HdlShardLogic.Current.ClearShardDirectory();
                    var memberInfo = new MemberShardInfoData();
                    var form = new SharedContent.ConfigureNewSharedListRoomForm();
                    this.AddFromAndRemoveNowForm(form, memberResult, memberInfo);
                };
                frame.AddChidren(btnmsg);
                //底线
                int lineWidth = btnmsg.GetRealWidthByText(12);
                var btnLine = new NormalViewControl(lineWidth, ControlCommonResourse.BottomLineHeight, false);
                btnLine.BackgroundColor = UserCenterColor.Current.TextOrangeColor;
                btnLine.Gravity = Gravity.CenterHorizontal;
                btnLine.Y = btnmsg.Bottom - Application.GetRealHeight(10);
                frame.AddChidren(btnLine);
            }
            //完成
            var btnFinish = new BottomClickButton(688);
@@ -132,28 +113,28 @@
            frame.AddChidren(btnFinish);
            btnFinish.ButtonClickEvent += (sender, e) =>
            {
                this.clearEvent = false;
                this.CloseForm();
                FormCloseEvent?.Invoke();
                FormCloseEvent = null;
            };
        }
        #endregion
        #region ■ 一般方法___________________________
        #region ■ 界面关闭___________________________
        /// <summary>
        /// 检测能否分享
        /// 界面关闭
        /// </summary>
        /// <returns></returns>
        private bool CheckIsCanShard()
        public override void CloseFormBefore()
        {
            //foreach (var room in Shared.Common.Room.Lists)
            //{
            //    if (room.DeviceUIList.Count > 0)
            //    {
            //        return true;
            //    }
            //}
            return false;
            if (clearEvent == true)
            {
                FormCloseEvent = null;
            }
            base.CloseFormBefore();
        }
        #endregion