using System;
using Shared;
using HDL_ON.UI.CSS;
using HDL_ON.Stan;
namespace HDL_ON.UI
{
///
/// 过户账号个人资料确认界面
///
public class TransferUserConfirmPage : EditorCommonForm
{
#region ■ 变量声明___________________________
///
/// 账号信息
///
private AccountInfoResult accountInfo = null;
#endregion
#region ■ 初始化_____________________________
///
/// 画面显示(底层会固定调用此方法,借以完成画面创建)
///
///
public void ShowForm(AccountInfoResult i_accountInfo)
{
this.accountInfo = i_accountInfo;
//个人资料
base.SetTitleText(Language.StringByID(StringId.Profile));
//初始化中部信息
this.InitMiddleFrame();
}
///
/// 初始化中部信息
///
private void InitMiddleFrame()
{
//清空bodyFrame
this.ClearBodyFrame();
//上部的白色背景
var frameBack1 = new FrameLayout();
frameBack1.BackgroundColor = CSS_Color.MainBackgroundColor;
frameBack1.Height = Application.GetRealHeight(204);
bodyFrameLayout.AddChidren(frameBack1);
//头像
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) =>
{
//如果设置有安全验证,则需要验证
HdlCheckLogic.Current.CheckUnlockSecurity(true, (div) =>
{
var form = new TransferingResidenceForm();
form.AddForm(this.accountInfo);
});
};
HdlThreadLogic.Current.RunThread(() =>
{
//用线程去下载头像
var headImageBytes = ImageUtlis.Current.DownHeadImageByImageKey(this.accountInfo.MemberHeadIcon, true);
if (headImageBytes != null && headImageBytes.Length > 0)
{
HdlThreadLogic.Current.RunMain(() =>
{
btnHeadImage.ImageBytes = headImageBytes;
}, ShowErrorMode.NO);
}
});
}
#endregion
}
}