Browse Source

常驻礼包

何晓捷 2 years ago
parent
commit
42819be394
20 changed files with 299 additions and 42 deletions
  1. 7 3
      FGUIProject/assets/EnduringGiftBox/EnduringGiftBoxUI.xml
  2. 2 1
      FGUIProject/assets/EnduringGiftBox/components/BtnBuy.xml
  3. 1 1
      FGUIProject/assets/EnduringGiftBox/components/ComCurSupplyItem.xml
  4. 1 1
      FGUIProject/assets/EnduringGiftBox/components/ComGouMaiGetText.xml
  5. 0 3
      FGUIProject/assets/EnduringGiftBox/components/ComRewardIconItem.xml
  6. BIN
      FGUIProject/assets/EnduringGiftBox/images/tili.png
  7. 1 0
      FGUIProject/assets/EnduringGiftBox/package.xml
  8. 32 0
      GameClient/Assets/Game/HotUpdate/Controller/EnduringGiftBoxController.cs
  9. 3 0
      GameClient/Assets/Game/HotUpdate/Controller/EnduringGiftBoxController.cs.meta
  10. 1 1
      GameClient/Assets/Game/HotUpdate/Data/EnduringGiftBoxDataManager.cs
  11. 6 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_BtnBuy.cs
  12. 3 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComCurSupplyItem.cs
  13. 0 3
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComRewardIconItem.cs
  14. 3 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_EnduringGiftBoxUI.cs
  15. 2 2
      GameClient/Assets/Game/HotUpdate/Utils/ItemUtil.cs
  16. 233 23
      GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/EnduringGiftBoxView.cs
  17. 4 4
      GameClient/Assets/Game/Launcher/LauncherConfig.cs
  18. BIN
      GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_atlas0!a.png
  19. BIN
      GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_atlas0.png
  20. BIN
      GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_fui.bytes

+ 7 - 3
FGUIProject/assets/EnduringGiftBox/EnduringGiftBoxUI.xml

@@ -19,7 +19,7 @@
     <component id="n14_qqhz" name="btnSure" src="qqhzu" fileName="components/BtnSub.xml" xy="648,326" group="n17_qqhz"/>
     <group id="n17_qqhz" name="n17" xy="224,163" size="799,238" group="n26_qqhz"/>
     <text id="n15_qqhz" name="txtPromptExt" xy="151,433" size="753,48" group="n26_qqhz" fontSize="28" color="#a67975" autoSize="none" text="除了上述购买体力的途径,我们还提供了更多的优惠礼包选择"/>
-    <list id="n35_qqhz" name="list" xy="71,481" size="925,459" group="n26_qqhz" overflow="scroll" defaultItem="ui://bdi1qe15qqhz11">
+    <list id="n35_qqhz" name="list" xy="71,481" size="925,459" group="n26_qqhz" overflow="scroll" scrollBarFlags="32" defaultItem="ui://bdi1qe15qqhz11">
       <item/>
       <item/>
     </list>
@@ -44,6 +44,7 @@
     <item time="0" type="Rotation" target="n0_qqhz" tween="true" startValue="-2" endValue="0" duration="15"/>
     <item time="0" type="XY" target="n1_qqhz" tween="true" startValue="6,96" endValue="37,61" duration="12"/>
     <item time="0" type="XY" target="n2_qqhz" tween="true" startValue="-25,400" endValue="30,365" duration="15"/>
+    <item time="5" type="Alpha" target="n29_qqhz" value="0"/>
     <item time="9" type="Alpha" target="n33_qqhz" tween="true" startValue="0.7" endValue="1" duration="5"/>
     <item time="12" type="Alpha" target="n1_qqhz" tween="true" startValue="0.2" endValue="1" duration="11"/>
     <item time="12" type="Alpha" target="n29_qqhz" tween="true" startValue="0.4" endValue="1" duration="13"/>
@@ -60,11 +61,14 @@
     <item time="19" type="Alpha" target="n3_qqhz" tween="true" startValue="0.7" endValue="1" duration="6"/>
     <item time="21" type="Alpha" target="n28_qqhz" value="1"/>
     <item time="25" type="Alpha" target="n30_qqhz" tween="true" startValue="0.5" endValue="1" duration="18"/>
