Beispiel #1
0
    private void OnRmbGiftClick(RmbMallVo vo)
    {
        //可能是直接支付了,不打开这个窗口!
        //FlowText.ShowMessage(I18NManager.Get("Common_Underdevelopment"));// ("暂无支付通道");
        SdkHelper.PayAgent.Pay(GlobalData.PayModel.GetProduct(vo.MallId));

//		if (_giftPackWindow==null)
//		{
//			_giftPackWindow=PopupManager.ShowWindow<GiftPackWindow>("Shop/Prefab/MallWindow/GiftPackWindow");
//		}
//		_giftPackWindow.SetData(vo);
    }
Beispiel #2
0
    private void OnGemClick(RmbMallVo vo)
    {
        if (Time.realtimeSinceStartup - _lastClickTime < 10f && _tempmallidlist.Contains(vo.MallId))
        {
            FlowText.ShowMessage(I18NManager.Get("Shop_DontRepeatBuy"));
            return;
        }

        if (!_tempmallidlist.Contains(vo.MallId))
        {
            _tempmallidlist.Add(vo.MallId);
        }
        SdkHelper.PayAgent.Pay(GlobalData.PayModel.GetProduct(vo.MallId));
        _lastClickTime = Time.realtimeSinceStartup;
    }
Beispiel #3
0
    public void SetData(RmbMallVo rmbMallVo, UserBuyRmbMallVo uservo)
    {
        mallId = rmbMallVo.MallId;
        _freeTxt.gameObject.SetActive(false);
        _price.gameObject.SetActive(true);
        for (int i = 0; i < rmbMallVo.Award.Count; i++)
        {
            var item = _propContainer.GetChild(i);
            item.gameObject.Show();
            RewardVo vo = new RewardVo(rmbMallVo.Award[i]);
//            PointerClickListener.Get(item.gameObject).onClick = go =>
//            {
//                var desc = ClientData.GetItemDescById(vo.Id, vo.Resource);
//                FlowText.ShowMessage(desc.ItemDesc);
//            };
//            item.Find("PropNameTxt").GetComponent<Text>().text = vo.Name;
            item.GetComponent <Frame>().SetData(vo);
            item.Find("ObtainText").GetComponent <Text>().text = vo.Num.ToString();//I18NManager.Get("Pay_Get")+vo.Num;
//            item.Find("PropImage").GetComponent<RawImage>().texture = ResourceManager.Load<Texture>(vo.IconPath);
//            item.Find("Image").gameObject.SetActive(vo.Resource==ResourcePB.Puzzle);
        }
        _des.text = I18NManager.Get("Shop_DailyBuyLimit");
        //_get.image.color=uservo.BuyNum > 0 ? Color.grey : Color.white;
        var payvo = GlobalData.PayModel.GetProduct(uservo.MallId);
//        var realrmbpoint = payvo != null ? payvo.AmountRmb : rmbMallVo.RealPrice;
//        _get.interactable = uservo.BuyNum == 0 ;
        int imageType = uservo.BuyNum > 0 ? 2 : 1;

        _get.enabled      = uservo.BuyNum == 0;
        _get.image.sprite = AssetManager.Instance.GetSpriteAtlas("UIAtlas_Activity_Btn" + imageType);
        string _areaprice        = "";
        string _originalPricetxt = "";

        if (AppConfig.Instance.isChinese == "true" || payvo?.Curreny == Constants.CHINACURRENCY)
        {
            _areaprice        = payvo?.AreaPrice;
            _originalPricetxt = rmbMallVo.OriginalPrice + "元";
        }
        else
        {
            _areaprice        = payvo?.Curreny + payvo?.AreaPrice;
            _originalPricetxt = payvo?.Curreny + payvo?.GetOriginalPrice(rmbMallVo.OriginalPrice);
        }

        _price.text = uservo.BuyNum > 0 ?I18NManager.Get("Common_AlreadyGet") :  _areaprice;
        _originalPrice.gameObject.SetActive(rmbMallVo.OriginalPrice > 0);
        _originalpriceTxt.text = _originalPricetxt;//payvo?.Curreny
    }
Beispiel #4
0
    public void InitRule(MallRuleRes res)
    {
        MallRefreshGoldRulePbs = res.MallRefreshGoldRules;

        if (GameMallDic == null)
        {
            GameMallDic = new Dictionary <int, GameMallVo>();
        }

        GameMallDic.Clear();
        foreach (var pb in res.GameMallRules)
        {
//                Debug.LogError(pb);
            var vo = new GameMallVo(pb);
            if (GameMallDic.ContainsKey(vo.MallId))
            {
                GameMallDic[vo.MallId] = vo;
            }
            else
            {
                GameMallDic.Add(vo.MallId, vo);
            }
        }


        if (RmbMallDic == null)
        {
            RmbMallDic = new Dictionary <int, RmbMallVo>();
        }

        RmbMallDic.Clear();
        foreach (var pb in res.RmbMallRules)
        {
//                Debug.LogError(pb);
            var vo = new RmbMallVo(pb);
            if (RmbMallDic.ContainsKey(vo.MallId))
            {
//                    Debug.LogError(vo.MallId);
                RmbMallDic[vo.MallId] = vo;
            }
            else
            {
                RmbMallDic.Add(vo.MallId, vo);
            }
        }
    }
    public void SetData(UserBuyRmbMallVo rmbvo, RmbMallVo mallVo)
    {
        _iconImg.texture = ResourceManager.Load <Texture>(GlobalData.PropModel.GetGiftPropPath(mallVo.GiftImage));
        _name.text       = mallVo.MallName;
        var payData = GlobalData.PayModel.GetProduct(rmbvo.MallId);

        _priceTxt.text = payData != null ?payData.Curreny + payData.AreaPrice : "";
        _rmbvo         = rmbvo;
        desc           = mallVo.MallDesc;
        foreach (var v in mallVo.Award)
        {
            _resourceid = v.ResourceId;
            _resourcePb = v.Resource;
        }

        _iconOnClick.enabled = rmbvo.BuyNum == 0;
        _tips.SetActive(rmbvo.BuyNum > 0);
        //要加一个已售罄!
    }