Пример #1
0
        public bool DataSet(int id, object a)
        {
            regions = LoadReagionsConfig.Instance.regionsInfo;
            Dropdown.OptionData op0 = new Dropdown.OptionData();
            op0.text = "请选择省份";
            ProvincelList.Add(op0);
            foreach (var province in regions)
            {
                Dropdown.OptionData op = new Dropdown.OptionData();
                op.text = province.Key;
                ProvincelList.Add(op);
            }
            Provincedropdown.AddOptions(ProvincelList);
            OnProvinceChange(0);
            if (PlayerSave.HasKey("province"))
            {
                Provincedropdown.value = PlayerSave.GetInt("province");
            }
            if (PlayerSave.HasKey("city"))
            {
                CityDropDown.value = PlayerSave.GetInt("city");
            }
            if (PlayerSave.HasKey("country"))
            {
                CountryDropDown.value = PlayerSave.GetInt("country");
            }

            if (PlayerSave.HasKey("pinpai"))
            {
                PinPaiDropDown.value = PlayerSave.GetInt("pinpai");
            }
            return(true);
        }
Пример #2
0
        public override void BuildUIContent()
        {
            base.BuildUIContent();
            CloseBtn = TargetGo.transform.Find("BG/CloseBtn").GetComponent <Button>();
            CloseBtn.onClick.AddListener(CloseView);
            LogoutBtn = TargetGo.transform.Find("BG/LogoutBtn").GetComponent <Button>();
            LogoutBtn.onClick.AddListener(OnClickLogout);

            Audio_On = TargetGo.transform.Find("BG/Audio/GameObject/Btn").GetComponent <Button>();
            Audio_On.onClick.AddListener(delegate() { this.OnClickAudioToggle(true); });
            Audio_Off = TargetGo.transform.Find("BG/Audio/GameObject/Btn (1)").GetComponent <Button>();
            Audio_Off.onClick.AddListener(delegate() { this.OnClickAudioToggle(false); });

            Volum_Slider          = TargetGo.transform.Find("BG/Volum/Slider").GetComponent <Slider>();
            Volum_Slider.minValue = 0;
            Volum_Slider.maxValue = 1.0f;
            Volum_Slider.onValueChanged.AddListener(OnChangeVolumn);
            if (PlayerSave.HasKey("ismute"))
            {
                if (PlayerSave.GetInt("ismute") == 0)
                {
                    Audio_On.gameObject.SetActive(false);
                    Audio_Off.gameObject.SetActive(true);
                    MusicManager.Instance.IsMute = false;
                }
                else
                {
                    Audio_On.gameObject.SetActive(true);
                    Audio_Off.gameObject.SetActive(false);

                    MusicManager.Instance.IsMute = true;
                }
            }
        }
Пример #3
0
        public override void OnOpen()
        {
            LoginController.Instance.GetDispatcher().AddListener(LoginEvent.VeriCodeSucc, RefrashUI);
            LoginController.Instance.GetDispatcher().AddListener(LoginEvent.ChangePWSucc, OnRegisterSucc);
            if (PlayerSave.HasKey("Account"))
            {
                Input.text = PlayerSave.GetString("Account");

//                Password.text = PlayerSave.GetString("Password");
            }
        }
Пример #4
0
 void MusicSetting()
 {
     if (PlayerSave.HasKey("ismute"))
     {
         if (PlayerSave.GetInt("ismute") == 1)
         {
             MusicManager.Instance.IsMute = true;
         }
         else
         {
             MusicManager.Instance.IsMute = false;
         }
     }
 }
