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

优化限时礼包相关功能

何晓捷 2 жил өмнө
parent
commit
7b6081ffcf

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

@@ -4,9 +4,11 @@
   <displayList>
   <displayList>
     <image id="n3_qqhz" name="bagGrey" src="qqhzm" fileName="images/cz_an_grey.png" xy="0,0"/>
     <image id="n3_qqhz" name="bagGrey" src="qqhzm" fileName="images/cz_an_grey.png" xy="0,0"/>
     <image id="n6_yjmk" name="bagYellow" src="yjmk2y" fileName="images/button.png" xy="0,0"/>
     <image id="n6_yjmk" name="bagYellow" src="yjmk2y" fileName="images/button.png" xy="0,0"/>
-    <text id="n1_qqhz" name="txtNewPrice" xy="134,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"/>
+    <text id="n2_qqhz" name="txtOldPrice" xy="21,2" size="84,69" group="n7_naid" font="ui://eg2y0ldpa0cftky" fontSize="32" color="#fffdf4" align="right" vAlign="middle" autoSize="shrink" strike="true" text="86"/>
+    <loader id="n5_yjmk" name="loaIcon" xy="105,22" size="38,34" group="n7_naid" fill="scale" shrinkOnly="true"/>
+    <text id="n1_qqhz" name="txtNewPrice" xy="143,2" size="104,69" group="n7_naid" font="ui://eg2y0ldpa0cftkz" fontSize="32" color="#fffdf4" vAlign="middle" autoSize="shrink" text="12元"/>
+    <group id="n7_naid" name="n7" xy="21,2" size="226,69" advanced="true" layout="hz" excludeInvisibles="true"/>
+    <text id="n8_naid" name="txtSoldOut" xy="26,8" size="208,53" font="ui://eg2y0ldpa0cftky" fontSize="32" color="#fffdf4" align="center" vAlign="middle" autoSize="none" text=""/>
   </displayList>
   </displayList>
   <Button/>
   <Button/>
 </component>
 </component>

+ 1 - 0
FGUIProject/assets/EnduringGiftBox/components/BtnBuyPink.xml

@@ -7,6 +7,7 @@
     <text id="n1_qqhz" name="txtNewPrice" xy="166,13" size="104,69" font="ui://eg2y0ldpa0cftkz" fontSize="32" color="#fffdf4" vAlign="middle" autoSize="shrink" text="300元"/>
     <text id="n1_qqhz" name="txtNewPrice" xy="166,13" size="104,69" font="ui://eg2y0ldpa0cftkz" fontSize="32" color="#fffdf4" vAlign="middle" autoSize="shrink" text="300元"/>
     <text id="n2_qqhz" name="txtOldPrice" xy="47,13" size="84,69" font="ui://eg2y0ldpa0cftkz" fontSize="32" color="#fffdf4" align="right" vAlign="middle" autoSize="shrink" strike="true" text="2000"/>
     <text id="n2_qqhz" name="txtOldPrice" xy="47,13" size="84,69" font="ui://eg2y0ldpa0cftkz" fontSize="32" color="#fffdf4" align="right" vAlign="middle" autoSize="shrink" strike="true" text="2000"/>
     <loader id="n5_yjmk" name="loaIcon" xy="122,30" size="33,31" fill="scale" shrinkOnly="true"/>
     <loader id="n5_yjmk" name="loaIcon" xy="122,30" size="33,31" fill="scale" shrinkOnly="true"/>
+    <text id="n8_naid" name="txtSoldOut" xy="49,13" size="218,69" font="ui://eg2y0ldpa0cftky" fontSize="32" color="#fffdf4" align="center" vAlign="middle" autoSize="none" text=""/>
   </displayList>
   </displayList>
   <Button/>
   <Button/>
 </component>
 </component>

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

@@ -3,8 +3,8 @@
   <displayList>
   <displayList>
     <image id="n0_yjmk" name="nczlb" src="qqhzg" fileName="images/cz_lb_db.png" xy="0,0" size="940,220" group="n8_yjmk"/>
     <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="体力补给礼包"/>
     <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"/>
