From e83db0da2f14a4661f5dad555ab27373508e1964 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期四, 28 五月 2026 11:55:30 +0800
Subject: [PATCH] 597 时装特卖 新增获取途径47,48 如果没上架或不在这期活动中,弹提示,否则直接跳转

---
 Main/System/Store/StoreModel.cs |   76 +++++++++++++++++++++++++++++++------
 1 files changed, 63 insertions(+), 13 deletions(-)

diff --git a/Main/System/Store/StoreModel.cs b/Main/System/Store/StoreModel.cs
index 5d167b4..cc7c163 100644
--- a/Main/System/Store/StoreModel.cs
+++ b/Main/System/Store/StoreModel.cs
@@ -184,11 +184,11 @@
     /// <summary>
     /// 鑾峰彇鍦ㄤ笂涓嬫灦鏃堕棿鑼冨洿鍐呯殑鍟嗗搧鍒楄〃
     /// </summary>
-    public List<StoreData> GetTimeValidStoreDatas(StoreFunc type)
-    {
-        List<StoreData> allDatas = TryGetStoreDatas(type);
-        if (allDatas == null)
-            return null;
+    public List<StoreData> GetTimeValidStoreDatas(StoreFunc type)
+    {
+        List<StoreData> allDatas = TryGetStoreDatas(type);
+        if (allDatas == null)
+            return null;
 
         int curOpenDay = TimeUtility.OpenDay + 1;
         List<StoreData> validDatas = new List<StoreData>();
@@ -208,14 +208,64 @@
             if (curOpenDay >= cfg.EndTime)
                 continue;
             validDatas.Add(allDatas[i]);
-        }
-        return validDatas;
-    }
-
- 
-    public StoreData GetStoreData(int shopId)
-    {
-        StoreConfig storeConfig = StoreConfig.Get(shopId);
+        }
+        return validDatas;
+    }
+
+    public bool TryGetTimeValidSkinShopIDByItemID(int itemID, out int shopID)
+    {
+        shopID = 0;
+        var validDatas = GetTimeValidStoreDatas(StoreFunc.HeroSkin);
+        if (validDatas == null)
+        {
+            return false;
+        }
+
+        for (int i = 0; i < validDatas.Count; i++)
+        {
+            var storeConfig = validDatas[i].storeConfig;
+            if (storeConfig == null)
+            {
+                continue;
+            }
+
+            if (HasStoreItem(storeConfig, itemID))
+            {
+                shopID = validDatas[i].shopId;
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    bool HasStoreItem(StoreConfig storeConfig, int itemID)
+    {
+        if (storeConfig.ItemID == itemID)
+        {
+            return true;
+        }
+
+        if (storeConfig.ItemListEx == null)
+        {
+            return false;
+        }
+
+        for (int i = 0; i < storeConfig.ItemListEx.Length; i++)
+        {
+            if (storeConfig.ItemListEx[i] != null && storeConfig.ItemListEx[i].Length > 0 && storeConfig.ItemListEx[i][0] == itemID)
+            {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+ 
+    public StoreData GetStoreData(int shopId)
+    {
+        StoreConfig storeConfig = StoreConfig.Get(shopId);
         if (storeConfig == null) return null;
 
         List<StoreData> storeDatas = null;

--
Gitblit v1.8.0