Пример #5
0
        void Start()
        {
            //设置自动锁屏
            Screen.sleepTimeout = 60;
            //            PlayerPrefs.DeleteAll();
            //            GetObjectSample.GetObject("AsyncGetObject");
            //事件通知
            InitBaseClasses();
            //加载基础代码
            InitSigletonMonos();
            //为下面的配置类中事件,完成添加方法执�?
            InitListener();

            //加载配置文件,配置类中有事�?
            InitConfigs();
            //初始model
            InitModels();
            //注册网络组件方法
            InitControllers();
            //加载配置文件后才能打开
            //            ViewMgr.Instance.Open(ViewNames.PayChooseView);
            //没有key则为第一次登录
            if (isDebug)
            {
                PlayerPrefs.DeleteAll();
            }

            if (!PlayerSave.HasKey("isFirstLogin"))
            {
                isfirstLogin = true;
                //是第一
                PlayerSave.SetInt("isFirstLogin", 1);
            }
//            string pAlipayOrder = AlipayOrderMgr.Instance.GetAlipayOrder();

//            Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", pAlipayOrder, "test1"));

            //            //开发者模式
            //            if (isDebug)
            //            {
            //                isfirstLogin = true;
            //
            //            }
            //                        string  encrycode=  EncryptManager.EncryptDES("isFirstLogin", "98765432");
            //                        string  decrycode=  EncryptManager.DecryptDES(encrycode, "98765432");
            //
            //                        Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", encrycode, decrycode));
            MusicSetting();
        }
Пример #6
0
        public override void OnOpen()
        {
            base.OnOpen();
//            if (GameStarter.isfirstLogin)
            {
                EnterGameTweener = DotweenManager.DOLocalMoveY(TargetGo).SetAutoKill(false);
                GlobalDispatcher.Instance.AddListener(LoginEvent.OnLoginSucc, HideView);
                if (PlayerSave.HasKey("Account") || PlayerSave.HasKey("Password"))
                {
                    Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", PlayerSave.GetString("Account"), "test1"));

                    password.text     = PlayerSave.GetString("Password");
                    inputAccount.text = PlayerSave.GetString("Account");
                }
            }
        }
Пример #7
0
        public override void BuildSubViews()
        {
            inputName       = TargetGo.transform.Find("InputFieldName").GetComponent <InputField>();
            inputPhone      = TargetGo.transform.Find("InputFieldPhone").GetComponent <InputField>();
            inputAddress    = TargetGo.transform.Find("InputFieldAddress").GetComponent <InputField>();
            inputBeaty      = TargetGo.transform.Find("InputFieldBeauty").GetComponent <InputField>();
            commitBtn       = TargetGo.transform.Find("Button").GetComponent <Button>();
            commitBtnCancel = TargetGo.transform.Find("ButtonClose").GetComponent <Button>();
            ques            = TargetGo.transform.Find("ques").GetComponent <Button>();

            ques.onClick.AddListener((() => SystemMsgView.SystemFunction(Function.Tip, !string.IsNullOrEmpty(AnnouncementModel.Instance.ExpressInfo) ? AnnouncementModel.Instance.ExpressInfo : Info.Sendcash, 10f)));
            commitBtn.onClick.AddListener(OnClickCommit);
            commitBtnCancel.onClick.AddListener(Cancel);
            Provincedropdown = TargetGo.transform.Find("DropdownProvince").GetComponent <Dropdown>();
            Provincedropdown.onValueChanged.AddListener(OnProvinceChange);

            CityDropDown = TargetGo.transform.Find("DropdownCity").GetComponent <Dropdown>();
            CityDropDown.onValueChanged.AddListener(OnCityChange);
            PinPaiDropDown = TargetGo.transform.Find("PinPai").GetComponent <Dropdown>();



            CountryDropDown = TargetGo.transform.Find("DropdownCountry").GetComponent <Dropdown>();

            ExchangeGrid = TargetGo.transform.Find("DropdownBrand/grid/content").gameObject;

            Carriage = TargetGo.transform.Find("DropdownCarriage/Label").GetComponent <Text>();

            if (PlayerSave.HasKey("name"))
            {
                inputName.text = PlayerSave.GetString("name");
            }
            if (PlayerSave.HasKey("address"))
            {
                inputAddress.text = PlayerSave.GetString("address");
            }
            if (PlayerSave.HasKey("beaty"))
            {
                inputBeaty.text = PlayerSave.GetString("beaty");
            }
            if (PlayerSave.HasKey("phone"))
            {
                inputPhone.text = PlayerSave.GetString("phone");
            }

            base.BuildSubViews();
        }
