| | |
| | | //SetOpenBuyType(chinModel);
|
| | | ItemAttrData attrData = new ItemAttrData(ReplaceItemIdByJob(shopInfo.ID,shopInfo.ItemID),true, (ulong)shopInfo.ItemCnt,-1,shopInfo.IsBind,true,PackType.rptDeleted
|
| | | ,"",null,ItemTipChildType.Buy);
|
| | | itemTipsModel.SetItemTipsModel(attrData);
|
| | | itemTipsModel.SetItemTipsModel(attrData,false);
|
| | | attrData.SetTipsFuncBtn(ItemWinBtnType.buy,(ItemWinBtnType type ,string id) => { OnClickBuyBtn(ItemWinBtnType.buy, shopInfo.ID); });
|
| | | itemTipsModel.ShowUICtrl();
|
| | | }
|
| | |
|
| | | public int BuyCnt { get; private set; }
|
| | | public void SetBuyCnt(int buyCnt)
|
| | | {
|
| | | BuyCnt = buyCnt;
|
| | | }
|
| | | private void OnClickBuyBtn(ItemWinBtnType type, int shopId)
|
| | | {
|
| | | BuyShopItemLimit shopItemLimit = GetBuyShopLimit((uint)shopId);
|
| | | StoreConfig storeConfig = Config.Instance.Get<StoreConfig>(shopId);
|
| | | int curVipIndex = -1;
|
| | | int nextVipIndex = -1;
|
| | | bool isVipBuy = BuyItemPopModel.Instance.CheckIsVipBuy(storeConfig, out curVipIndex, out nextVipIndex);
|
| | | if (shopItemLimit != null)
|
| | | {
|
| | | int remainNum = 0;
|
| | | if (isVipBuy)
|
| | | {
|
| | | remainNum = storeConfig.PurchaseNumber[curVipIndex] - shopItemLimit.BuyCnt;
|
| | | }
|
| | | else
|
| | | {
|
| | | remainNum = storeConfig.PurchaseNumber[0] - shopItemLimit.BuyCnt;
|
| | | }
|
| | | if (remainNum < 1)
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip(Language.Get("StoreWin109"));
|
| | | return;
|
| | | }
|
| | |
|
| | | }
|
| | | SendBuyShopItem(storeConfig,BuyCnt);
|
| | | }
|
| | |
|
| | | #endregion
|