| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686 | 
							- using System;
 
- using System.Collections;
 
- using System.Collections.Generic;
 
- using UnityEngine;
 
- using UnityEngine.UI;
 
- using UnityEngine.SceneManagement;
 
- using UnityEngine.Networking;
 
- using System.Text.RegularExpressions;
 
- using DG.Tweening;
 
- using Newtonsoft.Json;
 
- using JCUnityLib;
 
- using JCUnityLib.UI;
 
- using Newtonsoft.Json.Linq;
 
- /* 注册界面 */
 
- public class RegisterView : MonoBehaviour
 
- {
 
-     [SerializeField] GameObject registerContainer;
 
-     [SerializeField] GameObject improveContainer;
 
-     [SerializeField] GameObject registerInUser;
 
-     [SerializeField] GameObject registerInPWD1;
 
-     [SerializeField] GameObject registerInPWD2;
 
-     [SerializeField] GameObject registerInEmail;
 
-     [SerializeField] GameObject registerInPhone;
 
-     [SerializeField] GameObject registerInCaptcha;
 
-     [SerializeField] GameObject registerInNickname;
 
-     [SerializeField] GameObject registerInGender;
 
-     [SerializeField] GameObject registerInBirthday;
 
-     [SerializeField] GameObject registerInLocation;
 
-     [SerializeField] GameObject btnNext;
 
-     [SerializeField] GameObject btnSave;
 
-     [SerializeField] GameObject lineTip;
 
-     [SerializeField] GameObject agreenment;
 
-     [SerializeField] GameObject passwordTip;
 
-     [SerializeField] Button SendBtn;
 
-     [SerializeField] Text SendBtnText;
 
-     InputField _inputRelateAccount;
 
-     string sendCodeAccount;
 
-     InputField _inputValidateCode;
 
-     //状态记录
 
-     public int captcha_Register = -222222222;
 
-     public string captcha_Register_str = "";
 
-     void OnEnable() 
 
-     {
 
-         InitPage();
 
-         //弹出协议,不同意则退出注册
 
-         AgreementPopup agreementPopup = transform.parent.Find("AgreementPopup").GetComponent<AgreementPopup>();
 
-         agreementPopup.onDisagree = () => {
 
-             agreementPopup.onDisagree = null;
 
-             GameObject.FindObjectOfType<LoginMgr>().showLoginView();
 
-         };
 
-         agreementPopup.gameObject.SetActive(true);
 
-     }
 
-     void Start()
 
-     {
 
-         InitInputLimit();
 
-         //把账户视为手机号或者邮箱
 
-         _inputRelateAccount = GetGameObjectInputField(registerInUser);
 
-         _inputValidateCode = GetGameObjectInputField(registerInPhone);
 
-         if (CommonConfig.serverIndex == 0)
 
-         {
 
-             //国内使用手机注册
 
-             SetLoginValidateType(LoginValidateType.Phone);
 
-         }
 
-         else
 
-         {
 
-             //国外使用邮箱注册
 
-             SetLoginValidateType(LoginValidateType.Email);
 
-         }
 
-         SendBtnText.text = TextAutoLanguage2.GetTextByKey("common_send");
 
-     }
 
-     void InitInputLimit() {
 
-         GameObject[] inputNodes = {registerInPWD1, registerInPWD2};
 
-         foreach (var inputNode in inputNodes) {
 
-             InputField inputField = GetInputField(inputNode);
 
-             inputField.onValueChanged.AddListener(delegate(string text) {
 
-                 Match match = new Regex("[^A-Za-z0-9]").Match(text);
 
-                 if (match.Success)
 
-                 {
 
-                     inputField.text = text.Replace(match.Value, "");
 
-                 }
 
-                 //if (_LoginValidateType == LoginValidateType.Email)
 
-                 //{
 
-                 //    Match matchEmail = new Regex("^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$").Match(text);
 
-                 //    if (matchEmail.Success)
 
-                 //    {
 
-                 //        inputField.text = text.Replace(matchEmail.Value, "");
 
-                 //    }
 
-                 //}
 
-                 //else {
 
-                 //    Match match = new Regex("[^A-Za-z0-9]").Match(text);
 
-                 //    if (match.Success)
 
-                 //    {
 
-                 //        inputField.text = text.Replace(match.Value, "");
 
-                 //    }
 
-                 //}
 
-             });       
 
-         }
 
-     }
 
-     void InitPage(bool isNext = false) {
 
-         registerContainer.SetActive(!isNext);
 
-         //registerInUser.SetActive(!isNext);
 
-         //registerInPWD1.SetActive(!isNext);
 
-         //registerInPWD2.SetActive(!isNext);
 
-         //registerInPhone.SetActive(!isNext);
 
-         //registerInCaptcha.SetActive(!isNext);
 
-         btnNext.SetActive(!isNext);
 
-         agreenment.SetActive(!isNext);
 
-         //var btnNextTF = btnNext.transform as RectTransform;
 
-         //var btnNextAP = btnNextTF.anchoredPosition;
 
-         //btnNextAP.y = -540;
 
-         //btnNextTF.anchoredPosition = btnNextAP;
 
-         //registerInEmail.SetActive(!isNext && CommonConfig.serverIndex == 1);
 
-         //registerInPhone.SetActive(!isNext && CommonConfig.serverIndex == 0);
 
-         //if (CommonConfig.banBindRelateAccount)
 
-         //{
 
-         //    registerInEmail.SetActive(false);
 
-         //    registerInPhone.SetActive(false);
 
-         //}
 
-         //lineTip.SetActive(registerInEmail.activeSelf && registerInPhone.activeSelf);
 
-         //if (registerInEmail.activeSelf) btnNextAP.y -= 14;
 
-         //if (registerInPhone.activeSelf) btnNextAP.y -= 14;
 
-         improveContainer.SetActive(isNext);
 
-         //registerInNickname.SetActive(isNext);
 
-         //registerInGender.SetActive(isNext);
 
-         //registerInBirthday.SetActive(isNext);
 
-         //registerInLocation.SetActive(isNext);
 
-         btnSave.SetActive(isNext);
 
-         if (isNext) {
 
-             GetLocation();
 
-         } else {
 
-             ChnageCaptcha();
 
-         }
 
-     }
 
-     InputField GetInputField(GameObject inputNode) {
 
-         return inputNode.transform.Find("InputField").GetComponent<InputField>();
 
-     }
 
-     InputField GetGameObjectInputField(GameObject inputNode)
 
-     {
 
-         return inputNode.transform.Find("GameObject/InputField").GetComponent<InputField>();
 
-     }
 
-     public void ChnageCaptcha() {
 
-         StartCoroutine(CaptchaController.Instance.GetCaptcha(
 
-             registerInCaptcha.transform.Find("GameObject/Mask/CodeImage").GetComponent<Image>(),
 
-             (code) => { captcha_Register_str = code.ToString(); }
 
-         ));
 
-         //captcha_Register_str = CaptchaController.Instance.GetCaptchaV2(registerInCaptcha.transform.Find("GameObject/Mask/CodeImage").GetComponent<Image>());
 
-     }
 
-     string _bindingEmail = "";
 
-     public void OnClick_BindEmail()
 
-     {
 
-         RelateValidateView relateValidateView = 
 
-                 Instantiate(SceneResourceManager.Instance.GetPrefab("RelateValidateView"))
 
-                     .GetComponent<RelateValidateView>();
 
-         CanvasUtils.PlusSortOrder(gameObject.GetComponentInParent<Canvas>().gameObject, relateValidateView.gameObject, 1);
 
-         relateValidateView.InitForEmail2();
 
-         relateValidateView.onValidateSuccess = (a, b, c) => {
 
-             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("RelateValidateView-pass1"));
 
-             relateValidateView.CloseView();
 
-             GetInputField(registerInEmail).text = _bindingEmail = a;
 
-         };
 
-     }
 
