Exemplo n.º 1
0
        protected override void OnInit(QFramework.IUIData uiData)
        {
            mData = uiData as CollectGiftBoxPanelData ?? new CollectGiftBoxPanelData();
            BtnCheck.onClick.AddListener(() =>
            {
                SimpleEventSystem.Publish(new CollectGiftBoxPanelClosed(mData.Type));
                Back();
            });
            if (mData.Type == CollectGiftBoxType.Exchange)
            {
                var texture2D = mResLoader.LoadSync <Texture2D>("text_exchange_succee");
                ImgSuccess.sprite = Sprite.Create(texture2D, new Rect(0, 0, texture2D.width, texture2D.height), Vector2.one * 0.5f);

                var giftTexture2D = mResLoader.LoadSync <Texture2D>("text_baby_exclusive_gift");
                ImgName.sprite = Sprite.Create(giftTexture2D, new Rect(0, 0, giftTexture2D.width, giftTexture2D.height), Vector2.one * 0.5f);
            }
            else if (mData.Type == CollectGiftBoxType.ChineseLearningPlan)
            {
                var texture2D = mResLoader.LoadSync <Texture2D>("text_received_succee");
                ImgSuccess.sprite = Sprite.Create(texture2D, new Rect(0, 0, texture2D.width, texture2D.height), Vector2.one * 0.5f);
                var giftTexture2D = mResLoader.LoadSync <Texture2D>("text_chinese_learning_plan");
                ImgName.sprite = Sprite.Create(giftTexture2D, new Rect(0, 0, giftTexture2D.width, giftTexture2D.height), Vector2.one * 0.5f);
            }
            else if (mData.Type == CollectGiftBoxType.EnglishLearningPlan)
            {
                var texture2D = mResLoader.LoadSync <Texture2D>("text_received_succee");
                ImgSuccess.sprite = Sprite.Create(texture2D, new Rect(0, 0, texture2D.width, texture2D.height), Vector2.one * 0.5f);
                var giftTexture2D = mResLoader.LoadSync <Texture2D>("text_english_learning_plan");
                ImgName.sprite = Sprite.Create(giftTexture2D, new Rect(0, 0, giftTexture2D.width, giftTexture2D.height), Vector2.one * 0.5f);
            }
        }
Exemplo n.º 2
0
 protected override void OnInit(QFramework.IUIData uiData)
 {
     mData = uiData as ChoosePhotoPanelData ?? new ChoosePhotoPanelData();
     // please add init code here
     BtnCancel.onClick.AddListener(() => {
         Back();
     });
     BtnAlbum.onClick.AddListener(() => {
         SimpleEventSystem.Publish(new ChoosePhotoClick(mData.action, NativeAction.Album));
         Back();
     });
     BtnCamera.onClick.AddListener(() => {
         SimpleEventSystem.Publish(new ChoosePhotoClick(mData.action, NativeAction.Camera));
         Back();
     });
     if (mData.showTip)
     {
         TextTip.gameObject.SetActive(true);
         TextCamera.text = "拍摄";
     }
     else
     {
         TextTip.gameObject.SetActive(false);
         TextCamera.text = "拍照";
     }
 }
Exemplo n.º 3
0
        private void StartResquestForDelBabyAddress()
        {
            Dictionary <string, object> paramDict = new Dictionary <string, object>();

            paramDict.Add("inviteId", PlayerPrefsUtil.GetUserId());
            paramDict.Add("inviteeMobile", InputMobile.text);
            paramDict.Add("inviteeBabyRelation", relation);
            HttpUtil.PostWithSign <int>(UrlConst.DoCheckInviteValid, paramDict)
            .Subscribe(response =>
            {
                if (response == 1)
                {
                    Dictionary <string, object> message = new Dictionary <string, object>();
                    message.Add("mobile", InputMobile.text);
                    message.Add("content", "【环球少儿app】邀请你加入,快来跟我一起读绘本吧!");
                    NativeGallery.GetSomethingFromNative((json, action) =>
                    {
                    }, (int)NativeAction.SendSMS, message.ToJson());
                }
                CommonUtil.toast("邀请成功");
                SimpleEventSystem.Publish(new UpdateBaseInfoDate(true));
                Back();
            }
                       , e =>
            {
                if (e is HttpException)
                {
                    HttpException http = e as HttpException;
                    Log.E("弹吐司" + http.Message);
                }
            }).AddTo(this);
        }
