示例#1
0
    /// <summary>
    /// 获取礼包或者VIP商品
    /// </summary>
    /// <param name="page"></param>
    /// <returns></returns>
    public List <UserBuyRmbMallVo> GetTargetRmbMallList(MallLabelPB label)
    {
        var targetList = new List <UserBuyRmbMallVo>();

        foreach (var vo in UserBuyRmbMallList)
        {
            if (RmbMallDic.ContainsKey(vo.MallId))
            {
                bool hasthisMall = GlobalData.PayModel.GetProduct(vo.MallId) != null;
                var  rmbmallvo   = RmbMallDic[vo.MallId];
                bool buymax      = vo.BuyNum == 1 && rmbmallvo.BuyRefreshDay == 9999;
//                    bool timeenable = rmbmallvo.MallLabelPb==label;
//                    if (timeenable)
//                    {
//                        Debug.LogError(rmbmallvo.MallId+" "+rmbmallvo.MallName);
//                    }
//
//
//                    if (hasthisMall)
//                    {
//                        if (!timeenable)
//                        {
//                            //Debug.LogError(rmbmallvo.MallName+" MallLabelPb: "+rmbmallvo.MallLabelPb+" setLabel "+label);
//                        }
//                        else
//                        {
//                            Debug.LogError(rmbmallvo.MallName);
//                        }
//
//                    }

                //Debug.LogError(vo.MallId+" hasthisMall:"+hasthisMall+" time "+timeenable+" buymax"+buymax);
                if (rmbmallvo.MallLabelPb == label && rmbmallvo.EndTime > ClientTimer.Instance.GetCurrentTimeStamp() && hasthisMall && !buymax)
                {
                    targetList.Add(vo);
                }
            }
        }


//            Debug.LogError("targetList"+targetList.Count);
        if (targetList.Count > 0)
        {
            targetList.Sort((vo1, vo2) =>
            {
                if (RmbMallDic[vo1.MallId].Slot < RmbMallDic[vo2.MallId].Slot)
                {
                    return(-1);
                }
                if (RmbMallDic[vo1.MallId].Slot > RmbMallDic[vo2.MallId].Slot)
                {
                    return(1);
                }

                return(0);
            });
        }

        return(targetList);
    }
示例#2
0
    /// <summary>
    /// 获取星钻金币商品
    /// </summary>
    /// <param name="page"></param>
    /// <returns></returns>
    public List <UserBuyGameMallVo> GetTargetGameMallList(MallLabelPB label)
    {
        var targetList = new List <UserBuyGameMallVo>();

        foreach (var vo in UserBuyGameMallList)
        {
            //Debug.LogError(page+" "+vo.MallId+" "+vo.BuyNum+" "+vo.MallTypePb);
            if (GameMallDic.ContainsKey(vo.MallId) && GameMallDic[vo.MallId].MallLabelPb == label)
            {
//                    Debug.LogError(""+vo.MallId);
                targetList.Add(vo);
            }
        }

        if (targetList.Count > 0)
        {
            targetList.Sort((vo1, vo2) =>
            {
                if (GameMallDic[vo1.MallId].Slot < GameMallDic[vo2.MallId].Slot)
                {
                    return(-1);
                }
                if (GameMallDic[vo1.MallId].Slot > GameMallDic[vo2.MallId].Slot)
                {
                    return(1);
                }

                return(0);
            });
        }

//            Debug.LogError("targetList"+targetList.Count);
        return(targetList);
    }
示例#3
0
        public bool Special;                  //特殊礼包标记

        public RmbMallVo(RmbMallRulePB gamemallRulePb)
        {
            MallId        = gamemallRulePb.MallId;
            MallSortPb    = gamemallRulePb.MallSort;
            MallName      = gamemallRulePb.MallName;
            MallDesc      = gamemallRulePb.MallDesc;
            GiftImage     = gamemallRulePb.GiftImage;
            Slot          = gamemallRulePb.Slot;
            MallLabelPb   = gamemallRulePb.MallLabel;
            LabelImage    = gamemallRulePb.LabelImage;
            RealPrice     = gamemallRulePb.RealPrice;
            OriginalPrice = gamemallRulePb.OriginalPrice;
            Special       = gamemallRulePb.Special;
            BuyMax        = gamemallRulePb.BuyMax;
            BuyRefreshDay = gamemallRulePb.BuyRefreshDay;
            Award         = gamemallRulePb.Award;
            Starttime     = gamemallRulePb.StartTime;
            EndTime       = gamemallRulePb.EndTime;
        }
示例#4
0
        public long EndTime;                  //结束时间

        public GameMallVo(GameMallRulePB gamemallRulePb)
        {
            MallId        = gamemallRulePb.MallId;
            MallType      = gamemallRulePb.MallType;
            MallSortPb    = gamemallRulePb.MallSort;
            MoneyTypePb   = gamemallRulePb.MoneyType;
            MallName      = gamemallRulePb.MallName;
            MallDesc      = gamemallRulePb.MallDesc;
            GiftImage     = gamemallRulePb.GiftImage;
            Slot          = gamemallRulePb.Slot;
            MallLabelPb   = gamemallRulePb.MallLabel;
            LabelImage    = gamemallRulePb.LabelImage;
            RealPrice     = gamemallRulePb.RealPrice;
            OriginalPrice = gamemallRulePb.OriginalPrice;
            BuyMax        = gamemallRulePb.BuyMax;
            Award         = gamemallRulePb.Award;
            Starttime     = gamemallRulePb.StartTime;
            EndTime       = gamemallRulePb.EndTime;
        }