-     string _bindingPhone = "";
 
-     //public void OnClick_BindPhone()
 
-     //{
 
-     //    RelateValidateView relateValidateView = 
 
-     //            Instantiate(SceneResourceManager.Instance.GetPrefab("RelateValidateView"))
 
-     //                .GetComponent<RelateValidateView>();
 
-     //    CanvasUtils.PlusSortOrder(gameObject.GetComponentInParent<Canvas>().gameObject, relateValidateView.gameObject, 1);
 
-     //    relateValidateView.InitForPhone2();
 
-     //    relateValidateView.onValidateSuccess = (a, b, c) => {
 
-     //        PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("RelateValidateView-pass1"));
 
-     //        relateValidateView.CloseView();
 
-     //        GetInputField(registerInPhone).text = _bindingPhone = a;
 
-     //    };
 
-     //}
 
-     public enum LoginValidateType { Email, Phone }
 
-     private LoginValidateType _LoginValidateType = LoginValidateType.Email;
 
-     public void SetLoginValidateType(LoginValidateType _loginValidateType)
 
-     {
 
-         _LoginValidateType = _loginValidateType;
 
-         LanguageEnum languageEnum = TextAutoLanguage2.GetLanguage();
 
-         if (_LoginValidateType == LoginValidateType.Email)
 
-         {
 
-             _inputRelateAccount.contentType = InputField.ContentType.EmailAddress;
 
-             _inputRelateAccount.characterLimit = 32;
 
-             registerInUser.transform.Find("Text").GetComponent<Text>().text = TextAutoLanguage2.GetTextByKey("register_email2");
 
-             _inputRelateAccount.transform.Find("Placeholder").GetComponent<Text>().text = TextAutoLanguage2.GetTextByKey("RelateValidateView-email1");
 
-             //输入框文案
 
-             registerInPhone.transform.Find("Text").GetComponent<Text>().text = TextAutoLanguage2.GetTextByKey("RelateValidateView-email001");
 
-             //输入框提示
 
-             Text _tempCodeText = _inputValidateCode.transform.Find("Placeholder").GetComponent<Text>();
 
-             //_tempCodeText.fontSize = languageEnum == LanguageEnum.Chinese ? 24 : 20;
 
-             _tempCodeText.text = TextAutoLanguage2.GetTextByKey("RelateValidateView-email201"); //RelateValidateView-email2
 
-             //发送按钮
 
-             registerInPhone.transform.Find("GameObject/Send/Text").GetComponent<Text>().text = TextAutoLanguage2.GetTextByKey("common_send"); //RelateValidateView-email3
 
-         }
 
-         else if (_LoginValidateType == LoginValidateType.Phone)
 
-         {
 
-             _inputRelateAccount.contentType = InputField.ContentType.IntegerNumber;
 
-             _inputRelateAccount.characterLimit = 11;
 
-             registerInUser.transform.Find("Text").GetComponent<Text>().text = TextAutoLanguage2.GetTextByKey("register_phone2");
 
-             _inputRelateAccount.transform.Find("Placeholder").GetComponent<Text>().text = TextAutoLanguage2.GetTextByKey("RelateValidateView-phone1");
 
-             registerInPhone.transform.Find("Text").GetComponent<Text>().text = TextAutoLanguage2.GetTextByKey("RelateValidateView-phone0");
 
-             Text _tempCodeText = _inputValidateCode.transform.Find("Placeholder").GetComponent<Text>();
 
-             //_tempCodeText.fontSize = languageEnum == LanguageEnum.Chinese ? 24 : 20;
 
-             _tempCodeText.text = TextAutoLanguage2.GetTextByKey("RelateValidateView-phone2"); //RelateValidateView-phone2
 
-             registerInPhone.transform.Find("GameObject/Send/Text").GetComponent<Text>().text = TextAutoLanguage2.GetTextByKey("common_send");//RelateValidateView-phone3
 
-         }
 
-     }
 
