예제 #1
0
    /// <summary>
    /// 获取长期充值的累充数据!
    /// </summary>
    public List <AccumulativeRechargeVO> GetLongLastingVo()
    {
        var longlastinguservo = GlobalData.ActivityModel.GetLongLastRechargeInfoBb();

        AccumulativeRechargeVos.Clear();
        if (longlastinguservo == null)
        {
            longlastinguservo = new UserActivityAccumulativeRechargeInfoPB()
            {
//                ActivityId = GlobalData.ActivityModel.GetActivity(ActivityTypePB.ActivityAccumulativeRecharge).ActivityId,
                Amount        = 0,
                ReceiveStatus = { 0 }
            };
        }

        int displayNum = 6;
        RepeatedField <ActivityAccumulativeRechargeRulePB> rules = GlobalData.ActivityModel.BaseActivityRule.ActivityAccumulativeRechargeRules;

        for (int i = 0; i < rules.Count; i++)
        {
            AccumulativeRechargeVO uservo = new AccumulativeRechargeVO(rules[i], longlastinguservo.ReceiveStatus, longlastinguservo.Amount);
            if (i == 6 && uservo.Weight != 1)
            {
                displayNum = 11;
            }

            if (i == 11 && uservo.Weight != 1)
            {
                displayNum = rules.Count - 1;
            }

            if (i > displayNum)
            {
                break;
            }

            AccumulativeRechargeVos.Add(uservo);
        }
//        foreach (var v in GlobalData.ActivityModel.BaseActivityRule.ActivityAccumulativeRechargeRules)
//        {
//            AccumulativeRechargeVO uservo = new AccumulativeRechargeVO(v, longlastinguservo.ReceiveStatus, longlastinguservo.Amount);
//            AccumulativeRechargeVos.Add(uservo);
//
//        }

        return(AccumulativeRechargeVos);
    }
예제 #2
0
    public void SetData(AccumulativeRechargeVO vo)
    {
        //对象池问题!
        for (int i = 0; i < _awardList.childCount; i++)
        {
            _awardList.GetChild(i).gameObject.SetActive(false);
        }
        _accumulativeRechargeVo = vo;
        // _titleName.text = $"累积充值<size=40><color='#FF97CB'>{vo.GearAmound}</color></size>元";
        _titleName.text = I18NManager.Get("Activity_CumulativePayItemTitle", vo.GearAmound);
        _progressBar.gameObject.SetActive(vo.Weight == 1);
        _progressText.gameObject.SetActive(vo.Weight == 1);
        _progressBar.Progress = (int)((float)vo.CurAmount / vo.GearAmound * 100f);
        _progressText.text    = $"<color='#FF97CB'>{vo.CurAmount}</color>" + "/" + vo.GearAmound;
        _receiveaward.gameObject.SetActive(vo.Weight == 2);
        _titleName.gameObject.SetActive(vo.Weight != 0);
        _finishtips.SetActive(vo.Weight == 0);
        for (int i = 0; i < vo.Awards.Count; i++)
        {
            _awardList.GetChild(i).gameObject.SetActive(true);

            var item = _awardList.GetChild(i);
            item.GetComponent <AwardItem>().SetData(vo.Awards[i]);
//            RewardVo rewardVo=new RewardVo(vo.Awards[i]);
//            item.GetComponent<Frame>().SetData(rewardVo);

            bool special = GlobalData.FavorabilityMainModel.GetDressUpUnlockRulePb(vo.Awards[i].ResourceId) != null ||
                           vo.Awards[i].Resource == ResourcePB.Card;
            SetIconSize(special, item.Find("Mask/Icon").GetRectTransform());
            item.Find("PropNum").gameObject.SetActive(!special);

            if (vo.Awards[i].Resource == ResourcePB.Card)
            {
                var cardvo = GlobalData.CardModel.CardBaseDataDict[vo.Awards[i].ResourceId];
                item.Find("PropNameText").GetText().text = cardvo.Credit.ToString().ToUpper() + "·" + cardvo.CardName;
            }

            //AwardPB rewardVo = vo.Awards[i];
//            Debug.LogError(rewardVo);
//            PointerClickListener.Get(_awardList.GetChild(i).gameObject).onClick = go =>
//            {
//                var desc = ClientData.GetItemDescById(rewardVo.ResourceId, rewardVo.Resource);
//                FlowText.ShowMessage(desc.ItemDesc);
//            };
        }
    }
