| | |
| | | } |
| | | } |
| | | #endregion |
| | | //加载Loading效果 |
| | | var waitPage = new Loading(); |
| | | bodyView.AddChidren(waitPage); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | |
| | | int time = 0; |
| | | //2.检验通过 |
| | | new Thread(() => |
| | | { |
| | | //2.2 获取验证码 |
| | | ResponsePackNew resultObj; |
| | | if (!isPhone)//邮箱 |
| | | try |
| | | { |
| | | resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, account); |
| | | } |
| | | else |
| | | { |
| | | resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, account, true, phoneZoneCode); |
| | | } |
| | | |
| | | if (resultObj.Code != StateCode.SUCCESS) |
| | | { |
| | | // 提示错误 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); |
| | | } |
| | | else |
| | | { |
| | | if (time == 0) |
| | | //2.2 获取验证码 |
| | | ResponsePackNew resultObj; |
| | | if (!isPhone)//邮箱 |
| | | { |
| | | time = 60; |
| | | new Thread(() => |
| | | resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, account); |
| | | } |
| | | else |
| | | { |
| | | resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, account, true, phoneZoneCode); |
| | | } |
| | | |
| | | if (resultObj.Code != StateCode.SUCCESS) |
| | | { |
| | | // 提示错误 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); |
| | | } |
| | | else |
| | | { |
| | | if (time == 0) |
| | | { |
| | | while (time > 0) |
| | | time = 60; |
| | | new Thread(() => |
| | | { |
| | | time--; |
| | | while (time > 0) |
| | | { |
| | | time--; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | button.Text = time.ToString() + "s"; |
| | | }); |
| | | Thread.Sleep(1000); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | button.Text = time.ToString() + "s"; |
| | | button.IsSelected = true; |
| | | button.TextID = StringId.GetVerificationCode; |
| | | button.BackgroundColor = CSS_Color.MainColor; |
| | | time = 0; |
| | | }); |
| | | 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(); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | button.BackgroundColor = CSS_Color.PromptingColor1; |
| | | var vcp = new NewBindVerificationCodePage(); |
| | | vcp.PhoneZoneCode = phoneZoneCode; |
| | | MainPage.BasePageView.AddChidren(vcp); |
| | | vcp.LoadPage(action, titleId, account, isPhone, time, isModifyBind); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }); |
| | | } |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | button.BackgroundColor = CSS_Color.PromptingColor1; |
| | | var vcp = new NewBindVerificationCodePage(); |
| | | vcp.PhoneZoneCode = phoneZoneCode; |
| | | MainPage.BasePageView.AddChidren(vcp); |
| | | vcp.LoadPage(action, titleId, account, isPhone, time, isModifyBind); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |