zhaoyang 3 жил өмнө
parent
commit
34538b9018

+ 4 - 1
FGUIProject/assets/RechargeStore/RechargeStoreUI.xml

@@ -11,6 +11,9 @@
       <relation target="" sidePair="height-height,top-top"/>
     </image>
     <component id="n17_10not" name="comTab" src="10not1s" fileName="components/Component1.xml" xy="95,401"/>
+    <text id="n25_t8xr" name="txtRefreshTime" xy="796,480" size="204,44" fontSize="32" color="#b38282" autoClearText="true" text="23小时后刷新">
+      <gearDisplay controller="c1" pages="2"/>
+    </text>
     <list id="n10_d4iw" name="list" xy="0,472" size="1080,1232" layout="flow_hz" overflow="scroll" scrollBarFlags="64" colGap="22" defaultItem="ui://vlgobc15d4iwr" align="center" scrollItemToViewOnClick="false">
       <gearDisplay controller="c1" pages="0"/>
       <relation target="" sidePair="bottomext-bottom"/>
@@ -36,7 +39,7 @@
       <item/>
       <item/>
     </list>
-    <list id="n24_10not" name="listExchange" xy="0,472" size="1080,1232" layout="flow_hz" overflow="scroll" scrollBarFlags="64" colGap="22" defaultItem="ui://vlgobc15d4iwr" align="center" scrollItemToViewOnClick="false">
+    <list id="n24_10not" name="listExchange" xy="0,526" pivot="1,0" size="1080,1178" layout="flow_hz" overflow="scroll" scrollBarFlags="64" colGap="22" defaultItem="ui://vlgobc15d4iwr" align="center" scrollItemToViewOnClick="false">
       <gearDisplay controller="c1" pages="2"/>
       <relation target="" sidePair="bottomext-bottom"/>
       <item/>

+ 0 - 3
GameClient/Assets/Game/HotUpdate/Data/RechargeDataManager.cs

@@ -141,9 +141,6 @@ namespace GFGGame
                 if (lockA > lockB) return -1;
                 if (lockA < lockB) return 1;
 
-                // if (buyTypeA > 0 && buyTypeB < 0) return -1;
-                // if (buyTypeB > 0 && buyTypeA < 0) return 1;
-
                 //免费>钻石>现金>道具
                 if (a.costType < b.costType) return -1;
                 if (a.costType > b.costType) return 1;

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/RechargeStore/UI_RechargeStoreUI.cs

@@ -11,6 +11,7 @@ namespace UI.RechargeStore
         public GButton m_btnBack;
         public GComponent m_valueBar;
         public UI_Component1 m_comTab;
+        public GTextField m_txtRefreshTime;
         public GList m_list;
         public GList m_listGift;
         public GList m_listExchange;
@@ -65,6 +66,7 @@ namespace UI.RechargeStore
             m_btnBack = (GButton)comp.GetChild("btnBack");
             m_valueBar = (GComponent)comp.GetChild("valueBar");
             m_comTab = (UI_Component1)UI_Component1.Create(comp.GetChild("comTab"));
+            m_txtRefreshTime = (GTextField)comp.GetChild("txtRefreshTime");
             m_list = (GList)comp.GetChild("list");
             m_listGift = (GList)comp.GetChild("listGift");
             m_listExchange = (GList)comp.GetChild("listExchange");
@@ -76,6 +78,7 @@ namespace UI.RechargeStore
             m_valueBar = null;
             m_comTab.Dispose();
             m_comTab = null;
+            m_txtRefreshTime = null;
             m_list = null;
             m_listGift = null;
             m_listExchange = null;

+ 4 - 3
GameClient/Assets/Game/HotUpdate/ServerProxy/RechargeSProxy.cs

@@ -83,14 +83,15 @@ namespace GFGGame
         public static async ETTask<bool> ReqExchangeShopItem(int exchangeId, int buyNum)
         {
             M2C_ExchangeShopItem response = null;
-            response = (M2C_ExchangeShopItem)await MessageHelper.SendToServer(new C2M_ExchangeShopItem() { ExchangeId = exchangeId });
+            response = (M2C_ExchangeShopItem)await MessageHelper.SendToServer(new C2M_ExchangeShopItem() { ExchangeId = exchangeId, ExchangeTimes = buyNum });
             if (response != null)
             {
                 if (response.Error == ErrorCode.ERR_Success)
                 {
-                    RechargeDataManager.Instance.UpdateExchangeData(response.ExchangeId, response.ExchangeTimes);
+                    RechargeDataManager.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.ExchangedTimes));
                     return true;
                 }
             }