示例#5
0
        private void SetCommonUIData(string goodsNameText, string desc, double realprice, double primecost, string limitText,
                                     MallLabelPB mallLabelPb, int buyMax, bool finishedtipsShow, int propIconId, RepeatedField <AwardPB> awardPbs,
                                     string giftImgae, long endtime, string imageLabel = "")
        {
            _goodsNum.text = "";
            _desc.text     = desc;
            _curcost.text  = realprice.ToString();

            string spName = "";

            _tag.gameObject.SetActive(true);
            switch (imageLabel)
            {
            case "0":
                _tag.gameObject.SetActive(false);
                break;

            case "1":
                spName = I18NManager.Get("Shop_DiscountTips");    //"折扣";
                break;

            case "2":
                spName = I18NManager.Get("Shop_LimitCount");
                break;

            case "3":
                spName = "VIP";
                break;

            case "4":
                spName = "Hot";
                break;

            default:
                Debug.LogError("Notype:" + imageLabel);
                break;
            }
            bool discount = primecost > 0; //&& primecost > realprice折扣判断有改变,primecost>0就表示有折扣

            _primecost.gameObject.SetActive(discount);
            if (_isfirstPrice)
            {
                //_tag.sprite = AssetManager.Instance.GetSpriteAtlas("UIAtlas_Shop_mallSign");
//                Debug.LogError(_isfirstPrice);
                _tag.gameObject.SetActive(true);
                _tagContend.text = I18NManager.Get("Shop_FirstPrice");;
            }
            else
            {
                if (!String.IsNullOrEmpty(spName))
                {
                    //_tag.sprite = AssetManager.Instance.GetSpriteAtlas(spName);
                    _tagContend.text = spName;
                }
            }



            if (_curmallSortPB == MallSortPB.MallGift || _curmallSortPB == MallSortPB.MallOrdinary)
            {
                _monenyIcon.gameObject.SetActive(false);
//                _rmbIcon.SetActive(true);
                _curcost.text = realprice.ToString();
            }
            else
            {
//                _rmbIcon.SetActive(false);
                _monenyIcon.gameObject.SetActive(true);
                _monenyIcon.texture =
                    ResourceManager.Load <Texture>("Prop/particular/" + propIconId, ModuleConfig.MODULE_SHOP, true);
            }

            _limitTran.gameObject.SetActive(false);                             //mallLabelPb==MallLabelPB.LimitDiscount
            _limitText.text = I18NManager.Get("Shop_LeftTimeToEnd", limitText); //$"剩余{limitText}下架";

            _tips.SetActive(finishedtipsShow);
            _selloutTips.text = realprice > 0 ? "已售罄" : "已领取";

            if (finishedtipsShow && _curmallSortPB == MallSortPB.MallGift)
            {
                //Debug.LogError(endtime);
                _tiprefreshLabe.text = "";
                _endtime             = endtime;
                _handler             = ClientTimer.Instance.AddCountDown(mallid.ToString(), Int64.MaxValue, 1f, RefreshTime, null);//"RefreshTime"
            }
            else
            {
                _tiprefreshLabe.text = "";
            }


            if (_curmallSortPB == MallSortPB.MallGift || _curmallSortPB == MallSortPB.MallOrdinary || _curmallSortPB == MallSortPB.MallRebateGift)
            {
//                Debug.LogError(giftImgae);
                _goodsimg.texture = ResourceManager.Load <Texture>(GlobalData.PropModel.GetGiftPropPath(giftImgae));
            }
            else
            {
                foreach (var awardPb in awardPbs)
                {
                    RewardVo vo = new RewardVo(awardPb);
                    _goodsimg.texture =
                        ResourceManager.Load <Texture>(vo.IconPath);
                    //顺便加上描述!
                    _goodsNum.text = _curmallSortPB == MallSortPB.MallBatchItem ? awardPb.Num.ToString() : "";
                }
            }

            _gemIcon.SetActive(_isBuyGem);
            if (_isBuyGem)
            {
                if (_isfirstPrice)
                {
                    _goodsName.text = SetRechargeName(realprice, realprice);
                }
                else
                {
                    if (awardPbs.Count > 0)
                    {
                        foreach (var awardPb in awardPbs)
                        {
                            if (awardPb.Resource == ResourcePB.Gem)
                            {
                                _goodsName.text = SetRechargeName(realprice, awardPb.Num);
                            }
                        }
                    }
                    else
                    {
                        _goodsName.text = SetRechargeName(realprice, 0);
                    }
                }
            }
            else
            {
                _goodsName.text = goodsNameText;
            }

            if (String.IsNullOrEmpty(_areaprice) && (_curmallSortPB == MallSortPB.MallGift || _curmallSortPB == MallSortPB.MallOrdinary))
            {
                _curcost.text = "";
            }
            else if (!String.IsNullOrEmpty(_areaprice))
            {
                _curcost.text = _areaprice;
            }
            else
            {
                _curcost.text = realprice > 0? realprice.ToString():"免费";
            }
            _redPoint.gameObject.SetActive(realprice <= 0 && !finishedtipsShow);
        }