zhaoyang 2 years ago
parent
commit
69fe170e40

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Constant/ConstBuyType.cs

@@ -2,10 +2,10 @@ namespace GFGGame
 {
     public class ConstBuyType
     {
-        public const int TYPE_NORMAL = 0;//无类型兑换,无表格
+        // public const int TYPE_NORMAL = 0;//无类型兑换,无表格
         public const int TYPE_ITEM = 1;//物品兑换,对应兑换表
         public const int TYPE_SHOP = 2;//商店兑换,对应商店表
-        public const int TYPE_ITEM_Store = 2;//物品兑换,对应兑换商店表
+        // public const int TYPE_ITEM_Store = 2;//物品兑换,对应兑换商店表
 
     }
 }

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Controller/BuyItemConteoller.cs

@@ -20,14 +20,14 @@ namespace GFGGame
         /// <param name="showTips">是否弹购买成功飘字,默认是</param>
         /// <param name="openSource">是否打开来源界面。默认否</param>
         /// <param name="count">兑换总量</param>
-        public static void Show(int itemId, long count, int buyType = ConstBuyType.TYPE_NORMAL, int shopType = 0, Action onSuccess = null, bool showTips = true, bool openSource = false, int maxCount = 9990)
+        public static void Show(int itemId, long count, int buyType = ConstBuyType.TYPE_SHOP, Action onSuccess = null, bool showTips = true, bool openSource = false, int maxCount = 9990)
         {
             if (_buyCountView == null)
             {
                 _buyCountView = new BuyCountView();
             }
             _buyCountView.Reset();
-            _buyCountView.SetParams(itemId, count, buyType, shopType, onSuccess, showTips, openSource, maxCount);
+            _buyCountView.SetParams(itemId, count, buyType, onSuccess, showTips, openSource, maxCount);
             _buyCountView.Show();
 
         }

+ 4 - 3
GameClient/Assets/Game/HotUpdate/Controller/GameController.cs

@@ -108,7 +108,8 @@ namespace GFGGame
             await StorageSProxy.ReqGetClientValues();
             await SuitFosterProxy.SendGetSuitInfos();
             await ActivitySProxy.ReqSevenDayLoginInfos();
-            await RechargeSProxy.ReqRequestGiftBagInfo();
+            // await RechargeSProxy.ReqRequestGiftBagInfo();
+            await ShopSProxy.ReqShopInfo();
             await StudioSProxy.ReqStudioInfos();
             await RoleInfoSProxy.ReqPersonalInfo();
 
@@ -237,8 +238,8 @@ namespace GFGGame
             ItemHelper.GetItemAttributeInfos().Coroutine();
             MainStorySProxy.GetStoryInfos().Coroutine();
             CardSProxy.GetCardInfos().Coroutine();
-            RechargeSProxy.ReqRechargeInfo().Coroutine();
-            RechargeSProxy.ReqExchangeInfo().Coroutine();
+            // RechargeSProxy.ReqRechargeInfo().Coroutine();
+            // RechargeSProxy.ReqExchangeInfo().Coroutine();
             DailyTaskSProxy.ReqDailyTaskInfos().Coroutine();
             NoticeSProxy.ReqSystemNoticeList().Coroutine();
             MailSProxy.ReqMailCount().Coroutine();

+ 35 - 35
GameClient/Assets/Game/HotUpdate/Data/ShopDataManager.cs

@@ -10,26 +10,26 @@ namespace GFGGame
     {
         public string[] refreshType = { "永久限购", "每日限购", "每周限购", "每月限购" };
 
-        private Dictionary<int, int> _rechargeDic = new Dictionary<int, int>();
+        // private Dictionary<int, int> _rechargeDic = new Dictionary<int, int>();
         private Dictionary<int, int> _goodsDic = new Dictionary<int, int>();
-        private Dictionary<int, int> _exchangeDic = new Dictionary<int, int>();
+        // private Dictionary<int, int> _exchangeDic = new Dictionary<int, int>();
         public void Clear()
         {
-            _rechargeDic.Clear();
+            // _rechargeDic.Clear();
             _goodsDic.Clear();
-            _exchangeDic.Clear();
-        }
-        public void UpdateRechargeData(int rechargeId, int num)
-        {
-            if (!_rechargeDic.ContainsKey(rechargeId))
-            {
-                _rechargeDic.Add(rechargeId, num);
-            }
-            else
-            {
-                _rechargeDic[rechargeId] = num;
-            }
+            // _exchangeDic.Clear();
         }
+        // public void UpdateRechargeData(int rechargeId, int num)
+        // {
+        //     if (!_rechargeDic.ContainsKey(rechargeId))
+        //     {
+        //         _rechargeDic.Add(rechargeId, num);
+        //     }
+        //     else
+        //     {
+        //         _rechargeDic[rechargeId] = num;
+        //     }
+        // }
         public void UpdateGiftData(int giftId, int num)
         {
             if (!_goodsDic.ContainsKey(giftId))
@@ -41,17 +41,17 @@ namespace GFGGame
                 _goodsDic[giftId] = num;
             }
         }
-        public void UpdateExchangeData(int exchangeId, int num)
-        {
-            if (!_exchangeDic.ContainsKey(exchangeId))
-            {
-                _exchangeDic.Add(exchangeId, num);
-            }
-            else
-            {
-                _exchangeDic[exchangeId] = num;
-            }
-        }
+        // public void UpdateExchangeData(int exchangeId, int num)
+        // {
+        //     if (!_exchangeDic.ContainsKey(exchangeId))
+        //     {
+        //         _exchangeDic.Add(exchangeId, num);
+        //     }
+        //     else
+        //     {
+        //         _exchangeDic[exchangeId] = num;
+        //     }
+        // }
         /************************************************************************************************************/
 
         public List<ShopCfg> GetList(int storeId, int typeIndex, int scoreType)
@@ -117,15 +117,15 @@ namespace GFGGame
 
 
         /**************************************************************************************************************************/
-        /// <summary>
-        /// 根据充值id获取购买次数
-        /// </summary>
-        /// <param name="rechargeId"></param>
-        /// <returns></returns>
-        public int GetRechargeBuyNumById(int rechargeId)
-        {
-            return !_rechargeDic.ContainsKey(rechargeId) ? 0 : _rechargeDic[rechargeId];
-        }
+        // /// <summary>
+        // /// 根据充值id获取购买次数
+        // /// </summary>
+        // /// <param name="rechargeId"></param>
+        // /// <returns></returns>
+        // public int GetRechargeBuyNumById(int rechargeId)
+        // {
+        //     return !_rechargeDic.ContainsKey(rechargeId) ? 0 : _rechargeDic[rechargeId];
+        // }
         /// <summary>
         /// 根据商品id获取购买次数
         /// </summary>

+ 5 - 8
GameClient/Assets/Game/HotUpdate/Data/ShopViewManager.cs