Exemplo n.º 4
0
 public void UpdateVol(string msg)
 {
     Log.I("UpdateVol: " + msg);
     if (msg.IsNotNullAndEmpty())
     {
         SimpleEventSystem.Publish(new UpdateVol(msg));
     }
 }
Exemplo n.º 5
0
 public void ScanQR(string msg)
 {
     Log.I("ScanQR: " + msg);
     if (msg.IsNotNullAndEmpty())
     {
         SimpleEventSystem.Publish(new ScanQRResult(msg));
     }
 }
Exemplo n.º 6
0
 protected override void OnInit(QFramework.IUIData uiData)
 {
     mData = uiData as MessageMaskPanelData ?? new MessageMaskPanelData();
     SimpleEventSystem.Publish(new CanvasDotMove());
     TvContent.text = mData.Content;
     TvTitle.text   = mData.Title;
     BtnClick.onClick.AddListener(() => { Back(); });
 }
Exemplo n.º 7
0
        public void UpdateMonth()
        {
            SimpleEventSystem.Publish(new CanvasCanMove());
            var boxMonthIndex = PlayerPrefsUtil.GetBoxMonthIndex();

            BoxModel     = PlayerPrefsUtil.ContentModel.boxList[boxMonthIndex];
            TvTitle.text = BoxModel.name;
            mPlayer.GetComponent <MasterController>().SetData(BoxModel);
        }
Exemplo n.º 8
0
        /**
         * 视频压缩
         */
        public void VideoCompress(string json)
        {
            Log.I("VideoCompress: " + json);
            VideoCompressModel model = SerializeHelper.FromJson <VideoCompressModel>(json);

            if (model != null)
            {
                SimpleEventSystem.Publish(new VideoCompressResult(model));
            }
        }
Exemplo n.º 9
0
        /**
         * 设备绑定配网
         * {deviceId,"xx",state:"1"}
         */
        public void BindDevice(string msg)
        {
            Log.I("BindDevice: " + msg);
            BindDeviceModel model = SerializeHelper.FromJson <BindDeviceModel>(msg);

            if (model != null)
            {
                SimpleEventSystem.Publish(new BindDeviceResult(model));
            }
        }
Exemplo n.º 10
0
        // Update is called once per frame
        void Update()
        {
            if (Input.GetMouseButtonUp(0))
            {
                SimpleEventSystem.Publish(new A());
            }

            if (Input.GetMouseButtonUp(1))
            {
                SimpleEventSystem.Publish(new B());
            }
        }
Exemplo n.º 11
0
 private void ConnectResult(bool isSuccess)
 {
     SimpleEventSystem.Publish(new CloseBindCheckWIFI());
     if (isSuccess)
     {
         ModifyConnectImageStatueSuccess();
     }
     else
     {
         ModifyConnectImageStatusFail();
     }
 }
Exemplo n.º 12
0
 protected override void OnInit(QFramework.IUIData uiData)
 {
     mData = uiData as DatePickerPanelData ?? new DatePickerPanelData();
     // please add init code here
     // PickerPanel.Init(DateTime.Now, delegate
     // {
     //     Log.I(PickerPanel._selectDate.ToString());
     // } );
     PickerPanel.Init(DateTime.Parse(mData.birthday));
     BtnCancel.onClick.AddListener(() => {
         Back();
     });
     BtnConfirm.onClick.AddListener(() => {
         SimpleEventSystem.Publish(new SelectPickDate(PickerPanel._selectDate.ToString("yyyy-MM-dd")));
         Back();
     });
 }
