Ver código fonte

限时抢购界面功能基本实现,差一个倒计时的消息分发同步--用来同步主界面的倒计时,跟弹窗倒计时,保证显示完全一致.

何晓捷 2 anos atrás
pai
commit
13811c80b4
23 arquivos alterados com 431 adições e 88 exclusões
  1. 2 3
      FGUIProject/assets/EnduringGiftBox/EnduringGiftBoxUI.xml
  2. 9 9
      FGUIProject/assets/EnduringGiftBox/RushSaleGiftBoxUI.xml
  3. 1 3
      FGUIProject/assets/EnduringGiftBox/components/BtnBuy.xml
  4. 3 2
      FGUIProject/assets/EnduringGiftBox/components/BtnBuyPink.xml
  5. 1 3
      FGUIProject/assets/EnduringGiftBox/components/BtnBuyWeek.xml
  6. 1 3
      FGUIProject/assets/EnduringGiftBox/components/BtnReceive.xml
  7. 1 3
      FGUIProject/assets/EnduringGiftBox/components/BtnSub.xml
  8. 2 2
      FGUIProject/assets/EnduringGiftBox/components/ComSpecialOfferGiftBox.xml
  9. BIN
      FGUIProject/assets/EnduringGiftBox/images/an_pink.png
  10. 1 0
      FGUIProject/assets/EnduringGiftBox/package.xml
  11. 29 50
      GameClient/Assets/Game/HotUpdate/Data/LimitedTimeGiftBoxDataManager.cs
  12. 40 0
      GameClient/Assets/Game/HotUpdate/Data/VO/GiftBoxData.cs
  13. 3 0
      GameClient/Assets/Game/HotUpdate/Data/VO/GiftBoxData.cs.meta
  14. 6 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_BtnBuyPink.cs
  15. 5 5
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComSpecialOfferGiftBox.cs
  16. 28 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_RushSaleGiftBoxUI.cs
  17. 90 0
      GameClient/Assets/Game/HotUpdate/Utils/ListUtil.cs
  18. 3 0
      GameClient/Assets/Game/HotUpdate/Utils/ListUtil.cs.meta
  19. 38 1
      GameClient/Assets/Game/HotUpdate/Utils/TimeUtil.cs
  20. 168 4
      GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/RushSaleGiftBoxView.cs
  21. BIN
      GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_atlas0!a.png
  22. BIN
      GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_atlas0.png
  23. BIN
      GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_fui.bytes

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

@@ -37,18 +37,17 @@
     <item time="0" type="Alpha" target="n2_qqhz" tween="true" startValue="0" endValue="1" duration="15"/>
     <item time="0" type="Alpha" target="n33_qqhz" value="0"/>
     <item time="0" type="Alpha" target="n34_qqhz" value="0"/>
+    <item time="0" type="Alpha" target="n35_qqhz" value="0"/>
     <item time="0" type="Alpha" target="n3_qqhz" value="0"/>
     <item time="0" type="Alpha" target="n5_qqhz" value="0"/>
     <item time="0" type="Alpha" target="n6_qqhz" value="0"/>
     <item time="0" type="Alpha" target="n9_qqhz" value="0"/>
     <item time="0" type="Rotation" target="n0_qqhz" tween="true" startValue="-2" endValue="0" duration="15"/>
     <item time="0" type="Visible" target="n29_qqhz" value="false"/>
-    <item time="0" type="Visible" target="n35_qqhz" value="false"/>
     <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="5" type="Alpha" target="n3_qqhz" tween="true" startValue="0.2" endValue="1" duration="10"/>
-    <item time="8" type="Alpha" target="n35_qqhz" tween="true" startValue="0.4" endValue="1" duration="11"/>
     <item time="9" type="Alpha" target="n33_qqhz" tween="true" startValue="0.7" endValue="1" duration="9"/>
     <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"/>
@@ -58,9 +57,9 @@
     <item time="13" type="Alpha" target="n5_qqhz" tween="true" startValue="0.5" endValue="1" duration="8"/>
     <item time="14" type="Alpha" target="n34_qqhz" tween="true" startValue="0.7" endValue="1" duration="8"/>
     <item time="14" type="Alpha" target="n9_qqhz" tween="true" startValue="0.7" endValue="1" duration="8"/>
-    <item time="14" type="Visible" target="n35_qqhz" value="true"/>
     <item time="15" type="Alpha" target="n12_qqhz" tween="true" startValue="0.7" endValue="1" duration="8"/>
     <item time="15" type="Alpha" target="n14_qqhz" tween="true" startValue="0.7" endValue="1" duration="8"/>
+    <item time="15" type="Alpha" target="n35_qqhz" tween="true" startValue="0.7" endValue="1" duration="8"/>
     <item time="18" type="Alpha" target="n15_qqhz" tween="true" startValue="0.7" endValue="1" duration="8"/>
     <item time="18" type="Alpha" target="n27_qqhz" tween="true" startValue="0.7" endValue="1" duration="8"/>
     <item time="18" type="Alpha" target="n33_qqhz" tween="true" startValue="1" endValue="0.028" duration="15"/>

+ 9 - 9
FGUIProject/assets/EnduringGiftBox/RushSaleGiftBoxUI.xml

@@ -5,20 +5,20 @@
     <image id="n0_yjmk" name="n0" src="yjmk2l" fileName="images/xsqg_lihui.png" xy="44,95"/>
     <image id="n2_yjmk" name="n2" src="yjmk2i" fileName="images/wz_xsqg.png" xy="335,98"/>
     <image id="n5_yjmk" name="n5" src="yjmk2m" fileName="images/xsqg_nr_db.png" xy="193,287"/>
