|
@@ -1,3 +1,5 @@
|
|
|
|
|
+using System.Text.RegularExpressions;
|
|
|
|
|
+using ET;
|
|
|
using UI.Login;
|
|
using UI.Login;
|
|
|
using UnityEngine;
|
|
using UnityEngine;
|
|
|
using FairyGUI;
|
|
using FairyGUI;
|
|
@@ -8,8 +10,6 @@ namespace GFGGame
|
|
|
{
|
|
{
|
|
|
private UI_RegisterUI _ui;
|
|
private UI_RegisterUI _ui;
|
|
|
|
|
|
|
|
- private const string CODE = "";
|
|
|
|
|
-
|
|
|
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
|
{
|
|
{
|
|
|
if (_ui != null)
|
|
if (_ui != null)
|
|
@@ -17,6 +17,7 @@ namespace GFGGame
|
|
|
_ui.Dispose();
|
|
_ui.Dispose();
|
|
|
_ui = null;
|
|
_ui = null;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
base.Dispose();
|
|
base.Dispose();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -34,14 +35,25 @@ namespace GFGGame
|
|
|
_ui.m_loaEventa.onClick.Add(() => { FullScreenTextController.Show("event:a"); });
|
|
_ui.m_loaEventa.onClick.Add(() => { FullScreenTextController.Show("event:a"); });
|
|
|
_ui.m_loaEventb.onClick.Add(() => { FullScreenTextController.Show("event:b"); });
|
|
_ui.m_loaEventb.onClick.Add(() => { FullScreenTextController.Show("event:b"); });
|
|
|
_ui.m_loaEventc.onClick.Add(() => { FullScreenTextController.Show("event:c"); });
|
|
_ui.m_loaEventc.onClick.Add(() => { FullScreenTextController.Show("event:c"); });
|
|
|
- // _ui.m_btnSendCode.onClick.Add(() => {
|
|
|
|
|
- //
|
|
|
|
|
- // _ui.m_btnSendCode.enabled = false;
|
|
|
|
|
- // _ui.m_inputCode.text = CODE;
|
|
|
|
|
- // float endTime = Time.time + 60;
|
|
|
|
|
- // Timers.inst.Add(1,0, timerCallback, endTime);
|
|
|
|
|
- // timerCallback(endTime);
|
|
|
|
|
- // });
|
|
|
|
|
|
|
+ _ui.m_btnSendCode.onClick.Add(() =>
|
|
|
|
|
+ {
|
|
|
|
|
+ if (!Regex.IsMatch(_ui.m_inputPhone.text.Trim(), // 匹配所有中国大陆手机号(11 位,包括物联网和卫星电话)
|
|
|
|
|
+ @"^(?:\+86)?1(?:3\d{3}|4[5-9]\d{2}|5[0-35-9]\d{2}|6[2567]\d{2}|7[0-8]\d{2}|8\d{3}|9[0-35-9]\d{2})\d{6}$"))
|
|
|
|
|
+ {
|
|
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt("输入的手机号格式有误");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ _ui.m_btnSendCode.enabled = false;
|
|
|
|
|
+
|
|
|
|
|
+ //在此发送验证码
|
|
|
|
|
+ SecurityHelper.GetMobileVerificationCode(_ui.m_inputPhone.text, SendCodeType.RegisterAccount)
|
|
|
|
|
+ .Coroutine();
|
|
|
|
|
+
|
|
|
|
|
+ float endTime = Time.time + 60;
|
|
|
|
|
+ Timers.inst.Add(1, 0, timerCallback, endTime);
|
|
|
|
|
+ timerCallback(endTime);
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
//输入限制
|
|
//输入限制
|
|
|
_ui.m_inputAccount.restrict = "[0-9A-Za-z_]";
|
|
_ui.m_inputAccount.restrict = "[0-9A-Za-z_]";
|
|
@@ -56,13 +68,13 @@ namespace GFGGame
|
|
|
float remainTime = endTime - Time.time;
|
|
float remainTime = endTime - Time.time;
|
|
|
if (remainTime <= 0)
|
|
if (remainTime <= 0)
|
|
|
{
|
|
{
|
|
|
- // _ui.m_btnSendCode.text = "发送验证码";
|
|
|
|
|
- // _ui.m_btnSendCode.enabled = true;
|
|
|
|
|
|
|
+ _ui.m_btnSendCode.text = "发送验证码";
|
|
|
|
|
+ _ui.m_btnSendCode.enabled = true;
|
|
|
Timers.inst.Remove(timerCallback);
|
|
Timers.inst.Remove(timerCallback);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
|
- // _ui.m_btnSendCode.text = (int)remainTime + "s后重发";
|
|
|
|
|
|
|
+ _ui.m_btnSendCode.text = (int)remainTime + "s后重发";
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -75,6 +87,7 @@ namespace GFGGame
|
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
|
{
|
|
{
|
|
|
base.OnHide();
|
|
base.OnHide();
|
|
|
|
|
+ Timers.inst.Remove(timerCallback);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private void OnClickBtnSubmit()
|
|
private void OnClickBtnSubmit()
|
|
@@ -89,31 +102,38 @@ namespace GFGGame
|
|
|
string passwordSure = _ui.m_inputPassword2.text;
|
|
string passwordSure = _ui.m_inputPassword2.text;
|
|
|
string realName = _ui.m_inputName.text;
|
|
string realName = _ui.m_inputName.text;
|
|
|
string idNumberStr = _ui.m_inputIDNumber.text;
|
|
string idNumberStr = _ui.m_inputIDNumber.text;
|
|
|
|
|
+ string phoneNumber = _ui.m_inputPhone.text;
|
|
|
|
|
+ string code = _ui.m_inputCode.text;
|
|
|
if (string.IsNullOrEmpty(account))
|
|
if (string.IsNullOrEmpty(account))
|
|
|
{
|
|
{
|
|
|
PromptController.Instance.ShowFloatTextPrompt("请输入账号");
|
|
PromptController.Instance.ShowFloatTextPrompt("请输入账号");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(account.Length < 8)//最长输入在UI编辑器中做了限制
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (account.Length < 8) //最长输入在UI编辑器中做了限制
|
|
|
{
|
|
{
|
|
|
PromptController.Instance.ShowFloatTextPrompt("账号长度最少需要8位");
|
|
PromptController.Instance.ShowFloatTextPrompt("账号长度最少需要8位");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
if (string.IsNullOrEmpty(password))
|
|
if (string.IsNullOrEmpty(password))
|
|
|
{
|
|
{
|
|
|
PromptController.Instance.ShowFloatTextPrompt("请输入密码");
|
|
PromptController.Instance.ShowFloatTextPrompt("请输入密码");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if (password.Length < 8)//最长输入在UI编辑器中做了限制
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (password.Length < 8) //最长输入在UI编辑器中做了限制
|
|
|
{
|
|
{
|
|
|
PromptController.Instance.ShowFloatTextPrompt("密码长度最少需要8位");
|
|
PromptController.Instance.ShowFloatTextPrompt("密码长度最少需要8位");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
if (passwordSure != password)
|
|
if (passwordSure != password)
|
|
|
{
|
|
{
|
|
|
PromptController.Instance.ShowFloatTextPrompt("确认密码不一致");
|
|
PromptController.Instance.ShowFloatTextPrompt("确认密码不一致");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
GameController.CheckSpecialAccount(account);
|
|
GameController.CheckSpecialAccount(account);
|
|
|
if (GameGlobal.antiAddiction)
|
|
if (GameGlobal.antiAddiction)
|
|
|
{
|
|
{
|
|
@@ -122,11 +142,13 @@ namespace GFGGame
|
|
|
PromptController.Instance.ShowFloatTextPrompt("请输入真实姓名");
|
|
PromptController.Instance.ShowFloatTextPrompt("请输入真实姓名");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
if (idNumberStr.Length <= 0)
|
|
if (idNumberStr.Length <= 0)
|
|
|
{
|
|
{
|
|
|
PromptController.Instance.ShowFloatTextPrompt("请输入身份证号");
|
|
PromptController.Instance.ShowFloatTextPrompt("请输入身份证号");
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
if (!_ui.m_btnAgree.selected)
|
|
if (!_ui.m_btnAgree.selected)
|
|
|
{
|
|
{
|
|
|
PromptController.Instance.ShowFloatTextPrompt("请仔细阅读并同意服务协议、隐私政策、保护规则");
|
|
PromptController.Instance.ShowFloatTextPrompt("请仔细阅读并同意服务协议、隐私政策、保护规则");
|
|
@@ -134,8 +156,7 @@ namespace GFGGame
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- LoginController.Register(account, password, realName, idNumberStr, CODE).Coroutine();
|
|
|
|
|
|
|
+ LoginController.Register(account, password, realName, idNumberStr, code, phoneNumber).Coroutine();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|