tzy
2021-05-25 65bcedda4d8e3ff6500dbf59a4e607d96e469375
HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs
@@ -1,68 +1,124 @@
using System;
using Shared;
using HDL_ON.UI.CSS;
using HDL_ON.Stan;
namespace HDL_ON.UI
{
    /// <summary>
    /// 过户账号确认界面
    /// 个人资料
    /// 过户账号个人资料确认界面
    /// </summary>
    public class TransferUserConfirmPage : FrameLayout
    public class TransferUserConfirmPage : EditorCommonForm
    {
        /// <summary>
        ///
        /// </summary>
        FrameLayout bodyView;
        #region ■ 变量声明___________________________
        public TransferUserConfirmPage()
        /// <summary>
        /// 账号信息
        /// </summary>
        private AccountInfoResult accountInfo = null;
        #endregion
        #region ■ 初始化_____________________________
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
        /// <param name="i_accountInfo"></param>
        public void ShowForm(AccountInfoResult i_accountInfo)
        {
            bodyView = this;
            this.accountInfo = i_accountInfo;
            //个人资料
            base.SetTitleText(Language.StringByID(StringId.Profile));
            //初始化中部信息
            this.InitMiddleFrame();
        }
        /// <summary>
        ///
        /// 初始化中部信息
        /// </summary>
        public void LoadPage()
        private void InitMiddleFrame()
        {
            BackgroundColor = CSS_Color.BackgroundColor;
            //清空bodyFrame
            this.ClearBodyFrame();
            new TopViewDiv(bodyView, "个人资料").LoadTopView();
            //上部的白色背景
            var frameBack1 = new FrameLayout();
            frameBack1.BackgroundColor = CSS_Color.MainBackgroundColor;
            frameBack1.Height = Application.GetRealHeight(204);
            bodyFrameLayout.AddChidren(frameBack1);
            var headView = new FrameLayout()
            //头像
            var btnHeadImage = new ImageView();
            btnHeadImage.Y = Application.GetRealHeight(32);
            btnHeadImage.Gravity = Gravity.CenterHorizontal;
            btnHeadImage.Width = Application.GetRealWidth(84);
            btnHeadImage.Height = Application.GetRealWidth(84);
            btnHeadImage.Radius = (uint)Application.GetRealWidth(42);
            btnHeadImage.ImagePath = "LoginIcon/2.png";
            frameBack1.AddChidren(btnHeadImage);
            //昵称
            var btnName = new NormalViewControl(frameBack1.Width - HdlControlResourse.XXLeft * 2, Application.GetRealHeight(24), false);
            btnName.Y = btnHeadImage.Bottom + Application.GetRealHeight(11);
            btnName.Gravity = Gravity.CenterHorizontal;
            btnName.IsBold = true;
            btnName.TextSize = CSS_FontSize.SubheadingFontSize;
            btnName.TextColor = CSS_Color.FirstLevelTitleColor;
            btnName.Text = accountInfo.MemberName;
            btnName.TextAlignment = TextAlignment.Center;
            frameBack1.AddChidren(btnName);
            //账号
            var btnAccount = new NormalViewControl(frameBack1.Width - HdlControlResourse.XXLeft * 2, Application.GetRealHeight(16), false);
            btnAccount.Y = btnName.Bottom + Application.GetRealHeight(7);
            btnAccount.Gravity = Gravity.CenterHorizontal;
            btnAccount.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
            btnAccount.TextAlignment = TextAlignment.Center;
            btnAccount.Text = accountInfo.Account;
            frameBack1.AddChidren(btnAccount);
            //确认的白色背景
            var frameBack2 = new FrameLayout();
            frameBack2.Y = frameBack1.Bottom + Application.GetRealHeight(8);
            frameBack2.Height = Application.GetRealHeight(50);
            frameBack2.BackgroundColor = CSS_Color.MainBackgroundColor;
            bodyFrameLayout.AddChidren(frameBack2);
            //确认过户
            var btnConform = new NormalViewControl(200, 24, true);
            btnConform.Gravity = Gravity.Center;
            btnConform.TextSize = CSS_FontSize.SubheadingFontSize;
            btnConform.TextAlignment = TextAlignment.Center;
            btnConform.TextColor = CSS_Color.MainColor;
            btnConform.TextID = StringId.ConfirmTransferre;
            frameBack2.AddChidren(btnConform);
            btnConform.ButtonClickEvent += (sender, e) =>
            {
                Y = Application.GetRealHeight(64),
                Height = Application.GetRealHeight(204),
                BackgroundColor = CSS_Color.MainBackgroundColor,
                //如果设置有安全验证,则需要验证
                HdlCheckLogic.Current.CheckUnlockSecurity(true, (div) =>
                {
                    var form = new TransferingResidenceForm();
                    form.AddForm(this.accountInfo);
                });
            };
            bodyView.AddChidren(headView);
            ImageView myHeadImage = new ImageView()
            HdlThreadLogic.Current.RunThread(() =>
            {
                Y = Application.GetRealHeight(32),
                Width = Application.GetRealWidth(84),
                Height = Application.GetRealWidth(84),
                Radius = (uint)Application.GetRealWidth(42),
                ImagePath = UserInfo.Current.headImagePagePath,
                Gravity = Gravity.CenterHorizontal,
            };
            headView.AddChidren(myHeadImage);
            var btnConfirm = new Button()
            {
                Y = headView.Bottom + Application.GetRealHeight(8),
                Height = Application.GetRealHeight(50),
                TextAlignment = TextAlignment.Center,
                TextColor = CSS_Color.MainColor,
                TextSize = CSS_FontSize.SubheadingFontSize,
                BackgroundColor = CSS_Color.MainBackgroundColor,
                Text = "确认过户"
            };
            bodyView.AddChidren(btnConfirm);
                //用线程去下载头像
                var headImageBytes = ImageUtlis.Current.DownHeadImageByImageKey(this.accountInfo.MemberHeadIcon, true);
                if (headImageBytes != null && headImageBytes.Length > 0)
                {
                    HdlThreadLogic.Current.RunMain(() =>
                    {
                        btnHeadImage.ImageBytes = headImageBytes;
                    }, ShowErrorMode.NO);
                }
            });
        }
        #endregion
    }
}