-    <text id="n4_yjmk" name="n4" xy="363,279" size="283,65" fontSize="40" color="#fffbf5" align="center" autoSize="none" strokeColor="#d69546" text="体力限时礼包"/>
+    <text id="n4_yjmk" name="txtBoxItemName" xy="363,279" size="283,65" fontSize="40" color="#fffbf5" align="center" autoSize="none" strokeColor="#d69546" text="体力限时礼包"/>
     <image id="n6_yjmk" name="n6" src="yjmk2n" fileName="images/xsqg_sj_db.png" xy="639,288"/>
-    <text id="n8_yjmk" name="n8" xy="683,286" size="207,48" fontSize="35" color="#fffbf5" align="center" autoSize="none" text="6天23分23秒"/>
-    <image id="n9_yjmk" name="n9" src="yjmk2k" fileName="images/xsqg_fy_an.png" xy="877,458"/>
-    <image id="n10_yjmk" name="n10" src="yjmk2o" fileName="images/xsqg_fy_an_2.png" xy="63,452"/>
-    <list id="n11_yjmk" name="n11" xy="344,449" size="425,203" layout="flow_vt" overflow="scroll" scroll="horizontal" colGap="50" defaultItem="ui://bdi1qe15yjmk2p" align="center">
+    <text id="n8_yjmk" name="txtBoxResidueTime" xy="683,286" size="207,48" fontSize="35" color="#fffbf5" align="center" autoSize="none" text="6天23分23秒"/>
+    <image id="n10_yjmk" name="btnUp" src="yjmk2o" fileName="images/xsqg_fy_an_2.png" xy="63,452"/>
+    <image id="n9_yjmk" name="btnNext" src="yjmk2k" fileName="images/xsqg_fy_an.png" xy="877,458"/>
+    <list id="n11_yjmk" name="list" xy="344,449" size="425,203" layout="flow_vt" overflow="scroll" scroll="horizontal" colGap="50" defaultItem="ui://bdi1qe15yjmk2p" align="center">
       <item/>
       <item/>
     </list>
     <image id="n12_yjmk" name="n12" src="yjmk2b" fileName="images/xsqg_zsx.png" xy="302,674"/>
-    <text id="n13_yjmk" name="n13" xy="453,695" size="224,68" fontSize="34" color="#b8857b" align="center" vAlign="middle" autoSize="shrink" text="今日限购0/1"/>
-    <component id="n15_yjmk" name="n15" src="yjmk2q" fileName="components/BtnBuyPink.xml" xy="408,765"/>
+    <text id="n13_yjmk" name="txtUrc" xy="453,695" size="224,68" fontSize="34" color="#b8857b" align="center" vAlign="middle" autoSize="shrink" text="今日限购0/1"/>
+    <component id="n15_yjmk" name="btnBuyPink" src="yjmk2q" fileName="components/BtnBuyPink.xml" xy="408,765"/>
     <component id="n14_yjmk" name="comDiscount" src="yjmk2r" fileName="components/ComDiscount2.xml" xy="333,714"/>
-    <text id="n16_yjmk" name="n16" xy="379,859" size="380,46" fontSize="34" color="#b8857b" align="center" autoSize="shrink" text="可获得60充值经验"/>
-    <image id="n18_yjmk" name="n18" src="yjmk2s" fileName="images/back2.png" xy="499,1030"/>
+    <text id="n16_yjmk" name="txtLrc" xy="379,859" size="380,46" fontSize="34" color="#b8857b" align="center" autoSize="shrink" text="可获得60充值经验"/>
+    <image id="n18_yjmk" name="btnBack" src="yjmk2s" fileName="images/back2.png" xy="499,1030"/>
   </displayList>
 </component>

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

@@ -3,9 +3,7 @@
   <controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
   <displayList>
     <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" pkg="eg2y0ldp">
-      <relation target="" sidePair="width-width,height-height"/>
-    </image>
+    <image id="n6_yjmk" name="bagYellow" src="yjmk2y" fileName="images/button.png" xy="0,0"/>
     <text id="n1_qqhz" name="txtNewPrice" xy="146,2" size="104,69" font="ui://eg2y0ldpa0cftkz" fontSize="32" color="#fffdf4" vAlign="middle" autoSize="shrink" text="12元"/>
     <text id="n2_qqhz" name="txtOldPrice" xy="21,2" size="84,69" font="ui://eg2y0ldpa0cftky" fontSize="32" color="#fffdf4" align="center" vAlign="middle" autoSize="shrink" strike="true" text="86"/>
     <loader id="n5_yjmk" name="loaIcon" xy="104,22" size="38,34" fill="scale" shrinkOnly="true"/>

+ 3 - 2
FGUIProject/assets/EnduringGiftBox/components/BtnBuyPink.xml

@@ -2,9 +2,10 @@
 <component size="316,83" extention="Button">
   <controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
   <displayList>
-    <image id="n4_yjmk" name="n4" src="qqhzl" fileName="images/cz_an_pink.png" xy="0,0" size="316,91" aspect="true"/>
+    <image id="n7_yjmk" name="bagGrey" src="qqhzm" fileName="images/cz_an_grey.png" xy="0,7" size="316,75" aspect="true"/>
+    <image id="n6_yjmk" name="bagPink" src="yjmk3b" fileName="images/an_pink.png" xy="0,7" size="316,75" aspect="true"/>
     <text id="n1_qqhz" name="txtNewPrice" xy="166,5" size="104,69" font="ui://eg2y0ldpa0cftkz" fontSize="32" color="#fffdf4" vAlign="middle" autoSize="shrink" text="300元"/>
-    <text id="n2_qqhz" name="txtOldPrice" xy="37,2" size="84,69" font="ui://eg2y0ldpa0cftkz" fontSize="32" color="#fffdf4" vAlign="middle" autoSize="shrink" strike="true" text="2000"/>
+    <text id="n2_qqhz" name="txtOldPrice" xy="37,5" size="84,69" font="ui://eg2y0ldpa0cftkz" fontSize="32" color="#fffdf4" vAlign="middle" autoSize="shrink" strike="true" text="2000"/>
     <loader id="n5_yjmk" name="loaIcon" xy="122,22" size="33,31" fill="scale" shrinkOnly="true"/>
   </displayList>
   <Button/>

