New file |
| | |
| | | using System; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI.UI1Login |
| | | { |
| | | public partial class ForgetPasswordPage : Dialog |
| | | { |
| | | #region 控件列表 |
| | | /// <summary> |
| | | /// 等待提示 |
| | | /// </summary> |
| | | Loading waitPage; |
| | | /// <summary> |
| | | /// 当前界面 |
| | | /// </summary> |
| | | FrameLayout bodyView; |
| | | /// <summary> |
| | | /// 选择手机登录按钮 |
| | | /// </summary> |
| | | Button btnPhoneLogin; |
| | | /// <summary> |
| | | /// 选择邮箱登录按钮 |
| | | /// </summary> |
| | | Button btnEmailLogin; |
| | | /// <summary> |
| | | /// 账号子区域 |
| | | /// </summary> |
| | | FrameLayout accountView; |
| | | /// <summary> |
| | | /// 国际区号按钮 |
| | | /// </summary> |
| | | Button btnGlobalRoaming; |
| | | /// <summary> |
| | | /// 账号子区域里面的分割线 |
| | | /// </summary> |
| | | Button btnDividingLineVertical_AccountView; |
| | | /// <summary> |
| | | /// 账号文本框 |
| | | /// </summary> |
| | | EditText etAccount; |
| | | /// <summary> |
| | | /// 账号Icon按钮 |
| | | /// </summary> |
| | | Button btnAccountIcon; |
| | | /// <summary> |
| | | /// 账号子区域底部横线 |
| | | /// </summary> |
| | | Button btnAccountViewBottomLine; |
| | | /// <summary> |
| | | /// 密码子区域 |
| | | /// </summary> |
| | | FrameLayout passwordView; |
| | | /// <summary> |
| | | /// 密码Icon按钮 |
| | | /// </summary> |
| | | Button btnPasswordIcon; |
| | | /// <summary> |
| | | /// 密码文本框 |
| | | /// </summary> |
| | | EditText etPassword; |
| | | /// <summary> |
| | | /// 密码子区域里面的分割线1 |
| | | /// </summary> |
| | | Button btnDividingLineVertical_PasswordView1; |
| | | /// <summary> |
| | | /// 密码是否可见按钮 |
| | | /// </summary> |
| | | Button btnVisiblePassword; |
| | | /// <summary> |
| | | /// 密码子区域底部横线 |
| | | /// </summary> |
| | | Button btnPasswordViewBottomLine; |
| | | |
| | | /// <summary> |
| | | /// 确认密码子区域 |
| | | /// </summary> |
| | | FrameLayout repeatPasswordView; |
| | | /// <summary> |
| | | /// 确认密码Icon按钮 |
| | | /// </summary> |
| | | Button btnRepeatPasswordIcon; |
| | | /// <summary> |
| | | /// 确认密码文本框 |
| | | /// </summary> |
| | | EditText etRepeatPassword; |
| | | /// <summary> |
| | | /// 确认密码子区域里面的分割线1 |
| | | /// </summary> |
| | | Button btnRepeatDividingLineVertical_PasswordView1; |
| | | /// <summary> |
| | | /// 确认密码是否可见按钮 |
| | | /// </summary> |
| | | Button btnRepeatVisiblePassword; |
| | | /// <summary> |
| | | /// 确认密码子区域底部横线 |
| | | /// </summary> |
| | | Button btnRepeatPasswordViewBottomLine; |
| | | /// <summary> |
| | | /// 验证码子区域 |
| | | /// </summary> |
| | | FrameLayout verificationCodeView; |
| | | /// <summary> |
| | | /// 验证码图标 |
| | | /// </summary> |
| | | Button btnVerificationCodeIcon; |
| | | /// <summary> |
| | | /// 验证码子区域分割线 |
| | | /// </summary> |
| | | Button btnDividingLineVertical_VerificationCodeView1; |
| | | /// <summary> |
| | | /// 验证码文本输入框 |
| | | /// </summary> |
| | | EditText etVerificationCode; |
| | | /// <summary> |
| | | /// 获取验证码按钮 |
| | | /// </summary> |
| | | Button btnGetVerificationCode_Phone; |
| | | /// <summary> |
| | | /// 获取验证码按钮 |
| | | /// </summary> |
| | | Button btnGetVerificationCode_Mail; |
| | | /// <summary> |
| | | /// 验证码子区域底部分割线 |
| | | /// </summary> |
| | | Button btnVerificationCodeViewBottomLine; |
| | | /// <summary> |
| | | /// 修改按钮 |
| | | /// </summary> |
| | | Button btnReset; |
| | | |
| | | #endregion |
| | | |
| | | #region 局部变量列表 |
| | | /// <summary> |
| | | /// 账号类型 |
| | | /// 0:手机 |
| | | /// 1:邮箱 |
| | | /// </summary> |
| | | int accountType = 0; |
| | | /// <summary> |
| | | /// 服务器请求对象 |
| | | /// </summary> |
| | | HttpServerRequest pm; |
| | | /// <summary> |
| | | /// 回调事件 |
| | | /// 账号,密码,是否手机 |
| | | /// account,password,isPhone |
| | | /// </summary> |
| | | Action<string, string, bool> AutoLoginAction; |
| | | /// <summary> |
| | | /// 修改类型 |
| | | /// 0:手机 |
| | | /// 1:邮箱 |
| | | /// </summary> |
| | | int registerType; |
| | | /// <summary> |
| | | /// 手机区号 |
| | | /// </summary> |
| | | string phoneZoneCode = "86"; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | string registerPhone; |
| | | string registerEmail; |
| | | /// <summary> |
| | | /// 是否点击了返回,用于屏蔽EditText失去焦点检测事件 |
| | | /// </summary> |
| | | bool isHitBack; |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="autoLoginAction">自动登录回调事件</param> |
| | | public ForgetPasswordPage(Action<string, string, bool> autoLoginAction) |
| | | { |
| | | AutoLoginAction = autoLoginAction; |
| | | bodyView = new FrameLayout() |
| | | { |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | AddChidren(bodyView); |
| | | //2020-12-22 增加点击隐藏键盘事件 |
| | | bodyView.MouseDownEventHandler += (sender, e) => { |
| | | Application.HideSoftInput(); |
| | | }; |
| | | |
| | | pm = new HttpServerRequest(); |
| | | } |
| | | |
| | | public void ShowDialog() |
| | | { |
| | | Action backAction = () => |
| | | { |
| | | isHitBack = true; |
| | | //2020-12-22 增加点击隐藏键盘事件 |
| | | Application.HideSoftInput(); |
| | | |
| | | }; |
| | | new TopViewDiv(this, bodyView, Language.StringByID(StringId.ModifyPassword)).LoadTopView(backAction); |
| | | //new PublicAssmebly().LoadTopView(this, bodyView, Language.StringByID(StringId.ForgetPassword)); |
| | | |
| | | #region 修改方式选择 |
| | | btnPhoneLogin = new Button() |
| | | { |
| | | X = Application.GetRealWidth(28), |
| | | Y = Application.GetRealHeight(112), |
| | | Width = Application.GetRealWidth(120), |
| | | Height = Application.GetRealHeight(40), |
| | | TextID = StringId.PhoneNumberAccount, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_Secondary, |
| | | }; |
| | | bodyView.AddChidren(btnPhoneLogin); |
| | | |
| | | btnEmailLogin = new Button() |
| | | { |
| | | X = btnPhoneLogin.Right, |
| | | Y = Application.GetRealHeight(112), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealHeight(40), |
| | | TextID = StringId.EmailAccount, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | bodyView.AddChidren(btnEmailLogin); |
| | | |
| | | bodyView.AddChidren(btnEmailLogin); |
| | | if (Language.CurrentLanguage != "Chinese") |
| | | { |
| | | btnPhoneLogin.Width = Application.GetRealWidth(180); |
| | | btnEmailLogin.Width = Application.GetRealWidth(180); |
| | | } |
| | | #endregion |
| | | |
| | | #region 账号填写 |
| | | accountView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(28), |
| | | Y = Application.GetRealHeight(167), |
| | | Width = Application.GetRealWidth(319), |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | bodyView.AddChidren(accountView); |
| | | |
| | | btnGlobalRoaming = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(57), |
| | | X = Application.GetRealWidth(9), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = "+" + phoneZoneCode, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | |
| | | //跳转国家区号选择界面 |
| | | EventHandler<MouseEventArgs> eHandler = (sender, e) => { |
| | | JLCountrycode.CountryCodeView.Current.Show((countryName, code) => { |
| | | if (!string.IsNullOrEmpty(code)) |
| | | { |
| | | phoneZoneCode = code; |
| | | btnGlobalRoaming.Text = "+" + phoneZoneCode; |
| | | } |
| | | }); |
| | | }; |
| | | btnGlobalRoaming.MouseUpEventHandler += eHandler; |
| | | |
| | | if (accountType == 0) |
| | | { |
| | | accountView.AddChidren(btnGlobalRoaming); |
| | | } |
| | | |
| | | etAccount = new EditText() |
| | | { |
| | | X = Application.GetRealWidth(49), |
| | | Width = Application.GetRealWidth(319 - 78), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | PlaceholderTextColor = CSS_Color.PromptingColor1, |
| | | PlaceholderText = Language.StringByID(StringId.PlsEntryPhoneNumber), |
| | | IsNumberKeyboardType = true |
| | | }; |
| | | accountView.AddChidren(etAccount); |
| | | |
| | | btnAccountViewBottomLine = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(42), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | Height = Application.GetRealHeight(1), |
| | | }; |
| | | accountView.AddChidren(btnAccountViewBottomLine); |
| | | |
| | | btnAccountIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(9), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(20), |
| | | Height = Application.GetMinRealAverage(20), |
| | | UnSelectedImagePath = "LoginIcon/AccountIcon.png", |
| | | }; |
| | | if (accountType == 1) |
| | | { |
| | | accountView.AddChidren(btnAccountIcon); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region 验证码填写 |
| | | verificationCodeView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(28), |
| | | Y = Application.GetRealHeight(223), |
| | | Width = Application.GetRealWidth(319), |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | bodyView.AddChidren(verificationCodeView); |
| | | |
| | | btnVerificationCodeIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(9), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(20), |
| | | Height = Application.GetMinRealAverage(20), |
| | | UnSelectedImagePath = "LoginIcon/VerificationCodeIcon.png", |
| | | }; |
| | | verificationCodeView.AddChidren(btnVerificationCodeIcon); |
| | | |
| | | //btnDividingLineVertical_VerificationCodeView1 = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(65), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = 1, |
| | | // Height = Application.GetRealHeight(20), |
| | | // BackgroundColor = CSS_Color.DividingLineColor, |
| | | //}; |
| | | //verificationCodeView.AddChidren(btnDividingLineVertical_VerificationCodeView1); |
| | | |
| | | etVerificationCode = new EditText() |
| | | { |
| | | X = Application.GetRealWidth(49), |
| | | Width = Application.GetRealWidth(61 + 84), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | PlaceholderTextColor = CSS_Color.PromptingColor1, |
| | | PlaceholderText = Language.StringByID(StringId.PlsEntryVerificationCode), |
| | | IsNumberKeyboardType = true |
| | | }; |
| | | verificationCodeView.AddChidren(etVerificationCode); |
| | | |
| | | btnGetVerificationCode_Phone = new Button() |
| | | { |
| | | X = Application.GetRealWidth(219), |
| | | Width = Application.GetRealWidth(100), |
| | | TextID = StringId.GetVerificationCode, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | verificationCodeView.AddChidren(btnGetVerificationCode_Phone); |
| | | |
| | | btnGetVerificationCode_Mail = new Button() |
| | | { |
| | | X = Application.GetRealWidth(219), |
| | | Width = Application.GetRealWidth(100), |
| | | TextID = StringId.GetVerificationCode, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Visible = false |
| | | }; |
| | | verificationCodeView.AddChidren(btnGetVerificationCode_Mail); |
| | | |
| | | btnVerificationCodeViewBottomLine = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(42), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | SelectedBackgroundColor = CSS_Color.MainColor, |
| | | Height = Application.GetRealHeight(1), |
| | | }; |
| | | verificationCodeView.AddChidren(btnVerificationCodeViewBottomLine); |
| | | |
| | | #endregion |
| | | |
| | | #region 密码填写 |
| | | passwordView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(28), |
| | | Y = Application.GetRealHeight(279), |
| | | Width = Application.GetRealWidth(319), |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | bodyView.AddChidren(passwordView); |
| | | |
| | | btnPasswordIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(9), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(20), |
| | | Height = Application.GetMinRealAverage(20), |
| | | UnSelectedImagePath = "LoginIcon/PasswordIcon.png", |
| | | |
| | | }; |
| | | passwordView.AddChidren(btnPasswordIcon); |
| | | //btnDividingLineVertical_PasswordView1 = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(65), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = 1, |
| | | // Height = Application.GetRealHeight(20), |
| | | // BackgroundColor = CSS_Color.DividingLineColor, |
| | | //}; |
| | | //passwordView.AddChidren(btnDividingLineVertical_PasswordView1); |
| | | |
| | | etPassword = new EditText() |
| | | { |
| | | X = Application.GetRealWidth(49), |
| | | Width = Application.GetRealWidth(319 - 78), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | PlaceholderTextColor = CSS_Color.PromptingColor1, |
| | | PlaceholderText = Language.StringByID(StringId.PlsRegisterPassword), |
| | | SecureTextEntry = true, |
| | | }; |
| | | passwordView.AddChidren(etPassword); |
| | | |
| | | #region 密码登录-控件加载 |
| | | btnVisiblePassword = new Button() |
| | | { |
| | | X = Application.GetRealWidth(295), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(20), |
| | | Height = Application.GetMinRealAverage(20), |
| | | UnSelectedImagePath = "LoginIcon/HidePasswordIcon.png", |
| | | SelectedImagePath = "LoginIcon/ShowPasswordIcon.png", |
| | | }; |
| | | passwordView.AddChidren(btnVisiblePassword); |
| | | |
| | | #endregion |
| | | btnPasswordViewBottomLine = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(42), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | SelectedBackgroundColor = CSS_Color.MainColor, |
| | | Height = Application.GetRealHeight(1), |
| | | }; |
| | | passwordView.AddChidren(btnPasswordViewBottomLine); |
| | | #endregion |
| | | |
| | | #region 确认密码填写 |
| | | repeatPasswordView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(28), |
| | | Y = Application.GetRealHeight(335), |
| | | Width = Application.GetRealWidth(335), |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | bodyView.AddChidren(repeatPasswordView); |
| | | |
| | | btnRepeatPasswordIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(9), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(20), |
| | | Height = Application.GetMinRealAverage(20), |
| | | UnSelectedImagePath = "LoginIcon/PasswordIcon.png", |
| | | |
| | | }; |
| | | repeatPasswordView.AddChidren(btnRepeatPasswordIcon); |
| | | //btnRepeatDividingLineVertical_PasswordView1 = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(65), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = 1, |
| | | // Height = Application.GetRealHeight(20), |
| | | // BackgroundColor = CSS_Color.DividingLineColor, |
| | | //}; |
| | | //repeatPasswordView.AddChidren(btnRepeatDividingLineVertical_PasswordView1); |
| | | |
| | | etRepeatPassword = new EditText() |
| | | { |
| | | X = Application.GetRealWidth(49), |
| | | Width = Application.GetRealWidth(319 - 78), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | PlaceholderTextColor = CSS_Color.PromptingColor1, |
| | | PlaceholderText = Language.StringByID(StringId.PlsRegisterRepeatPassword), |
| | | SecureTextEntry = true, |
| | | }; |
| | | repeatPasswordView.AddChidren(etRepeatPassword); |
| | | |
| | | #region 密码登录-控件加载 |
| | | btnRepeatVisiblePassword = new Button() |
| | | { |
| | | X = Application.GetRealWidth(295), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(20), |
| | | Height = Application.GetMinRealAverage(20), |
| | | UnSelectedImagePath = "LoginIcon/HidePasswordIcon.png", |
| | | SelectedImagePath = "LoginIcon/ShowPasswordIcon.png", |
| | | }; |
| | | repeatPasswordView.AddChidren(btnRepeatVisiblePassword); |
| | | |
| | | #endregion |
| | | |
| | | btnRepeatPasswordViewBottomLine = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(42), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | SelectedBackgroundColor = CSS_Color.MainColor, |
| | | Height = Application.GetRealHeight(1), |
| | | }; |
| | | repeatPasswordView.AddChidren(btnRepeatPasswordViewBottomLine); |
| | | |
| | | #endregion |
| | | |
| | | btnReset = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(421), |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | SelectedBackgroundColor = CSS_Color.MainColor, |
| | | BackgroundColor = CSS_Color.PromptingColor1, |
| | | TextID = StringId.ConfirmReset, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | bodyView.AddChidren(btnReset); |
| | | |
| | | LoadEventList(); |
| | | } |
| | | } |
| | | } |