Example #1
0
 private void Awake()
 {
     _inst = this;
     toMainPage();
 }
Example #2
0
        // Use this for initialization
        void Start()
        {
            mainui = GetComponent <mainUISet>();

            #region 主页
            btn_touser.onClick.AddListener(delegate
            {
                mainui.ShowUI(mainUISet.UIname.user_center, 0);
            });
            btn_tospot.onClick.AddListener(delegate
            {
                mainui.ShowUI(mainUISet.UIname.spot, 0);
            });
            btn_tochange.onClick.AddListener(delegate
            {
                mainui.ShowUI(mainUISet.UIname.change, 0);
            });
            btn_togps.onClick.AddListener(delegate
            {
                mainui.LoadScene("gpsConvert");
            });
            btn_toarscan.onClick.AddListener(delegate
            {
                mainui.LoadScene("ARScan");
            });
            btn_toyiyou.onClick.AddListener(delegate
            {
                mainui.LoadScene("yiyou");
            });


            #endregion

            #region 景点列表

            btn_spotback.onClick.AddListener(delegate
            {
                mainui.HideUI(mainUISet.UIname.spot, 0);
            });

            #endregion

            #region 移空换景列表

            btn_changeback.onClick.AddListener(delegate
            {
                mainui.HideUI(mainUISet.UIname.change, 0);
            });
            btn_changtogpscancel.onClick.AddListener(delegate
            {
                mainui.HideUI(mainUISet.UIname.change, 1);
            });
            btn_changtogpssure.onClick.AddListener(delegate
            {
                mainui.LoadScene("gpsConvert");
            });
            #endregion

            #region 个人中心

            btn_centerback.onClick.AddListener(delegate
            {
                mainui.HideUI(mainUISet.UIname.user_center, 0);
            });

            btn_centertofoot.onClick.AddListener(delegate
            {
                mainui.LoadScene("Track");
            });
            btn_centertoabout.onClick.AddListener(delegate
            {
                mainui.ShowUI(mainUISet.UIname.user_about, 0);
            });
            btn_centertoset.onClick.AddListener(delegate
            {
                mainui.ShowUI(mainUISet.UIname.user_set, 0);
            });
            btn_centertoabout2.onClick.AddListener(delegate
            {
                mainui.ShowUI(mainUISet.UIname.user_about, 0);
            });
            btn_centertoset2.onClick.AddListener(delegate
            {
                mainui.ShowUI(mainUISet.UIname.user_set, 0);
            });

            btn_centerlogout.onClick.AddListener(delegate
            {
                LogOut();
            });
            btn_centertoeditor.onClick.AddListener(delegate
            {
                mainui.ShowUI(mainUISet.UIname.user_editor, 0);
            });
            btn_centerenter.onClick.AddListener(delegate
            {
                LogOut();
            });

            #endregion

            #region 编辑界面

            btn_editorback.onClick.AddListener(delegate
            {
                mainui.HideUI(mainUISet.UIname.user_editor, 0);
            });
            btn_editor_nameback.onClick.AddListener(delegate
            {
                mainui.HideUI(mainUISet.UIname.user_editor, 1);
            });
            btn_editor_phoback.onClick.AddListener(delegate
            {
                mainui.HideUI(mainUISet.UIname.user_editor, 2);
            });
            btn_editor_passwordback.onClick.AddListener(delegate
            {
                mainui.HideUI(mainUISet.UIname.user_editor, 3);
            });
            btn_editor_headback.onClick.AddListener(delegate
            {
                mainui.HideUI(mainUISet.UIname.user_editor, 4);
            });



            btn_editortoname.onClick.AddListener(delegate
            {
                mainui.ShowUI(mainUISet.UIname.user_editor, 1);
            });
            btn_editortopho.onClick.AddListener(delegate
            {
                mainui.ShowUI(mainUISet.UIname.user_editor, 2);
            });
            btn_editortoword.onClick.AddListener(delegate
            {
                mainui.ShowUI(mainUISet.UIname.user_editor, 3);
            });
            btn_editortohead.onClick.AddListener(delegate
            {
                mainui.ShowUI(mainUISet.UIname.user_editor, 4);
            });

            headbtn[0].onClick.AddListener(delegate
            {
                mainui.SetHeadID(0);
            });
            headbtn[1].onClick.AddListener(delegate
            {
                mainui.SetHeadID(1);
            });
            headbtn[2].onClick.AddListener(delegate
            {
                mainui.SetHeadID(2);
            });
            headbtn[3].onClick.AddListener(delegate
            {
                mainui.SetHeadID(3);
            });
            headbtn[4].onClick.AddListener(delegate
            {
                mainui.SetHeadID(4);
            });
            headbtn[5].onClick.AddListener(delegate
            {
                mainui.SetHeadID(5);
            });


            namesure.onClick.AddListener(delegate
            {
                SetUserName(nametext);
            });


            emptyname.onClick.AddListener(delegate
            {
                nametext.GetComponentInParent <InputField>().text = "";
            });

            #endregion

            #region About界面

            btn_aboutback.onClick.AddListener(delegate
            {
                mainui.HideUI(mainUISet.UIname.user_about, 0);
            });
            btn_yinsiback.onClick.AddListener(delegate
            {
                mainui.HideUI(mainUISet.UIname.user_about, 1);
            });
            btn_xieyiback.onClick.AddListener(delegate
            {
                mainui.HideUI(mainUISet.UIname.user_about, 2);
            });
            btn_showyinsi.onClick.AddListener(delegate
            {
                mainui.ShowUI(mainUISet.UIname.user_about, 1);
            });
            btn_showxieyi.onClick.AddListener(delegate
            {
                mainui.ShowUI(mainUISet.UIname.user_about, 2);
            });
            btn_update.onClick.AddListener(delegate
            {
                mainui.isTip = true;
                HttpManager.Instance.UpdateApp((b) =>
                {
                    if (b.Contains("200"))
                    {
                        JsonData content = JsonMapper.ToObject(b);
                        JsonData date    = content["data"];
                        if (date["appVersion"].ToString() == GlobalInfo.APPversion)
                        {
                            PP.ShowPopup("", "当前已是最新版本");
                        }
                        else
                        {
                            PP.ShowUpdatePP();
                        }
                    }
                    else
                    {
                        PP.ShowPopup("", "网络出错!");
                    }
                });
            });
            #endregion

            #region Set界面

            btn_setback.onClick.AddListener(delegate
            {
                mainui.HideUI(mainUISet.UIname.user_set, 0);
            });
            btn_fankuiback.onClick.AddListener(delegate
            {
                mainui.HideUI(mainUISet.UIname.user_set, 1);
                for (int i = 0; i < btn_fankuitype.Length; i++)
                {
                    btn_fankuitype[i].SetActive(false);
                }
            });
            btn_shareapp.onClick.AddListener(delegate
            {
                ShowShareMenu();
            });
            btn_settofankui.onClick.AddListener(delegate
            {
                mainui.ShowUI(mainUISet.UIname.user_set, 1);
            });
            btn_fankuisure.onClick.AddListener(delegate
            {
                Suggest(fankuitext);
            });

            #endregion

            #region 编辑手机号
            BindingPage_BindingBtn.onClick.AddListener((() =>
            {
                if (VerifyPhoneNo(BindingPage_PhoneNoInputField.text))
                {
                    if (VerifySMSCode(BindingPage_SmsCodeInputField.text))
                    {
                        if (!isHit)
                        {
                            isHit = true;
                            HttpManager.Instance.ChangePhoneNo(BindingPage_PhoneNoInputField.text, BindingPage_SmsCodeInputField.text, (PopupInfo));
                        }
                    }
                    else
                    {
                        PP.ShowPopup("", "请输入正确的验证码");
                    }
                }
                else
                {
                    PP.ShowPopup("", "请输入正确的手机号");
                }
            }));

            BindingPage_GetSMSBtn.onClick.AddListener((() =>
            {
                if (BindingPage_PhoneNoInputField.text == PublicAttribute.UserInfo.PhoneNo)
                {
                    PP.ShowPopup("", "请输入其他手机号");
                    return;
                }
                if (VerifyPhoneNo(BindingPage_PhoneNoInputField.text))
                {
                    FreezeButton(BindingPage_GetSMSBtn);
                    HttpManager.Instance.GetSMSS(BindingPage_PhoneNoInputField.text, (b =>
                    {
                        Debug.Log("获取短信验证码 " + b);
                    }));
                }
                else
                {
                    PP.ShowPopup("格式不正确", "请输入正确的手机号");
                }
            }));
            #endregion

            #region  载
            btn_down.onClick.AddListener(delegate
            {
                mainui.panel_down.SetActive(false);
            });
            #endregion
        }