Browse Source

Merge branch 'master' of http://10.108.64.190:3000/gfg/client

zhaoyang 2 years ago
parent
commit
157f69c333
1 changed files with 12 additions and 7 deletions
  1. 12 7
      GameClient/Assets/Game/HotUpdate/Views/Store/StoreMonthView.cs

+ 12 - 7
GameClient/Assets/Game/HotUpdate/Views/Store/StoreMonthView.cs

@@ -88,7 +88,6 @@ namespace GFGGame
             MonthlyCardPrivilegeCfg privilegeCfg = MonthlyCardPrivilegeCfgArray.Instance.GetCfg(MonthCardPrivilegeType.Privilege1);
 
             string iconUrl = "";
-            bool isFirstBuy = false;
             bool isGot = false;
             long endTime = 0;
             int privilegeCount = 0;
@@ -98,7 +97,6 @@ namespace GFGGame
                 case ConstStoreSubId.STORE_MONTH_GOLD_CARD:
                     iconUrl = "ui://Store/MonthCard_Icon";
                     monthCfg = MonthlyCardCfgArray.Instance.GetCfg(MonthCardType.Gold);
-                    isFirstBuy = GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardGoldFirstBuy) <= 0;
                     endTime = GameGlobal.myNumericComponent.GetAsLong(NumericType.MonthCardGoldEndTime);
                     isGot = GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardGoldReward) > 0;
                     for (int i = 0; i < MonthlyCardPrivilegeCfgArray.Instance.dataArray.Length; i++)
@@ -116,7 +114,6 @@ namespace GFGGame
                 case ConstStoreSubId.STORE_MONTH_BLACK_CARD:
                     iconUrl = "ui://Store/MonthCard_Icon";
                     monthCfg = MonthlyCardCfgArray.Instance.GetCfg(MonthCardType.BlackGold);
-                    isFirstBuy = GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardBlackGoldFirstBuy) <= 0;
                     endTime = GameGlobal.myNumericComponent.GetAsLong(NumericType.MonthCardBlackGoldEndTime);
                     isGot = GameGlobal.myNumericComponent.GetAsInt(NumericType.MonthCardBlackGoldReward) > 0;
                     for (int i = 0; i < MonthlyCardPrivilegeCfgArray.Instance.dataArray.Length; i++)
@@ -139,11 +136,19 @@ namespace GFGGame
             _ui.m_txtTime.visible = endTime > TimeHelper.ServerNow();
             _ui.m_loaCard.url = iconUrl;
             ShopCfg shopCfg = ShopCfgArray.Instance.GetCfg(monthCfg.shopId);
-            _ui.m_btnBuy.m_txtOriginalPrice.text = shopCfg.price.ToString();
-            _ui.m_btnBuy.m_grpOriginalPrice.visible = isFirstBuy && shopCfg.oncePrice < shopCfg.price;
-            int price = isFirstBuy ? shopCfg.oncePrice : shopCfg.price;
+            if(shopCfg.onceShopId > 0)
+            {
+                //如果配置了首次购买物品,使用特殊物品购买
+                if(ShopDataManager.Instance.GetGoodsBuyNumById(shopCfg.onceShopId) <= 0)
+                {
+                    shopCfg = ShopCfgArray.Instance.GetCfg(shopCfg.onceShopId);
+                }
+            }
+            _ui.m_btnBuy.m_txtOriginalPrice.text = shopCfg.originalPrice.ToString();
+            _ui.m_btnBuy.m_grpOriginalPrice.visible = shopCfg.price < shopCfg.originalPrice;
+            int price = shopCfg.price;
             _ui.m_btnBuy.m_txtPrice.text = price.ToString();
-            _ui.m_btnBuy.target.data = monthCfg.shopId;
+            _ui.m_btnBuy.target.data = shopCfg.id;
             _ui.m_txtTips.SetVar("value", (price * 10).ToString()).FlushVars();
             _ui.m_txtTips.SetVar("day", monthCfg.limitDays.ToString()).FlushVars();