-    <item time="25" type="Alpha" target="n31_qqhz" tween="true" startValue="0" endValue="1" duration="18"/>
     <item time="25" type="Visible" target="n33_qqhz" value="false"/>
     <item time="43" type="Alpha" target="n30_qqhz" tween="true" startValue="1" endValue="0" duration="24"/>
-    <item time="43" type="Alpha" target="n31_qqhz" tween="true" startValue="1" endValue="0" duration="24"/>
     <item time="68" type="Visible" target="n30_qqhz" value="false"/>
+  </transition>
+  <transition name="t2" autoPlay="true" autoPlayRepeat="-1">
+    <item time="5" type="Alpha" target="n31_qqhz" value="1"/>
+    <item time="25" type="Alpha" target="n31_qqhz" tween="true" startValue="0" endValue="1" duration="18"/>
+    <item time="43" type="Alpha" target="n31_qqhz" tween="true" startValue="1" endValue="0" duration="24"/>
     <item time="68" type="Visible" target="n31_qqhz" value="false"/>
   </transition>
 </component>

+ 2 - 1
FGUIProject/assets/EnduringGiftBox/components/BtnBuy.xml

@@ -2,7 +2,8 @@
 <component size="260,74" extention="Button">
   <controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
   <displayList>
-    <image id="n0_qqhz" name="n0" src="qqhzk" fileName="images/cz_an_yellow.png" xy="0,0">
+    <image id="n3_qqhz" name="bagGrey" src="qqhzm" fileName="images/cz_an_grey.png" xy="0,0"/>
+    <image id="n0_qqhz" name="bagYellow" src="qqhzk" fileName="images/cz_an_yellow.png" xy="0,0">
       <relation target="" sidePair="width-width,height-height"/>
     </image>
     <text id="n1_qqhz" name="txtNewPrice" xy="116,0" size="123,69" font="SourceHanSerifCN-SemiBold" fontSize="32" color="#fffdf4" vAlign="middle" autoSize="shrink" text="12元"/>

+ 1 - 1
FGUIProject/assets/EnduringGiftBox/components/ComCurSupplyItem.xml

@@ -11,7 +11,7 @@
     <text id="n15_qqhz" name="txtTitle" xy="290,15" size="275,47" font="SourceHanSerifCN-SemiBold" fontSize="28" color="#cc9974" align="center" autoSize="none" text="体力超值返利包"/>
     <text id="n22_qqhz" name="txtWeekPrompt" xy="294,46" size="266,39" font="FZKTJW--GB1-0" fontSize="26" color="#bda5a8" align="center" autoSize="none" text="连续七天每日获得"/>
     <image id="n23_qqhz" name="icoWeekPromptTag" src="qqhz1p" fileName="images/lm_tb_tishi.png" xy="530,48"/>
-    <list id="n18_qqhz" name="n18" xy="231,83" size="402,132" layout="flow_vt" overflow="scroll" scroll="horizontal" colGap="35" defaultItem="ui://bdi1qe15qqhz1g" align="center">
+    <list id="n18_qqhz" name="list" xy="231,83" size="402,132" layout="flow_vt" overflow="scroll" scroll="horizontal" scrollBarFlags="32" colGap="35" defaultItem="ui://bdi1qe15qqhz1g" align="center">
       <item/>
     </list>
   </displayList>

+ 1 - 1
FGUIProject/assets/EnduringGiftBox/components/ComGouMaiGetText.xml

@@ -3,7 +3,7 @@
   <displayList>
     <image id="n0_qqhz" name="n0" src="qqhzi" fileName="images/cz_gmjd_db.png" xy="0,1" group="n4_qqhz"/>
     <text id="n1_qqhz" name="n1" xy="15,-6" size="170,39" group="n4_qqhz" fontSize="28" color="#ffffff" align="center" autoSize="none" text="购买即得"/>