Пример #8
0
        private void OnEnsurePayClik()
        {
            //直接登录模式直接调起
            if (PayOrderInterfaceMgr.Instance.payfor == PayFor.Login && !PlayerSave.HasKey("Login"))
            {
                NativeHandle handle = new NativeHandle();
                if (type == payType.alipay)
                {
                    object payData = PayOrderInterfaceMgr.Instance.GetDatas(LoginModel.Instance.Uid, Urltype.alipay, PayOrderInterfaceMgr.Instance.payfor, GetPayCount());
                    if (payData != null)
                    {
                        handle.Alipay(payData.ToString());

                        Debug.Log(string.Format("<color=#ffffffff><---{0}-{1}----></color>", payData.ToString(), "test1"));
                    }
                }
                else if (type == payType.wechat)
                {
                    object o = PayOrderInterfaceMgr.Instance.GetDatas(LoginModel.Instance.Uid, Urltype.wx, PayOrderInterfaceMgr.Instance.payfor, GetPayCount());
                    if (o != null)
                    {
                        PayData payData = o as PayData;
                        handle.WechatPay(payData.appid, payData.partnerid, payData.prepayid, payData.noncestr, payData.timestamp, payData.package, payData.sign);
                    }
                }
                else
                {
                    SystemMsgView.SystemFunction(Function.Tip, Info.Chooseone);
                }
            }
            else if (PayOrderInterfaceMgr.Instance.payfor == PayFor.Exchange)
            {
                CommitViewModel cvm = CommitViewModel.Instance;
                CommitController.Instance.OidExchangeReq(LoginModel.Instance.Uid, 1, cvm.Name, cvm.Phone, cvm.Province, cvm.City, cvm.Country, cvm.SelectPinpai, cvm.Address, cvm.Beaty, (int)type);
            }
            EnsurePay.onClick.RemoveListener(OnEnsurePayClik);
        }
Пример #9
0
        /// <summary>
        /// 隐藏面板动画
        ///
        /// </summary>
        public bool HideView(int id, object arg)
        {
            CloseViewInfo closeView = arg as CloseViewInfo;
            int           pattern   = closeView.pattern;

            //返回的时候保存密码
            if (PlayerSave.HasKey("Account") || PlayerSave.HasKey("Password"))
            {
                password.text     = PlayerSave.GetString("Password");
                inputAccount.text = PlayerSave.GetString("Account");
            }
            if (pattern == 0)
            {
                //直接登录动画
                EnterGameTweener.PlayBackwards();

                EnterGameTweener.onPause += () =>
                {
                    LoginEnterToMain();
                };
            }
            else if (pattern == 1)
            {
                //注册账号界面直接登录
                RegisterViewTweener.PlayBackwards();

                RegisterViewTweener.onPause += () =>
                {
                    LoginEnterToMain();
                };
            }
            else if (pattern == 2)
            {
                ChangePWViewTweener.PlayBackwards();

                ChangePWViewTweener.onPause += () =>
                {
                    LoginEnterToMain();
                };
            }
            else if (pattern == 3)
            {
                //注册账号界面直接登录
                RegisterViewTweener.PlayBackwards();

                RegisterViewTweener.onPause += () =>
                {
                    lv.EnterGameView.SetActive(true);
                    EnterGameTweener.PlayForward();
                    if (PlayerSave.HasKey("Account") && PlayerSave.HasKey("Password"))
                    {
                        password.text     = PlayerSave.GetString("Password");
                        inputAccount.text = PlayerSave.GetString("Account");
                    }
                };
            }
            else if (pattern == 4)
            {
                ChangePWViewTweener.PlayBackwards();

                ChangePWViewTweener.onPause += () =>
                {
                    lv.EnterGameView.SetActive(true);

                    EnterGameTweener.PlayForward();
                    if (PlayerSave.HasKey("Account") && PlayerSave.HasKey("Password"))
                    {
                        password.text     = PlayerSave.GetString("Password");
                        inputAccount.text = PlayerSave.GetString("Account");
                    }
                };
            }

            return(false);
        }