Эх сурвалжийг харах

修复ios 调起ios支付的bug

gfgios 1 жил өмнө
parent
commit
3c5039116b

+ 29 - 6
GameClient/Assets/Game/HotUpdate/Platform/QDDouYouManagerIos.cs

@@ -67,13 +67,37 @@ namespace GFGGame
                 return;
             }
 
-            ItemCfg costItemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.costId);
-            if (costItemCfg == null)
+            string currencyName = string.Empty;
+           
+            if (shopCfg.costType ==  CostType.FREE)
             {
-                Log.Error($"recharge2 {buyID} itemCfgId:{shopCfg.costId} config not found!");
-                return;
+                //免费
+                currencyName = "免费";
             }
-
+            else if(shopCfg.costType ==  CostType.ITEM)
+            {
+                //货币
+                ItemCfg costItemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.costId);
+                if (costItemCfg == null)
+                {
+                    currencyName = $"货币_{shopCfg.costId}";
+                }
+                else
+                {
+                    currencyName = costItemCfg.name; 
+                }
+            }
+            else if(shopCfg.costType ==  CostType.RMB)
+            {
+                //人民币
+                currencyName = "人民币";
+            }
+            else
+            {
+                //指定渠道商品id
+                currencyName = $"指定商品id_{shopCfg.costId}";
+            }
+            
             var zoneScene = GameGlobal.zoneScene;
             if (zoneScene == null) return;
 
@@ -100,7 +124,6 @@ namespace GFGGame
             string productDesc = "";
             string productCount = count.ToString();
             string exchangeRate = 1.ToString();
-            string currencyName = costItemCfg.name;
             string serverId = (serverInfosComponent?.CurrentServerId ?? 0).ToString();
             string serverName = serverInfosComponent?.recentlyServerInfo?.ServerName ?? "";
             string roleId = roleInfo.Id.ToString();