Exemplo n.º 13
0
        void StartRequestForPunch(string filePath)
        {
            Dictionary <string, object> paramDict = new Dictionary <string, object>();

            paramDict.Add("babyId", PlayerPrefsUtil.GetBabyId());
            paramDict.Add("relBoxId", mData.BoxId);
            paramDict.Add("boxDay", mData.BoxDay);
            if (mData.Action == AttendanceAdd.Audio)
            {
                paramDict.Add("duration", (int)(MicrophoneManager.GetInstance().GetClipLength() * 1000));
            }
            paramDict.Add("punchText", InputContent.text);
            paramDict.Add("punchType", (int)mData.Action);
            paramDict.Add("punchPath", filePath);
            HttpUtil.PostWithSign <AttendanceModel>(UrlConst.Punch, paramDict)
            .Subscribe(response =>
            {
                LoadingManager.GetInstance().DismissLoading();
                if (PlayerPrefsUtil.LockModels[PlayerPrefsUtil.GetBoxMonthIndex()].boxDayList.IsNull())
                {
                    PlayerPrefsUtil.LockModels[PlayerPrefsUtil.GetBoxMonthIndex()].boxDayList = new List <int>();
                }
                if (PlayerPrefsUtil.LockModels[PlayerPrefsUtil.GetBoxMonthIndex()].boxDayList
                    .Contains(mData.BoxDay))
                {
                    PlayerPrefsUtil.LockModels[PlayerPrefsUtil.GetBoxMonthIndex()].boxDayList.Remove(mData.BoxDay);
                }
                PlayerPrefsUtil.LockModels[PlayerPrefsUtil.GetBoxMonthIndex()].boxDayList.Add(mData.BoxDay);
                Log.I("发布:" + mData.Action);
                BtnPush.enabled = true;
                SimpleEventSystem.Publish(new AttendanceSuccess(true));
                UIMgr.OpenPanel <AttendanceSharePanel>(new AttendanceSharePanelData()
                {
                    AttendanceModel = response
                }, UITransitionType.CIRCLE);
                Close();
            }
                       , e =>
            {
                BtnPush.enabled = true;
                if (e is HttpException)
                {
                    HttpException http = e as HttpException;
                }
            }).AddTo(this);
        }
Exemplo n.º 14
0
        protected override void OnInit(QFramework.IUIData uiData)
        {
            mData = uiData as AddressPickerPanelData ?? new AddressPickerPanelData();
            Dictionary <string, object> paramDict = new Dictionary <string, object>();

            if (PlayerPrefsUtil.ProvinceModels.IsNull())
            {
                HttpUtil.GetWithSign <List <ProvinceModel> >(UrlConst.ProvinceCityAreaList, paramDict)
                .Subscribe(response =>
                {
                    PlayerPrefsUtil.ProvinceModels = response;
                    if (mData.selectAddress != null)
                    {
                        PickerPanel.Init(response, mData.selectAddress);
                    }
                    else
                    {
                        PickerPanel.Init(response);
                    }
                }
                           , e =>
                {
                }).AddTo(this);
            }
            else
            {
                if (mData.selectAddress != null)
                {
                    PickerPanel.Init(PlayerPrefsUtil.ProvinceModels, mData.selectAddress);
                }
                else
                {
                    PickerPanel.Init(PlayerPrefsUtil.ProvinceModels);
                }
            }
            BtnCancel.onClick.AddListener(() => {
                Back();
            });
            BtnConfirm.onClick.AddListener(() => {
                SimpleEventSystem.Publish(new SelectAddressDate(PickerPanel.selectAddress));
                Back();
            });
        }
Exemplo n.º 15
0
 private void Awake()
 {
     helpPanelTween = transform.DOLocalMoveY(0, 0.5f).SetEase(Ease.InOutCubic);
     helpPanelTween.SetAutoKill(false);
     helpPanelTween.Pause();
     IsShow.Subscribe(IsShow =>
     {
         if (IsShow)
         {
             SimpleEventSystem.Publish(new CanvasDotMove());
             helpPanelTween.PlayForward();
         }
         else
         {
             SimpleEventSystem.Publish(new CanvasCanMove());
             helpPanelTween.PlayBackwards();
         }
     });
 }
Exemplo n.º 16
0
        void StartResquestForDoSetRelation()
        {
            BtnUserConfirm.enabled = false;
            Dictionary <string, object> paramDict = new Dictionary <string, object>();

            paramDict.Add("relation", mRelation);
            paramDict.Add("userId", PlayerPrefsUtil.GetUserId());
            HttpUtil.PostWithSign <UserInfoModel>(UrlConst.DoSetRelation, paramDict, "userHead.jpg", mUserHead)
            .Subscribe(response =>
            {
                BtnUserConfirm.enabled   = true;
                response.deviceId        = PlayerPrefsUtil.GetDeviceId();
                response.token           = PlayerPrefsUtil.GetToken();
                PlayerPrefsUtil.UserInfo = response;
                if (mData.IsEdit)
                {
                    SimpleEventSystem.Publish(new UpdateUserDate(true));
                    Back();
                }
                else
                {
                    if (PlayerPrefsUtil.GetDeviceId().IsNullOrEmpty())
                    {
                        UIMgr.OpenPanel <BindGuidePanel>(new BindGuidePanelData(), UITransitionType.CIRCLE, this);
                    }
                    else
                    {
                        CommonUtil.OpenCloudMain(this);
                    }
                }
            }
                       , e =>
            {
                BtnUserConfirm.enabled = true;
                if (e is HttpException)
                {
                    HttpException http = e as HttpException;
                    Log.E("弹吐司" + http.Message);
                }
            }).AddTo(this);
        }
