using System;
using Shared;
using HDL_ON.UI.CSS;
using HDL_ON.Stan;
using System.Collections.Generic;
namespace HDL_ON.UI
{
///
/// 过户结果界面
///
public class TransferResidenceResultPage : EditorCommonForm
{
#region ■ 变量声明___________________________
///
/// 结束事件
///
public Action FinishEvent = null;
#endregion
#region ■ 初始化_____________________________
///
/// 画面显示(底层会固定调用此方法,借以完成画面创建)
///
/// 用户对象信息
/// 是否成功
public void ShowForm(AccountInfoResult i_accountInfo, bool i_success)
{
this.ScrollLeftEnabled = false;
//过户
base.SetTitleText(Language.StringByID(StringId.Transfer));
//初始化中部信息
this.InitMiddleFrame(i_accountInfo, i_success);
//移除返回键
base.RemoveBackButton();
}
///
/// 初始化中部信息
///
/// 用户对象信息
/// 是否成功
private void InitMiddleFrame(AccountInfoResult i_accountInfo, bool i_success)
{
//清空bodyFrame
this.ClearBodyFrame();
//图片
var btnPictrue = new PicViewControl(180, 180);
btnPictrue.Y = Application.GetRealHeight(32);
btnPictrue.Gravity = Gravity.CenterHorizontal;
btnPictrue.UnSelectedImagePath = i_success == true ? "Public/TipIcon_Successfully.png" : "Public/TipIcon_Failed.png";
bodyFrameLayout.AddChidren(btnPictrue);
List listContr = null;
if (i_success == true)
{
//用户{0}已经成为住宅行管理员
string strMsg = Language.StringByID(StringId.CongratulationsXXBecomingNNAdministrator).Replace("{0}", i_accountInfo.MemberName);
listContr = this.AddListMsgControls(bodyFrameLayout, strMsg, CSS_FontSize.SubheadingFontSize, CSS_Color.MainColor, Application.GetRealHeight(24),
btnPictrue.Bottom + Application.GetRealHeight(16));
//该住宅的信息将在您的账号中删除
var btnMsg2 = new NormalViewControl(bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2, Application.GetRealHeight(18), false);
btnMsg2.Y = listContr[listContr.Count - 1].Bottom + Application.GetRealHeight(8);
btnMsg2.TextAlignment = TextAlignment.Center;
btnMsg2.Gravity = Gravity.CenterHorizontal;
btnMsg2.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
btnMsg2.TextID = StringId.ResidenceDataWillBeDeletedFromYourAccount;
bodyFrameLayout.AddChidren(btnMsg2);
}
else
{
//过户失败
string strMsg = Language.StringByID(StringId.TransferFail);
listContr = this.AddListMsgControls(bodyFrameLayout, strMsg, CSS_FontSize.SubheadingFontSize, CSS_Color.AuxiliaryColor2, Application.GetRealHeight(24),
btnPictrue.Bottom + Application.GetRealHeight(16));
//请重新尝试
var btnMsg2 = new NormalViewControl(bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2, Application.GetRealHeight(18), false);
btnMsg2.Y = listContr[listContr.Count - 1].Bottom + Application.GetRealHeight(8);
btnMsg2.TextAlignment = TextAlignment.Center;
btnMsg2.Gravity = Gravity.CenterHorizontal;
btnMsg2.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
btnMsg2.TextID = StringId.PleaseTryAgain;
bodyFrameLayout.AddChidren(btnMsg2);
}
//完成
var btnConfirm = new BottomClickButton(220);
btnConfirm.Y = Application.GetRealHeight(337);
btnConfirm.TextID = i_success == true ? StringId.Complete : StringId.Retry;
bodyFrameLayout.AddChidren(btnConfirm);
btnConfirm.ButtonClickEvent += (sender, e) =>
{
this.CloseForm();
//回调函数
this.FinishEvent?.Invoke();
this.FinishEvent = null;
};
}
#endregion
}
}