예제 #1
0
        public void SetData(GameMallVo vo, UserBuyGameMallVo userBuyGameMallVo)
        {
            _curMallVo    = vo;
            itemName.text = vo.RealPrice > 0 ? I18NManager.Get("Shop_BuyMall", vo.MallName):  I18NManager.Get("Common_GetReward") + vo.MallName;
            var enableLongPress = vo.MallSortPb == MallSortPB.MallItem && vo.MallType == MallTypePB.MallGem;

            SetLongBtnActive(enableLongPress);            //malllBatchItem来判断是否为批量道具显影长按
            leftTime           = userBuyGameMallVo == null?vo.BuyMax:vo.BuyMax - userBuyGameMallVo.BuyNum;
            _buyCountDesc.text = I18NManager.Get("Shop_LeftBuyCounts2", (vo.BuyMax - userBuyGameMallVo?.BuyNum), vo.BuyMax);
            //"剩余购买次数:" + (vo.BuyMax - userBuyGameMallVo?.BuyNum) + "/" + vo.BuyMax;//
            foreach (var v in vo.Award)
            {
                if (v.Num != 0)
                {
                    _malldesc.text        = I18NManager.Get("Shop_GoodsDesc") + ClientData.GetItemDescById(v.ResourceId, v.Resource).ItemDesc;
                    _itemNumText.text     = v.Num.ToString();
                    _itemRawIamge.texture = ResourceManager.Load <Texture>(GlobalData.PropModel.GetPropPath(v.ResourceId), ModuleConfig.MODULE_SHOP, true);
                    switch (v.Resource)
                    {
                    case ResourcePB.Power:
                        _haveNumText.text =
                            I18NManager.Get("Shop_CurrentOwn", GlobalData.PlayerModel.PlayerVo.Energy);
                        break;

                    case ResourcePB.Gold:
                        _haveNumText.text =
                            I18NManager.Get("Shop_CurrentOwn", GlobalData.PlayerModel.PlayerVo.Gold);
                        break;

                    case ResourcePB.Fans:
                        var fansvo = GlobalData.DepartmentData.GetFans(v.ResourceId);
                        _haveNumText.text     = I18NManager.Get("Shop_CurrentOwn", fansvo.Num);
                        _itemRawIamge.texture = ResourceManager.Load <Texture>(fansvo.FansHeadPath, ModuleConfig.MODULE_SHOP, true);
                        break;

                    default:
                        _haveNumText.text = I18NManager.Get("Shop_CurrentOwn", GlobalData.PropModel.GetUserProp(v.ResourceId).Num);
                        break;
                    }
                }
            }
            if (enableLongPress)
            {
                _itemNumText.text = leftTime > 0?1.ToString():0.ToString();
            }
//			Debug.LogError(vo.MoneyTypePb);
            _costIconRawIamge.texture = ResourceManager.Load <Texture>("Prop/particular/" + (vo.MoneyTypePb == MoneyTypePB.MoGem?PropConst.GemIconId:PropConst.GoldIconId), ModuleConfig.MODULE_SHOP, true);
            realprice     = vo.RealPrice;
            _buytext.text = vo.RealPrice > 0 ? I18NManager.Get("Shop_BuyTxt") : I18NManager.Get("RandowEventWindow_Free");
            //这个应该要在长按的逻辑里面去!
            _costNum.text = I18NManager.Get("Shop_CostToBuy", _curnum * realprice);
            _costNum.gameObject.SetActive(vo.RealPrice > 0);
            //还有剩余购买数量和商品描述
        }
예제 #2
0
        public void SetData(UserBuyGameMallVo uservo, GameMallVo vo)
        {
            malltype        = 0;
            _curMallVo      = vo;
            _giftname.text  = vo.MallName;
            _giftDesc.text  = vo.MallDesc;
            _realPrice.text = vo.RealPrice.ToString();
            _oldPrice.text  = I18NManager.Get("Shop_RealPrice", vo.OriginalPrice);

            _awardList.UpdateCallback = UpdateAwardItem;
            _awardList.totalCount     = vo.Award.Count;
            _awardList.RefreshCells();
            _awardList.RefillCells();
        }
예제 #3
0
 public void SetData(GameMallVo vo, UserBuyGameMallVo uservo, long refreshTime)
 {
     _rmbIcon.gameObject.SetActive(false);
     _itemvo            = vo;
     mallid             = vo.MallId;
     _userBuyGameMallVo = uservo;
     _curmallSortPB     = vo.MallSortPb;
     if (vo.OriginalPrice > 0)
     {
         _primecost.text = vo.OriginalPrice + "";
     }
     SetCommonUIData(vo.MallName, vo.MallDesc, vo.RealPrice, vo.OriginalPrice,
                     DateUtil.GetDay(vo.EndTime - ClientTimer.Instance.GetCurrentTimeStamp()), vo.MallLabelPb, vo.BuyMax,
                     uservo != null && (uservo.BuyNum >= vo.BuyMax && vo.BuyMax != 0),
                     (vo.MoneyTypePb == MoneyTypePB.MoGem ? PropConst.GemIconId : PropConst.GoldIconId), vo.Award,
                     vo.GiftImage, refreshTime, _itemvo.LabelImage);
 }