Exemplo n.º 17
0
        private void StartResquestForDelBabyAddress()
        {
            Dictionary <string, object> paramDict = new Dictionary <string, object>();

            paramDict.Add("id", mData.AddressInfo.id);
            HttpUtil.PostWithSign <object>(UrlConst.DelBabyAddress, paramDict)
            .Subscribe(response =>
            {
                CommonUtil.toast("删除地址成功");
                SimpleEventSystem.Publish(new UpdateAddressDate(true));
                Back();
            }
                       , e =>
            {
                if (e is HttpException)
                {
                    HttpException http = e as HttpException;
                    Log.E("弹吐司" + http.Message);
                }
            }).AddTo(this);
        }
Exemplo n.º 18
0
        private void StartRequestForDoTransferManager()
        {
            Dictionary <string, object> param = new Dictionary <string, object>();

            param.Add("userId", mFamilyModel.id);
            param.Add("deviceId", PlayerPrefsUtil.GetDeviceId());
            HttpUtil.PostWithSign <int>(UrlConst.DoTransferManager, param)
            .Subscribe(response =>
            {
                CommonUtil.toast("转让成功");
                SimpleEventSystem.Publish(new UpdateBaseInfoDate(true));
                Back();
            }, e =>
            {
                if (e is HttpException)
                {
                    HttpException http = e as HttpException;
                    Log.E("弹吐司" + http.Message);
                }
            }).AddTo(this);
        }
Exemplo n.º 19
0
 protected override void OnInit(QFramework.IUIData uiData)
 {
     mData            = uiData as MainGuidePanelData ?? new MainGuidePanelData();
     mMainAnimationGo = mResLoader.LoadSync <GameObject>("MainAnimation")
                        .Instantiate()
                        .transform
                        .LocalScale(1.35475f, 1.35475f, 1.35475f)
                        .Position(-11.436f, -5.028f, 0)
                        .ApplySelfTo((self) =>
     {
         mMainAnimation = self.GetComponent <MainAnimation>();
     })
                        .gameObject;
     mMainAnimation.LionNotify();
     ImgChineseNotify.onClick.AddListener(() =>
     {
         ImgChineseNotify.gameObject.SetActive(false);
         mMainAnimation.DionNotify();
         ImgEnglishNotify.gameObject.SetActive(true);
     });
     ImgEnglishNotify.onClick.AddListener(() =>
     {
         ImgEnglishNotify.gameObject.SetActive(false);
         mMainAnimation.TongTongNotify();
         ImgLearningNotify.gameObject.SetActive(true);
     });
     ImgWifiNotify.onClick.AddListener(() =>
     {
         SimpleEventSystem.Publish(new MainPanelGuideDismiss());
         Back();
     });
     ImgLearningNotify.onClick.AddListener(() =>
     {
         ImgLearningNotify.gameObject.SetActive(false);
         mMainAnimation.WifiNotify();
         ImgWifiNotify.gameObject.SetActive(true);
     });
 }
