| | |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 修改绑定或者解绑--发送验证码页面 |
| | | /// </summary> |
| | | public partial class ChangeBindAccountPage : FrameLayout |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | FrameLayout bodyView; |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | Action<string> action; |
| | | /// <summary> |
| | | /// 操作目标类型 1:邮箱,2:手机 |
| | | /// </summary> |
| | | int optionType; |
| | | /// <summary> |
| | | /// 是否为解绑验证 |
| | | /// </summary> |
| | | public bool isUnbind; |
| | | |
| | | /// <summary> |
| | | /// ChangeBindAccountPage |
| | | /// </summary> |
| | | public ChangeBindAccountPage() |
| | | { |
| | | bodyView = this; |
| | |
| | | }; |
| | | bodyView.AddChidren(btnChangeBind); |
| | | |
| | | if (!string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo)) |
| | | //同时绑定邮箱或者手机才显示"更换验证方式" |
| | | if (!string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo) && !string.IsNullOrEmpty(MainPage.LoginUser.userEmailInfo)) |
| | | { |
| | | Button btnChangeGetVer = new Button() |
| | | { |
| | |
| | | |
| | | LoadEvent_ChangeVerificationMethod(btnChangeGetVer, btnTitle, btnContent); |
| | | } |
| | | |
| | | |
| | | LoadEvent_GetVerification(btnChangeBind, titleId); |
| | | } |
| | |
| | | { |
| | | new Thread(() => |
| | | { |
| | | if (optionType == 1) |
| | | //1.获取验证码,采用敏感数据验证 |
| | | ResponsePackNew resultObj; |
| | | if (optionType == 1)//邮箱 |
| | | { |
| | | var resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, MainPage.LoginUser.userEmailInfo); |
| | | resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.SENSITIVE_DATA, MainPage.LoginUser.userEmailInfo); |
| | | } |
| | | else |
| | | { |
| | | resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.SENSITIVE_DATA, MainPage.LoginUser.userMobileInfo, true, MainPage.LoginUser.areaCode); |
| | | } |
| | | |
| | | } |
| | | else if (optionType == 2) |
| | | if (resultObj.Code != StateCode.SUCCESS) |
| | | { |
| | | var resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, MainPage.LoginUser.userMobileInfo, true, MainPage.LoginUser.areaCode.ToString()); |
| | | // 提示错误 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | if (time == 0) |
| | | { |
| | | time = 60; |
| | | new Thread(() => |
| | | { |
| | | while (time > 0) |
| | | else |
| | | { |
| | | time--; |
| | | if (time == 0) |
| | | { |
| | | time = 60; |
| | | new Thread(() => |
| | | { |
| | | while (time > 0) |
| | | { |
| | | time--; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | button.Text = time.ToString() + "s"; |
| | | }); |
| | | Thread.Sleep(1000); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | button.IsSelected = true; |
| | | button.TextID = StringId.GetVerificationCode; |
| | | button.BackgroundColor = CSS_Color.MainColor; |
| | | time = 0; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | button.Text = time.ToString() + "s"; |
| | | button.BackgroundColor = CSS_Color.PromptingColor1; |
| | | var vcp = new ChangeBindVerificationCodePage(); |
| | | vcp.isUnbind = isUnbind; |
| | | MainPage.BasePageView.AddChidren(vcp); |
| | | vcp.LoadPage(action, titleId, optionType, time); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }); |
| | | Thread.Sleep(1000); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | button.IsSelected = true; |
| | | button.TextID = StringId.GetVerificationCode; |
| | | button.BackgroundColor = CSS_Color.MainColor; |
| | | time = 0; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | }) { IsBackground = true }.Start(); |
| | | } |
| | | button.BackgroundColor = CSS_Color.PromptingColor1; |
| | | var vcp = new VerificationCodePage(); |
| | | MainPage.BasePageView.AddChidren(vcp); |
| | | vcp.LoadPage(action, titleId, optionType, time); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | |
| | | }; |
| | | } |
| | | } |