-     [SerializeField] GameObject _prefabValidateJigsawView;
 
-     static long _throttlerBtnSend_phone_reg = 0;
 
-     long _throttlerBtnSend_reg
 
-     {
 
-         get
 
-         {
 
-              return _throttlerBtnSend_phone_reg;
 
-         }
 
-         set
 
-         {
 
-             _throttlerBtnSend_phone_reg = value;
 
-         }
 
-     }
 
-     public void OnClick_SendCode() {
 
-         if (_LoginValidateType == LoginValidateType.Email)
 
-         {
 
-             string email = _inputRelateAccount.text;
 
-             sendCodeAccount = email;
 
-             if (!ValidateHelper.IsEmail(email))
 
-             {
 
-                 PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("RelateValidateView-a0"));
 
-                 return;
 
-             }
 
-         }
 
-         else if (_LoginValidateType == LoginValidateType.Phone)
 
-         {   
 
-             //记录一个发送code时候的号码,下一步时候判定一下是否同一个号码,不是的话提示重新发送,和检测一下合理性
 
-             string phone = _inputRelateAccount.text;
 
-             sendCodeAccount = phone;
 
-             if (!ValidateHelper.IsMobilePhone(phone))
 
-             {
 
-                 PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("RelateValidateView-a1"));
 
-                 return;
 
-             }
 
