| | |
| | | /// <summary> |
| | | /// sendCode |
| | | /// </summary> |
| | | public Button SendCodeBtn; |
| | | public NormalViewControl SendCodeBtn; |
| | | /// <summary> |
| | | /// VerificationCodeET |
| | | /// </summary> |
| | |
| | | }; |
| | | codeFL.AddChidren(VerificationCodeET); |
| | | |
| | | SendCodeBtn = new Button() |
| | | SendCodeBtn = new NormalViewControl(300, 127, true) |
| | | { |
| | | X = Application.GetRealWidth(CommonFormResouce.Row_Width - 300), |
| | | Width = Application.GetRealWidth(300), |
| | | Height = Application.GetRealHeight(127), |
| | | Gravity = Gravity.CenterVertical, |
| | | TextID = R.MyInternationalizationString.SendVerificationCode, |
| | | TextColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | SelectedTextColor = ZigbeeColor.Current.GXCTextWhiteColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | BackgroundColor = ZigbeeColor.Current.GXCButtonDisableColor, |
| | | SelectedBackgroundColor=ZigbeeColor.Current.GXCButtonSelectedColor, |
| | | Enable = false, |
| | | IsSelected = false, |
| | | BackgroundColor = 0xFFFEBCA9, |
| | | CanClick = false, |
| | | Radius=(uint)Application.GetRealHeight(12), |
| | | IsBold=true, |
| | | TextSize=CommonFormResouce.TextSize |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// TimeOut |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void TimeOut(object sender, System.Timers.ElapsedEventArgs e) |
| | | { |
| | | var span = DateTime.Now - dateBegin; |
| | | if (span.TotalSeconds <= 61) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | SendCodeBtn.Text = Convert.ToInt16(60 - span.TotalSeconds) + "s" + Language.StringByID(R.MyInternationalizationString.SendVerificationCodeAgain); |
| | | SendCodeBtn.Enable = false; |
| | | SendCodeBtn.BackgroundColor = ZigbeeColor.Current.GXCClearColor; |
| | | SendCodeBtn.SelectedBackgroundColor= ZigbeeColor.Current.GXCClearColor; |
| | | SendCodeBtn.TextColor = ZigbeeColor.Current.GXCTextBlackColor; |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | SendCodeBtn.TextID = R.MyInternationalizationString.SendVerificationCode; |
| | | SendCodeBtn.BackgroundColor = ZigbeeColor.Current.GXCButtonDisableColor; |
| | | SendCodeBtn.SelectedBackgroundColor = ZigbeeColor.Current.GXCButtonSelectedColor; |
| | | SendCodeBtn.TextColor = ZigbeeColor.Current.GXCTextWhiteColor; |
| | | SendCodeBtn.Enable = true; |
| | | t.Stop(); |
| | | t.Close(); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// TimeBegin |
| | | /// </summary> |
| | | public void TimeBegin() |
| | | { |
| | | t.Interval = 1000; |
| | | t.AutoReset = true; |
| | | t.Enabled = true; |
| | | t.Elapsed += TimeOut; |
| | | //启动计时器倒计时-60s |
| | | t.Start(); |
| | | dateBegin = DateTime.Now; |
| | | {
|
| | | SendCodeBtn.BackgroundColor = UserCenterColor.Current.White;
|
| | | SendCodeBtn.TextColor = ZigbeeColor.Current.GXCTextBlackColor;
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //后重发
|
| | | string txtValue = Language.StringByID(R.MyInternationalizationString.SendVerificationCodeAgain);
|
| | | int timeOut = 60;
|
| | | while (timeOut > 0 && SendCodeBtn.Parent != null)
|
| | | {
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | SendCodeBtn.Text = timeOut + "s" + txtValue;
|
| | | });
|
| | | timeOut--;
|
| | | System.Threading.Thread.Sleep(1000);
|
| | | }
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | SendCodeBtn.TextID = R.MyInternationalizationString.SendVerificationCode; |
| | | SendCodeBtn.BackgroundColor = 0xFFFC744B; |
| | | SendCodeBtn.TextColor = ZigbeeColor.Current.GXCTextWhiteColor; |
| | | SendCodeBtn.CanClick = true;
|
| | | });
|
| | | }); |
| | | } |
| | | |
| | | /// <summary> |