@@ -9,9 +9,9 @@ namespace GFGGame
 
     public class ShopViewManager : SingletonBase<ShopViewManager>
     {
-        public void BuyItem(int itemId, int itemCount, int shopType, ShopCfg shopCfg)
+        public void BuyItem(int itemId, int itemCount, int buyType, ShopCfg shopCfg)
         {
-            BuyItemConteoller.Show(itemId, itemCount, ConstBuyType.TYPE_SHOP, shopType, () =>
+            BuyItemConteoller.Show(itemId, itemCount, buyType, () =>
             {
                 LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.FU_ZHUANG_DIAN, 2);
                 GetSuitItemController.TryShow(0);
@@ -124,17 +124,14 @@ namespace GFGGame
             {
                 if (!AntiAddictionController.CheckAntiAddictionRecharge(cfg.price))
                 {
-                    RechargeSProxy.ReqRecharge(cfg.id).Coroutine();
+                    ShopSProxy.ReqShopBuy(cfg.id, 1).Coroutine();
                     LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
                 }
             }
             else if (cfg.costType == CostType.FREE)
             {
-                bool result = await RechargeSProxy.ReqExchangeShopItem(cfg.id, 1);
-                if (result)
-                {
-                    LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
-                }
+                ShopSProxy.ReqShopBuy(cfg.id, 1).Coroutine();
+                LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
             }
             else
             {

+ 3 - 2
GameClient/Assets/Game/HotUpdate/ServerProxy/CommonSProxy.cs

@@ -40,8 +40,9 @@ namespace GFGGame
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
-                    RechargeSProxy.ReqRequestGiftBagInfo().Coroutine();
-                    RechargeSProxy.ReqExchangeInfo().Coroutine();
+                    // RechargeSProxy.ReqRequestGiftBagInfo().Coroutine();
+                    // RechargeSProxy.ReqExchangeInfo().Coroutine();
+                    ShopSProxy.ReqShopInfo().Coroutine();
                     DailyTaskSProxy.ReqDailyTaskInfos().Coroutine();
                     SuitFosterProxy.SendGetSuitInfos().Coroutine();
                     FieldSProxy.ReqFieldInstanceInfos().Coroutine();

+ 93 - 93
GameClient/Assets/Game/HotUpdate/ServerProxy/RechargeSProxy.cs

@@ -4,99 +4,99 @@ namespace GFGGame
 {
     public class RechargeSProxy
     {
-        public static async ETTask ReqRecharge(int rechargeId)
-        {
-            M2C_Recharge response = null;
-            response = (M2C_Recharge)await MessageHelper.SendToServer(new C2M_Recharge() { RechargeId = rechargeId });
-            if (response != null)
-            {
-                if (response.Error == ErrorCode.ERR_Success)
-                {
-                    ShopDataManager.Instance.UpdateRechargeData(response.RechargeId, response.RechargedTimes);
-                    PromptController.Instance.ShowFloatTextPrompt("虚拟充值成功", MessageType.SUCCESS);
-                    EventAgent.DispatchEvent(ConstMessage.BUY_RECHARGE_SUCCESS);
+        // public static async ETTask ReqRecharge(int rechargeId)
+        // {
+        //     M2C_Recharge response = null;
+        //     response = (M2C_Recharge)await MessageHelper.SendToServer(new C2M_Recharge() { RechargeId = rechargeId });
+        //     if (response != null)
+        //     {
+        //         if (response.Error == ErrorCode.ERR_Success)
+        //         {
+        //             ShopDataManager.Instance.UpdateRechargeData(response.RechargeId, response.RechargedTimes);
+        //             PromptController.Instance.ShowFloatTextPrompt("虚拟充值成功", MessageType.SUCCESS);
+        //             EventAgent.DispatchEvent(ConstMessage.BUY_RECHARGE_SUCCESS);
 
-                }
-            }
-        }
-        public static async ETTask ReqRechargeInfo()
-        {
-            M2C_GetRechargeInfo response = null;
-            response = (M2C_GetRechargeInfo)await MessageHelper.SendToServer(new C2M_GetRechargeInfo() { });
-            if (response != null)
-            {
-                if (response.Error == ErrorCode.ERR_Success)
-                {
-                    for (int i = 0; i < response.ks.Count; i++)
-                    {
-                        ShopDataManager.Instance.UpdateRechargeData(response.ks[i], response.vs[i]);
-                    }
-                }
-            }
-        }
-        public static async ETTask ReqRequestGiftBagInfo()
-        {
-            M2C_RequestGiftBagInfo response = null;
-            response = (M2C_RequestGiftBagInfo)await MessageHelper.SendToServer(new C2M_RequestGiftBagInfo() { });
-            if (response != null)
-            {
-                if (response.Error == ErrorCode.ERR_Success)
-                {
-                    for (int i = 0; i < response.ks.Count; i++)
-                    {
-                        ShopDataManager.Instance.UpdateGiftData(response.ks[i], response.vs[i]);
-                    }
-                }
-            }
-        }
-        public static async ETTask<bool> ReqBuyGiftBag(int giftId)
-        {
-            M2C_BuyGiftBag response = null;
-            response = (M2C_BuyGiftBag)await MessageHelper.SendToServer(new C2M_BuyGiftBag() { GiftBagId = giftId });
-            if (response != null)
-            {
-                if (response.Error == ErrorCode.ERR_Success)
-                {
-                    ShopDataManager.Instance.UpdateGiftData(response.GiftBagId, response.BuyTimes);
-                    BonusController.TryShowBonusList(GiftBagCfgArray.Instance.GetCfg(response.GiftBagId).itemsArr);
-                    EventAgent.DispatchEvent(ConstMessage.BUY_GIFT_SUCCESS);
-                    EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
-                    return true;
-                }
-            }
-            return false;
-        }
-        public static async ETTask ReqExchangeInfo()
-        {
-            M2C_RequestShopExchangeInfo response = null;
-            response = (M2C_RequestShopExchangeInfo)await MessageHelper.SendToServer(new C2M_RequestShopExchangeInfo() { });
-            if (response != null)
-            {
-                if (response.Error == ErrorCode.ERR_Success)
-                {
-                    for (int i = 0; i < response.ks.Count; i++)
-                    {
-                        ShopDataManager.Instance.UpdateExchangeData(response.ks[i], response.vs[i]);
-                    }
-                }
-            }
-        }
-        public static async ETTask<bool> ReqExchangeShopItem(int exchangeId, long buyNum)
-        {
-            M2C_ExchangeShopItem response = null;
-            response = (M2C_ExchangeShopItem)await MessageHelper.SendToServer(new C2M_ExchangeShopItem() { ExchangeId = exchangeId, Times = (int)buyNum });
-            if (response != null)
-            {
-                if (response.Error == ErrorCode.ERR_Success)
-                {
-                    ShopDataManager.Instance.UpdateExchangeData(response.ExchangeId, response.ExchangedTimes);
-                    EventAgent.DispatchEvent(ConstMessage.BUY_EXCHANGE_SUCCESS);
-                    ShopExchangeCfg cfg = ShopExchangeCfgArray.Instance.GetCfg(response.ExchangeId);
-                    BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(cfg.itemId, cfg.num * response.Times));
-                    return true;
-                }
-            }
-            return false;
-        }
+        //         }
+        //     }
+        // }
+        // public static async ETTask ReqRechargeInfo()
+        // {
+        //     M2C_GetRechargeInfo response = null;
+        //     response = (M2C_GetRechargeInfo)await MessageHelper.SendToServer(new C2M_GetRechargeInfo() { });
+        //     if (response != null)
+        //     {
+        //         if (response.Error == ErrorCode.ERR_Success)
+        //         {
+        //             for (int i = 0; i < response.ks.Count; i++)
+        //             {
+        //                 ShopDataManager.Instance.UpdateRechargeData(response.ks[i], response.vs[i]);
+        //             }
+        //         }
+        //     }
+        // }
+        // public static async ETTask ReqRequestGiftBagInfo()
+        // {
+        //     M2C_RequestGiftBagInfo response = null;
+        //     response = (M2C_RequestGiftBagInfo)await MessageHelper.SendToServer(new C2M_RequestGiftBagInfo() { });
+        //     if (response != null)
+        //     {
+        //         if (response.Error == ErrorCode.ERR_Success)
+        //         {
+        //             for (int i = 0; i < response.ks.Count; i++)
+        //             {
+        //                 ShopDataManager.Instance.UpdateGiftData(response.ks[i], response.vs[i]);
+        //             }
+        //         }
+        //     }
+        // }
+        // public static async ETTask<bool> ReqBuyGiftBag(int giftId)
+        // {
+        //     M2C_BuyGiftBag response = null;
+        //     response = (M2C_BuyGiftBag)await MessageHelper.SendToServer(new C2M_BuyGiftBag() { GiftBagId = giftId });
+        //     if (response != null)
+        //     {
+        //         if (response.Error == ErrorCode.ERR_Success)
+        //         {
+        //             ShopDataManager.Instance.UpdateGiftData(response.GiftBagId, response.BuyTimes);
+        //             BonusController.TryShowBonusList(GiftBagCfgArray.Instance.GetCfg(response.GiftBagId).itemsArr);
+        //             EventAgent.DispatchEvent(ConstMessage.BUY_GIFT_SUCCESS);
+        //             EventAgent.DispatchEvent(ConstMessage.RED_CHANGE);
+        //             return true;
+        //         }
+        //     }
+        //     return false;
+        // }
+        // public static async ETTask ReqExchangeInfo()
+        // {
+        //     M2C_RequestShopExchangeInfo response = null;
+        //     response = (M2C_RequestShopExchangeInfo)await MessageHelper.SendToServer(new C2M_RequestShopExchangeInfo() { });
+        //     if (response != null)
+        //     {
+        //         if (response.Error == ErrorCode.ERR_Success)
+        //         {
+        //             for (int i = 0; i < response.ks.Count; i++)
+        //             {
+        //                 ShopDataManager.Instance.UpdateExchangeData(response.ks[i], response.vs[i]);
+        //             }
+        //         }
+        //     }
+        // }
+        // public static async ETTask<bool> ReqExchangeShopItem(int exchangeId, long buyNum)
+        // {
+        //     M2C_ExchangeShopItem response = null;
+        //     response = (M2C_ExchangeShopItem)await MessageHelper.SendToServer(new C2M_ExchangeShopItem() { ExchangeId = exchangeId, Times = (int)buyNum });
+        //     if (response != null)
+        //     {
+        //         if (response.Error == ErrorCode.ERR_Success)
+        //         {
+        //             ShopDataManager.Instance.UpdateExchangeData(response.ExchangeId, response.ExchangedTimes);
+        //             EventAgent.DispatchEvent(ConstMessage.BUY_EXCHANGE_SUCCESS);
+        //             ShopExchangeCfg cfg = ShopExchangeCfgArray.Instance.GetCfg(response.ExchangeId);
+        //             BonusController.TryShowBonusList(ItemUtil.CreateItemDataList(cfg.itemId, cfg.num * response.Times));
+        //             return true;
+        //         }
+        //     }
+        //     return false;
+        // }
     }
 }

+ 35 - 4
GameClient/Assets/Game/HotUpdate/ServerProxy/ShopSProxy.cs

@@ -4,15 +4,46 @@ namespace GFGGame
 {
     public class ShopSProxy
     {
-        public static async ETTask<bool> ShopBuy(int shopType, int buyId, long buyCount)
+        // public static async ETTask<bool> ShopBuy(int shopType, int buyId, long buyCount)
+        // {
+        //     M2C_ShopBuy response = null;
+        //     response = (M2C_ShopBuy)await MessageHelper.SendToServer(new C2M_ShopBuy() { ShopType = shopType, BuyId = buyId, BuyCount = (int)buyCount });
+        //     if (response != null)
+        //     {
+        //         if (response.Error == ErrorCode.ERR_Success)
+        //         {
+        //             // EventAgent.DispatchEvent(ConstMessage.SHOP_BUY);
+        //             return true;
+        //         }
+        //     }
+        //     return false;
+        // }
+        public static async ETTask<bool> ReqShopInfo()
         {
-            M2C_ShopBuy response = null;
-            response = (M2C_ShopBuy)await MessageHelper.SendToServer(new C2M_ShopBuy() { ShopType = shopType, BuyId = buyId, BuyCount = (int)buyCount });
+            S2C_RequestShopInfo response = null;
+            response = (S2C_RequestShopInfo)await MessageHelper.SendToServer(new C2S_RequestShopInfo());
             if (response != null)
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
-                    // EventAgent.DispatchEvent(ConstMessage.SHOP_BUY);
+                    for (int i = 0; i < response.ks.Count; i++)
+                    {
+                        ShopDataManager.Instance.UpdateGiftData(response.ks[i], response.vs[i]);
+                    }
+                    return true;
+                }
+            }
+            return false;
+        }
+        public static async ETTask<bool> ReqShopBuy(int buyId, long buyCount)
+        {
+            S2C_ShopBuy response = null;
+            response = (S2C_ShopBuy)await MessageHelper.SendToServer(new C2S_ShopBuy() { BuyId = buyId, Times = (int)buyCount });
+            if (response != null)
+            {
+                if (response.Error == ErrorCode.ERR_Success)
+                {
+                    ShopDataManager.Instance.UpdateGiftData(response.BuyId, response.TotalTimes);
                     return true;
                 }
             }

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Utils/ItemUtil.cs

@@ -27,7 +27,7 @@ namespace GFGGame
             }
             else
             {
-                BuyItemConteoller.Show(itemId, num, ConstBuyType.TYPE_ITEM, 0, onSuccess, showTips, openSource, maxCount);
+                BuyItemConteoller.Show(itemId, num, ConstBuyType.TYPE_ITEM, onSuccess, showTips, openSource, maxCount);
                 BuyItemConteoller.showTxtBuyTips = showTxtBuyTips;
             }
         }
@@ -68,7 +68,7 @@ namespace GFGGame
         {
 
             ItemExchangeCfg currencyRatioCfg = ItemExchangeCfgArray.Instance.GetCfg(ConstItemID.DIAMOND_RED);// GetCurrencyRatioCfgById(ConstItemID.DIAMOND_RED);
-            BuyItemConteoller.Show(currencyRatioCfg.id, value > 0 ? value : 1, ConstBuyType.TYPE_ITEM, 0, onSuccess, true, true);
+            BuyItemConteoller.Show(currencyRatioCfg.id, value > 0 ? value : 1, ConstBuyType.TYPE_ITEM, onSuccess, true, true);
             BuyItemConteoller.showTxtBuyTips = true;
         }
 

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Views/ClothingShop/ClothingShopView.cs

@@ -174,7 +174,7 @@ namespace GFGGame
             }
             if (_selectedItemId > 0 && _selectedItemCount > 0)
             {
-                ShopViewManager.Instance.BuyItem(_cfgSelected.id, _selectedItemCount, _storeId, _cfgSelected);
+                ShopViewManager.Instance.BuyItem(_cfgSelected.id, _selectedItemCount, ConstBuyType.TYPE_SHOP, _cfgSelected);
             }
 
             Timers.inst.AddUpdate(CheckGuide);
@@ -208,7 +208,7 @@ namespace GFGGame
             int count = _selectedItemId > 0 && _cfgSelected.itemId == _selectedItemId ? _selectedItemCount : INIT_COUNT;
             // BuyItemConteoller.Show(_cfgSelected.itemID, _cfgSelected.costID, INIT_COUNT, _cfgSelected.costNum, count, null, true, false, MAX_COUNT);
             count = Math.Max(1, count);
-            ShopViewManager.Instance.BuyItem(_cfgSelected.id, count, _storeId, _cfgSelected);
+            ShopViewManager.Instance.BuyItem(_cfgSelected.id, count, ConstBuyType.TYPE_SHOP, _cfgSelected);
         }
         private void UpdateItemChange()
         {

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/CommonGame/BuyConfirmView.cs

@@ -96,7 +96,7 @@ namespace GFGGame
                     AlertUI.Show(costCfg.name + "不足,是否前往购买?").SetLeftButton(true).SetRightButton(true, "确认", (AlertWindow.AlertCallback)((object data) =>
                     {
                         long costNeedCount = coustNum - ItemDataManager.GetItemNum(costId);
-                        BuyItemConteoller.Show(costId, costNeedCount, ConstBuyType.TYPE_ITEM, 0, null, true, true, GameConst.MAX_COUNT_TO_BUY_DIAMOND_RED);
+                        BuyItemConteoller.Show(costId, costNeedCount, 0, null, true, true, GameConst.MAX_COUNT_TO_BUY_DIAMOND_RED);
                     }));
                     OnClickBtnCancel();
                 }

+ 3 - 7
GameClient/Assets/Game/HotUpdate/Views/CommonGame/BuyCountView.cs

@@ -97,7 +97,7 @@ namespace GFGGame
         /// <param name="showTips">是否弹购买成功飘字,默认是</param>
         /// <param name="openSource">是否打开来源界面。默认否</param>
         /// <param name="maxCount"></param>
-        public void SetParams(int buyId, long minBuyCount, int buyType, int shopType = 0, Action onSuccess = null, bool showTips = true, bool openSource = false, int maxCount = 9990)
+        public void SetParams(int buyId, long minBuyCount, int buyType, Action onSuccess = null, bool showTips = true, bool openSource = false, int maxCount = 9990)
         {
             _buyId = buyId;
             _itemId = buyId;
@@ -107,7 +107,7 @@ namespace GFGGame
             _openSource = openSource;
             _showTips = showTips;
             _buyType = buyType;
-            _shopType = shopType;
+
             if (buyType == ConstBuyType.TYPE_SHOP)
             {
                 ShopCfg shopCfg = ShopCfgArray.Instance.GetCfg(buyId);
@@ -241,13 +241,11 @@ namespace GFGGame
                     bool result = false;
                     switch (_buyType)
                     {
-                        case ConstBuyType.TYPE_NORMAL:
-                            break;
                         case ConstBuyType.TYPE_ITEM:
                             result = await ItemExchangeSProxy.ItemExchange(_buyId, _count);
                             break;
                         case ConstBuyType.TYPE_SHOP:
-                            result = await ShopSProxy.ShopBuy(_shopType, _buyId, _count);
+                            result = await ShopSProxy.ReqShopBuy(_buyId, _count);
                             break;
                     }
                     if (_onSuccess != null)
@@ -280,9 +278,7 @@ namespace GFGGame
             _buyNum = 0;
             if (_buyType == ConstBuyType.TYPE_SHOP)
             {
-
                 ShopDataManager.Instance.GetMoneyIdAndNum(_buyId, (int)count, _shopType, out _costId, out _costNum, out _buyNum);
-
             }
             else if (_buyType == ConstBuyType.TYPE_ITEM)
             {

+ 105 - 105
GameClient/Assets/Game/HotUpdate/Views/Store/GiftBagBuyView.cs

@@ -7,121 +7,121 @@ namespace GFGGame
 {
     public class GiftBagBuyView : BaseWindow
     {
-        private UI_GiftBagBuyUI _ui;
-        private int _goodsId;
-        public override void Dispose()
-        {
+        // private UI_GiftBagBuyUI _ui;
+        // private int _goodsId;
+        // public override void Dispose()
+        // {
 
-            if (_ui != null)
-            {
-                _ui.Dispose();
-            }
-            _ui = null;
-            base.Dispose();
-        }
-        protected override void OnHide()
-        {
-            base.OnHide();
+        //     if (_ui != null)
+        //     {
+        //         _ui.Dispose();
+        //     }
+        //     _ui = null;
+        //     base.Dispose();
+        // }
+        // protected override void OnHide()
+        // {
+        //     base.OnHide();
 
-        }
-        protected override void OnInit()
-        {
-            base.OnInit();
-            packageName = UI_GiftBagBuyUI.PACKAGE_NAME;
-            _ui = UI_GiftBagBuyUI.Create();
-            this.viewCom = _ui.target;
-            this.viewCom.Center();
-            this.modal = true;
-            viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
+        // }
+        // protected override void OnInit()
+        // {
+        //     base.OnInit();
+        //     packageName = UI_GiftBagBuyUI.PACKAGE_NAME;
+        //     _ui = UI_GiftBagBuyUI.Create();
+        //     this.viewCom = _ui.target;
+        //     this.viewCom.Center();
+        //     this.modal = true;
+        //     viewAnimationType = EnumViewAnimationType.ZOOM_CENTER;
 
-            _ui.m_btnBuy.onClick.Add(OnBtnBuyClick);
-            _ui.m_list.itemRenderer = ListItemRender;
-        }
+        //     _ui.m_btnBuy.onClick.Add(OnBtnBuyClick);
+        //     _ui.m_list.itemRenderer = ListItemRender;
+        // }
 
-        protected override void OnShown()
-        {
-            base.OnShown();
-            _goodsId = (int)this.viewData;
-            ShopCfg cfg = ShopCfgArray.Instance.GetCfg(_goodsId);
-            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.itemId);
-            _ui.m_txtName.text = itemCfg.name;
-            _ui.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);//string.Format("ui://RechargeStore/{0}", cfg.res);
-            _ui.m_list.numItems = itemCfg.itemsArr.Length;
-            _ui.m_c1.selectedIndex = ShopDataManager.Instance.GetShopGoodsStateById(_goodsId) ? 0 : 1;
-            _ui.m_txtLock.text = ShopDataManager.Instance.GetShopGoodsStateTips(cfg.id);
+        // protected override void OnShown()
+        // {
+        //     base.OnShown();
+        //     _goodsId = (int)this.viewData;
+        //     ShopCfg cfg = ShopCfgArray.Instance.GetCfg(_goodsId);
+        //     ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.itemId);
+        //     _ui.m_txtName.text = itemCfg.name;
+        //     _ui.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);//string.Format("ui://RechargeStore/{0}", cfg.res);
+        //     _ui.m_list.numItems = itemCfg.itemsArr.Length;
+        //     _ui.m_c1.selectedIndex = ShopDataManager.Instance.GetShopGoodsStateById(_goodsId) ? 0 : 1;
+        //     _ui.m_txtLock.text = ShopDataManager.Instance.GetShopGoodsStateTips(cfg.id);
 
-            int buyNum = ShopDataManager.Instance.GetGoodsBuyNumById(cfg.id);
-            _ui.m_txtLimit.text = string.Format("{0}({1}/{2})", ShopDataManager.Instance.refreshType[cfg.refreshType], StringUtil.GetColorText(buyNum.ToString(), "#DA8870"), cfg.maxBuyNum);
-            // if (cfg.refreshType == RefreshType.NONE) _ui.m_txtLimit.text = "永久限购";
-            _ui.m_txtEndTime.text = ShopDataManager.Instance.GetEndTime(cfg.id);
-            _ui.m_grpEndTime.visible = cfg.endTime != "";
+        //     int buyNum = ShopDataManager.Instance.GetGoodsBuyNumById(cfg.id);
+        //     _ui.m_txtLimit.text = string.Format("{0}({1}/{2})", ShopDataManager.Instance.refreshType[cfg.refreshType], StringUtil.GetColorText(buyNum.ToString(), "#DA8870"), cfg.maxBuyNum);
+        //     // if (cfg.refreshType == RefreshType.NONE) _ui.m_txtLimit.text = "永久限购";
+        //     _ui.m_txtEndTime.text = ShopDataManager.Instance.GetEndTime(cfg.id);
+        //     _ui.m_grpEndTime.visible = cfg.endTime != "";
 
-            _ui.m_txtOriginalPrice.text = NumberUtil.ChangeNumberUnit(cfg.originalPrice);// cfg.originalPrice.ToString();
-            if (cfg.price > 0 && cfg.costType != CostType.FREE)
-            {
-                _ui.m_grpOriginalPrice.visible = cfg.originalPrice > 0;
-                _ui.m_grpIcon.visible = true;
-                _ui.m_txtPrice.text = NumberUtil.ChangeNumberUnit(cfg.price);// cfg.price.ToString();
+        //     _ui.m_txtOriginalPrice.text = NumberUtil.ChangeNumberUnit(cfg.originalPrice);// cfg.originalPrice.ToString();
+        //     if (cfg.price > 0 && cfg.costType != CostType.FREE)
+        //     {
+        //         _ui.m_grpOriginalPrice.visible = cfg.originalPrice > 0;
+        //         _ui.m_grpIcon.visible = true;
+        //         _ui.m_txtPrice.text = NumberUtil.ChangeNumberUnit(cfg.price);// cfg.price.ToString();
 
-                if (cfg.costType == CostType.RMB)
-                {
-                    _ui.m_loaPriceIcon.visible = false;
-                    _ui.m_txtIcon.visible = true;
-                    _ui.m_txtIcon.text = "¥";
-                }
-                else
-                {
-                    ItemCfg itemCostCfg = ItemCfgArray.Instance.GetCfg(cfg.costId);
-                    _ui.m_loaPriceIcon.url = ResPathUtil.GetIconPath(itemCostCfg);
-                    _ui.m_loaPriceIcon.visible = true;
-                    _ui.m_txtIcon.visible = false;
-                }
-            }
-            else
-            {
-                _ui.m_grpIcon.visible = false;
-                _ui.m_grpOriginalPrice.visible = false;
-                _ui.m_txtPrice.text = "免费";
-            }
-        }
+        //         if (cfg.costType == CostType.RMB)
+        //         {
+        //             _ui.m_loaPriceIcon.visible = false;
+        //             _ui.m_txtIcon.visible = true;
+        //             _ui.m_txtIcon.text = "¥";
+        //         }
+        //         else
+        //         {
+        //             ItemCfg itemCostCfg = ItemCfgArray.Instance.GetCfg(cfg.costId);
+        //             _ui.m_loaPriceIcon.url = ResPathUtil.GetIconPath(itemCostCfg);
+        //             _ui.m_loaPriceIcon.visible = true;
+        //             _ui.m_txtIcon.visible = false;
+        //         }
+        //     }
+        //     else
+        //     {
+        //         _ui.m_grpIcon.visible = false;
+        //         _ui.m_grpOriginalPrice.visible = false;
+        //         _ui.m_txtPrice.text = "免费";
+        //     }
+        // }
 
 
 
-        private void ListItemRender(int index, GObject item)
-        {
-            ShopCfg cfg = ShopCfgArray.Instance.GetCfg(_goodsId);
-            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.itemId);
-            ItemData itemData = ItemUtil.createItemData(itemCfg.itemsArr[index]);
-            if (item.data == null)
-            {
-                item.data = new ItemView(item as GComponent);
-            }
-            (item.data as ItemView).SetData(itemData);
-        }
-        private async void OnBtnBuyClick()
-        {
-            ShopCfg cfg = ShopCfgArray.Instance.GetCfg(_goodsId);
-            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.itemId);
-            if (cfg.costType == CostType.ITEM)
-            {
-                long hasNum = ItemDataManager.GetItemNum(cfg.costId);
-                if (hasNum < cfg.price)
-                {
-                    PromptController.Instance.ShowFloatTextPrompt("道具不足");
-                    return;
-                }
-            }
-            bool result = await RechargeSProxy.ReqBuyGiftBag(_goodsId);
-            if (result)
-            {
-                LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
-                this.Hide();
-                if (cfg.costType == CostType.RMB)
-                {
+        // private void ListItemRender(int index, GObject item)
+        // {
+        //     ShopCfg cfg = ShopCfgArray.Instance.GetCfg(_goodsId);
+        //     ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.itemId);
+        //     ItemData itemData = ItemUtil.createItemData(itemCfg.itemsArr[index]);
+        //     if (item.data == null)
+        //     {
+        //         item.data = new ItemView(item as GComponent);
+        //     }
+        //     (item.data as ItemView).SetData(itemData);
+        // }
+        // private async void OnBtnBuyClick()
+        // {
+        //     ShopCfg cfg = ShopCfgArray.Instance.GetCfg(_goodsId);
+        //     ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.itemId);
+        //     if (cfg.costType == CostType.ITEM)
+        //     {
+        //         long hasNum = ItemDataManager.GetItemNum(cfg.costId);
+        //         if (hasNum < cfg.price)
+        //         {
+        //             PromptController.Instance.ShowFloatTextPrompt("道具不足");
+        //             return;
+        //         }
+        //     }
+        //     bool result = await RechargeSProxy.ReqBuyGiftBag(_goodsId);
+        //     if (result)
+        //     {
+        //         LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
+        //         this.Hide();
+        //         if (cfg.costType == CostType.RMB)
+        //         {
 
-                    PromptController.Instance.ShowFloatTextPrompt("虚拟充值购买成功");
-                }
-            }
-        }
+        //             PromptController.Instance.ShowFloatTextPrompt("虚拟充值购买成功");
+        //         }
+        //     }
+        // }
     }
 }

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Views/Store/ItemExchangeView.cs