+ 1 - 3
FGUIProject/assets/EnduringGiftBox/components/BtnBuyWeek.xml

@@ -2,9 +2,7 @@
 <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" pkg="eg2y0ldp">
-      <relation target="" sidePair="width-width,height-height"/>
-    </image>
+    <image id="n4_yjmk" name="n4" src="yjmk2y" fileName="images/button.png" xy="0,0"/>
     <text id="n1_qqhz" name="txtNewPrice" xy="135,0" size="106,69" font="SourceHanSerifCN-SemiBold" fontSize="32" color="#fffdf4" vAlign="middle" autoSize="shrink" text="300"/>
     <text id="n2_qqhz" name="txtOldPrice" xy="21,1" size="84,69" font="SourceHanSerifCN-SemiBold" fontSize="32" color="#fffdf4" vAlign="middle" autoSize="shrink" strike="true" text="2000"/>
     <image id="n3_qqhz" name="n3" src="qqhz10" fileName="images/lm_tb.png" xy="103,21"/>

+ 1 - 3
FGUIProject/assets/EnduringGiftBox/components/BtnReceive.xml

@@ -3,9 +3,7 @@
   <controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
   <displayList>
     <image id="n2_qqhz" name="received" src="qqhzm" fileName="images/cz_an_grey.png" xy="0,0"/>
-    <image id="n0_qqhz" name="receive" src="qqhzk" fileName="images/cz_an_yellow.png" xy="0,0" pkg="eg2y0ldp">
-      <relation target="" sidePair="width-width,height-height"/>
-    </image>
+    <image id="n3_yjmk" name="receive" src="yjmk2y" fileName="images/button.png" xy="0,0"/>
     <text id="n1_qqhz" name="txtRec" xy="0,0" size="260,69" font="SourceHanSerifCN-SemiBold" fontSize="32" color="#fffdf4" align="center" vAlign="middle" autoSize="none" text="领取"/>
   </displayList>
   <Button/>

+ 1 - 3
FGUIProject/assets/EnduringGiftBox/components/BtnSub.xml

@@ -2,9 +2,7 @@
 <component size="260,75" extention="Button">
   <controller name="button" pages="0,up,1,down,2,over,3,selectedOver" selected="0"/>
   <displayList>
-    <image id="n0_qqhz" name="n0" src="qqhzl" fileName="images/cz_an_pink.png" xy="0,0" pkg="eg2y0ldp">
-      <relation target="" sidePair="width-width,height-height"/>
-    </image>
+    <image id="n2_yjmk" name="n2" src="yjmk3b" fileName="images/an_pink.png" xy="0,0"/>
     <text id="n1_qqhz" name="n1" xy="0,0" size="260,69" font="ui://eg2y0ldpa0cftkz" fontSize="32" color="#fffdf4" align="center" vAlign="middle" autoSize="none" text="确定"/>
   </displayList>
   <Button/>

+ 2 - 2
FGUIProject/assets/EnduringGiftBox/components/ComSpecialOfferGiftBox.xml

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
 <component size="940,213">
   <displayList>
-    <image id="n0_yjmk" name="txtBoxItemName" src="qqhzg" fileName="images/cz_lb_db.png" xy="0,0" size="940,220" group="n8_yjmk"/>
-    <text id="n2_yjmk" name="txtBoxItemName" xy="55,8" size="459,44" group="n8_yjmk" font="ui://eg2y0ldpa0cftkz" fontSize="32" color="#cc9974" autoSize="none" text="体力补给礼包"/>
+    <image id="n0_yjmk" name="nczlb" src="qqhzg" fileName="images/cz_lb_db.png" xy="0,0" size="940,220" group="n8_yjmk"/>
+    <text id="n2_yjmk" name="txtBoxItemName" xy="55,7" size="459,44" group="n8_yjmk" font="ui://eg2y0ldpa0cftkz" fontSize="32" color="#cc9974" autoSize="none" text="体力补给礼包"/>
     <component id="n3_yjmk" name="btnBuy" src="qqhzy" fileName="components/BtnBuy.xml" xy="660,85" size="261,73" group="n8_yjmk"/>
     <image id="n4_yjmk" name="n4" src="qqhz8" fileName="images/lm_dt_tsdb_2.png" xy="679,8" group="n8_yjmk"/>
     <text id="n5_yjmk" name="txtUrc" xy="714,13" size="216,42" group="n8_yjmk" rotation="-0.6" fontSize="28" color="#cc6960" align="center" leading="0" autoSize="none" text="今日限购1/1"/>

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


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

@@ -80,6 +80,7 @@
     <component id="yjmk37" name="ComSpecialOfferGiftBox.xml" path="/components/" exported="true"/>
     <image id="yjmk39" name="wpk_db_1_da.png" path="/images/"/>
     <image id="yjmk3a" name="wpk_sz_db_1.png" path="/images/"/>
+    <image id="yjmk3b" name="an_pink.png" path="/images/"/>
   </resources>
   <publish name="" path="../GameClient/Assets/ResIn/UI/EnduringGiftBox" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 29 - 50
GameClient/Assets/Game/HotUpdate/Data/LimitedTimeGiftBoxDataManager.cs

