Пример #1
0
        public void SetData(RmbMallVo vo, UserBuyRmbMallVo uservo, ShopModel buyGemModel = null)
        {
            _rmbIcon.gameObject.SetActive(true);
            _itemRmbVo        = vo;
            mallid            = vo.MallId;
            _userBuyRmbMallVo = uservo;
            _curmallSortPB    = vo.MallSortPb;
            _isBuyGem         = buyGemModel != null;
            if (vo.MallSortPb == MallSortPB.MallOrdinary && buyGemModel != null && !buyGemModel.HasDoublePrice(vo.RealPrice))
            {
                _isfirstPrice = true;
            }
            else
            {
                _isfirstPrice = false;
            }


//            Debug.LogError(vo.MallName+"_isfirstPrice"+_isfirstPrice);
            var payvo = GlobalData.PayModel.GetProduct(vo.MallId);

            if (vo.OriginalPrice > 0)
            {
                _primecost.text = payvo?.GetOriginalPrice(vo.OriginalPrice);
            }
            var realrmbpoint = payvo != null ? payvo.AmountRmb : vo.RealPrice;

            _rmbIcon.text = payvo?.Curreny;
            if (AppConfig.Instance.isChinese == "true" || payvo?.Curreny == Constants.CHINACURRENCY)
            {
                _rmbIcon.text   = "";
                _primecost.text = vo.OriginalPrice + "元";
            }

            _areaprice = payvo?.AreaPrice;
            if (_isBuyGem)
            {
                realrmbpoint = vo.RealPrice * 10;
                if (vo.RealPrice <= 0)
                {
                    Debug.LogError("数据异常:" + vo.MallName + " " + vo.OriginalPrice);
                }
            }

            if (uservo != null)
            {
                SetCommonUIData(vo.MallName, vo.MallDesc, realrmbpoint, vo.OriginalPrice,
                                DateUtil.GetDay(vo.EndTime - ClientTimer.Instance.GetCurrentTimeStamp()), vo.MallLabelPb, vo.BuyMax,
                                (uservo.BuyNum >= vo.BuyMax && vo.BuyMax != 0), PropConst.GemIconId, vo.Award,
                                vo.GiftImage, uservo.RefreshTime, _itemRmbVo.LabelImage); //(vo.BuyMax - uservo?.BuyNum ?? 0) + "/" + vo.BuyMax
            }
        }
Пример #2
0
        public void SetData(UserBuyRmbMallVo uservo, RmbMallVo vo)
        {
            malltype       = 1;
            _curRmbMallvo  = vo;
            _giftname.text = vo.MallName;
            _giftDesc.text = vo.MallDesc;

            var npcId   = GlobalData.PlayerModel.PlayerVo.NpcId;
            var roleImg = transform.GetRawImage("RoleImage" + npcId);

            roleImg.texture = ResourceManager.Load <Texture>("Background/PersonIcon/Npc" + npcId);
            roleImg.gameObject.Show();

            var payvo = GlobalData.PayModel.GetProduct(vo.MallId);

            _realPrice.text = AppConfig.Instance.isChinese == "true" || payvo?.Curreny == Constants.CHINACURRENCY?payvo?.AreaPrice:(payvo?.Curreny + payvo?.AreaPrice);    //I18NManager.Get("Shop_RealPrice",);



            _oldPrice.gameObject.SetActive(vo.OriginalPrice > 0);
            if (vo.OriginalPrice > 0)
            {
                //var realrmbpoint = payvo != null ? payvo.Price: vo.RealPrice;
////				Debug.LogError("realprice:"+realrmbpoint);
//				var originalPrice=Math.Ceiling(realrmbpoint/(vo.OriginalPrice*0.01)) ;
                _oldPrice.text = AppConfig.Instance.isChinese == "true" || payvo?.Curreny == Constants.CHINACURRENCY? I18NManager.Get("RandowEventWindow_OriginalPrice") + vo.OriginalPrice + "元":I18NManager.Get("RandowEventWindow_OriginalPrice") + payvo?.GetOriginalPrice(vo.OriginalPrice);   //I18NManager.Get("Shop_RealPrice",);
            }

            if (AppConfig.Instance.isChinese == "true" || payvo?.Curreny == Constants.CHINACURRENCY)
            {
                _line.gameObject.SetActive(vo.OriginalPrice > vo.RealPrice);
            }
            else
            {
                _line.gameObject.SetActive(vo.OriginalPrice > 0);
            }


            _leftbuyTime   = vo.BuyMax - uservo.BuyNum;
            _buyCount.text = I18NManager.Get("Shop_LeftBuyCounts", _leftbuyTime, vo.BuyMax);             //"剩余购买次数:" + _leftbuyTime+"/"+vo.BuyMax;
            var entime = DateUtil.GetDataTime(vo.EndTime);

            _endtimetxt.text = I18NManager.Get("Shop_GiftTimeEnd") + $"<color=#9769ac>{entime}</color>";
            _endtimetxt.gameObject.SetActive(entime.Subtract(DateUtil.GetDataTime(ClientTimer.Instance.GetCurrentTimeStamp())).Days < 365);
            //_awardList.RefillCells();
            _awardList.UpdateCallback = UpdateAwardItem;
            _awardList.totalCount     = vo.Award.Count;
            _awardList.RefreshCells();
        }