From f4a702e212d1853735f8dae399da69d23bfa510e Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期四, 26 三月 2026 18:16:16 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master' into h5version

---
 Main/System/Store/StoreModel.cs |   78 ++++++++++++++++++++++++++++++++-------
 1 files changed, 64 insertions(+), 14 deletions(-)

diff --git a/Main/System/Store/StoreModel.cs b/Main/System/Store/StoreModel.cs
index 4214b94..32856e4 100644
--- a/Main/System/Store/StoreModel.cs
+++ b/Main/System/Store/StoreModel.cs
@@ -41,6 +41,8 @@
     public Dictionary<int, List<int>> freeShopDict = new Dictionary<int, List<int>>();  //鍏嶈垂鍟嗗搧 鍟嗗簵绫诲瀷锛氬晢鍝佸垪琛�
     public Dictionary<int, int> shopMoneyTypeDict = new Dictionary<int, int>();
 
+
+
     public override void Init()
     {
         FuncOpen.Instance.OnFuncStateChangeEvent += FuncStateChange;
@@ -362,14 +364,28 @@
 
     public void SendBuyShopItem(StoreConfig model, int count)
     {
-        if (UIHelper.CheckMoneyCount(model.MoneyType, model.MoneyNum * count, 2))
+        if (model.MoneyType <= 0)
         {
-            CA310_tagCSBuyItem buyShop = new CA310_tagCSBuyItem();
-            buyShop.ShopID = (ushort)model.ID;
-            buyShop.BuyCount = (uint)count;
-            GameNetSystem.Instance.SendInfo(buyShop);
+            if (UIHelper.CheckItemCount(model.CostItemID, model.MoneyNum * count, 2))
+            {
+                SendBuyItem(model.ID, count);
+            }
         }
+        else
+        {
+            if (UIHelper.CheckMoneyCount(model.MoneyType, model.MoneyNum * count, 2))
+            {
+                SendBuyItem(model.ID, count);
+            }
+        }
+    }
 
+    public void SendBuyItem(int shopID, int count)
+    {
+        CA310_tagCSBuyItem buyShop = new CA310_tagCSBuyItem();
+        buyShop.ShopID = (ushort)shopID;
+        buyShop.BuyCount = (uint)count;
+        GameNetSystem.Instance.SendInfo(buyShop);
     }
 
     //璐у竵璐拱鐨勪簩娆$‘璁ゆ鐨勭‘璁よ褰�
@@ -392,16 +408,21 @@
             return;
         }
 
-        ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), Language.Get("BuyStoreItem", model.MoneyNum, model.MoneyType, model.Name),
-        Language.Get("ConfirmCancel102"), (bool isOk, bool isToggle) =>
-        {
-            if (isOk)
+        ConfirmCancel.ToggleConfirmCancel(
+            Language.Get("Mail101"),
+            model.MoneyType <= 0 ?
+                Language.Get("BuyStoreItem1", model.MoneyNum, ItemConfig.Get(model.CostItemID).ItemName, model.Name) :
+                Language.Get("BuyStoreItem", model.MoneyNum, model.MoneyType, model.Name),
+            Language.Get("ConfirmCancel102"),
+            (isOk, isToggle) =>
             {
-                SendBuyShopItem(model, count);
-                buyItemCheckDict[eventType] = isToggle;
-            }
-            
-        });
+                if (isOk)
+                {
+                    SendBuyShopItem(model, count);
+                    buyItemCheckDict[eventType] = isToggle;
+                }
+
+            });
     }
 
     //鑺变粰鐜夎喘涔扮殑浜屾纭妗�(鏈鐧诲綍)
@@ -562,6 +583,30 @@
         }
         return true;
     }
+
+    // 寮瑰嚭璐拱妗嗭紝涓嶈冻鍒欐彁绀哄凡鍞絼
+    public void ShowBuyItem(int shopID, int tipType = 0)
+    {
+        var cfg = StoreConfig.Get(shopID);
+        if (!TryGetIsSellOut(cfg, out var cnt))
+        {
+            buyShopID = shopID;
+            UIManager.Instance.OpenWindow<BuyItemWin>();
+        }
+        else
+        {
+            if (tipType == 0)
+            {
+                //鍞絼
+                SysNotifyMgr.Instance.ShowTip("StoreTip1");
+            }
+            else if (tipType == 1)
+            {
+                //鐗╁搧涓嶈冻鎻愮ず
+                SysNotifyMgr.Instance.ShowTip("ItemNotEnough", ItemConfig.Get(cfg.ItemID).ItemName);
+            }
+        }
+    }
 }
 
 public enum StoreFunc
@@ -576,6 +621,11 @@
     DailySpecialsFree = 8, //8: 姣忔棩鐗规儬-姣忔棩鐗规儬鍏嶈垂
     DailyGiftFree = 9, //9: 姣忔棩鐗规儬-姣忔棩绀煎寘鍏嶈垂
     WeeklyGiftFree = 10, //10: 姣忔棩鐗规儬-姣忓懆绀煎寘鍏嶈垂
+    HeroSkin = 16, //16: 鏃惰鍟嗗簵
+    OSBeautyMM = 17, //17: 绾㈤鍐叉绀煎寘
+    OSHeroTrain = 18, //18: 姝﹀皢鍐叉绀煎寘
+    OSMingge = 19, //19: 鍛芥牸鍐叉绀煎寘
+    Qunying = 20, //20: 缇よ嫳绉垎鍟嗗簵
 }
 
 

--
Gitblit v1.8.0