@@ -9,7 +9,7 @@ using UI.DressUp;
 
 namespace GFGGame
 {
-    public class LimitedTimeGiftBoxDataManager : SingletonBase<EnduringGiftBoxDataManager>
+    public class LimitedTimeGiftBoxDataManager : SingletonBase<LimitedTimeGiftBoxDataManager>
     {
         //测试数据定义--等之后搞好活动有效期组件之后,再替换成真实数据 <活动id,活动结束时间戳精确到秒> --假设这个就是我排好序的活动列表
         private Dictionary<int, ActivityOpenData> _activityOpenEndTimeDic = new Dictionary<int, ActivityOpenData>();
@@ -18,12 +18,15 @@ namespace GFGGame
 
         //列表数据3--等级条件的数据
         private List<LimitedTimeGiftBoxItemData> _ltgGbItemData3 = new List<LimitedTimeGiftBoxItemData>();
+        public List<LimitedTimeGiftBoxItemData> LtgGbItemData3 => _ltgGbItemData3;
 
-        //圆形样式数据4--等级条件的数据
-        private List<LimitedTimeGiftBoxItemData2> _ltgGbItemData4 = new List<LimitedTimeGiftBoxItemData2>();
+        //圆形样式数据4--等级条件的数据 
+        private List<LimitedTimeGiftBoxItemYxData> _ltgGbItemData4 = new List<LimitedTimeGiftBoxItemYxData>();
+        public List<LimitedTimeGiftBoxItemYxData> LtgGbItemData4 => _ltgGbItemData4;
 
         //圆形样式数据5--时间条件的数据
-        private List<LimitedTimeGiftBoxItemData2> _ltgGbItemData5 = new List<LimitedTimeGiftBoxItemData2>();
+        private List<LimitedTimeGiftBoxItemYxData> _ltgGbItemData5 = new List<LimitedTimeGiftBoxItemYxData>();
+        public List<LimitedTimeGiftBoxItemYxData> LtgGbItemData5 => _ltgGbItemData5;
 
         // public void InitData()
         // {
@@ -32,7 +35,7 @@ namespace GFGGame
         //     _ltgGbItemData4.Clear();
         //     _ltgGbItemData5.Clear();
         // }
-        
+
         public void UpAllData()
         {
             //UpActivityOpenEndTimeDic(); //等之后搞好活动有效期组件之后,再替换成真实数据的更新
@@ -40,19 +43,21 @@ namespace GFGGame
             UpLtgGbItemData4();
             UpLtgGbItemData5();
         }
-        
+
         public void UpLtgGbItemData3()
         {
             _ltgGbItemData3.Clear();
             foreach (var itemKv in _activityOpenEndTimeDic)
             {
-                if (itemKv.Value.ActivityEndTime >= 0) //当前服务器时间戳---稍迟再从原来的代码里找个获取当前服务器时间戳的代码copy过来
+                if (itemKv.Value.ActivityEndTime >= TimeInfo.Instance.ServerNow())
                 {
                     ActivityOpenCfg activityOpenCfg = itemKv.Value.ActivityOpenCfgData;
                     //判断是否是类型3的数据
-                    if (activityOpenCfg.type == 3)
+                    if (activityOpenCfg.type == ConstActivityType.ActLimitGiftShByLevel)
                     {
-                        foreach (var shopCfgId in activityOpenCfg.paramsArr)
+                        var paramsArr = activityOpenCfg.paramsArr;
+                        Array.Sort(paramsArr);
+                        foreach (var shopCfgId in paramsArr)
                         {
                             ShopCfg shopCfg = ShopCfgArray.Instance.GetCfg(shopCfgId);
 
@@ -78,6 +83,7 @@ namespace GFGGame
                                     ltgGbItemData.ShopCfgIds = new List<int> { shopCfgId };
                                 }
 
+                                ltgGbItemData.EndTime = itemKv.Value.ActivityEndTime;
                                 _ltgGbItemData3.Add(ltgGbItemData);
                             }
                             else
@@ -85,7 +91,8 @@ namespace GFGGame
                                 ltgGbItemData = new LimitedTimeGiftBoxItemData
                                 {
                                     IndexType = shopCfg.menu2,
-                                    ShopCfgIds = new List<int> { shopCfgId }
+                                    ShopCfgIds = new List<int> { shopCfgId },
+                                    EndTime = itemKv.Value.ActivityEndTime
                                 };
 
                                 _ltgGbItemData3.Add(ltgGbItemData);
@@ -94,6 +101,8 @@ namespace GFGGame
                     }
                 }
             }
+
+            _ltgGbItemData3 = _ltgGbItemData3.OrderBy(a => a.IndexType).ToList();
         }
 
         public void UpLtgGbItemData4()
@@ -101,15 +110,15 @@ namespace GFGGame
             _ltgGbItemData4.Clear();
             foreach (var itemKv in _activityOpenEndTimeDic)
             {
-                if (itemKv.Value.ActivityEndTime >= 0) //当前服务器时间戳---稍迟再从原来的代码里找个获取当前服务器时间戳的代码copy过来
+                if (itemKv.Value.ActivityEndTime >= TimeInfo.Instance.ServerNow())
                 {
                     ActivityOpenCfg activityOpenCfg = itemKv.Value.ActivityOpenCfgData;
                     //判断是否是类型4的数据
-                    if (activityOpenCfg.type == 4)
+                    if (activityOpenCfg.type == ConstActivityType.ActLimitGiftYxByLevel)
                     {
                         foreach (var shopCfgId in activityOpenCfg.paramsArr)
                         {
-                            FillData(_ltgGbItemData4, shopCfgId);
+                            FillData(_ltgGbItemData4, shopCfgId, itemKv.Value.ActivityEndTime);
                         }
                     }
                 }
@@ -123,13 +132,13 @@ namespace GFGGame
             _ltgGbItemData5.Clear();
             foreach (var itemKv in _activityOpenEndTimeDic)
             {
-                if (itemKv.Value.ActivityEndTime >= 0) //当前服务器时间戳---稍迟再从原来的代码里找个获取当前服务器时间戳的代码copy过来
+                if (itemKv.Value.ActivityEndTime >= TimeInfo.Instance.ServerNow())
                 {
                     ActivityOpenCfg activityOpenCfg = itemKv.Value.ActivityOpenCfgData;
                     //判断是否是类型4的数据
-                    if (activityOpenCfg.type == 5)
+                    if (activityOpenCfg.type == ConstActivityType.ActLimitGiftYxByTime)
                     {
-                        FillData(_ltgGbItemData5, activityOpenCfg.paramsArr[0]);
+                        FillData(_ltgGbItemData5, activityOpenCfg.paramsArr[0], itemKv.Value.ActivityEndTime);
                     }
                 }
             }
@@ -137,7 +146,7 @@ namespace GFGGame
             _ltgGbItemData5 = _ltgGbItemData5.OrderBy(a => a.ShopCfgId).ToList();
         }
 
-        private void FillData(List<LimitedTimeGiftBoxItemData2> listData, int shopCfgId)
+        private void FillData(List<LimitedTimeGiftBoxItemYxData> listData, int shopCfgId, long endTime)
         {
             ShopCfg shopCfg = ShopCfgArray.Instance.GetCfg(shopCfgId);
 
@@ -150,8 +159,9 @@ namespace GFGGame
             var ltgGbItemData = listData.FirstOrDefault(a => a.ShopCfgId == shopCfgId);
             if (ltgGbItemData == null)
             {
-                listData.Add(new LimitedTimeGiftBoxItemData2
+                listData.Add(new LimitedTimeGiftBoxItemYxData
                 {
+                    EndTime = endTime,
                     ShopCfgId = shopCfg.id,
                     IndexType = shopCfg.menu2
                 });
@@ -160,40 +170,9 @@ namespace GFGGame
             {
                 var index = listData.IndexOf(ltgGbItemData);
                 ltgGbItemData.IndexType = shopCfg.menu2;
+                ltgGbItemData.EndTime = endTime;
                 listData[index] = ltgGbItemData;
             }
         }
     }
-
-    public class ActivityOpenData
-    {
-        //活动开启配置
-        public ActivityOpenCfg ActivityOpenCfgData;
-
-        //活动结束时间戳
-        public long ActivityEndTime;
-    }
-
-    /// <summary>
-    /// 限时礼包列表数据模型
-    /// </summary>
-    public class LimitedTimeGiftBoxItemData
-    {
-        //限时礼包_ShopCfg的menu2
-        public int IndexType;
-
-        //只存同一个menu2的3条数据,超出忽略
-        public List<int> ShopCfgIds;
-    }
-
-    /// <summary>
-    /// 圆形样式数据模型
-    /// </summary>
-    public class LimitedTimeGiftBoxItemData2
-    {
-        public int ShopCfgId;
-
-        //限时礼包_ShopCfg的menu2
-        public int IndexType;
-    }
 }

+ 40 - 0
GameClient/Assets/Game/HotUpdate/Data/VO/GiftBoxData.cs

@@ -0,0 +1,40 @@
+using System.Collections.Generic;
+
+namespace GFGGame
+{
+    public class ActivityOpenData
+    {
+        //活动开启配置
+        public ActivityOpenCfg ActivityOpenCfgData;
+
+        //活动结束时间戳
+        public long ActivityEndTime;
+    }
+
+    /// <summary>
+    /// 限时礼包列表数据模型
+    /// </summary>
+    public class LimitedTimeGiftBoxItemData
+    {
+        //限时礼包_ShopCfg的menu2
+        public int IndexType;
+
+        //只存同一个menu2的3条数据,超出忽略
+        public List<int> ShopCfgIds;
+
+        public long EndTime;
+    }
+
+    /// <summary>
+    /// 圆形样式数据模型
+    /// </summary>
+    public class LimitedTimeGiftBoxItemYxData
+    {
+        public int ShopCfgId;
+
+        //限时礼包_ShopCfg的menu2
+        public int IndexType;
+
+        public long EndTime;
+    }
+}

+ 3 - 0
GameClient/Assets/Game/HotUpdate/Data/VO/GiftBoxData.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 371bcaa6079b44e48cc3197e0a51d0c9
+timeCreated: 1685758053

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

@@ -7,6 +7,8 @@ namespace UI.EnduringGiftBox
     public partial class UI_BtnBuyPink
     {
         public GButton target;
+        public GImage m_bagPink;
+        public GImage m_bagGrey;
         public GTextField m_txtNewPrice;
         public GTextField m_txtOldPrice;
         public GLoader m_loaIcon;
@@ -57,12 +59,16 @@ namespace UI.EnduringGiftBox
 
         private void Init(GComponent comp)
         {
+            m_bagPink = (GImage)comp.GetChild("bagPink");
+            m_bagGrey = (GImage)comp.GetChild("bagGrey");
             m_txtNewPrice = (GTextField)comp.GetChild("txtNewPrice");
             m_txtOldPrice = (GTextField)comp.GetChild("txtOldPrice");
             m_loaIcon = (GLoader)comp.GetChild("loaIcon");
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_bagPink = null;
+            m_bagGrey = null;
             m_txtNewPrice = null;
             m_txtOldPrice = null;
             m_loaIcon = null;

+ 5 - 5
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComSpecialOfferGiftBox.cs

@@ -7,8 +7,8 @@ namespace UI.EnduringGiftBox
     public partial class UI_ComSpecialOfferGiftBox
     {
         public GComponent target;
-        public GImage m_txtBoxItemName;
-        public GTextField m_txtBoxItemName_2;
+        public GImage m_nczlb;
+        public GTextField m_txtBoxItemName;
         public UI_BtnBuy m_btnBuy;
         public GTextField m_txtUrc;
         public GTextField m_txtGetJf;
@@ -61,8 +61,8 @@ namespace UI.EnduringGiftBox
 
         private void Init(GComponent comp)
         {
-            m_txtBoxItemName = (GImage)comp.GetChild("txtBoxItemName");
-            m_txtBoxItemName_2 = (GTextField)comp.GetChild("txtBoxItemName");
+            m_nczlb = (GImage)comp.GetChild("nczlb");
+            m_txtBoxItemName = (GTextField)comp.GetChild("txtBoxItemName");
             m_btnBuy = (UI_BtnBuy)UI_BtnBuy.Create(comp.GetChild("btnBuy"));
             m_txtUrc = (GTextField)comp.GetChild("txtUrc");
             m_txtGetJf = (GTextField)comp.GetChild("txtGetJf");
@@ -71,8 +71,8 @@ namespace UI.EnduringGiftBox
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_nczlb = null;
             m_txtBoxItemName = null;
-            m_txtBoxItemName_2 = null;
             m_btnBuy.Dispose();
             m_btnBuy = null;
             m_txtUrc = null;

+ 28 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_RushSaleGiftBoxUI.cs

@@ -7,7 +7,16 @@ namespace UI.EnduringGiftBox
     public partial class UI_RushSaleGiftBoxUI
     {
         public GComponent target;
+        public GTextField m_txtBoxItemName;
+        public GTextField m_txtBoxResidueTime;
+        public GImage m_btnUp;
+        public GImage m_btnNext;
+        public GList m_list;
+        public GTextField m_txtUrc;
+        public UI_BtnBuyPink m_btnBuyPink;
         public UI_ComDiscount2 m_comDiscount;
+        public GTextField m_txtLrc;
+        public GImage m_btnBack;
         public const string URL = "ui://bdi1qe15yjmk29";
         public const string PACKAGE_NAME = "EnduringGiftBox";
         public const string RES_NAME = "RushSaleGiftBoxUI";
@@ -55,12 +64,31 @@ namespace UI.EnduringGiftBox
 
         private void Init(GComponent comp)
         {
+            m_txtBoxItemName = (GTextField)comp.GetChild("txtBoxItemName");
+            m_txtBoxResidueTime = (GTextField)comp.GetChild("txtBoxResidueTime");
+            m_btnUp = (GImage)comp.GetChild("btnUp");
+            m_btnNext = (GImage)comp.GetChild("btnNext");
+            m_list = (GList)comp.GetChild("list");
+            m_txtUrc = (GTextField)comp.GetChild("txtUrc");
+            m_btnBuyPink = (UI_BtnBuyPink)UI_BtnBuyPink.Create(comp.GetChild("btnBuyPink"));
             m_comDiscount = (UI_ComDiscount2)UI_ComDiscount2.Create(comp.GetChild("comDiscount"));
+            m_txtLrc = (GTextField)comp.GetChild("txtLrc");
+            m_btnBack = (GImage)comp.GetChild("btnBack");
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_txtBoxItemName = null;
+            m_txtBoxResidueTime = null;
+            m_btnUp = null;
+            m_btnNext = null;
+            m_list = null;
+            m_txtUrc = null;
+            m_btnBuyPink.Dispose();
+            m_btnBuyPink = null;
             m_comDiscount.Dispose();
             m_comDiscount = null;
+            m_txtLrc = null;
+            m_btnBack = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 90 - 0
GameClient/Assets/Game/HotUpdate/Utils/ListUtil.cs

@@ -0,0 +1,90 @@
+using System.Collections.Generic;
+
+namespace GFGGame
+{
+    public class ListUtil
+    {
+        /// <summary>
+        /// 用来做泛型数据切换,上一条,下一条...
+        /// </summary>
+        /// <param name="list"></param>
+        /// <param name="type"></param>
+        /// <param name="currentIndex">当前处于的索引</param>
+        /// <param name="newIndex">操作数据之后返回的数据的索引,也就是最新的索引</param>
+        /// <typeparam name="T"></typeparam>
+        /// <returns></returns>
+        public static T Navigate<T>(List<T> list, NavigateType type, int currentIndex, out int newIndex) where T : new()
+        {
+            if (type == NavigateType.Previous)
+            {
+                //如果已经是最前面的一条数据,则切换到最后一条数据,形成一个切换循环
+                if (currentIndex <= 0)
+                {
+                    currentIndex = list.Count - 1;
+                    newIndex = currentIndex;
+                    return list[currentIndex];
+                }
+            }
+            else if (type == NavigateType.Next)
+            {
+                //如果已经是最后一条数据,则切换到第一条数据,形成一个切换循环
+                if (currentIndex >= list.Count - 1)
+                {
+                    currentIndex = 0;
+                    newIndex = currentIndex;
+                    return list[currentIndex];
+                }
+            }
+            else
+            {
+                newIndex = currentIndex;
+                return list[currentIndex];
+            }
+
+            int previousIndex = currentIndex - 1;
+            int nextIndex = currentIndex + 1;
+
+            if (previousIndex < 0 && nextIndex >= list.Count)
+            {
+                newIndex = currentIndex;
+                return list[currentIndex];
+            }
+
+            if (type == NavigateType.Previous && previousIndex >= 0)
+            {
+                newIndex = previousIndex;
+                return list[previousIndex];
+            }
+
+            if (type == NavigateType.Next && nextIndex < list.Count)
+            {
+                newIndex = nextIndex;
+                return list[nextIndex];
+            }
+
+            newIndex = currentIndex;
+            return list[currentIndex];
+        }
+
+        /// <summary>
+        /// 动作枚举
+        /// </summary>
+        public enum NavigateType
+        {
+            /// <summary>
+            /// 不作切换动作,返回当前索引的数据
+            /// </summary>
+            None = 0,
+
+            /// <summary>
+            /// 上一条
+            /// </summary>
+            Previous = 1,
+
+            /// <summary>
+            /// 下一条
+            /// </summary>
+            Next = 2
+        }
+    }
+}

+ 3 - 0
GameClient/Assets/Game/HotUpdate/Utils/ListUtil.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 250cd1df042041008c95c9cad474dbcb
+timeCreated: 1685762914

+ 38 - 1
GameClient/Assets/Game/HotUpdate/Utils/TimeUtil.cs

@@ -19,16 +19,19 @@ namespace GFGGame
             {
                 return string.Format("{0}天", days);
             }
+
             int hours = (int)Math.Floor((decimal)time / TimeUtil.SECOND_PER_HOUR);
             if (hours >= 1)
             {
                 return string.Format("{0}小时", hours);
             }
+
             int minutes = (int)Math.Floor((decimal)time / TimeUtil.SECOND_PER_MUNITE);
             if (minutes >= 1)
             {
                 return string.Format("{0}分钟", minutes);
             }
+
             return string.Format("{0}秒", time);
         }
 
@@ -38,6 +41,7 @@ namespace GFGGame
             int days = (int)Math.Ceiling((decimal)time / TimeUtil.SECOND_PER_DAY);
             return days;
         }
+
         /// <summary>
         /// 
         /// </summary>
@@ -55,6 +59,7 @@ namespace GFGGame
                 str = "天";
                 return;
             }
+
             int hours = (int)Math.Floor((decimal)time / TimeUtil.SECOND_PER_HOUR);
             if (hours >= 1)
             {
@@ -62,6 +67,7 @@ namespace GFGGame
                 str = "小时";
                 return;
             }
+
             int minutes = (int)Math.Floor((decimal)time / TimeUtil.SECOND_PER_MUNITE);
             if (minutes >= 1)
             {
@@ -69,6 +75,7 @@ namespace GFGGame
                 str = "分钟";
                 return;
             }
+
             num = minutes;
             str = "秒";
         }
@@ -84,6 +91,7 @@ namespace GFGGame
 
             return str;
         }
+
         /// <summary>
         /// 将时间戳转换成yyyy/MM/dd格式
         /// </summary>
@@ -144,6 +152,7 @@ namespace GFGGame
             string strS = ts.Seconds.ToString().Length == 1 ? "0" + ts.Seconds : ts.Seconds.ToString();
             return string.Format("{0}:{1}:{2}", strH, strM, strS);
         }
+
         /// <summary>
         /// 输入一段时间(毫秒),将时间转换成DD天HH小时mm分格式
         /// </summary>
@@ -156,6 +165,7 @@ namespace GFGGame
             string strM = ts.Minutes.ToString().Length == 1 ? "0" + ts.Minutes : ts.Minutes.ToString();
             return string.Format("{0}天{1}小时{2}分", strD, strH, strM);
         }