-    <graph id="n11_fter" name="holderBtn" xy="788,116" size="80,56" group="n8_yjmk"/>
+    <component id="n3_yjmk" name="btnBuy" src="qqhzy" fileName="components/BtnBuy.xml" xy="660,85" size="261,72" group="n8_yjmk"/>
+    <graph id="n11_fter" name="holderBtn" xy="791,119" size="35,31" group="n8_yjmk" scale="1,0.985"/>
     <image id="n4_yjmk" name="n4" src="qqhz8" fileName="images/lm_dt_tsdb_2.png" xy="679,8" 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"/>
     <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"/>
     <text id="n6_yjmk" name="txtGetJf" xy="660,165" size="269,33" group="n8_yjmk" fontSize="28" color="#c69652" align="center" autoSize="none" text="可获得120会员积分"/>
     <text id="n6_yjmk" name="txtGetJf" xy="660,165" size="269,33" group="n8_yjmk" fontSize="28" color="#c69652" align="center" autoSize="none" text="可获得120会员积分"/>

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

@@ -9,9 +9,10 @@ namespace UI.EnduringGiftBox
         public GButton target;
         public GButton target;
         public GImage m_bagGrey;
         public GImage m_bagGrey;
         public GImage m_bagYellow;
         public GImage m_bagYellow;
-        public GTextField m_txtNewPrice;
         public GTextField m_txtOldPrice;
         public GTextField m_txtOldPrice;
         public GLoader m_loaIcon;
         public GLoader m_loaIcon;
+        public GTextField m_txtNewPrice;
+        public GTextField m_txtSoldOut;
         public const string URL = "ui://bdi1qe15qqhzy";
         public const string URL = "ui://bdi1qe15qqhzy";
         public const string PACKAGE_NAME = "EnduringGiftBox";
         public const string PACKAGE_NAME = "EnduringGiftBox";
         public const string RES_NAME = "BtnBuy";
         public const string RES_NAME = "BtnBuy";
