Example #1
0
 //baotnq: code thêm ở đây
 public ProductViewModel(P_Product model)
 {
     Id          = model.ProductId.ToString();
     ProductCode = model.ProductCode;
     ProductName = model.ProductName;
     Price       = model.PriceExpected.ToString();
 }
Example #2
0
    void onSelect(GameObject go)
    {
        P_Product p = GameManager.me.uiManager.popupShop.popupGift.selectedGiftItem;

        UISystemPopup.open(UISystemPopup.PopupType.YesNoPrice,
                           Util.getUIText("CONFIRM_SENDGIFT", p.count.ToString(), epi.GAME_DATA.appFriendDic[data.userId].f_Nick),
                           onConfirmToSendGift, null, p.price.ToString(), p.priceType);
    }
Example #3
0
        public BOrderDetailModel(B_OrderDetail model, P_Product getProduct)
        {
            OrderDetailId = model.OrderDetailId;
            OrderId       = model.OrderId;
            ProductId     = model.ProductId;

            ProductColorCode = model.ProductColorCode;
            ProductCode      = model.ProductCode;
            Price            = model.Price;

            Amount      = model.Amount;
            IsMain      = model.IsMain;
            ProductName = model.ProductName;

            ColorName    = model.ColorName;
            ImageDetail  = getProduct.ProductImage;
            Discount     = model.Discount;
            DiscountCode = model.DiscountCode;
            ParentId     = model.ParentId;
            Imei         = model.Imei;
        }
    protected override void setPassData()
    {
        int len = sortList.Count;

        if (isPageType)
        {
            int totalPage = Mathf.CeilToInt((float)len / (float)maxPerLine);
            for (int i = 0; i < totalPage; ++i)
            {
                P_Product[] p = new P_Product[maxPerLine];

                for (int j = 0; j < maxPerLine; ++j)
                {
                    if (i * maxPerLine + j < len)
                    {
                        p[j] = sortList[i * maxPerLine + j];
                    }
                    else
                    {
                        p[j] = null;
                    }
                }

                rankers_obj.Add((object)p);
            }
        }
        else
        {
            for (int i = 0; i < len; ++i)
            {
                rankers_obj.Add((object)sortList[i]);
            }
        }


        sortList.Clear();
    }