Exemplo n.º 20
0
        void StartResquestForDoUpdateBabyInfo()
        {
            if (mBabyHead.IsNullOrEmpty())
            {
                if (mData.BabyInfoModel.babyLogoUrl.IsNullOrEmpty())
                {
                    CommonUtil.toast("请选择宝宝头像");
                    return;
                }
            }
            BtnBabyConfirm.enabled = false;
            Dictionary <string, object> paramDict = new Dictionary <string, object>();

            paramDict.Add("name", InputName.text);
            paramDict.Add("sex", mSex);
            paramDict.Add("birthday", TextBirthday.text);
            paramDict.Add("babyId", mData.BabyInfoModel.id);
            HttpUtil.PostWithSign <BabyInfoModel>(UrlConst.DoUpdateBabyInfo, paramDict, "babyHead.jpg", mBabyHead)
            .Subscribe(response =>
            {
                BtnBabyConfirm.enabled      = true;
                UserInfoModel userInfoModel = PlayerPrefsUtil.UserInfo;
                userInfoModel.babyInfoVo    = response;
                PlayerPrefsUtil.UserInfo    = userInfoModel;
                SimpleEventSystem.Publish(new UpdateUserDate(true));
                Back();
            }
                       , e =>
            {
                BtnBabyConfirm.enabled = true;
                if (e is HttpException)
                {
                    HttpException http = e as HttpException;
                    Log.E("弹吐司" + http.Message);
                }
            }).AddTo(this);
        }
Exemplo n.º 21
0
 protected override void OnInit(QFramework.IUIData uiData)
 {
     mData = uiData as TipPanelData ?? new TipPanelData();
     if (mData.isHideConfirmButton)
     {
         BtnConfirm.gameObject.SetActive(false);
     }
     if (mData.isHideCancelButton)
     {
         BtnCancel.gameObject.SetActive(false);
     }
     if (mData.strCancel.IsNotNullAndEmpty())
     {
         TextCancel.text = mData.strCancel;
     }
     if (mData.strConfirm.IsNotNullAndEmpty())
     {
         TextConfirm.text = mData.strConfirm;
     }
     if (mData.strTitle.IsNotNullAndEmpty())
     {
         TextTitle.text = mData.strTitle;
     }
     TextTip.text = mData.message;
     // please add init code here
     BtnCancel.onClick.AddListener(() => {
         Back();
     });
     BtnConfirm.onClick.AddListener(() => {
         if (!mData.removeConfirmCallback)
         {
             SimpleEventSystem.Publish(new TipConfirmClick(mData.action));
         }
         Back();
     });
 }
Exemplo n.º 22
0
 /**
  * 分享回调 1成功2失败3取消
  */
 public void ShareResult(string status)
 {
     Log.I("ShareResult: " + status);
     SimpleEventSystem.Publish(new ShareResult(status));
 }
Exemplo n.º 23
0
 protected override void OnClose()
 {
     SimpleEventSystem.Publish(new CanvasCanMove());
 }
Exemplo n.º 24
0
 public void ButtonClick()
 {
     AudioManager.PlaySound("Button_Audio");
     SimpleEventSystem.Publish(new ListItemButton());
     IsBig.Value = true;
 }