-         }
 
-         //验证码再次发送需要间隔60秒
 
-         long gapTime = TimeUtils.GetTimestamp() - _throttlerBtnSend_reg;
 
-         long maxTime = 60 * 1000;
 
-         if (gapTime < maxTime)
 
-         {   
 
-             long second = (maxTime - gapTime) / 1000;
 
-             if (second <= 0) second = 1;
 
-             PopupMgr.ins.ShowTip(string.Format(TextAutoLanguage2.GetTextByKey("RelateValidateView-a2"), second));
 
-             return;
 
-         }
 
-         //打开拼图验证
 
-         GameObject gameObjectValidateJigsawView = Instantiate(_prefabValidateJigsawView);
 
-         //CanvasUtils.PlusSortOrder(gameObject, gameObjectValidateJigsawView, 1);
 
-         ValidateJigsawView validateJigsawView = gameObjectValidateJigsawView.GetComponent<ValidateJigsawView>();
 
-         validateJigsawView.onComplete = RequestSendValidateCode;
 
-         validateJigsawView.SetTextLabel(TextAutoLanguage2.GetTextByKey("ValidateJigsawView_label"));
 
-         validateJigsawView.SetTextTip(TextAutoLanguage2.GetTextByKey("ValidateJigsawView_tip"));
 
-         validateJigsawView.SetTextOK(TextAutoLanguage2.GetTextByKey("ValidateJigsawView_ok"));
 
-     }
 
-     bool bSend = false;
 
-     private void Update()
 
-     {
 
-         if (bSend)
 
-         {
 
-             //验证码再次发送需要间隔60秒
 
-             if (SendBtn.IsInteractable()) SendBtn.interactable = false;
 
-             long gapTime = TimeUtils.GetTimestamp() - _throttlerBtnSend_reg;
 
-             long maxTime = 60 * 1000;
 
-             long second = (maxTime - gapTime) / 1000;
 
-             if (second <= 0) second = 0;
 
-             SendBtnText.text = second + " S";
 
-             if (second == 0)
 
-             {
 
-                 bSend = false;
 
-                 SendBtnText.text = TextAutoLanguage2.GetTextByKey("common_send");
 
-             }
 
-         }
 
-         else {
 
-             //停止计时
 
-             if (!SendBtn.IsInteractable()) SendBtn.interactable = true;
 
-         }
 
-      
 
-     }
 
-     void RequestSendValidateCode()
 