+
         /// <summary>
         /// <summary>
         /// 将时间戳转换成HH:mm格式
@@ -168,6 +178,7 @@ namespace GFGGame
 
             return str;
         }
+
         /// <summary>
         /// <summary>
         /// 将时间戳转换成mm:ss格式
@@ -180,5 +191,31 @@ namespace GFGGame
 
             return str;
         }
+
+        /// <summary>
+        /// 计算两个时间戳之间的时间差,返回格式为: 1天1小时1分1秒,如果时间差小于1天,则返回格式为: 03:59:30
+        /// </summary>
+        /// <param name="startTimeStamp">开始时间戳毫秒级,一般是服务器当前时间</param>
+        /// <param name="endTimeStamp">结束时间戳毫秒级</param>
+        /// <returns></returns>
+        public static string GetTimeLeft(long startTimeStamp, long endTimeStamp)
+        {
+            DateTime dtStart = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(startTimeStamp);
+            DateTime dtEnd = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).AddMilliseconds(endTimeStamp);
+
+            TimeSpan timeLeft = dtEnd.Subtract(DateTime.UtcNow).Add(DateTime.UtcNow.Subtract(dtStart));
+            string timeLeftFormatted;
+
+            if (timeLeft.TotalHours < 24)
+            {
+                timeLeftFormatted = timeLeft.ToString(@"hh\:mm\:ss");
+            }
+            else
+            {
+                timeLeftFormatted = string.Format("{0}天{1}小时{2}分", timeLeft.Days, timeLeft.Hours, timeLeft.Minutes);
+            }
+
+            return timeLeftFormatted;
+        }
     }