Exemplo n.º 25
0
 public void Finish()
 {
     SimpleEventSystem.Publish(new CanvasAnimationFinish());
 }
        protected override void OnInit(QFramework.IUIData uiData)
        {
            mData = uiData as AttendanceAudioRecordPanelData ?? new AttendanceAudioRecordPanelData();
            BtnBack.onClick.AddListener(() =>
            {
                AudioManager.PlaySound("Button_Audio");
                Back();
            });
            BtnRecord.onClick.AddListener(() =>
            {
                AudioManager.PlaySound("Button_Audio");
                if (MicrophoneManager.GetInstance().mRecordStatus.Value == RecordStatus.NoRecord)
                {
                    MicrophoneManager.GetInstance().StartRecord();
                }
                else if (MicrophoneManager.GetInstance().mRecordStatus.Value == RecordStatus.Recording)
                {
                    MicrophoneManager.GetInstance().PauseRecord();
                }
                else if (MicrophoneManager.GetInstance().mRecordStatus.Value == RecordStatus.Pause)
                {
                    MicrophoneManager.GetInstance().StartRecord();
                }
            });
            BtnComplete.onClick.AddListener(() =>
            {
                AudioManager.PlaySound("Button_Audio");
                if ((int)MicrophoneManager.GetInstance().mRecordTime < MicrophoneManager.MIN_TIME)
                {
                    CommonUtil.toast("音频时长过短");
                    Log.I("音频时长过短");
                }
                else
                {
                    MicrophoneManager.GetInstance().StopRecord();
                }
            });

            MicrophoneManager.GetInstance().mRecordStatus.Subscribe(RecordStatus =>
            {
                if (RecordStatus == RecordStatus.NoRecord)
                {
                    var soundOnTexture = mResLoader.LoadSync <Texture2D>("audio_record");
                    BtnRecord.GetComponent <Image>().sprite = Sprite.Create(soundOnTexture, new Rect(0, 0, soundOnTexture.width, soundOnTexture.height), Vector2.one * 0.5f);
                    TvTime.gameObject.SetActive(false);
                    BtnComplete.gameObject.SetActive(false);
                    // <b>加粗</b>
                    string time   = "<color=#FF9E47><size=24>音频5分钟内</size></color>";
                    TvRecord.text = "点击开始录音\n" + time;
                }
                else if (RecordStatus == RecordStatus.Recording)
                {
                    var soundOnTexture = mResLoader.LoadSync <Texture2D>("audio_recording");
                    BtnRecord.GetComponent <Image>().sprite = Sprite.Create(soundOnTexture, new Rect(0, 0, soundOnTexture.width, soundOnTexture.height), Vector2.one * 0.5f);
                    TvTime.gameObject.SetActive(true);
                    BtnComplete.gameObject.SetActive(true);
                    TvRecord.text = "录制中...\n点击完成结束录音";
                }
                else if (RecordStatus == RecordStatus.Pause)
                {
                    var soundOnTexture = mResLoader.LoadSync <Texture2D>("audio_pause_record");
                    BtnRecord.GetComponent <Image>().sprite = Sprite.Create(soundOnTexture, new Rect(0, 0, soundOnTexture.width, soundOnTexture.height), Vector2.one * 0.5f);
                    TvTime.gameObject.SetActive(true);
                    BtnComplete.gameObject.SetActive(true);
                    TvRecord.text = "暂停";
                }
                else if (RecordStatus == RecordStatus.RecordComplete)
                {
                    MicrophoneManager.GetInstance().Save(out path);
                    if (path.IsNotNullAndEmpty())
                    {
                        SimpleEventSystem.Publish(new RecordPath(path));
                    }
                    Close();
                }
            }).AddTo(this);
        }
Exemplo n.º 27
0
    private void DoMove(GameObject obj, BoxDayDetailModel dayDetailModel)
    {
        IsOpenDay            = true;
        SelectDayDetailModel = dayDetailModel;
        IsRun = true;
        Vector3 position = obj.transform.position;
        int     index    = int.Parse(obj.name);

        if (CurrentIndex == 0)
        {
            if (index == 1)
            {
                MasterAnimation.JumpRight();
                CurrentItem = obj;
                CanvasItemDown();
                StartCoroutine(JumpForSeconds(false, false, position.x));
            }
            else if (index == 2)
            {
                _fallTime = 20 + 8;
                _jumpTime = 20 + 8;
                MasterAnimation.JumpRight();
                CurrentItem = obj;
                CanvasItemDown();
                StartCoroutine(JumpForSeconds(false, false, position.x));
            }
            else
            {
                _fallTime = 20 + 8 * (index - 1);
                _jumpTime = 20 + 8 * (index - 1);
                MasterAnimation.JumpHighRight();
                CurrentItem = obj;
                CanvasItemDown();
                StartCoroutine(JumpForSeconds(true, false, position.x, 0.12f));
            }
        }
        else
        {
            if (CurrentIndex == index)
            {
                IsRun = false;
                SimpleEventSystem.Publish(new CanvasAnimationFinish());
            }
            else if (CurrentIndex < index)
            {
                if (index - CurrentIndex == 1)
                {
                    MasterAnimation.JumpRight();
                    CurrentItem = obj;
                    CanvasItemDown();
                    StartCoroutine(JumpForSeconds(false, false, position.x));
                }
                else if (index - CurrentIndex == 2)
                {
                    MasterAnimation.JumpRight();
                    CurrentItem = obj;
                    CanvasItemDown();
                    StartCoroutine(JumpForSeconds(false, true, position.x));
                }
                else
                {
                    MasterAnimation.JumpHighRight();
                    CurrentItem = obj;
                    CanvasItemDown();
                    StartCoroutine(JumpForSeconds(true, false, position.x, 0.12f));
                }
            }
            else
            {
                if (CurrentIndex - index == 1)
                {
                    MasterAnimation.JumpLeft();
                    CurrentItem = obj;
                    CanvasItemDown();
                    StartCoroutine(JumpForSeconds(false, false, position.x));
                }
                else if (CurrentIndex - index == 2)
                {
                    MasterAnimation.JumpLeft();
                    CurrentItem = obj;
                    CanvasItemDown();
                    StartCoroutine(JumpForSeconds(false, true, position.x));
                }
                else
                {
                    MasterAnimation.JumpHighLeft();
                    CurrentItem = obj;
                    CanvasItemDown();
                    StartCoroutine(JumpForSeconds(true, false, position.x, 0.12f));
                }
            }
        }

        CurrentIndex = index;
        PlayerPrefsUtil.SaveUserDayPosition(BoxModel, CurrentIndex);
    }
