public void PhonePass() { if (/*!DataManager.Instance.usersData.isExitUser(phoneNumber.text) && */ UserInformationCheckout.userPhone(phoneNumber.text) && phoneIsPass.activeSelf == false) { phoneIsPass.SetActive(true); } else if (!UserInformationCheckout.userPhone(phoneNumber.text) && phoneIsPass.activeSelf == true) { phoneIsPass.SetActive(false); } }
public void CompanyPass() { if (UserInformationCheckout.userCompany(company.text) && companyIsPass.activeSelf == false) { companyIsPass.SetActive(true); } else if (!UserInformationCheckout.userCompany(company.text) && companyIsPass.activeSelf == true) { companyIsPass.SetActive(false); } }
public void WeightPass() { if (UserInformationCheckout.userWeight(weight.text) && weightIsPass.activeSelf == false) { weightIsPass.SetActive(true); } else if (!UserInformationCheckout.userWeight(weight.text) && weightIsPass.activeSelf == true) { weightIsPass.SetActive(false); } }
public void NamePass() { if (UserInformationCheckout.nameJudge(userName.text) && nameIsPass.activeSelf == false) { nameIsPass.SetActive(true); } else if (!UserInformationCheckout.nameJudge(userName.text) && nameIsPass.activeSelf == true) { nameIsPass.SetActive(false); } }
//List<UserInfo> userList; // Use this for initialization void Start() { PC_MainRootUI = gameObject.GetComponent <RectTransform>(); userNumber = transform.Find("Background/UserNumber").GetComponent <Text>(); userName = transform.GetChild(1).Find("InputField_Name").GetComponent <InputField>(); man = transform.GetChild(1).Find("Toggle_Man").GetComponent <Toggle>(); woman = transform.GetChild(1).Find("Toggle_Woman").GetComponent <Toggle>(); height = transform.GetChild(1).Find("InputField_Height").GetComponent <InputField>(); weight = transform.GetChild(1).Find("InputField_Weight").GetComponent <InputField>(); company = transform.GetChild(1).Find("InputField_Company").GetComponent <InputField>(); phoneNumber = transform.GetChild(1).Find("InputField_Phone").GetComponent <InputField>(); isGoOn = transform.GetChild(1).Find("Toggle_GoOn").GetComponent <Toggle>(); // brithday = transform.GetChild(0).Find("DatePicker 1 (1)").GetChild(0).GetComponent<Text>(); //选择出生年月日 age_Year = transform.GetChild(1).Find("Dropdown_Age/Dropdown_Year").gameObject; age_Mouth = transform.GetChild(1).Find("Dropdown_Age/Dropdown_Month").gameObject; age_Day = transform.GetChild(1).Find("Dropdown_Age/Dropdown_Day").gameObject; age_Year_Text = age_Year.transform.Find("Label").GetComponent <Text>(); age_Mouth_Text = age_Mouth.transform.Find("Label").GetComponent <Text>(); age_Day_Text = age_Day.transform.Find("Label").GetComponent <Text>(); // brithday = transform.GetChild(1).Find("InputField_Age").GetComponent<InputField>(); nameIsPass = userName.transform.Find("IsPass").gameObject; ageIsPass = transform.GetChild(1).Find("Dropdown_Age/IsPass").gameObject; heightIsPass = height.transform.Find("IsPass").gameObject; weightIsPass = weight.transform.Find("IsPass").gameObject; companyIsPass = company.transform.Find("IsPass").gameObject; phoneIsPass = phoneNumber.transform.Find("IsPass").gameObject; birthdayInformation = age_Year_Text.text + age_Mouth_Text.text + age_Day_Text.text; checkout = new UserInformationCheckout(); }
//添加一个 void AddOneInfo(bool goOn) { if (userName.text == "" | company.text == "" | height.text == "" | phoneNumber.text == "" | weight.text == "") { Debug.Log("请完善信息"); return; } if (birthdayInformation == age_Year_Text.text + age_Mouth_Text.text + age_Day_Text.text | age_Year_Text.text == "" | age_Mouth_Text.text == "" | age_Day_Text.text == "") { Debug.Log("请更改生日"); return; } if ((!man.isOn && !woman.isOn)) { Debug.Log("请选择性别"); return; } if (!UserInformationCheckout.nameJudge(userName.text)) { Debug.Log("用户名输入错误,2-10个汉字以内或15个英文字母"); return; } if (!UserInformationCheckout.userCompany(company.text)) { Debug.Log("公司名输入错误,15个汉字以内或25个英文字母"); return; } if (!UserInformationCheckout.userHeight(height.text)) { Debug.Log("请输入一个有效的身高(0-230),单位cm"); return; } if (!phoneIsPass.activeSelf) { //if (DataManager.Instance.usersData.isExitUser(phoneNumber.text)) { Debug.Log("手机号已经注册"); } } if (!UserInformationCheckout.userPhone(phoneNumber.text)) { Debug.Log("手机号输入错误"); return; } if (!UserInformationCheckout.userWeight(weight.text)) { Debug.Log("请输入一个有效的重量"); return; } if (!ageIsPass.activeSelf) { Debug.Log("请更改生日"); //请更改生日 return; } //for (int i = 0; i < DataManager.Instance.usersData.userList.Count; i++) //{ // if (DataManager.Instance.usersData.isExitUser (phoneNumber.text)) // { // PromptManager.Instance.ShowPrompt(5020, null, null); // Debug.Log("手机号已经注册"); // //手机号已经注册了 // return; // } //} if (man.isOn) { SaveBrn(userName.text, GenderEnum.Male, Convert.ToInt32(height.text), age_Year_Text.text + age_Mouth_Text.text + age_Day_Text.text, Convert.ToInt32(weight.text), company.text, phoneNumber.text, null); Debug.Log("添加成功"); } if (woman.isOn) { SaveBrn(userName.text, GenderEnum.Female, Convert.ToInt32(height.text), age_Year_Text.text + age_Mouth_Text.text + age_Day_Text.text, Convert.ToInt32(weight.text), company.text, phoneNumber.text, null); Debug.Log("添加成功"); } //DataManager.Instance.SaveUserData();//存储 if (!goOn) { Close(); } }