-}
+}

+ 168 - 4
GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/RushSaleGiftBoxView.cs

@@ -18,9 +18,23 @@ namespace GFGGame
 
         private int _type; //决定数据的类型 --等级条件的数据,时间条件的数据
 
+        private int _pageIndex; //当前页码,需要显示的数据的索引
+
         protected override void OnInit()
         {
             base.OnInit();
+
+            packageName = UI_EnduringGiftBoxUI.PACKAGE_NAME;
+            _ui = UI_RushSaleGiftBoxUI.Create();
+            this.viewCom = _ui.target;
+            this.viewCom.Center();
+            this.modal = true;
+            viewAnimationType = EnumViewAnimationType.None;
+
+            _ui.m_btnUp.onClick.Add(OnBtnPreviousClick);
+            _ui.m_btnNext.onClick.Add(OnBtnNextClick);
+            _ui.m_btnBack.onClick.Add(OnBtnCancelClick);
+            _ui.m_btnBuyPink.target.onClick.Add(OnBtnBuyClick);
         }
 
         public override void Dispose()
@@ -38,8 +52,9 @@ namespace GFGGame
         {
             base.OnShown();
             AddEffect();
+            InitPageInex();
 
-            UpdateView();
+            UpdateView(ListUtil.NavigateType.None);
         }
 
         protected override void AddEventListener()
