JLChen
2020-11-24 4c17caa61bc3b0a05a2b303bccdfedfbf3853f6d
HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs
@@ -21,7 +21,6 @@
        /// </summary>
        ImageView userHeadImageView;
        #region 图标选择部分图标
        /// <summary>
        /// 背景图选项区域
@@ -44,8 +43,6 @@
        /// </summary>
        Button btnCancel;
        #endregion
        #region 个人信息选项区域
        /// <summary>
@@ -146,6 +143,7 @@
        Button btnResetPasswordRight;
        #endregion
        #endregion
        #endregion
        #region 解锁设置区域
@@ -173,7 +171,7 @@
        /// </summary>
        Action updataUserName;
        public PersonalDataPage(Action upHeadImage,Action upUserName)
        public PersonalDataPage(Action upHeadImage, Action upUserName)
        {
            updataHeadImage = upHeadImage;
            updataUserName = upUserName;
@@ -199,7 +197,7 @@
                Width = Application.GetMinRealAverage(84),
                Height = Application.GetMinRealAverage(84),
                Radius = (uint)Application.GetMinRealAverage(42),
                ImagePath = MainPage.LoginUser.headImagePagePath,
                ImagePath =  UserInfo.Current.headImagePagePath,
            };
            headPortraitView.AddChidren(userHeadImageView);
@@ -247,7 +245,7 @@
                TextAlignment = TextAlignment.CenterRight,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.TextFontSize,
                Text = string.IsNullOrEmpty(MainPage.LoginUser.userName) ? "不愿意透露姓名的用户" : MainPage.LoginUser.userName
                Text = string.IsNullOrEmpty( UserInfo.Current.userName) ? Language.StringByID(StringId.UsersWhoNameIsEmpty) :  UserInfo.Current.userName
            };
            userNameView.AddChidren(btnUserName);
            /// <summary>
@@ -344,7 +342,7 @@
                TextAlignment = TextAlignment.CenterRight,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.TextFontSize,
                Text = string.IsNullOrEmpty(MainPage.LoginUser.userEmailInfo) ? Language.StringByID(StringId.Unbound) : MainPage.LoginUser.userEmailInfo
                Text = GetBindAccountText( UserInfo.Current.userEmailInfo)
            };
            userEmailInfoView.AddChidren(btnUserEmailInfo);
            /// <summary>
@@ -393,7 +391,7 @@
                TextAlignment = TextAlignment.CenterRight,
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.TextFontSize,
                Text = string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo) ? Language.StringByID(StringId.Unbound) : MainPage.LoginUser.userMobileInfo
                Text = GetBindAccountText( UserInfo.Current.userMobileInfo)
            };
            userPhoneInfoView.AddChidren(btnUserPhoneInfo);
            /// <summary>
@@ -534,51 +532,49 @@
            };
            bodyView.AddChidren(btnLogout);
            if(MainPage.Increase)
            if (MainPage.Increase)
            {
                btnLogout.Y = Application.GetRealHeight(613);
                btnLogout.Height = Application.GetRealHeight(50);
                bodyView.AddChidren(new Button() { Y = Application.GetRealHeight(663), Height = Application.GetRealHeight(20), BackgroundColor = CSS_Color.MainBackgroundColor });
            }
            LoadEventList();
        }
        /// <summary>
        /// 加载图标选择选项
        /// </summary>
        void LoadPictureOptionView()
        {
            pictureOptionView = new FrameLayout()
            var pictureBaseView = new FrameLayout()
            {
                BackgroundColor = CSS_Color.DialogTransparentColor1,
            };
            bodyView.AddChidren(pictureOptionView);
            bodyView.AddChidren(pictureBaseView);
            pictureOptionView = new FrameLayout()
            {
                Y = Application.GetRealHeight(495),
                AnimateSpeed = 0.3f,
                Animate = Animate.DownToUp,
                Height = Application.GetRealHeight(200),
            };
            pictureBaseView.AddChidren(pictureOptionView);
            optionView = new VerticalScrolViewLayout()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(495),
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(100),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Radius = (uint)Application.GetRealWidth(12),
                Animate = Animate.DownToUp,
                ScrollEnabled = false,
            };
            pictureOptionView.AddChidren(optionView);
            //btnDefaultGallery = new Button()
            //{
            //    Height = Application.GetRealHeight(50),
            //    TextAlignment = TextAlignment.Center,
            //    TextColor = CSS_Color.TextualColor,
            //    SelectedTextColor = CSS_Color.MainColor,
            //    TextSize = CSS_FontSize.SubheadingFontSize,
            //    TextID = StringId.DefaultGallery,
            //};
            //optionView.AddChidren(btnDefaultGallery);
            //optionView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor });
            btnTakePicture = new Button()
            {
@@ -613,16 +609,33 @@
                Width = Application.GetRealWidth(343),
                Height = Application.GetRealHeight(50),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Radius = (uint)Application.GetRealWidth(6),
                Radius = (uint)Application.GetRealWidth(12),
                TextID = StringId.Cancel,
                TextColor = CSS_Color.WarningColor,
                Animate = Animate.DownToUp
                TextSize = CSS_FontSize.SubheadingFontSize,
            };
            pictureOptionView.AddChidren(btnCancel);
            LoadEvent_PictureOptionViewEventList();
            LoadEvent_PictureOptionViewEventList(pictureBaseView);
        }
        /// <summary>
        /// 获取绑定账号显示文本,空的时候显示为未绑定
        /// </summary>
        /// <param name="account"></param>
        string GetBindAccountText(string account)
        {
            return string.IsNullOrEmpty(account) ? Language.StringByID(StringId.Unbound) : account;
        }
        /// <summary>
        /// 判断是否为未绑定
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        bool CheckIfUnbound(string account)
        {
            return string.IsNullOrEmpty(account) || account == Language.StringByID(StringId.Unbound);
        }
    }
}