using System;
|
using Shared;
|
using HDL_ON.UI.CSS;
|
|
namespace HDL_ON.UI
|
{
|
public partial class ResetPasswordOptionPage : FrameLayout
|
{
|
FrameLayout bodyView;
|
|
public ResetPasswordOptionPage()
|
{
|
bodyView = this;
|
}
|
|
public void LoadPage()
|
{
|
bodyView.BackgroundColor = CSS_Color.MainBackgroundColor;
|
new TopViewDiv(bodyView, Language.StringByID(StringId.ModifyPassword)).LoadTopView();
|
|
Button btnTip1 = new Button()
|
{
|
Y = Application.GetRealHeight(86),
|
Height = Application.GetRealHeight(29),
|
TextAlignment = TextAlignment.Center,
|
TextColor = CSS_Color.FirstLevelTitleColor,
|
TextSize = CSS_FontSize.SubheadingFontSize,
|
TextID = StringId.ModifyPasswordTip1,
|
};
|
bodyView.AddChidren(btnTip1);
|
|
Button btnTip2 = new Button()
|
{
|
Y = btnTip1.Bottom,
|
Height = Application.GetRealHeight(29),
|
TextAlignment = TextAlignment.Center,
|
TextColor = CSS_Color.FirstLevelTitleColor,
|
TextSize = CSS_FontSize.SubheadingFontSize,
|
TextID = StringId.ModifyPasswordTip2,
|
};
|
bodyView.AddChidren(btnTip2);
|
|
Button btnPhoneNumberOption = new Button()
|
{
|
Gravity = Gravity.CenterHorizontal,
|
Y = Application.GetRealWidth(226),
|
Width = Application.GetRealWidth(220),
|
Height = Application.GetRealWidth(44),
|
TextAlignment = TextAlignment.Center,
|
Radius = (uint)Application.GetRealWidth(22),
|
BackgroundColor = CSS_Color.MainColor,
|
TextID = StringId.PhoneNumberVerification,
|
TextSize = CSS_FontSize.SubheadingFontSize,
|
TextColor = CSS_Color.MainBackgroundColor,
|
};
|
bodyView.AddChidren(btnPhoneNumberOption);
|
|
Button btnEmailOption = new Button()
|
{
|
Gravity = Gravity.CenterHorizontal,
|
TextAlignment = TextAlignment.Center,
|
Y = btnPhoneNumberOption.Bottom,
|
Radius = (uint)Application.GetRealWidth(22),
|
Width = Application.GetRealWidth(220),
|
Height = Application.GetRealWidth(64),
|
TextID = StringId.EmailVerification,
|
TextSize = CSS_FontSize.TextFontSize,
|
TextColor = CSS_Color.MainColor,
|
};
|
bodyView.AddChidren(btnEmailOption);
|
|
btnPhoneNumberOption.MouseUpEventHandler = (sender, e) =>
|
{
|
LoadMethod_OptionVerification(0);
|
};
|
|
btnEmailOption.MouseUpEventHandler = (sender, e) =>
|
{
|
LoadMethod_OptionVerification(1);
|
};
|
}
|
}
|
|
//------------------------------------------------------------------------------------
|
|
public partial class ResetPasswordOptionPage
|
{
|
/// <summary>
|
///
|
/// </summary>
|
/// <param name="verificationOption">验证类型0:手机,1:邮箱</param>
|
void LoadMethod_OptionVerification(int verificationOption)
|
{
|
if (verificationOption == 0)
|
{
|
if (string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo))
|
{
|
LoadDialog_UnbindTipInfo(verificationOption);
|
}
|
else
|
{
|
this.RemoveFromParent();
|
var vcp = new ResetPasswordVerificationCodePage();
|
MainPage.BasePageView.AddChidren(vcp);
|
vcp.LoadPage(StringId.PhoneNumberVerification,2);
|
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
|
}
|
}
|
else
|
{
|
if (string.IsNullOrEmpty(MainPage.LoginUser.userEmailInfo))
|
{
|
LoadDialog_UnbindTipInfo(verificationOption);
|
}
|
else
|
{
|
this.RemoveFromParent();
|
var vcp = new ResetPasswordVerificationCodePage();
|
MainPage.BasePageView.AddChidren(vcp);
|
vcp.LoadPage(StringId.EmailVerification,1);
|
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
|
}
|
}
|
}
|
/// <summary>
|
/// 没有绑定手机/邮箱提示
|
/// </summary>
|
/// <param name="verificationOption">验证类型0:手机,1:邮箱</param>
|
void LoadDialog_UnbindTipInfo(int verificationOption)
|
{
|
Dialog dialog = new Dialog();
|
|
FrameLayout dialogView = new FrameLayout();
|
dialogView.MouseUpEventHandler = (sender, e) => {
|
dialog.Close();
|
};
|
|
Button btnTitleIcon = new Button()
|
{
|
X = Application.GetRealWidth(108),
|
Y = Application.GetRealWidth(152),
|
Width = Application.GetRealWidth(160),
|
Height = Application.GetRealWidth(160),
|
UnSelectedImagePath = "PersonalCenter/ResetPassword/DialogTipTitleIcon.png"
|
};
|
dialogView.AddChidren(btnTitleIcon);
|
|
FrameLayout contentView = new FrameLayout()
|
{
|
Gravity = Gravity.CenterHorizontal,
|
Y = Application.GetRealWidth(223),
|
Width = Application.GetRealWidth(288),
|
Height = Application.GetRealWidth(245),
|
Radius = (uint)Application.GetRealWidth(6),
|
BackgroundColor = CSS_Color.MainBackgroundColor,
|
};
|
dialogView.AddChidren(contentView);
|
|
Button btnMsg = new Button()
|
{
|
Gravity = Gravity.CenterHorizontal,
|
Y = Application.GetRealWidth(79),
|
Width = Application.GetRealWidth(220),
|
Height = Application.GetRealWidth(62),
|
TextColor = CSS_Color.MainColor,
|
TextSize = CSS_FontSize.SubheadingFontSize,
|
TextID = verificationOption == 0?StringId.UnBindPhoneNumberCannotVerification: StringId.UnBindEmailCannotVerification,
|
};
|
contentView.AddChidren(btnMsg);
|
|
Button btnSkipBindPage = new Button()
|
{
|
Gravity = Gravity.CenterHorizontal,
|
Y = Application.GetRealWidth(169),
|
Width = Application.GetRealWidth(220),
|
Height = Application.GetRealWidth(44),
|
TextAlignment = TextAlignment.Center,
|
Radius = (uint)Application.GetRealWidth(22),
|
BackgroundColor = CSS_Color.MainColor,
|
TextID = StringId.PhoneNumberVerification,
|
TextSize = CSS_FontSize.SubheadingFontSize,
|
TextColor = CSS_Color.MainBackgroundColor,
|
};
|
contentView.AddChidren(btnSkipBindPage);
|
|
btnSkipBindPage.MouseUpEventHandler = (sender, e) =>
|
{
|
dialog.Close();
|
Action<string> action = (obj) => { };
|
var vcp = new BindAccountPage();
|
MainPage.BasePageView.AddChidren(vcp);
|
vcp.LoadPage(action, verificationOption == 0 ? StringId.BindPhone : StringId.BindEmail);
|
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
|
};
|
|
dialog.Show();
|
}
|
|
}
|
}
|