@@ -56,16 +71,165 @@ namespace GFGGame
         {
         }
 
-        private void UpdateView()
+        //实例化索引
+        private void InitPageInex()
+        {
+            if (_type == ConstActivityType.ActLimitGiftYxByLevel)
+            {
+                //4
+                var data4 = LimitedTimeGiftBoxDataManager.Instance.LtgGbItemData4
+                    .FirstOrDefault(a => a.IndexType == 1);
+                _pageIndex = data4 == null ? 0 : LimitedTimeGiftBoxDataManager.Instance.LtgGbItemData4.IndexOf(data4);
+            }
+            else if (_type == ConstActivityType.ActLimitGiftYxByTime)
+            {
+                //5
+                var data5 = LimitedTimeGiftBoxDataManager.Instance.LtgGbItemData5
+                    .FirstOrDefault(a => a.IndexType == 1);
+                _pageIndex = data5 == null ? 0 : LimitedTimeGiftBoxDataManager.Instance.LtgGbItemData4.IndexOf(data5);
+            }
+        }
+
+        private void UpdateView(ListUtil.NavigateType type)
         {
+            //筛选一条数据用来界面渲染
+            var list = _type == ConstActivityType.ActLimitGiftYxByLevel
+                ? LimitedTimeGiftBoxDataManager.Instance.LtgGbItemData4
+                : LimitedTimeGiftBoxDataManager.Instance.LtgGbItemData5;
+            var data = ListUtil.Navigate(list, type, _pageIndex, out int newIndex);
+            _pageIndex = newIndex;
+
+            var shopCfg = ShopCfgArray.Instance.GetCfg(data.ShopCfgId);
+            var boxItemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId);
+            var remainBuyNum = shopCfg.maxBuyNum - ShopDataManager.Instance.GetGoodsBuyNumById(shopCfg.id);
+
+            string mTxtUrc = string.Empty;
+            if (shopCfg.refreshType == RefreshType.DAY)
+            {
+                mTxtUrc = $"今日限购{remainBuyNum}/{shopCfg.maxBuyNum}";
+            }
+            else if (shopCfg.refreshType == RefreshType.WEEK)
+            {
+                mTxtUrc = $"本周限购{remainBuyNum}/{shopCfg.maxBuyNum}";
+            }
+            else if (shopCfg.refreshType == RefreshType.MONTH)
+            {
+                mTxtUrc = $"本月限购{remainBuyNum}/{shopCfg.maxBuyNum}";
+            }
+
+            if (remainBuyNum == 0)
+            {
+                //已售完
+                _ui.m_btnBuyPink.m_bagGrey.visible = true;
+                _ui.m_btnBuyPink.m_bagPink.visible = false;
+            }
+            else
+            {
+                //未售完
+                _ui.m_btnBuyPink.m_bagGrey.visible = false;
+                _ui.m_btnBuyPink.m_bagPink.visible = true;
+            }
+
+            string mTxtNewPrice;
+            _ui.m_btnBuyPink.m_loaIcon.visible = false;
+            _ui.m_btnBuyPink.m_txtOldPrice.text = shopCfg.originalPrice.ToString();
+            if (shopCfg.costType == CostType.ITEM)
+            {
+                //货币  
+                ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(shopCfg.costId);
+                mTxtNewPrice = shopCfg.price.ToString();
+                _ui.m_btnBuyPink.m_loaIcon.visible = true;
+                _ui.m_btnBuyPink.m_loaIcon.url = ResPathUtil.GetIconPath(costCfg);
+            }
+            else if (shopCfg.costType == CostType.RMB)
+            {
+                //人民币
+                mTxtNewPrice = $"{shopCfg.price}元";
+                _ui.m_btnBuyPink.m_txtNewPrice.align = AlignType.Left;
+                _ui.m_btnBuyPink.m_txtNewPrice.x = 90;
+            }
+            else
+            {
+                //免费
+                mTxtNewPrice = $"免费";
+                _ui.m_btnBuyPink.m_txtOldPrice.text = "";
+                _ui.m_btnBuyPink.m_txtNewPrice.align = AlignType.Left;
+                _ui.m_btnBuyPink.m_txtNewPrice.x = 90;
+            }
+
+            _ui.m_txtBoxItemName.text = shopCfg.itemName;
+            //这个B时间需要在一个地方统一处理,然后广播事件,不然可能会存在不同步的问题,最后做
+            _ui.m_txtBoxResidueTime.text = TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), data.EndTime);
+            _ui.m_txtUrc.text = mTxtUrc;
+            _ui.m_comDiscount.m_txtDiscountNum.text =
+                NumberUtil.CalculateDiscount(shopCfg.originalPrice, shopCfg.price);
+            _ui.m_txtLrc.text = $"可获得{shopCfg.price * 10}充值经验";
+            _ui.m_btnBuyPink.m_txtNewPrice.text = mTxtNewPrice;
+            _ui.m_btnBuyPink.target.data = shopCfg;
+
+            _ui.m_list.data = boxItemCfg;
+            _ui.m_list.itemRenderer = ListItemRender;
+            _ui.m_list.numItems = boxItemCfg.itemsArr.Length;
+            _ui.m_list.visible = true;
         }
 
         private void ListItemRender(int index, GObject obj)
         {
+            UI_ComRsGifBoxIconItem uiItem = UI_ComRsGifBoxIconItem.Proxy(obj);
+            var boxItemCfg = uiItem.target.parent.data as ItemCfg;
+            var itemKv = boxItemCfg.itemsArr[index];
+
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemKv[0]);
+            uiItem.m_txtItemName.text = itemCfg.name;
+            uiItem.m_comRewardIconItem.m_bagBlue.visible = false;
+            uiItem.m_comRewardIconItem.m_bagBlueEx.visible = false;
+            uiItem.m_comRewardIconItem.m_num.text = itemKv[1].ToString();
+            uiItem.m_comRewardIconItem.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
+        }
+
+
+        //上一条
+        private void OnBtnPreviousClick()
+        {
+            UpdateView(ListUtil.NavigateType.Previous);
+        }
+
+        //下一条
+        private void OnBtnNextClick()
+        {
+            UpdateView(ListUtil.NavigateType.Next);
         }
 
-        private void ChildListItemRender(int index, GObject obj)
+        //购买按钮点击事件
+        private void OnBtnBuyClick(EventContext context)
         {
+            GObject sender = context.sender as GObject;
+            //GObject obj = sender.parent;
+            ShopCfg cfg = sender.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);
+            }
         }
 
         protected override void OnHide()
@@ -75,7 +239,7 @@ namespace GFGGame
             base.Hide();
         }
 
-        private void OnClickBtnCancel()
+        private void OnBtnCancelClick()
         {
             this.Hide();
         }

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