コード例 #1
0
 private void OnCodeClicked()
 {
     if (FormValidator.IsValidPhoneNumber(GetPhoneNumber()))
     {
         StartSmsCodeCountDown();
         PlayerIdentityManager.Current.RequestSmsCode(GetPhoneNumber(), OnCodeResult);
     }
     else
     {
         MainController.Instance.
         PopupController.ShowError(new Error()
         {
             message = "手机号码格式错误"
         });
     }
 }
コード例 #2
0
 private void OnPhoneNumberValueChanged(string text)
 {
     if ((FormUtils.AreInputFieldsNotEmpty(phoneNumber.text) && IsCodeSendable()) || FormValidator.IsValidPhoneNumber(GetPhoneNumber()))
     {
         if (!_sendCodeBtn.IsInteractable())
         {
             _smsCodeBtnText.text      = SmsCodeButtonDefaultText;
             _codeCountDown            = -1; //avoid redundant text set
             _sendCodeBtn.interactable = true;
         }
     }
     else
     {
         if (_sendCodeBtn.IsInteractable())
         {
             _sendCodeBtn.interactable = false;
         }
     }
 }