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/ItemTip/ItemTipWayWin.cs | 29 +++++++++
Main/System/HeroSkinFlashSale/HeroSkinFlashSaleManager.cs | 18 ++++++
Main/System/Store/StoreModel.cs | 76 +++++++++++++++++++++----
3 files changed, 110 insertions(+), 13 deletions(-)
diff --git a/Main/System/HeroSkinFlashSale/HeroSkinFlashSaleManager.cs b/Main/System/HeroSkinFlashSale/HeroSkinFlashSaleManager.cs
index d99ebf7..d4dd889 100644
--- a/Main/System/HeroSkinFlashSale/HeroSkinFlashSaleManager.cs
+++ b/Main/System/HeroSkinFlashSale/HeroSkinFlashSaleManager.cs
@@ -216,6 +216,24 @@
return ctgID;
}
+ public bool TryGetCurrentActSkinIDByItemID(int itemID, out int skinID)
+ {
+ skinID = 0;
+ if (!HeroSkinAttrConfig.TryGetSkinIDByItemID(itemID, out skinID))
+ {
+ return false;
+ }
+
+ var act = GetActInfo();
+ if (act == null)
+ {
+ return false;
+ }
+
+ var skinIDList = GetSkinIDList(act.CfgID);
+ return skinIDList != null && skinIDList.Contains(skinID);
+ }
+
Dictionary<int, int> GetSkinIDToCtgIDDict()
{
if (!ctgDict.IsNullOrEmpty())
diff --git a/Main/System/ItemTip/ItemTipWayWin.cs b/Main/System/ItemTip/ItemTipWayWin.cs
index ff5f6ea..bdc4275 100644
--- a/Main/System/ItemTip/ItemTipWayWin.cs
+++ b/Main/System/ItemTip/ItemTipWayWin.cs
@@ -130,6 +130,35 @@
UIManager.Instance.OpenWindow<TimingGiftWin>(int.Parse(way.CustomValue));
}
break;
+ case 4:
+ if (!HeroSkinFlashSaleManager.Instance.TryGetCurrentActSkinIDByItemID(itemID, out var skinID))
+ {
+ SysNotifyMgr.Instance.ShowTip("ActivityNoOpen");
+ return;
+ }
+
+ HeroSkinFlashSaleManager.Instance.currentChooseSkinID = skinID;
+ UIJumpManager.Instance.OpenWindow(way.WinJumpID);
+ break;
+ case 5:
+ if (!StoreModel.Instance.TryGetTimeValidSkinShopIDByItemID(itemID, out var skinShopID))
+ {
+ SysNotifyMgr.Instance.ShowTip("ActivityNoOpen");
+ return;
+ }
+
+ StoreModel.Instance.jumpShopID = skinShopID;
+ StoreModel.Instance.selectStoreFuncType = StoreFunc.HeroSkin;
+ if (UIManager.Instance.IsOpened<StoreBaseWin>())
+ {
+ UIManager.Instance.CloseWindow<StoreBaseWin>();
+ UIManager.Instance.OpenWindow<StoreBaseWin>(1);
+ }
+ else
+ {
+ UIManager.Instance.OpenWindow<StoreBaseWin>(1);
+ }
+ break;
case 0:
default:
if (WindowSearchConfig.HasKey(way.WinJumpID))
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