@@ -61,17 +62,19 @@ namespace UI.EnduringGiftBox
         {
         {
             m_bagGrey = (GImage)comp.GetChild("bagGrey");
             m_bagGrey = (GImage)comp.GetChild("bagGrey");
             m_bagYellow = (GImage)comp.GetChild("bagYellow");
             m_bagYellow = (GImage)comp.GetChild("bagYellow");
-            m_txtNewPrice = (GTextField)comp.GetChild("txtNewPrice");
             m_txtOldPrice = (GTextField)comp.GetChild("txtOldPrice");
             m_txtOldPrice = (GTextField)comp.GetChild("txtOldPrice");
             m_loaIcon = (GLoader)comp.GetChild("loaIcon");
             m_loaIcon = (GLoader)comp.GetChild("loaIcon");
+            m_txtNewPrice = (GTextField)comp.GetChild("txtNewPrice");
+            m_txtSoldOut = (GTextField)comp.GetChild("txtSoldOut");
         }
         }
         public void Dispose(bool disposeTarget = false)
         public void Dispose(bool disposeTarget = false)
         {
         {
             m_bagGrey = null;
             m_bagGrey = null;
             m_bagYellow = null;
             m_bagYellow = null;
-            m_txtNewPrice = null;
             m_txtOldPrice = null;
             m_txtOldPrice = null;
             m_loaIcon = null;
             m_loaIcon = null;
+            m_txtNewPrice = null;
+            m_txtSoldOut = null;
             if(disposeTarget && target != null)
             if(disposeTarget && target != null)
             {
             {
                 target.RemoveFromParent();
                 target.RemoveFromParent();

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

@@ -12,6 +12,7 @@ namespace UI.EnduringGiftBox
         public GTextField m_txtNewPrice;
         public GTextField m_txtNewPrice;
         public GTextField m_txtOldPrice;
         public GTextField m_txtOldPrice;
         public GLoader m_loaIcon;
         public GLoader m_loaIcon;
+        public GTextField m_txtSoldOut;
         public const string URL = "ui://bdi1qe15yjmk2q";
         public const string URL = "ui://bdi1qe15yjmk2q";
         public const string PACKAGE_NAME = "EnduringGiftBox";
         public const string PACKAGE_NAME = "EnduringGiftBox";
         public const string RES_NAME = "BtnBuyPink";
         public const string RES_NAME = "BtnBuyPink";
@@ -64,6 +65,7 @@ namespace UI.EnduringGiftBox
             m_txtNewPrice = (GTextField)comp.GetChild("txtNewPrice");
             m_txtNewPrice = (GTextField)comp.GetChild("txtNewPrice");
             m_txtOldPrice = (GTextField)comp.GetChild("txtOldPrice");
             m_txtOldPrice = (GTextField)comp.GetChild("txtOldPrice");
             m_loaIcon = (GLoader)comp.GetChild("loaIcon");
             m_loaIcon = (GLoader)comp.GetChild("loaIcon");
+            m_txtSoldOut = (GTextField)comp.GetChild("txtSoldOut");
         }
         }
         public void Dispose(bool disposeTarget = false)
         public void Dispose(bool disposeTarget = false)
         {
         {
@@ -72,6 +74,7 @@ namespace UI.EnduringGiftBox
             m_txtNewPrice = null;
             m_txtNewPrice = null;
             m_txtOldPrice = null;
             m_txtOldPrice = null;
             m_loaIcon = null;
             m_loaIcon = null;
+            m_txtSoldOut = null;
             if(disposeTarget && target != null)
             if(disposeTarget && target != null)
             {
             {
                 target.RemoveFromParent();
                 target.RemoveFromParent();

+ 43 - 21
GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/RushSaleGiftBoxView.cs

@@ -26,13 +26,17 @@ namespace GFGGame
         private List<Transition> _transitionList = new List<Transition>();
         private List<Transition> _transitionList = new List<Transition>();
 
 
         private GameObject _gameObject1;
         private GameObject _gameObject1;
+
         private GameObject _gameObject2;
         private GameObject _gameObject2;
+
         // private GameObject _gameObject3;
         // private GameObject _gameObject3;
         private GameObject _gameObject4;
         private GameObject _gameObject4;
         private GameObject _gameObject5;
         private GameObject _gameObject5;
 
 
         private GoWrapper _wrapper1;
         private GoWrapper _wrapper1;
+
         private GoWrapper _wrapper2;
         private GoWrapper _wrapper2;
+
         // private GoWrapper _wrapper3;
         // private GoWrapper _wrapper3;
         private GoWrapper _wrapper4;
         private GoWrapper _wrapper4;
         private GoWrapper _wrapper5;
         private GoWrapper _wrapper5;
@@ -94,13 +98,17 @@ namespace GFGGame
 
 
             Timers.inst.Add(0.8f, 1, (obj) =>
             Timers.inst.Add(0.8f, 1, (obj) =>
                 {
                 {
-                    string resPath4 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_discount_baofa");
-                    SceneController.AddObjectToView(null, null, _ui.m_holderZheKou, resPath4,
-                        out _gameObject4, out _wrapper4);
-
-                    string resPath2 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_button");
-                    SceneController.AddObjectToView(null, null, _ui.m_holderBtnBy, resPath2,
-                        out _gameObject2, out _wrapper2);
+                    //防止手速超快关了又开开了又关导致的特效重复加载,因为这里是通过Timers延时加载的
+                    if (ViewManager.isViewOpen(nameof(RushSaleGiftBoxView)))
+                    {
+                        string resPath4 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_discount_baofa");
+                        SceneController.AddObjectToView(null, null, _ui.m_holderZheKou, resPath4,
+                            out _gameObject4, out _wrapper4);
+
+                        string resPath2 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_button");
+                        SceneController.AddObjectToView(null, null, _ui.m_holderBtnBy, resPath2,
+                            out _gameObject2, out _wrapper2);
+                    }
                 }
                 }
             );
             );
             string resPath5 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_star");
             string resPath5 = ResPathUtil.GetViewEffectPath("ui_Activity", "Limite_star");
@@ -201,19 +209,6 @@ namespace GFGGame
                 mTxtUrc = $"本月限购{remainBuyNum}/{shopCfg.maxBuyNum}";
                 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;
             string mTxtNewPrice;
             _ui.m_txtLrc.text = string.Empty;
             _ui.m_txtLrc.text = string.Empty;
             _ui.m_btnBuyPink.m_loaIcon.visible = false;
             _ui.m_btnBuyPink.m_loaIcon.visible = false;
@@ -243,6 +238,33 @@ namespace GFGGame
                 //_ui.m_btnBuyPink.m_txtNewPrice.align = AlignType.Left;
                 //_ui.m_btnBuyPink.m_txtNewPrice.align = AlignType.Left;
                 // _ui.m_btnBuyPink.m_txtNewPrice.x = 166;
                 // _ui.m_btnBuyPink.m_txtNewPrice.x = 166;
             }
             }
+            
+            if (remainBuyNum == 0)
+            {
+                //已售完
+                _ui.m_btnBuyPink.m_bagGrey.visible = true;
+                _ui.m_btnBuyPink.m_bagPink.visible = false;
+
+                _ui.m_btnBuyPink.m_txtSoldOut.visible = true;
+                _ui.m_btnBuyPink.m_txtSoldOut.text = "已售罄";
+                _ui.m_holderBtnBy.visible = false;
+                _ui.m_btnBuyPink.m_loaIcon.visible = false;
+                _ui.m_btnBuyPink.m_txtOldPrice.visible = false;
+                _ui.m_btnBuyPink.m_txtNewPrice.visible = false;
+            }
+            else
+            {
+                //未售完
+                _ui.m_btnBuyPink.m_bagGrey.visible = false;
+                _ui.m_btnBuyPink.m_bagPink.visible = true;
+
+                _ui.m_btnBuyPink.m_txtSoldOut.visible = false;
+                _ui.m_btnBuyPink.m_txtSoldOut.text = "";
+               // _ui.m_holderBtnBy.visible = true;
+               _ui.m_btnBuyPink.m_loaIcon.visible = true;
+                _ui.m_btnBuyPink.m_txtOldPrice.visible = true;
+                _ui.m_btnBuyPink.m_txtNewPrice.visible = true;
+            }
 
 
             _ui.m_txtBoxItemName.text = shopCfg.itemName;
             _ui.m_txtBoxItemName.text = shopCfg.itemName;
             //这个B时间需要在一个地方统一处理,然后广播事件,不然可能会存在不同步的问题,最后做
             //这个B时间需要在一个地方统一处理,然后广播事件,不然可能会存在不同步的问题,最后做
@@ -283,7 +305,7 @@ namespace GFGGame
                 _gameObjectList.Add(gameObject);
                 _gameObjectList.Add(gameObject);
                 _wrapperList.Add(wrapper);
                 _wrapperList.Add(wrapper);
             }
             }
-            
+
             uiItem.m_t1.Play();
             uiItem.m_t1.Play();
             UI_RushSaleGiftBoxUI.ProxyEnd();
             UI_RushSaleGiftBoxUI.ProxyEnd();
         }
         }

