Ejemplo n.º 1
0
    void OnBuyBtnClick()
    {
        //判断是否还在打折;
        //TODO::
        bool discount = ShopModule.IsShopItemInDiscount(shopT);

        if (discount != isDiscount)
        {
            InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("shop_bubble7"), transform);
            return;
        }

        //判断是否已经下架;
        //TODO::
        bool isSale = ShopModule.IsShopItemInSaling(shopT);

        if (!isSale)
        {
            InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("shop_bubble6"), transform);
            return;
        }
        //购买商品接口;
        ShopModule.BuyItem(shopT.getId(), 1, isDiscount);

        CloseUI();
    }
Ejemplo n.º 2
0
    void OnBuyBtnClick()
    {
        bool isDiscount = ShopModule.IsShopItemInDiscount(mShopTemplate);

        //string errStr = "";
        //if(!ShopModule.BuyItem(mShopTemplate.getId(), 1, isDiscount, out errStr))
        //{
        //    InterfaceControler.GetInst().AddMsgBox(errStr, transform);
        //}
        ShopModule.BuyItem(mShopTemplate.getId(), 1, isDiscount);
    }
Ejemplo n.º 3
0
    void ShowBuyWater(bool isDiscount, int costNum)
    {
        UI_RechargeBox box = UI_HomeControler.Inst.AddUI(UI_RechargeBox.UI_ResPath).GetComponent <UI_RechargeBox>();

        if (box == null)
        {
            LogManager.LogError("提示窗is null");
            return;
        }

        box.SetDescription_text(GameUtils.getString("vigour_buy_title"));
        box.SetIsNeedDescription(true);
        box.SetConsume_Image(GameUtils.GetSpriteByResourceType(shopT.getCostType()));
        box.SetConNum(costNum.ToString());
        box.SetLeftBtn_text(GameUtils.getString("common_button_purchase"));
        box.SetLeftClick(() =>
        {
            ShopModule.BuyItem(shopT.getId(), 1, isDiscount);
            box.OnCloes();
        });

        box.SetRightBtn_text(GameUtils.getString("common_button_close"));
    }
Ejemplo n.º 4
0
    void OnBuyBtnClick()
    {
        //判断是否还在打折;
        //TODO::
        bool discount = ShopModule.IsShopItemInDiscount(ShopT);

        if (discount != isDiscount)
        {
            InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("shop_bubble7"), selfTransform);
            return;
        }

        //判断是否已经下架;
        //TODO::
        bool isSale = ShopModule.IsShopItemInSaling(ShopT);

        if (!isSale)
        {
            InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("shop_bubble6"), selfTransform);
            return;
        }

        //购买商品接口;
        //string err = "";
        //if(!ShopModule.BuyItem(ShopT.getId(),ItemCount, isDiscount, out err))
        //{
        //    InterfaceControler.GetInst().AddMsgBox(err, selfTransform);
        //}
        //else
        //{
        //    CloseUI();
        //}

        ShopModule.BuyItem(ShopT.getId(), ItemCount, isDiscount);
        CloseUI();
    }
Ejemplo n.º 5
0
    /// <summary>
    /// 点击立刻购买;
    /// </summary>
    void OnMsgBoxYesClick()
    {
        UI_HomeControler.Inst.ReMoveUI(UI_RechargeBox.UI_ResPath);

        int          stoneid = DataTemplate.GetInstance().GetGameConfig().getIdentify_stone_id();
        ShopTemplate shopT   = DataTemplate.GetInstance().GetShopTemplateByID(stoneid);

        if (!ShopModule.IsShopItemInSaling(shopT))
        {
            InterfaceControler.GetInst().AddMsgBox(GameUtils.getString("shop_bubble6"), transform);
            return;
        }
        int  buyTimes   = ObjectSelf.GetInstance().GetShopBuyInfoByShopId(stoneid).todaynum;
        bool isdiscount = ShopModule.IsShopItemInDiscount(shopT);

        int haveCount = 0;

        ObjectSelf.GetInstance().TryGetItemCountById(EM_BAG_HASHTABLE_TYPE.EM_BAG_HASHTABLE_TYPE_COMMON, itemId, ref haveCount);

        //获取符文鉴定石对应到商店表的id;
        int shopId = DataTemplate.GetInstance().GetGameConfig().getIdentify_stone_id();

        ShopModule.BuyItem(shopId, itemCount - haveCount, isdiscount);
    }
Ejemplo n.º 6
0
    void OnItemClick(GameObject go)
    {
        int shopId = System.Convert.ToInt32(EventTriggerListener.Get(go).param);

        ShopModule.BuyItem(shopId, 1, false);
    }