@@ -159,7 +159,7 @@ namespace GFGGame
                 return;
             }
 
-            bool result = await RechargeSProxy.ReqExchangeShopItem(_goodIds, _buyCount);
+            bool result = await ShopSProxy.ReqShopBuy(_goodIds, _buyCount);
             if (result)
             {
                 LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);

+ 7 - 6
GameClient/Assets/Game/HotUpdate/Views/Store/StoreChargeView.cs

@@ -63,18 +63,18 @@ namespace GFGGame
 
         private void ListItemRenderer(int index, GObject obj)
         {
-            ShopCfg itemData = _shopCfgs[index];
+            ShopCfg shopCfg = _shopCfgs[index];
             UI_ListChargeItem item = UI_ListChargeItem.Proxy(obj);
             item.m_btnBuy.m_c1.selectedIndex = 1;
-            item.m_btnBuy.m_txtTitle.text = itemData.price.ToString();
+            item.m_btnBuy.m_txtTitle.text = shopCfg.price.ToString();
             if (item.target.data == null)
             {
                 item.target.onClick.Add(OnClickBtnBuy);
             }
             item.target.data = index;
-            item.m_txtName.text = string.Format("{0}{1}", itemData.itemNum, itemData.itemName);
-            item.m_txtDesc.text = string.Format("首充赠送+{0}{1}", itemData.itemNum, itemData.itemName);
-            bool isDouble = ShopDataManager.Instance.GetRechargeBuyNumById(itemData.id) < itemData.doubleTimes;
+            item.m_txtName.text = string.Format("{0}{1}", shopCfg.itemNum, shopCfg.itemName);
+            item.m_txtDesc.text = string.Format("首充赠送+{0}{1}", shopCfg.itemNum, shopCfg.itemName);
+            bool isDouble = ShopDataManager.Instance.GetGoodsBuyNumById(shopCfg.id) < shopCfg.doubleTimes;
             item.m_imgDouble.visible = isDouble;
             item.m_txtDesc.visible = isDouble;
             item.m_icon.url = "ui://Store/sc_zizhuan_" + (index + 1);
@@ -89,7 +89,8 @@ namespace GFGGame
             ShopCfg itemData = _shopCfgs[index];
             if (!AntiAddictionController.CheckAntiAddictionRecharge(itemData.price))
             {
-                RechargeSProxy.ReqRecharge(itemData.id).Coroutine();
+                // RechargeSProxy.ReqRecharge(itemData.id).Coroutine();
+                ShopSProxy.ReqShopBuy(itemData.id, 1).Coroutine();
                 LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
             }
         }