+ 29 - 14
GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/SpecialOfferGiftBoxView.cs

@@ -189,20 +189,8 @@ namespace GFGGame
             {
             {
                 mTxtUrc = $"永久限购{remainBuyNum}/{shopCfg.maxBuyNum}";
                 mTxtUrc = $"永久限购{remainBuyNum}/{shopCfg.maxBuyNum}";
             }
             }
-
-            if (remainBuyNum == 0)
-            {
-                //已售完
-                uiItem.m_btnBuy.m_bagGrey.visible = true;
-                uiItem.m_btnBuy.m_bagYellow.visible = false;
-            }
-            else
-            {
-                //未售完
-                uiItem.m_btnBuy.m_bagGrey.visible = false;
-                uiItem.m_btnBuy.m_bagYellow.visible = true;
-            }
-
+            
+            uiItem.m_btnBuy.m_txtOldPrice.text = shopCfg.originalPrice.ToString();
             if (shopCfg.costType == CostType.ITEM)
             if (shopCfg.costType == CostType.ITEM)
             {
             {
                 //货币
                 //货币
@@ -231,7 +219,34 @@ namespace GFGGame
                 uiItem.m_btnBuy.m_txtNewPrice.x = 125;
                 uiItem.m_btnBuy.m_txtNewPrice.x = 125;
                 uiItem.m_btnBuy.m_txtOldPrice.x = 30;
                 uiItem.m_btnBuy.m_txtOldPrice.x = 30;
             }
             }