-    <loader id="n5_qqhz" name="loaIcon" xy="56,27" size="33,31" group="n4_qqhz"/>
+    <loader id="n5_qqhz" name="loaIcon" xy="62,31" size="23,24" group="n4_qqhz" fill="scaleFree" shrinkOnly="true"/>
     <text id="n3_qqhz" name="txtGetGold" xy="93,22" size="76,39" group="n4_qqhz" fontSize="28" color="#ffffff" autoSize="none" text="200"/>
     <group id="n4_qqhz" name="n4" xy="0,-6" size="194,67"/>
   </displayList>

+ 0 - 3
FGUIProject/assets/EnduringGiftBox/components/ComRewardIconItem.xml

@@ -8,8 +8,5 @@
     <image id="n6_qqhz" name="bagYellowEx" src="qqhz1f" fileName="images/wpk_sz_db.png" xy="7,95" size="118,31"/>
     <image id="n1_nd17" name="bagBlueEx" src="qqhz1b" fileName="images/wpk_sz_db2.png" xy="7,95" size="118,31"/>
     <text id="n2_nd17" name="num" xy="9,85" size="116,44" font="ui://eg2y0ldpa0cftks" fontSize="32" color="#ffffff" align="center" autoSize="none" text="120"/>
-    <image id="n4_itts" name="showRreceives" src="qqhz1c" fileName="images/txz_tb_ylq.png" xy="71,-1">
-      <gearDisplay controller="c1" pages="1"/>
-    </image>
   </displayList>
 </component>

BIN
FGUIProject/assets/EnduringGiftBox/images/tili.png


+ 1 - 0
FGUIProject/assets/EnduringGiftBox/package.xml

@@ -46,6 +46,7 @@
     <component id="qqhz1q" name="ComLeftGiftBox.xml" path="/components/" exported="true"/>
     <component id="qqhz1r" name="ComGouMaiGetText.xml" path="/components/" exported="true"/>
     <component id="qqhz1v" name="EnduringGiftBoxUIbackups.xml" path="/"/>
+    <image id="qqhz25" name="tili.png" path="/images/"/>
   </resources>
   <publish name="" path="../GameClient/Assets/ResIn/UI/EnduringGiftBox" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 32 - 0
GameClient/Assets/Game/HotUpdate/Controller/EnduringGiftBoxController.cs

@@ -0,0 +1,32 @@
+using System;
+
+namespace GFGGame
+{
+
+    public class EnduringGiftBoxController : SingletonBase<EnduringGiftBoxController>
+    {
+        private static EnduringGiftBoxView _enduringGiftBoxView;
+
+        public static void Show(int itemId, int count, Action onSuccess = null, string message = "")
+        {
+            if (_enduringGiftBoxView == null)
+            {
+                _enduringGiftBoxView = new EnduringGiftBoxView();
+            }
+            _enduringGiftBoxView.SetParams(itemId, count, onSuccess, message);
+            _enduringGiftBoxView.Show();
+        }
+        
+        public static void hide()
+        {
+            if (_enduringGiftBoxView != null)
+            {
+                _enduringGiftBoxView.Hide();
+            }
+        }
+        public static void Dispose()
+        {
+            _enduringGiftBoxView = null;
+        }
+    }
+}

+ 3 - 0
GameClient/Assets/Game/HotUpdate/Controller/EnduringGiftBoxController.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 78e0e445c1624fd1b0bdde5f666ff33b
+timeCreated: 1685352694

+ 1 - 1
GameClient/Assets/Game/HotUpdate/Data/EnduringGiftBoxDataManager.cs