Example #5
0
    public override void setData(object obj)
    {
        if (obj == null)
        {
            this.gameObject.SetActive(false);
            return;
        }
        else
        {
            this.gameObject.SetActive(true);
        }

        lbBonusNum.enabled = false;

        _type    = UIShopItemList.type;
        _nowItem = (P_Product)obj;

        if (string.IsNullOrEmpty(_nowItem.imgUrl) == false && _nowItem.imgUrl.StartsWith("http"))
        {
            photo.gameObject.SetActive(true);
            goDefaultContainer.SetActive(false);
            goNormalContainer.SetActive(false);
            goItemContainer.SetActive(false);

            _imgUrl = _nowItem.imgUrl;

            photo.init(_nowItem.imgUrl);

            _title = _nowItem.desc.Split('/');

            switch (_type)
            {
            case ShopItem.Type.item:

                if (TutorialManager.instance.isTutorialMode)
                {
                    if (TutorialManager.nowPlayingTutorial("T44") && _nowItem.id == "ITEM_P1_UNIT")
                    {
                        btn.gameObject.name = "P";
                    }
                    else if (TutorialManager.nowPlayingTutorial("T45") && _nowItem.id == "ITEM_P1_SKILL")
                    {
                        btn.gameObject.name = "P";
                    }
                    else
                    {
                        btn.gameObject.name = string.Empty;
                    }
                }

                if (_title.Length == 3 || _title.Length == 4)
                {
                    _currentItemName = _title[0] + " " + _title[1];
                }

                break;
            }


            return;
        }

        _imgUrl = null;

        _title = _nowItem.desc.Split('/');

        goDefaultContainer.SetActive(true);
        photo.gameObject.SetActive(false);


        if (_nowItem.priceType == PRICE_TYPE_MONEY)
        {
                        #if UNITY_ANDROID
            lbPrice.text = Util.GetCommaScore(Mathf.RoundToInt(_nowItem.price));
                        #else
            lbPrice.text = string.Format("{0:F2}", _nowItem.price);
                        #endif
        }
        else
        {
            lbPrice.text = Util.GetCommaScore(Mathf.RoundToInt(_nowItem.price));
        }

        spPriceIcon.spriteName = getPriceType(_nowItem.priceType);
        spPriceIcon.MakePixelPerfect();

        spGiftWord.enabled = _type == ShopItem.Type.gift;

        switch (_type)
        {
        case  ShopItem.Type.energy:

            goNormalContainer.gameObject.SetActive(true);
            goItemContainer.gameObject.SetActive(false);

            spRibon.spriteName = "img_buy_ruby";

            spCenterIcon.spriteName = "img_buy_energy_0" + ((index + 1 < 5)?index + 1:5);
            spCenterIcon.MakePixelPerfect();

            lbNormalItemName.enabled = true;
            lbNormalItemName.text    = _title[0];         //Util.getUIText("ENERGY",_nowItem.count.ToString());
            lbCount.enabled          = false;


            _v   = spPriceIcon.transform.localPosition;
            _v.x = 7; _v.y = -147;
            spPriceIcon.transform.localPosition = _v;

            _v   = lbPrice.transform.localPosition;
            _v.x = 68; _v.y = -149;
            lbPrice.transform.localPosition = _v;

            setBonusLabelAndSprite();

            break;

        case  ShopItem.Type.gold:

            goNormalContainer.gameObject.SetActive(true);
            goItemContainer.gameObject.SetActive(false);

            spRibon.spriteName = "img_buy_ruby";

            spCenterIcon.spriteName = "img_buy_gold_0" + ((index + 1 < 5)?index + 1:5);
            spCenterIcon.MakePixelPerfect();

            lbNormalItemName.enabled = false;
            lbCount.enabled          = true;

            lbCount.text = Util.GetCommaScore(_nowItem.count);

            setBonusLabelAndSprite();

            _v   = spPriceIcon.transform.localPosition;
            _v.x = 7; _v.y = -147;
            spPriceIcon.transform.localPosition = _v;

            _v   = lbPrice.transform.localPosition;
            _v.x = 68; _v.y = -149;
            lbPrice.transform.localPosition = _v;

            break;

        case ShopItem.Type.ruby:
        case ShopItem.Type.gift:

            goNormalContainer.gameObject.SetActive(true);
            goItemContainer.gameObject.SetActive(false);

            spRibon.spriteName = "img_buy_ruby";

            spCenterIcon.spriteName = "img_buy_ruby_0" + ((index + 1 < 5)?index + 1:5);
            spCenterIcon.MakePixelPerfect();

            lbNormalItemName.enabled = false;
            lbCount.enabled          = true;

            lbCount.text = Util.GetCommaScore(_nowItem.count);



            _v   = lbPrice.transform.localPosition;
            _v.x = 68; _v.y = -149;
            lbPrice.transform.localPosition = _v;


            _v   = spPriceIcon.transform.localPosition;
            _v.x = lbPrice.transform.localPosition.x - lbPrice.printedSize.x * 0.5f - 30f;              //7;
            _v.y = -147;
            spPriceIcon.transform.localPosition = _v;

            setBonusLabelAndSprite();

            break;

        case ShopItem.Type.item:

            if (TutorialManager.instance.isTutorialMode)
            {
                btn.gameObject.name = string.Empty;
            }

            goNormalContainer.gameObject.SetActive(false);
            goItemContainer.gameObject.SetActive(true);

            char[] ta        = _nowItem.id.ToCharArray();
            bool   isNormal  = (ta[5] == 'N');
            bool   isPackage = (ta[6] != '1');

            if (TutorialManager.nowPlayingTutorial("T44"))
            {
                btn.gameObject.name = "";
            }

            switch (ta[8])
            {
            case 'U':
                if (isPackage && !isNormal)
                {
                    spEquipIcon.spriteName = "img_buy_premiumset_01";
                }
                else if (!isNormal)
                {
                    spEquipIcon.spriteName = "img_buy_premium_01";

                    if (TutorialManager.nowPlayingTutorial("T44") && _nowItem.id == "ITEM_P1_UNIT")
                    {
                        btn.gameObject.name = "P";
                    }
                }
                else
                {
                    spEquipIcon.spriteName = "img_buy_normal_01";
                    if (TutorialManager.nowPlayingTutorial("T44"))
                    {
                        btn.gameObject.name = "N";
                    }
                }
                break;

            case 'S':
                if (isPackage && !isNormal)
                {
                    spEquipIcon.spriteName = "img_buy_premiumset_02";
                }
                else if (!isNormal)
                {
                    spEquipIcon.spriteName = "img_buy_premium_02";

                    if (TutorialManager.nowPlayingTutorial("T45") && _nowItem.id == "ITEM_P1_SKILL")
                    {
                        btn.gameObject.name = "P";
                    }
                }
                else
                {
                    spEquipIcon.spriteName = "img_buy_normal_02";
                }
                break;



            case 'E':
                if (isPackage && !isNormal)
                {
                    spEquipIcon.spriteName = "img_buy_premiumset_03";
                }
                else if (!isNormal)
                {
                    spEquipIcon.spriteName = "img_buy_premium_03";

                    if (TutorialManager.nowPlayingTutorial("T50"))
                    {
                        btn.gameObject.name = "P";
                    }
                }
                else
                {
                    spEquipIcon.spriteName = "img_buy_normal_03";
                }
                break;
            }


            switch (_title.Length)
            {
            case 3:
                lbPrefix.text         = _title[0];
                lbItemName.text       = _title[1];
                lbEquipMiddleMsg.text = _title[2];

                _currentItemName = _title[0] + " " + _title[1];

                break;

            case 4:
                lbPrefix.text = _title[0];

                lbItemName.text       = _title[1];
                lbItemCount.text      = _title[2];
                lbEquipMiddleMsg.text = _title[3];

                _currentItemName = _title[0] + " " + _title[1];
                break;
            }

            lbItemCount.enabled = (isPackage && !isNormal);

            _v   = lbPrefix.transform.localPosition;
            _v.x = 52; _v.y = 148;
            lbPrefix.transform.localPosition = _v;

            _v   = lbPrefix.transform.localScale;
            _v.x = 1.1f; _v.y = 1.1f;
            lbPrefix.transform.localScale = _v;

            _v   = lbItemName.transform.localPosition;
            _v.x = 53; _v.y = 118;
            lbItemName.transform.localPosition = _v;



            spEquipTitleRibon.spriteName = (isNormal)?"img_buy_normal":"img_buy_premium";

            spEquipIcon.MakePixelPerfect();


            _v   = spPriceIcon.transform.localPosition;
            _v.x = 22; _v.y = -147;
            spPriceIcon.transform.localPosition = _v;

            _v   = lbPrice.transform.localPosition;
            _v.x = 77; _v.y = -149;
            lbPrice.transform.localPosition = _v;

            break;
        }
    }