Exemplo n.º 28
0
 public void IPhoneGetWiFiSSIDResult(string msg)
 {
     SimpleEventSystem.Publish(new SSIDResult(msg));
 }
Exemplo n.º 29
0
        private void StartRequestForGetAddress()
        {
            Dictionary <string, object> param = new Dictionary <string, object>();

            if (PlayerPrefsUtil.UserInfo == null)
            {
                CommonUtil.toast("数据异常,请重新登录");
                return;
            }
            param.Add("babyId", PlayerPrefsUtil.UserInfo.relBabyId);
            param.Add("pageSize", 500);
            param.Add("pageNum", 1);
            HttpUtil.PostWithSign <AddressInfoModel>(UrlConst.BabyAddressListPage, param)
            .Subscribe(model =>
            {
                Log.I(model.ToJson());
                Content.DestroyAllChild();
                foreach (var modelRecord in model.records)
                {
                    //SettingAddressItemPrefab SettingAddAddressPrefab

                    mResLoader.LoadSync <GameObject>("SettingAddressItemPrefab")
                    .Instantiate()
                    .transform
                    .LocalIdentity()
                    .Parent(Content)
                    .LocalScale(1, 1, 1)
                    .ApplySelfTo(game =>
                    {
                        game.Find("ItemAddress/TvName").GetComponent <Text>().text
                            = modelRecord.consignee + " " + modelRecord.consigneeMobile;
                        game.Find("ItemAddress/TvAddress").GetComponent <Text>().text
                            = modelRecord.provinceName
                              + modelRecord.cityName
                              + modelRecord.areaName
                              + modelRecord.consigneeAddress;
                        if (modelRecord.isDefault == 1)
                        {
                            game.Find("ItemAddress/ImgDefault").GetComponent <Image>().gameObject.SetActive(true);
                        }
                        else
                        {
                            game.Find("ItemAddress/ImgDefault").GetComponent <Image>().gameObject.SetActive(false);
                        }
                        game.Find("BtnEdit").GetComponent <Button>().onClick.AddListener(() =>
                        {
                            UIMgr.OpenPanel <AddressEditPanel>(new AddressEditPanelData()
                            {
                                AddressInfo = modelRecord
                            }, UITransitionType.CIRCLE);
                        });
                        Color nowColor;
                        ColorUtility.TryParseHtmlString("#FFCD60", out nowColor);
                        game.Find("ImgLine").GetComponent <Image>().color = nowColor;
                        game.Find("ItemAddress").GetComponent <Button>().onClick.AddListener(() =>
                        {
                            Log.I(modelRecord.ToJson());
                            SimpleEventSystem.Publish(new ExchangeOrderAddress(modelRecord));
                            Back();
                        });
                    })
                    .Show();
                }
                mResLoader.LoadSync <GameObject>("SettingAddAddressPrefab")
                .Instantiate()
                .transform
                .LocalIdentity()
                .Parent(Content)
                .LocalScale(1, 1, 1)
                .ApplySelfTo(game =>
                {
                    game.Find("BtnAdd").GetComponent <Button>().onClick.AddListener(() =>
                    {
                        UIMgr.OpenPanel <AddressEditPanel>(new AddressEditPanelData(), UITransitionType.CIRCLE);
                    });
                })
                .Show();
            }, e =>
            {
                if (e is HttpException)
                {
                    HttpException http = e as HttpException;
                    Log.E("弹吐司" + http.Message);
                }
            }).AddTo(this);
        }
Exemplo n.º 30
0
 public void IPhoneFinishLottie(string msg)
 {
     FirstInitialize(1);
     SimpleEventSystem.Publish(new LottieAnimationFinish());
 }