+            
+            if (remainBuyNum == 0)
+            {
+                //已售完
+                uiItem.m_btnBuy.m_bagGrey.visible = true;
+                uiItem.m_btnBuy.m_txtSoldOut.text = "已售罄";
+                uiItem.m_btnBuy.m_txtSoldOut.visible = true;
+                uiItem.m_btnBuy.m_bagYellow.visible = false;
+                uiItem.m_btnBuy.m_txtOldPrice.visible = false;
+                uiItem.m_btnBuy.m_txtNewPrice.visible = false;
+                uiItem.m_btnBuy.m_loaIcon.visible = false;
+                uiItem.m_holderBtn.visible = false;
+            }
+            else
+            {
+                //未售完
+                uiItem.m_btnBuy.m_txtSoldOut.text = "";
+                uiItem.m_btnBuy.m_txtSoldOut.visible = false;
+                uiItem.m_btnBuy.m_bagGrey.visible = false;
+                uiItem.m_btnBuy.m_bagYellow.visible = true;
+                uiItem.m_btnBuy.m_txtOldPrice.visible = true;
+                uiItem.m_btnBuy.m_txtNewPrice.visible = true;
+                uiItem.m_btnBuy.m_loaIcon.visible = true;
+                uiItem.m_holderBtn.visible = true;
+            }
 
 
+            uiItem.m_comDiscount.m_txtDiscountNum.text =
+                NumberUtil.CalculateDiscount(shopCfg.originalPrice, shopCfg.price);
             uiItem.target.data = shopCfg;
             uiItem.target.data = shopCfg;
             uiItem.m_btnBuy.m_txtNewPrice.text = mTxtNewPrice;
             uiItem.m_btnBuy.m_txtNewPrice.text = mTxtNewPrice;
             uiItem.m_txtUrc.text = mTxtUrc;
             uiItem.m_txtUrc.text = mTxtUrc;

+ 29 - 3
GameClient/Assets/Game/HotUpdate/Views/LuckyBox/LuckyBoxActivityView.cs

@@ -156,9 +156,35 @@ namespace GFGGame
             }
             }
             else
             else
             {
             {
-                _ui.m_comBagTime.m_txtGiftBagTime.text = TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), list[0].EndTime);
-                _ui.m_comBagTime.target.visible = true;
-                _ui.m_btnGiftBag.visible = true;
+                bool isSoldOut = true;
+                foreach (var activityInfo in list)
+                {
+                    ActivityOpenCfg activityOpenCfg = ActivityOpenCfgArray.Instance.GetCfg(activityInfo.ActivityId);
+                    var paramsArr = activityOpenCfg.paramsArr;
+                    foreach (var shopCfgId in paramsArr)
+                    {
+                        var shopCfg = ShopCfgArray.Instance.GetCfg(shopCfgId);
+                        var remainBuyNum = shopCfg.maxBuyNum - ShopDataManager.Instance.GetGoodsBuyNumById(shopCfgId);
+                        //只要有一个商品还能购买,就不是售罄
+                        if (remainBuyNum > 0)
+                        {
+                            isSoldOut = false;
+                            break;
+                        }
+                    }
+                }
+
+                if (isSoldOut)
+                {
+                    _ui.m_comBagTime.target.visible = false;
+                    _ui.m_btnGiftBag.visible = false;
+                }
+                else
+                {
+                    _ui.m_comBagTime.m_txtGiftBagTime.text = TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), list[0].EndTime);
+                    _ui.m_comBagTime.target.visible = true;
+                    _ui.m_btnGiftBag.visible = true;
+                }
             }
             }
         }
         }
 
 