-     {
 
-         //限流时间点记录
 
-         _throttlerBtnSend_reg = TimeUtils.GetTimestamp();
 
-         bSend = true;
 
-         //请求服务端接口
 
-         if (_LoginValidateType == LoginValidateType.Email)
 
-         {
 
-             string email = _inputRelateAccount.text;
 
-             StartCoroutine(EmailValidateController.Instance.SendEmailValidateCode(email, (res) => {
 
-                 if (res.code == 0) PopupMgr.ins.ShowTipTop(TextAutoLanguage2.GetTextByKey("RelateValidateView-b0"));
 
-                 else PopupMgr.ins.ShowTipTop(TextAutoLanguage2.GetTextByKey("RelateValidateView-b1"));
 
-             }));
 
-         }
 
-         else if (_LoginValidateType == LoginValidateType.Phone)
 
-         {
 
-             string phone = _inputRelateAccount.text;
 
-             StartCoroutine(PhoneValidateController.Instance.SendPhoneValidateCode(phone, (res) => {
 
-                 if (res.code == 0) PopupMgr.ins.ShowTipTop(TextAutoLanguage2.GetTextByKey("RelateValidateView-b2"));
 
-                 else PopupMgr.ins.ShowTipTop(TextAutoLanguage2.GetTextByKey("RelateValidateView-b3"));
 
-             }));
 
-         }
 
-     }
 
-     Throttler _throttlerBtnSubmit = new Throttler(3000);
 
-     public void OnClick_BtnSubmit()
 
-     {
 
-         if (_LoginValidateType == LoginValidateType.Email)
 
-         {
 
-             string email = _inputRelateAccount.text;
 
-             if (!ValidateHelper.IsEmail(email))
 
-             {
 
-                 PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("RelateValidateView-a0"));
 
-                 return;
 
-             }
 
-         }
 
-         else if (_LoginValidateType == LoginValidateType.Phone)
 
-         {
 
-             string phone = _inputRelateAccount.text;
 
-             if (!ValidateHelper.IsMobilePhone(phone))
 
-             {
 
-                 PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("RelateValidateView-a1"));
 
-                 return;
 
-             }
 
-         }
 
-         string code = _inputValidateCode.text;
 
-         if (code.Length != 6)
 
-         {
 
-             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("RelateValidateView-a3"));
 
-             return;
 
-         }
 
-         if (!_throttlerBtnSubmit.CanPass())
 
-         {
 
-             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("操作过于频繁"));
 
-             return;
 
-         }
 
-         RequestSubmit();
 
-     }
 
-     void RequestSubmit()
 
-     {
 
-         if (_LoginValidateType == LoginValidateType.Email)
 
-         {
 
-             string email = _inputRelateAccount.text;
 
-             string code = _inputValidateCode.text;
 
-             StartCoroutine(EmailValidateController.Instance.ValidateEmail(email, code, (res) => {
 
-                 if (res.code == 0)
 
-                 {
 
-                     JObject data = res.data as JObject;
 
-                     string arg0 = data.Value<string>("email");
 
-                     long arg1 = data.Value<long>("timestamp");
 
-                     string arg2 = data.Value<string>("sign");
 
-                     Debug.Log($"邮箱验证成功 {arg0} {arg1} {arg2}");
 
-                     _bindingEmail = arg0;
 
-                     RegisterNext();
 
-                 }
 
-                 else PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("RelateValidateView-c0"));
 
-             }));
 
-         }
 
-         else if (_LoginValidateType == LoginValidateType.Phone)
 
-         {
 
-             string phone = _inputRelateAccount.text;
 
-             string code = _inputValidateCode.text;
 
-             StartCoroutine(PhoneValidateController.Instance.ValidatePhone(phone, code, (res) => {
 
-                 if (res.code == 0)
 
-                 {
 
-                     JObject data = res.data as JObject;
 
-                     string arg0 = data.Value<string>("phone");
 
-                     long arg1 = data.Value<long>("timestamp");
 
-                     string arg2 = data.Value<string>("sign");
 
-                     Debug.Log($"手机验证成功 {arg0} {arg1} {arg2}");
 
-                     _bindingPhone = arg0;
 
-                     RegisterNext();
 
-                 }
 
-                 else PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("RelateValidateView-c1"));
 
-             }));
 