+ 7 - 11
GameClient/Assets/Game/HotUpdate/Views/RechargeStore/GiftBagBuyView.cs

@@ -116,19 +116,15 @@ namespace GFGGame
                 }
             }
             bool result = await RechargeSProxy.ReqBuyGiftBag(_giftId);
-            if (result && cfg.costType == CostType.RMB)
+            if (result)
             {
-                PromptController.Instance.ShowFloatTextPrompt("虚拟充值购买成功");
-            }
-            // if (cfg.costType == CostType.RMB)
-            // {
+                this.Hide();
+                if (cfg.costType == CostType.RMB)
+                {
 
-            // }
-            // else
-            // {
-            // RechargeSProxy.ReqBuyGiftBag(_giftId).Coroutine();
-            this.Hide();
-            // }
+                    PromptController.Instance.ShowFloatTextPrompt("虚拟充值购买成功");
+                }
+            }
         }
     }
 }

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

@@ -129,7 +129,7 @@ namespace GFGGame
             bool result = await RechargeSProxy.ReqExchangeShopItem(_exchangeId, _buyCount);
             if (result)
             {
-
+                this.Hide();
             }
         }
     }

+ 17 - 2
GameClient/Assets/Game/HotUpdate/Views/RechargeStore/RechargeStoreView.cs

@@ -2,6 +2,7 @@ using UI.RechargeStore;
 using UI.CommonGame;
 using FairyGUI;
 using System.Collections.Generic;
+using ET;
 
 namespace GFGGame
 {
@@ -62,12 +63,15 @@ namespace GFGGame
             _ui.m_listExchange.numItems = ShopExchangeCfgArray.Instance.dataArray.Length;
             UpdateGiftBagList();
             OnTabChange();
+            Timers.inst.Add(1, 0, UpdateExchangeTime);
         }
 
         protected override void OnHide()
         {
             base.OnHide();
             _valueBarController.OnHide();
+            Timers.inst.Remove(UpdateExchangeTime);
+
         }
 
         private void OnClickBtnBack()
@@ -90,6 +94,18 @@ namespace GFGGame
             _giftCfgs = RechargeDataManager.Instance.GetGiftBagCfgs();
             _ui.m_listGift.numItems = _giftCfgs.Count;
         }
+        private void UpdateExchangeTime(object param)
+        {
+            int endTime = TimeUtil.GetTomorrowTime(GlobalCfgArray.globalCfg.refreshTime);
+            string time = TimeUtil.FormattingTime(TimeHelper.ServerNowSecs, endTime);
+            _ui.m_txtRefreshTime.text = time + "后刷新";
+            for (int i = 0; i < _ui.m_listGift.numItems; i++)
+            {
+                UI_ListGiftItem item = UI_ListGiftItem.Proxy(_ui.m_listGift.GetChildAt(1));
+                GiftBagCfg cfg = _giftCfgs[i];
+                item.m_txtEndTime.text = RechargeDataManager.Instance.GetEndTime(cfg.id);
+            }
+        }
         private void ListItemRenderer(int index, GObject obj)
         {
             RechargeCfg itemData = RechargeCfgArray.Instance.dataArray[index];
@@ -118,6 +134,7 @@ namespace GFGGame
         {
             UI_ListGiftItem item = UI_ListGiftItem.Proxy(obj);
             GiftBagCfg cfg = _giftCfgs[index];
+
             item.m_txtName.text = cfg.name;
             item.m_icon.url = string.Format("ui://RechargeStore/{0}", cfg.res);
 
@@ -141,8 +158,6 @@ namespace GFGGame
             int buyNum = RechargeDataManager.Instance.GetGiftBuyNumById(cfg.id);
             item.m_txtLimit.text = string.Format("{0}({1}/{2})", RechargeDataManager.Instance.refreshType[cfg.refreshType], StringUtil.GetColorText(buyNum.ToString(), "#DA8870"), cfg.maxBuyNum);
             item.m_txtLimit.visible = cfg.maxBuyNum > 0;
-            // if (cfg.refreshType == RefreshType.NONE) item.m_txtLimit.text = "永久限购";
-            // UI_Button14 btn = UI_Button14.Proxy(item.m_btnBuy);
             item.m_c1.selectedIndex = cfg.maxBuyNum == 0 || buyNum < cfg.maxBuyNum ? 0 : 1;
             if (item.m_c1.selectedIndex == 0)
             {

BIN
GameClient/Assets/ResIn/UI/RechargeStore/RechargeStore_fui.bytes