@@ -8,7 +8,7 @@ namespace GFGGame
 {
     public class EnduringGiftBoxDataManager
     {
-        //礼包配置id,状态:根据常量 EnduringGiftBoxBuyStatus
+        //礼包id,状态:根据常量 EnduringGiftBoxBuyStatus --每天的领取状态
         public static Dictionary<int, int> GiftBoxStateDic = new Dictionary<int, int>();
         
         public static void InitData()

+ 6 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_BtnBuy.cs

@@ -7,6 +7,8 @@ namespace UI.EnduringGiftBox
     public partial class UI_BtnBuy
     {
         public GButton target;
+        public GImage m_bagGrey;
+        public GImage m_bagYellow;
         public GTextField m_txtNewPrice;
         public GTextField m_txtOldPrice;
         public const string URL = "ui://bdi1qe15qqhzy";
@@ -56,11 +58,15 @@ namespace UI.EnduringGiftBox
 
         private void Init(GComponent comp)
         {
+            m_bagGrey = (GImage)comp.GetChild("bagGrey");
+            m_bagYellow = (GImage)comp.GetChild("bagYellow");
             m_txtNewPrice = (GTextField)comp.GetChild("txtNewPrice");
             m_txtOldPrice = (GTextField)comp.GetChild("txtOldPrice");
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_bagGrey = null;
+            m_bagYellow = null;
             m_txtNewPrice = null;
             m_txtOldPrice = null;
             if(disposeTarget && target != null)

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComCurSupplyItem.cs

@@ -15,6 +15,7 @@ namespace UI.EnduringGiftBox
         public GTextField m_txtTitle;
         public GTextField m_txtWeekPrompt;
         public GImage m_icoWeekPromptTag;
+        public GList m_list;
         public const string URL = "ui://bdi1qe15qqhz11";
         public const string PACKAGE_NAME = "EnduringGiftBox";
         public const string RES_NAME = "ComCurSupplyItem";
@@ -70,6 +71,7 @@ namespace UI.EnduringGiftBox
             m_txtTitle = (GTextField)comp.GetChild("txtTitle");
             m_txtWeekPrompt = (GTextField)comp.GetChild("txtWeekPrompt");
             m_icoWeekPromptTag = (GImage)comp.GetChild("icoWeekPromptTag");
+            m_list = (GList)comp.GetChild("list");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -84,6 +86,7 @@ namespace UI.EnduringGiftBox
             m_txtTitle = null;
             m_txtWeekPrompt = null;
             m_icoWeekPromptTag = null;
+            m_list = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 0 - 3
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComRewardIconItem.cs

@@ -14,7 +14,6 @@ namespace UI.EnduringGiftBox
         public GImage m_bagYellowEx;
         public GImage m_bagBlueEx;
         public GTextField m_num;
-        public GImage m_showRreceives;
         public const string URL = "ui://bdi1qe15qqhz1g";
         public const string PACKAGE_NAME = "EnduringGiftBox";
         public const string RES_NAME = "ComRewardIconItem";
@@ -69,7 +68,6 @@ namespace UI.EnduringGiftBox
             m_bagYellowEx = (GImage)comp.GetChild("bagYellowEx");
             m_bagBlueEx = (GImage)comp.GetChild("bagBlueEx");
             m_num = (GTextField)comp.GetChild("num");
-            m_showRreceives = (GImage)comp.GetChild("showRreceives");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -80,7 +78,6 @@ namespace UI.EnduringGiftBox
             m_bagYellowEx = null;
             m_bagBlueEx = null;
             m_num = null;
-            m_showRreceives = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 3 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_EnduringGiftBoxUI.cs

@@ -19,6 +19,7 @@ namespace UI.EnduringGiftBox
         public GList m_list;
         public GImage m_btnBack;
         public Transition m_t1;
+        public Transition m_t2;
         public const string URL = "ui://bdi1qe15qqhz1";
         public const string PACKAGE_NAME = "EnduringGiftBox";
         public const string RES_NAME = "EnduringGiftBoxUI";
@@ -78,6 +79,7 @@ namespace UI.EnduringGiftBox
             m_list = (GList)comp.GetChild("list");
             m_btnBack = (GImage)comp.GetChild("btnBack");
             m_t1 = comp.GetTransition("t1");
+            m_t2 = comp.GetTransition("t2");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -93,6 +95,7 @@ namespace UI.EnduringGiftBox
             m_list = null;
             m_btnBack = null;
             m_t1 = null;
+            m_t2 = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

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

@@ -38,7 +38,7 @@ namespace GFGGame
             int maxLimit = ItemExchangeCfgArray.Instance.GetCfg(ConstItemID.POWER).maxLimit;
             int lastBuyCount = maxLimit - ItemDataManager.GetItemExchangeTimes(ConstItemID.POWER);
             string showTxt = string.Format("每5分钟回复1点体力\n今日剩余购买{0}/{1}次", lastBuyCount, maxLimit);
-            BuyConfirmController.Show(ConstItemID.POWER, 1, () =>
+            EnduringGiftBoxController.Show(ConstItemID.POWER, 1, () =>
             {
                 if (onSuccess != null)
                 {
@@ -50,7 +50,7 @@ namespace GFGGame
         public static void AddGold(long value = 0, Action onSuccess = null)
         {
 
-            BuyConfirmController.Show(ConstItemID.GOLD, 1, () =>
+            EnduringGiftBoxController.Show(ConstItemID.GOLD, 1, () =>
             {
                 if (onSuccess != null)
                 {

+ 233 - 23
GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/EnduringGiftBoxView.cs

@@ -1,6 +1,7 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using ET;
 using FairyGUI;
 using UI.EnduringGiftBox;
 using UnityEngine;
@@ -19,30 +20,89 @@ namespace GFGGame
         private int _maxTimes = 0;
         private string _message = "";
         private List<ShopCfg> _shopCfgList = new List<ShopCfg>();
+        private GameObject _gameObject1;
+        private GameObject _gameObject2;
+        private GameObject _gameObject3;
+        private GameObject _gameObject4;
+
+        private GoWrapper _wrapper1;
+        private GoWrapper _wrapper2;
+        private GoWrapper _wrapper3;
+        private GoWrapper _wrapper4;
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_EnduringGiftBoxUI.PACKAGE_NAME;
+            _ui = UI_EnduringGiftBoxUI.Create();
+            this.viewCom = _ui.target;
+            this.viewCom.Center();
+            this.modal = true;
+            viewAnimationType = EnumViewAnimationType.ZOOM_CENTER; //先这样写,后面再改
+
+            //测试数据
+            EnduringGiftBoxDataManager.GiftBoxStateDic[110001] = 1;
+            EnduringGiftBoxDataManager.GiftBoxStateDic[110002] = 1;
+            EnduringGiftBoxDataManager.GiftBoxStateDic[110003] = 1;
+            EnduringGiftBoxDataManager.GiftBoxStateDic[110004] = 1;
+
+            _ui.m_btnSure.onClick.Add(OnClickBtnSure);
+            _ui.m_btnCancel.onClick.Add(OnClickBtnCancel);
+        }
 
         public override void Dispose()
         {
+            SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
+            SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
+            SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
+            SceneController.DestroyObjectFromView(_gameObject4, _wrapper4);
             if (_ui != null)
             {
                 _ui.Dispose();
                 _ui = null;
             }
 
-            BuyConfirmController.Dispose();
+            EnduringGiftBoxController.Dispose();
             base.Dispose();
         }
 
-        protected override void OnInit()
+        protected override void OnShown()
         {
-            base.OnInit();
-            _ui = UI_EnduringGiftBoxUI.Create();
-            this.viewCom = _ui.target;
-            this.viewCom.Center();
-            this.modal = true;
-            //viewAnimationType = EnumViewAnimationType.ZOOM_CENTER; //先这样写,后面再改
+            base.OnShown();
+            AddEffect();
+            UpdateView();
+        }
 
-            _ui.m_btnSure.onClick.Add(OnClickBtnSure);
-            _ui.m_btnCancel.onClick.Add(OnClickBtnCancel);
+        private void AddEffect()
+        {
+            string resPath3;
+            if (_itemId == ConstItemID.POWER)
+            {
+                resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "Activity_people02");
+            }
+            else
+            {
+                resPath3 = ResPathUtil.GetViewEffectPath("ui_Activity", "Activity_people01");
+            }
+
+            //小人
+            SceneController.AddObjectToView(null, null, _ui.m_holderBaby, resPath3,
+                out _gameObject3, out _wrapper3);
+
+            //爆发,大泡泡
+            string resPath1 = ResPathUtil.GetViewEffectPath("ui_Activity", "Activity_baofa");
+            SceneController.AddObjectToView(null, null, _ui.m_holderPaoMax, resPath1,
+                out _gameObject1, out _wrapper1);
+
+            //持续的小泡泡
+            string resPath2 = ResPathUtil.GetViewEffectPath("ui_Activity", "Activity_chixu");
+            SceneController.AddObjectToView(null, null, _ui.m_holderPaoMin, resPath2,
+                out _gameObject2, out _wrapper2);
+
+            //爆发时候的发光
+            string resPath4 = ResPathUtil.GetViewEffectPath("ui_Activity", "Activity_glow");
+            SceneController.AddObjectToView(null, null, _ui.m_holderFg, resPath4,
+                out _gameObject4, out _wrapper4);
         }
 
         public void SetParams(int itemId, int count, Action onSuccess, string message = "")
@@ -54,15 +114,8 @@ namespace GFGGame
             _message = message;
         }
 
-        protected override void OnShown()
-        {
-            base.OnShown();
-            UpdateView();
-        }
-
         private void UpdateView()
         {
-            //--------老逻辑
             _buyTimes = ItemDataManager.GetItemExchangeTimes(_itemId);
 
             ItemExchangeCfgArray.Instance.GetMoneyIdAndNum(_itemId, _buyTimes, _count, out int costId, out int coustNum,
@@ -83,10 +136,11 @@ namespace GFGGame
                 _ui.m_txtNum.text = _message;
             }
 
-            //----新加逻辑
+            _shopCfgList.Clear();
+            //常驻礼包
             if (_itemId == ConstItemID.POWER)
             {
-                //体力礼包--ShopDataManager.Instance.GetGoodsBuyNumById(curPowerGiftBox.id);得次数
+                //体力礼包
                 _shopCfgList = ShopCfgArray.Instance
                     .GetCfgsBymenu1Andmenu2(ConstStoreTabId.ENDURING_GIFT_BOX, ConstStoreSubId.ENDURING_GIFT_BOX_POWER)
                     .OrderBy(a => a.refreshType).ToList();
@@ -101,9 +155,10 @@ namespace GFGGame
 
             _ui.m_txtPromptExt.text = string.Format("除了上述购买{0}的途径,我们还提供了更多的优惠礼包选择", itemCfg.name);
             _ui.m_list.itemRenderer = ListItemRender;
+            _ui.m_list.numItems = _shopCfgList.Count;
+            _ui.m_list.visible = true;
         }
 
-
         private void ListItemRender(int index, GObject obj)
         {
             ShopCfg shopCfg = _shopCfgList[index];
@@ -115,15 +170,20 @@ namespace GFGGame
             item.m_txtTitle.text = itemCfg.name;
             item.m_txtWeekPrompt.visible = false;
             item.m_icoWeekPromptTag.visible = false;
-            if (itemCfg.param2Arr[0] != 0)
+            if (itemCfg.param2Arr.Length != 0)
             {
                 item.m_txtWeekPrompt.visible = true;
                 item.m_icoWeekPromptTag.visible = true;
                 item.m_txtWeekPrompt.text = string.Format("连续{0}天每日获得", itemCfg.param2Arr[0]);
             }
 
+            int numItems;
+            var childItemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
             var remainBuyNum = shopCfg.maxBuyNum - ShopDataManager.Instance.GetGoodsBuyNumById(shopCfg.id);
             item.m_comLeftGiftBox.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
+            item.m_btnBuy.m_txtOldPrice.text = $"{shopCfg.originalPrice}";
+            item.m_btnBuy.m_txtNewPrice.text = $"{shopCfg.price}元";
+            
             if (shopCfg.refreshType == RefreshType.DAY) //也可以换成人民币来做条件
             {
                 //日刷
@@ -132,10 +192,31 @@ namespace GFGGame
                 item.m_comLeftGiftBox.m_comGouMaiGetText.target.visible = false;
                 item.m_txtUrc.text = string.Format("今日剩余{0}/{1}", remainBuyNum, shopCfg.maxBuyNum);
                 item.m_txtLrc.text = string.Format("可获得{0}会员积分", shopCfg.price * 10);
+                item.m_txtWeekPrompt.visible = false;
+                item.m_icoWeekPromptTag.visible = false;
+                numItems = childItemCfg.itemsArr.Length;
+                
+                if (remainBuyNum == 0)
+                {
+                    //已售完
+                    item.m_btnBuy.target.visible = true;
+                    item.m_btnCurReceive.target.visible = false;
+                    item.m_btnBuy.m_bagYellow.visible = false;
+                    item.m_btnBuy.m_bagGrey.visible = true;
+                }
+                else
+                {
+                    //未售完
+                    item.m_btnBuy.target.visible = true;
+                    item.m_btnCurReceive.target.visible = false;
+                    item.m_btnBuy.m_bagYellow.visible = true;
+                    item.m_btnBuy.m_bagGrey.visible = false;
+                }
             }
             else
             {
                 //周刷
+                var weekGiftBoxState = EnduringGiftBoxDataManager.GiftBoxStateDic[shopCfg.id];
                 item.m_comLeftGiftBox.m_comDiscount.target.visible = false;
                 item.m_comLeftGiftBox.m_comGouMaiGetText.target.visible = true;
                 var itemArr = itemCfg.itemsArr[0];
@@ -143,9 +224,138 @@ namespace GFGGame
                 item.m_comLeftGiftBox.m_comGouMaiGetText.m_loaIcon.url = ResPathUtil.GetIconPath(getItemCfg);
                 item.m_comLeftGiftBox.m_comGouMaiGetText.m_txtGetGold.text = itemArr[1].ToString();
                 item.m_txtUrc.text = string.Format("每周限购{0}/{1}", remainBuyNum, shopCfg.maxBuyNum);
-                item.m_txtLrc.text = string.Format("剩余{0}天", "");//剩余天数,应该是存储在数值组件上的,下周一过来再找找 然后赋值吧
-                //领取按钮的渲染,后端加个组件来记录着领取状态
+                item.m_txtLrc.text = string.Format("剩余{0}天", "");
+                item.m_txtWeekPrompt.visible = true;
+                item.m_txtWeekPrompt.text =
+                    string.Format("连续{0}天每日获得", NumberUtil.GetChiniseNumberText(itemCfg.param2Arr[0]));
+                item.m_icoWeekPromptTag.visible = true;
+
+                numItems = childItemCfg.param1Arr.Length;
+                
+                //是否需要领取
+                if (weekGiftBoxState == EnduringGiftBoxBuyStatus.NoGet)
+                {
+                    item.m_btnBuy.target.visible = false;
+                    item.m_btnCurReceive.target.visible = true;
+                    item.m_btnCurReceive.m_receive.visible = true;
+                    item.m_btnCurReceive.m_received.visible = false;
+                    item.m_btnCurReceive.m_txtRec.text = "领取";
+                }
+                else
+                {
+                    //是否能购买
+                    if (remainBuyNum == 0)
+                    {
+                        //已售完
+                        item.m_btnBuy.target.visible = false;
+                        item.m_btnCurReceive.target.visible = true;
+                        item.m_btnCurReceive.m_receive.visible = false;
+                        item.m_btnCurReceive.m_received.visible = true;
+                        item.m_btnCurReceive.m_txtRec.text = "已领取";
+                    }
+                    else
+                    {
+                        //未售完
+                        item.m_btnBuy.target.visible = true;
+                        item.m_btnCurReceive.target.visible = false;
+                    }
+                }
+            }
+            //领取按钮点击事件
+            //购买按钮点击事件
+            item.m_btnBuy.target.onClick.Add(OnBtnBuyClick);
+            
+            item.m_list.data = shopCfg;
+            item.m_list.itemRenderer = ChildListItemRender;
+            item.m_list.numItems = numItems;
+        }
+
+        //领取按钮点击事件
+
+        //购买按钮点击事件
+        private void OnBtnBuyClick(EventContext context)
+        {
+            GObject sender = context.sender as GObject;
+            GObject obj = sender.parent;
+            ShopCfg cfg = obj.data as ShopCfg;
+            bool isSellOut = cfg.maxBuyNum > 0 &&
+                             cfg.maxBuyNum - ShopDataManager.Instance.GetGoodsBuyNumById(cfg.id) <= 0;
+
+            if (isSellOut)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("已售罄");
+                return;
+            }
+
+            if (!ShopDataManager.Instance.GetShopGoodsStateById(cfg.id))
+            {
+                PromptController.Instance.ShowFloatTextPrompt(ShopDataManager.Instance.GetShopGoodsStateTips(cfg.id));
+                return;
+            }
+
+            if (cfg.costType == CostType.FREE)
+            {
+                ShopSProxy.ReqShopBuy(cfg.id, 1).Coroutine();
+                LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.SHANG_CHENG, 2);
+            }
+            else
+            {
+                ViewManager.Show<ItemExchangeView>(cfg.id);
+            }
+        }
+
+        private void ChildListItemRender(int index, GObject obj)
+        {
+            UI_ComRewardIconItem uiItemChild = UI_ComRewardIconItem.Proxy(obj);
+            var shopCfg = uiItemChild.target.parent.data as ShopCfg;
+            var itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
+            // uiItemChild.m_showRreceives.visible = false;
+
+            var curGiftBoxState = EnduringGiftBoxDataManager.GiftBoxStateDic[shopCfg.id];
+            int[][] result;
+            if (shopCfg.refreshType == RefreshType.DAY)
+            {
+                result = itemCfg.itemsArr;
+                uiItemChild.m_bagYellow.visible = false;
+                uiItemChild.m_bagBlue.visible = true;
+                uiItemChild.m_bagYellowEx.visible = false;
+                uiItemChild.m_bagBlueEx.visible = true;
             }
+            else
+            {
+                //周刷
+                result = itemCfg.param1Arr;
+                uiItemChild.m_bagYellow.visible = true;
+                uiItemChild.m_bagBlue.visible = false;
+                uiItemChild.m_bagYellowEx.visible = true;
+                uiItemChild.m_bagBlueEx.visible = false;
+            }
+            
+            // if (curGiftBoxState == EnduringGiftBoxBuyStatus.YesGet)
+            // {
+            //     uiItemChild.m_showRreceives.visible = true;
+            // }
+            // else if (curGiftBoxState == EnduringGiftBoxBuyStatus.NoGet)
+            // {
+            //     uiItemChild.m_showRreceives.visible = false;
+            // }
+
+            var itemArr = result[index];
+            var itemCfgChild = ItemCfgArray.Instance.GetCfg(itemArr[0]);
+            uiItemChild.m_loaIcon.onClick.Add(OnListSelectorItemClick);
+            uiItemChild.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfgChild);
+            uiItemChild.m_num.text = itemArr[1].ToString();
+            uiItemChild.target.data = itemCfgChild;
+            UI_ComRewardIconItem.ProxyEnd();
+        }
+
+        //弹出物品详细描述框
+        private void OnListSelectorItemClick(EventContext context)
+        {
+            GObject sender = context.sender as GObject;
+            GObject obj = sender.parent;
+            ItemCfg itemCfg = obj.data as ItemCfg;
+            GoodsItemTipsController.ShowItemTips(itemCfg.id);
         }
 
         private async void OnClickBtnSure()

+ 4 - 4
GameClient/Assets/Game/Launcher/LauncherConfig.cs

@@ -8,7 +8,7 @@ namespace GFGGame
         public static EnumNetType netType = EnumNetType.LOCAL;
         public static string cfgName;
 
-        //热更代码存放位置
+        //鐑�洿浠g爜瀛樻斁浣嶇疆
         public const string DllDirHotfix = "Assets/ResIn/Dll/Update/";
         public const string DllDirAOT = "Assets/ResIn/Dll/AOT/";
         public const int HTTP_GET_TIME_OUT = 3;
@@ -21,9 +21,9 @@ namespace GFGGame
         public static string loginApiUrl;
         public static string gameApiUrl;
         public static string cfgUrl;
-        //平台id
+        //骞冲彴id
         public static int platformId = 1;
-        //渠道id
+        //娓犻亾id
         public static int ChannelId = 1;
         public static string logApiRootUrl;
         public static string logApiReportLauncherUrl;
@@ -47,7 +47,7 @@ namespace GFGGame
         public static void InitScriptCompilation()
         {
 #if PT_DEV
-            //外网dev版本
+            //澶栫綉dev鐗堟湰
             netType = EnumNetType.DEV;
             cfgName = "cfg_dev";
 #elif PT_TEMP

BIN
GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_atlas0!a.png


BIN
GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_atlas0.png


BIN
GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_fui.bytes