-         }
 
-     }
 
-     private string usrRecord = "";
 
-     private string pwdRecord = "";
 
-     JCUnityLib.Throttler throttlerRegisterNext = new JCUnityLib.Throttler(2000);
 
-     public void onDetectPassword() {
 
-         InputField pwd1 = GetInputField(registerInPWD1);
 
-         InputField pwd2 = GetInputField(registerInPWD2);
 
-         passwordTip.SetActive(pwd1.text != pwd2.text);
 
-     }
 
-     void TestNav() {
 
-         InputField user = GetGameObjectInputField(registerInUser);
 
-         InputField pwd1 = GetInputField(registerInPWD1);
 
-         usrRecord = user.text;
 
-         pwdRecord = pwd1.text;
 
-         InputField nickname = GetInputField(registerInNickname);
 
-         if (_LoginValidateType == LoginValidateType.Email)
 
-         {
 
-             //邮箱裁剪一下
 
-             string[] arry = usrRecord.Trim().Split("@");
 
-             nickname.text = arry[0];
 
-         }
 
-         else
 
-         {
 
-             //手机直接设置电话号码
 
-             nickname.text = usrRecord;
 
-         }
 
-         InitPage(true);
 
-         LoginView.ins.FillLoginInput(usrRecord, pwdRecord);
 
-     }
 
-     public void RegisterNext()
 
-     {
 
-         //TestNav();
 
-         //return;
 
-         //检测是否绑定手机号和邮箱号,没有进行绑定。绑定后再调用此流程
 
-         if (!CommonConfig.banBindRelateAccount)
 
-         {
 
-             if (string.IsNullOrEmpty(_bindingEmail) && string.IsNullOrEmpty(_bindingPhone))
 
-             {
 
-                 OnClick_BtnSubmit();
 
-                 return;
 
-             }
 
-         }
 
-         //这里变成手机号或者邮箱号了
 
-         if (_LoginValidateType == LoginValidateType.Email)
 
-         {
 
-             if (!ValidateHelper.IsEmail(_inputRelateAccount.text))
 
-             {
 
-                 PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("RelateValidateView-a0"));
 
-                 return;
 
-             }
 
-            
 
-         }
 
-         else if (_LoginValidateType == LoginValidateType.Phone)
 
-         {
 
-             if (!ValidateHelper.IsMobilePhone(_inputRelateAccount.text))
 
-             {
 
-                 PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("RelateValidateView-a1"));
 
-                 return;
 
-             }
 
-         }
 
-         //更换账户后请重新发送验证码
 
-         if (sendCodeAccount != _inputRelateAccount.text)
 
-         {
 
-             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByKey("RelateValidateView-a11"));
 
-             return;
 
-         }
 
-         //if (user.text.Length < 6) {
 
-         //    PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("账号长度至少6位"));
 
-         //    return;
 
-         //}
 
-         InputField pwd1 = GetInputField(registerInPWD1);
 
-         if (pwd1.text.Length < 6) {
 
-             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("密码长度至少6位"));
 
-             return;
 
-         }
 
-         InputField pwd2 = GetInputField(registerInPWD2);
 
-         if (pwd1.text != pwd2.text) {
 
-             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("两次输入的密码不一致"));
 
-             passwordTip.SetActive(true);
 
-             return;
 
-         }
 
-         // if (!CommonConfig.banBindRelateAccount)
 
-         // {
 
-         //     if (string.IsNullOrEmpty(_bindingEmail) && string.IsNullOrEmpty(_bindingPhone)) {
 
-         //         if (CommonConfig.serverIndex == 0) PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("至少需要绑定邮箱号或者手机号"));
 
-         //         else PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("尚未绑定邮箱号"));
 
-         //         return;
 
-         //     }
 