예제 #3
0
    /// <summary>
    /// 是否显示累计充值红点
    /// </summary>
    /// <returns></returns>
    private bool IsShowAccumulativeRechargeRedDot()
    {
        bool isShow = false;

        var isOpenAccumulativeRecharge =
            GlobalData.ActivityModel.GetActivityVo(ActivityType.ActivityAccumulativeRecharge) == null;

        if (isOpenAccumulativeRecharge)
        {
            Debug.Log("AccumulativeRecharge No Open ===>" + isShow);
            return(isShow);
        }

        var userInfo = GetEndLongUserActivityAccumulativeRechargeInfo();

        if (userInfo == null)
        {
            Debug.Log("AccumulativeRecharge UserInfo is Null ===>" + isShow);
            return(isShow);
        }

        List <AccumulativeRechargeVO> accumulativeRechargeVos = new List <AccumulativeRechargeVO>();

        var rules = GlobalData.ActivityModel.BaseActivityRule.ActivityAccumulativeRechargeRules;

        foreach (var v in rules)
        {
            AccumulativeRechargeVO vo = new AccumulativeRechargeVO(v, userInfo.ReceiveStatus, userInfo.Amount);
            accumulativeRechargeVos.Add(vo);
        }

        if (accumulativeRechargeVos.Count > 0)
        {
            foreach (var v in accumulativeRechargeVos)
            {
                if (v.Weight == 2)
                {
                    isShow = true;
                    break;
                }
            }
        }

        Debug.Log("AccumulativeRecharge RedDot ===>" + isShow);
        return(isShow);
    }
예제 #4
0
//    private void UpdateAccumulativeData(RepeatedField<UserBuyRmbMallPB> obj)
//    {
//        LoadingOverlay.Instance.Show();
//        ClientTimer.Instance.DelayCall(() =>
//        {
//            NetWorkManager.Instance.Send<ActivityRes>(CMD.ACTIVITY_ACTIVITYLIST,null, res =>
//            {
//                GlobalData.ActivityModel.GetAllActivityRes(res);
//                LoadingOverlay.Instance.Hide();
//                View.SetData(_accumulativeRechargeModel.GetLongLastingVo());
//            });
//        }, 0.5f);
//    }


    private void ReveiveRechargeAwardReq(AccumulativeRechargeVO vo)
    {
        //Debug.LogError(vo.GearId+" "+vo.ActivityId);
        var buffer = NetWorkManager.GetByteData(new ReceiveActivityAccumulativeRechargeAwardReq {
            Id = vo.GearId, ActivityId = vo.ActivityId
        });

        LoadingOverlay.Instance.Show();
        NetWorkManager.Instance.Send <ReceiveActivityAccumulativeRechargeAwardRes>(CMD.ACTIVITY_GETACCUMULATIVERECHARGE,
                                                                                   buffer, res =>
        {
            LoadingOverlay.Instance.Hide();
            GlobalData.ActivityModel.UpdateLongLastRechargeInfoBb(res.UserActivityAccumulativeRechargeInfo);
            RewardUtil.AddReward(res.Awards);
            if (_awardWindow == null)
            {
                _awardWindow = PopupManager.ShowWindow <AwardWindow>("GameMain/Prefabs/AwardWindow/AwardWindow");
            }
            _awardWindow.SetData(res.Awards);
            View.SetData(_accumulativeRechargeModel.GetLongLastingVo());
            SendMessage(new Message(MessageConst.CMD_ACTIVITY_REFRESH_ACTIVITYTOGGLE_REDDOT));
        });
    }