예제 #1
0
 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);
     }
 }
예제 #2
0
        //添加一个
        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();
            }
        }