-         // }
 
-         //if (registerInEmail.activeSelf && string.IsNullOrEmpty(_bindingEmail)) {
 
-         //    PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("尚未绑定邮箱号"));
 
-         //    return;
 
-         //}
 
-         //if (registerInPhone.activeSelf && string.IsNullOrEmpty(_bindingPhone)) {
 
-         //    PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("尚未绑定手机号"));
 
-         //    return;
 
-         //}
 
-         InputField captcha = GetGameObjectInputField(registerInCaptcha);
 
-         if (!captcha.text.Equals(captcha_Register_str)) {
 
-             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("验证码错误"));
 
-             return;
 
-         }
 
-          if (!AgreenmentOption.ins.IsAgreementChecked()) {
 
-             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("请阅读并同意App协议"));
 
-             return;
 
-         }
 
-         if (throttlerRegisterNext.CanPass() == false) {
 
-             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("操作过于频繁"));
 
-             return;
 
-         }
 
-         usrRecord = _inputRelateAccount.text;
 
-         pwdRecord = pwd1.text;
 
-         if (CommonConfig.banBindRelateAccount)
 
-         {
 
-             StartCoroutine(LoginController.Instance.Register(
 
-                 usrRecord, pwdRecord, (res) => {
 
-                     PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey(res.msg));
 
-                     if (res.code == 0) {
 
-                         //设置默认名字,为当前注册的账户信息
 
-                         InputField nickname = GetInputField(registerInNickname);
 
-                         if (_LoginValidateType == LoginValidateType.Email)
 
-                         {
 
-                             //邮箱裁剪一下
 
-                             //string[] arry = usrRecord.Trim().Split("@");
 
-                             //nickname.text = arry[0];
 
-                             nickname.text = usrRecord;
 
-                         }
 
-                         else {
 
-                             //手机直接设置电话号码
 
-                             nickname.text = usrRecord;
 
-                         }
 
-                        
 
-                         InitPage(true); //前往完善用户信息
 
-                         LoginView.ins.FillLoginInput(usrRecord, pwdRecord);
 
-                     }
 
-                 }
 
-             ));
 
-             return;
 
-         }
 
-         StartCoroutine(LoginController.Instance.Register2(
 
-             usrRecord, pwdRecord, _bindingEmail, _bindingPhone, (res) => {
 
-                 PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey(res.msg));
 
-                 if (res.code == 0) {
 
-                     //设置默认名字,为当前注册的账户信息
 
-                     InputField nickname = GetInputField(registerInNickname);
 
-                     if (_LoginValidateType == LoginValidateType.Email)
 
-                     {
 
-                         //邮箱裁剪一下
 
-                         //string[] arry = usrRecord.Trim().Split("@");
 
-                         nickname.text = usrRecord;
 
-                     }
 
-                     else
 
-                     {
 
-                         //手机直接设置电话号码
 
-                         nickname.text = usrRecord;
 
-                     }
 
-                     InitPage(true); //前往完善用户信息
 
-                     LoginView.ins.FillLoginInput(usrRecord, pwdRecord);
 
-                 }
 
-             }
 
-         ));
 
-     }
 
-     JCUnityLib.Throttler throttlerRegisterSave = new JCUnityLib.Throttler(2000);
 
-     public void RegisterSave() {
 
-         InputField nickname = GetInputField(registerInNickname);
 
-         string text_nickname = nickname.text.Trim();
 
-         if (text_nickname.Length == 0) {
 
-             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("请输入游戏昵称"));
 
-             return;
 
-         }
 
-         int gender = 0;
 
-         Transform toggleGroup = registerInGender.transform.Find("ToggleGroup");
 
-         for (int i = 0; i < toggleGroup.childCount; i++) {
 
-             if (toggleGroup.GetChild(i).GetComponent<Toggle>().isOn) {
 
-                 gender = i == 0 ? 1 : 2;
 
-                 break;
 
-             }
 
-         }
 