+ 57 - 4
GameClient/Assets/Game/HotUpdate/Views/MainUI/MainUIView.cs

@@ -712,6 +712,7 @@ namespace GFGGame
             }
             }
         }
         }
 
 
+        //列表样式
         private void UpGiftBox1()
         private void UpGiftBox1()
         {
         {
             var activityInfoByTypeList =
             var activityInfoByTypeList =
@@ -725,11 +726,37 @@ namespace GFGGame
             }
             }
             else
             else
             {
             {
-                _ui.m_btnGiftBag2.m_txtTime.text = TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), list[0].EndTime);
-                _ui.m_btnGiftBag2.target.visible = true;
+                bool isSoldOut = true;
+                foreach (var activityInfo in list)
+                {
+                    ActivityOpenCfg activityOpenCfg = ActivityOpenCfgArray.Instance.GetCfg(activityInfo.ActivityId);
+                    var paramsArr = activityOpenCfg.paramsArr;
+                    foreach (var shopCfgId in paramsArr)
+                    {
+                        var shopCfg = ShopCfgArray.Instance.GetCfg(shopCfgId);
+                        var remainBuyNum = shopCfg.maxBuyNum - ShopDataManager.Instance.GetGoodsBuyNumById(shopCfgId);
+                        //只要有一个商品还能购买,就不是售罄
+                        if (remainBuyNum > 0)
+                        {
+                            isSoldOut = false;
+                            break;
+                        }
+                    }
+                }
+
+                if (isSoldOut)
+                {
+                    _ui.m_btnGiftBag2.target.visible = false;
+                }
+                else
+                {
+                    _ui.m_btnGiftBag2.m_txtTime.text = TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), list[0].EndTime);
+                    _ui.m_btnGiftBag2.target.visible = true;
+                }
             }
             }
         }
         }
 
 
+        //圆形样式
         private void UpGiftBox2()
         private void UpGiftBox2()
         {
         {
             var activityInfoByTypeList =
             var activityInfoByTypeList =
@@ -743,8 +770,34 @@ namespace GFGGame
             }
             }
             else
             else
             {
             {
-                _ui.m_btnGiftBag1.m_txtTime.text = TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), list[0].EndTime);
-                _ui.m_btnGiftBag1.target.visible = true;
+                bool isSoldOut = true;
+                foreach (var activityInfo in list)
+                {
+                    ActivityOpenCfg activityOpenCfg = ActivityOpenCfgArray.Instance.GetCfg(activityInfo.ActivityId);
+                    var paramsArr = activityOpenCfg.paramsArr;
+                    foreach (var shopCfgId in paramsArr)
+                    {
+                        var shopCfg = ShopCfgArray.Instance.GetCfg(shopCfgId);
+                        var remainBuyNum = shopCfg.maxBuyNum - ShopDataManager.Instance.GetGoodsBuyNumById(shopCfgId);
+                        //只要有一个商品还能购买,就不是售罄
+                        if (remainBuyNum > 0)
+                        {
+                            isSoldOut = false;
+                            break;
+                        }
+                    }
+                }
+
+                if (isSoldOut)
+                {
+                    _ui.m_btnGiftBag1.target.visible = false;
+                }
+                else
+                {
+                    _ui.m_btnGiftBag1.m_txtTime.text =
+                        TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), list[0].EndTime);
+                    _ui.m_btnGiftBag1.target.visible = true;
+                }
             }
             }
         }
         }
 
 

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