Ejemplo n.º 1
0
    /// <summary>
    /// 领取普通奖励(不是卡)
    /// </summary>
    /// <param name="vO"></param>
    private void GetNormalAward(SevenDaysLoginAwardVO vO)
    {
        var curActivity = GlobalData.ActivityModel.GetActivityVo(ActivityType.ActivitySevenDaySignin);

        if (curActivity == null)
        {
            FlowText.ShowMessage(I18NManager.Get("Common_ActivityPastDue"));
            return;
        }
        else
        {
            if (curActivity.IsActivityPastDue)
            {
                FlowText.ShowMessage(I18NManager.Get("Common_ActivityPastDue"));
                return;
            }
        }

        GainSevenDayAwardReq req = new GainSevenDayAwardReq
        {
            ActivityId = vO.ActivityId,
        };

        byte[] data = NetWorkManager.GetByteData(req);
        NetWorkManager.Instance.Send <GainSevenDayAwardRes>(CMD.ACTIVITY_GAINSEVENDAYAWARD, data, res =>
        {
            RewardUtil.AddReward(res.Awards);
            _model.UpdateUserSevenDaySigninInfo(res.UserSevenDaySigninIndo);
            _model.UpdateSevenDayAwardList(res.UserSevenDaySigninIndo.SignDay);
            View.Refresh(vO.DayId);//刷新特殊处理下
            SendMessage(new Message(MessageConst.CMD_ACTIVITY_REFRESH_ACTIVITYTOGGLE_REDDOT));
            OpenNormalAwardWindow(vO);
        });
    }
Ejemplo n.º 2
0
 /// <summary>
 /// 打开普通奖励获得窗口
 /// </summary>
 /// <param name="vO"></param>
 private void OpenNormalAwardWindow(SevenDaysLoginAwardVO vO)
 {
     _normalAwardWindow = null;
     if (_normalAwardWindow == null)
     {
         _normalAwardWindow = PopupManager.ShowWindow <NormalAwardWindow>("Activity/Prefabs/NormalAwardWindow");
         _normalAwardWindow.SetData(vO);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 七日签到获取奖励
 /// </summary>
 /// <param name="vO"></param>
 public void SetData(SevenDaysLoginAwardVO vO)
 {
     _titleText.text = I18NManager.Get("Common_GetAward");
     CreateNormalAwardItem(vO.Rewards);
     _ok.gameObject.Show();
     _ok.onClick.AddListener(() =>
     {
         base.Close();
     });
 }
Ejemplo n.º 4
0
        public void SetData(SevenDaysLoginAwardVO vo, bool isPreview)
        {
            _titleTxt.text = I18NManager.Get(isPreview ? "Common_PreviewAward" : "Common_GetAward");
            var awards = vo.Rewards;

            if (awards.Count > 3)
            {
                _scrollRect.movementType = ScrollRect.MovementType.Elastic;
                _awardsRect.pivot        = new Vector2(0, 0.5f);
            }

            CreateItem(awards);
        }
Ejemplo n.º 5
0
    public void SetData(SevenDaysLoginAwardVO vo)
    {
        _data = vo;
        _icon.GetComponent <RawImage>().texture =
            ResourceManager.Load <Texture>(vo.IconPath, ModuleConfig.MODULE_ACTIVITY, true);
        _icon.GetComponent <RawImage>().SetNativeSize();
        _debris.SetActive(vo.IsPuzzle);

        _num.text = vo.IsGiftbag ? vo.GiftbagName : vo.Rewards[0].Num.ToString();


        PointerClickListener.Get(_onClickBtn).onClick = go =>
        {
            if (!vo.IsGiftbag)
            {
                FlowText.ShowMessage(ClientData.GetItemDescById(vo.Rewards[0].Id, vo.Rewards[0].Resource).ItemDesc);
            }
            else
            {
                //触发礼包预览
                EventDispatcher.TriggerEvent(EventConst.PreviewAward, vo);
            }
        };


        _mask.SetActive(vo.IsShowGetMask);



        _dayText.text = I18NManager.Get("Activity_SevenActivityDay", vo.DayId);
        _getBtn.SetActive(vo.IsShowGetBtn);

        PointerClickListener.Get(_getBtn).onClick = go =>
        {
            EventDispatcher.TriggerEvent <SevenDaysLoginAwardVO>(
                vo.IsCardAward ? EventConst.GetCardAward : EventConst.GetNormalAward, vo);
        };

        if (vo.DayId == 7)
        {
            _dayBg.sprite = AssetManager.Instance.GetSpriteAtlas("UIAtlas_Activity_SevendaysActivityAwardItemDaysBg2");
            _num.transform.parent.Hide();
        }
    }
Ejemplo n.º 6
0
    /// <summary>
    /// 领取卡的请求,防止策划以后配成卡
    /// </summary>
    /// <param name="vO"></param>
    private void GetCardAward(SevenDaysLoginAwardVO vO)
    {
        var curActivity = GlobalData.ActivityModel.GetActivityVo(ActivityType.ActivitySevenDaySignin);

        if (curActivity == null)
        {
            FlowText.ShowMessage(I18NManager.Get("Common_ActivityPastDue"));
            return;
        }
        else
        {
            if (curActivity.IsActivityPastDue)
            {
                FlowText.ShowMessage(I18NManager.Get("Common_ActivityPastDue"));
                return;
            }
        }

        GainSevenDayAwardReq req = new GainSevenDayAwardReq
        {
            ActivityId = vO.ActivityId,
        };

        byte[] data = NetWorkManager.GetByteData(req);
        NetWorkManager.Instance.Send <GainSevenDayAwardRes>(CMD.ACTIVITY_GAINSEVENDAYAWARD, data, res =>
        {
            RewardUtil.AddReward(res.Awards);
            _model.UpdateUserSevenDaySigninInfo(res.UserSevenDaySigninIndo);
            _model.UpdateSevenDayAwardList(res.UserSevenDaySigninIndo.SignDay);
            View.Refresh(vO.DayId);//刷新特殊处理下
            SendMessage(new Message(MessageConst.CMD_ACTIVITY_REFRESH_ACTIVITYTOGGLE_REDDOT));
            Action finish = () =>
            {
                SendMessage(new Message(MessageConst.CMD_ACTIVITY_SHOW_BAR_AND_BACKBTN));
            };

            SendMessage(new Message(MessageConst.CMD_ACTIVITY_HINT_BAR_AND_BACKBTN));

            List <AwardPB> temp = res.Awards.ToList();
            ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_DRAWCARD,
                                               false, false, "DrawCard_CardShow", temp, finish, false);
        });
    }
Ejemplo n.º 7
0
    /// <summary>
    /// 打开预览奖励窗口
    /// </summary>
    /// <param name="vo"></param>
    private void PreviewAward(SevenDaysLoginAwardVO vo)
    {
        var window = PopupManager.ShowWindow <ActivityAwardsWindow>("Activity/Prefabs/ActivityAwardWindow");

        window.SetData(vo, true);
    }