-         InputField birthday = GetInputField(registerInBirthday);
 
-         string text_birthday = birthday.text;
 
-         if (text_birthday.Length != 10) {
 
-             text_birthday = "2000-01-01";
 
-             // PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("未填写出生日期"));
 
-             // return;
 
-         }
 
-         InputField location = GetInputField(registerInLocation);
 
-         if (location.text.Length == 0) {
 
-             countryCode = "";
 
-             stateCode = "";
 
-             cityCode = "";
 
-             // PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("未填写所在地区"));
 
-             // return;
 
-         }
 
-         if (!AgreenmentOption.ins.IsAgreementChecked()) {
 
-             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("请阅读并同意App协议"));
 
-             return;
 
-         }
 
-         if (throttlerRegisterSave.CanPass() == false) {
 
-             PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey("操作过于频繁"));
 
-             return;
 
-         }
 
-         StartCoroutine(LoginController.Instance.CompleteUserInfo(
 
-             usrRecord, pwdRecord, text_nickname, gender, text_birthday,
 
-             countryCode, stateCode, cityCode 
 
-             ,(res) => {
 
-                 PopupMgr.ins.ShowTip(TextAutoLanguage2.GetTextByCNKey(res.msg));
 
-                 if (res.code == 0) {
 
-                     GameObject.FindObjectOfType<LoginMgr>().showLoginView();
 
-                 }
 
-             }
 
-         ));
 
-     }
 
-     #region Picker
 
-         [SerializeField] GameObject datePickerPrefab;
 
-         public void OpenDatePicker() {
 
-             GameObject o = GameObject.Instantiate(datePickerPrefab);
 
-             //o.GetComponentInChildren<JC.Unity.Picker.DatePickerGroup>().onEnter += (JC.Unity.Picker.DatePickerGroup picker) => {
 
-             //    GetInputField(registerInBirthday).text = picker.GetSelectDateStr();
 
-             //};
 
-             o.GetComponentInChildren<DatePickerGroupNew>().onEnter += (DatePickerGroupNew picker) =>
 
-             {
 
-                 GetInputField(registerInBirthday).text = picker.GetSelectDateStr();
 
-             };
 
-         }
 
-         [SerializeField] GameObject locationPickerPrefab;
 
-         private string countryCode = "", stateCode = "", cityCode = "";
 
-         public void OpenLocationPicker() {
 
-             // GameObject o = GameObject.Instantiate(locationPickerPrefab);
 
-             // o.GetComponentInChildren<JC.Unity.Picker.LocationPickerGroup>().onEnter += (JC.Unity.Picker.LocationInfo info) => {
 
-             //     countryCode = info.GetCountryRegion().Item2;
 
-             //     stateCode = info.GetState().Item2;
 
-             //     cityCode = info.GetCity().Item2;
 
-             //     GetInputField(registerInLocation).text = 
 
-             //         info.GetCountryRegion().Item1 + " " + 
 
-             //         info.GetState().Item1 + " " + 
 
-             //         info.GetCity().Item1;
 
-             // };
 
-             //2022-12-6 gps获取地理位置
 
-             GetLocation();
 
-         }
 
-         void GetLocation()
 
-         {
 
-             try
 
-             {
 
-                 System.Action eOnAgree = () => {
 
-                     GPSTool.GetAddress((address) => {
 
-                         if (address != null) {
 
-                             countryCode = address[0];
 
-                             stateCode = address[1];
 
-                             cityCode = address[2];
 
-                             GetInputField(registerInLocation).text = 
 
-                                 countryCode + " " + 
 
-                                 stateCode + " " + 
 
-                                 cityCode;
 
-                         }
 
-                     });
 
-                 };
 
-                 if (!HomeView.ShowProminentBeforeConnectBLE(eOnAgree)) eOnAgree.Invoke();
 
-             }
 
-             catch (System.Exception e) { Debug.LogError(e); }
 
-         }
 
-     #endregion
 
- }
 
 
  |