瀏覽代碼

体力 金币礼包

何晓捷 2 年之前
父節點
當前提交
0519618bc6
共有 18 個文件被更改,包括 279 次插入93 次删除
  1. 8 9
      FGUIProject/assets/EnduringGiftBox/EnduringGiftBoxUI.xml
  2. 72 0
      FGUIProject/assets/EnduringGiftBox/EnduringGiftBoxUIbackups.xml
  3. 1 1
      FGUIProject/assets/EnduringGiftBox/components/ComCurSupplyItem.xml
  4. 1 1
      FGUIProject/assets/EnduringGiftBox/components/ComGouMaiGetText.xml
  5. 2 2
      FGUIProject/assets/EnduringGiftBox/components/ComLeftGiftBox.xml
  6. 2 1
      FGUIProject/assets/EnduringGiftBox/package.xml
  7. 2 1
      GameClient/Assets/Game/HotUpdate/Constant/ConstStoreSubId.cs
  8. 2 2
      GameClient/Assets/Game/HotUpdate/Constant/ConstStoreTabId.cs
  9. 3 32
      GameClient/Assets/Game/HotUpdate/Data/EnduringGiftBoxDataManager.cs
  10. 10 10
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComCurSupplyItem.cs
  11. 1 1
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComCurSupplyItem.cs.meta
  12. 3 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComGouMaiGetText.cs
  13. 7 0
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComLeftGiftBox.cs
  14. 12 14
      GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_EnduringGiftBoxUI.cs
  15. 153 19
      GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/EnduringGiftBoxView.cs
  16. 二進制
      GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_atlas0!a.png
  17. 二進制
      GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_atlas0.png
  18. 二進制
      GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_fui.bytes

+ 8 - 9
FGUIProject/assets/EnduringGiftBox/EnduringGiftBoxUI.xml

@@ -13,14 +13,17 @@
     <graph id="n33_qqhz" name="holderFg" xy="454,283" size="295,196" group="n7_qqhz"/>
     <group id="n7_qqhz" name="n7" xy="-1,-28" size="1080,1105"/>
     <image id="n27_qqhz" name="n27" src="qqhzq" fileName="images/zsx_flower1.png" xy="224,300" group="n17_qqhz"/>
-    <text id="n9_qqhz" name="txtPrompt" xy="481,163" size="444,154" group="n17_qqhz" fontSize="32" color="#915e15" align="center" autoSize="none" text="是否花费20粉钻购买60体力?&#xA;体力每5分钟恢复1点&#xA;(今日剩余购买次数:8/8)"/>
+    <text id="n9_qqhz" name="txtNeed" xy="481,163" size="444,47" group="n17_qqhz" fontSize="32" color="#915e15" align="center" autoSize="none" text="是否花费20粉钻购买60体力?"/>
+    <text id="n34_qqhz" name="txtNum" xy="481,208" pivot="0.5,0" size="444,115" group="n17_qqhz" fontSize="32" color="#915e15" align="center" autoSize="none" text="体力每5分钟恢复1点&#xA;(今日剩余购买次数:8/8)"/>
     <component id="n12_qqhz" name="btnCancel" src="qqhzs" fileName="components/BtnCancel.xml" xy="362,326" group="n17_qqhz"/>
-    <component id="n14_qqhz" name="btnSub" src="qqhzu" fileName="components/BtnSub.xml" xy="648,326" group="n17_qqhz"/>
+    <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="除了上述购买体力的途径,我们还提供了更多的优惠礼包选择"/>
-    <component id="n24_qqhz" name="curSupply" src="qqhz11" fileName="components/ComCurSupply.xml" xy="69,475" group="n26_qqhz"/>
-    <component id="n25_qqhz" name="weekSupply" src="qqhz11" fileName="components/ComCurSupply.xml" xy="69,709" group="n26_qqhz"/>
-    <group id="n26_qqhz" name="n26" xy="69,163" size="954,777"/>
+    <list id="n35_qqhz" name="list" xy="71,481" size="925,459" group="n26_qqhz" overflow="scroll" defaultItem="ui://bdi1qe15qqhz11">
+      <item/>
+      <item/>
+    </list>
+    <group id="n26_qqhz" name="n26" xy="71,163" size="952,777"/>
     <image id="n28_qqhz" name="btnBack" src="qqhz2" fileName="images/back.png" xy="497,1064"/>
   </displayList>
   <transition name="t1">
@@ -29,8 +32,6 @@
     <item time="0" type="Alpha" target="n14_qqhz" value="0"/>
     <item time="0" type="Alpha" target="n15_qqhz" value="0"/>
     <item time="0" type="Alpha" target="n1_qqhz" value="0"/>
-    <item time="0" type="Alpha" target="n24_qqhz" value="0"/>
-    <item time="0" type="Alpha" target="n25_qqhz" value="0"/>
     <item time="0" type="Alpha" target="n27_qqhz" value="0"/>
     <item time="0" type="Alpha" target="n28_qqhz" value="0"/>
     <item time="0" type="Alpha" target="n29_qqhz" value="0"/>
@@ -54,11 +55,9 @@
     <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="n28_qqhz" value="0.75"/>
-    <item time="17" type="Alpha" target="n24_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="19" type="Alpha" target="n3_qqhz" tween="true" startValue="0.7" endValue="1" duration="6"/>
-    <item time="20" type="Alpha" target="n25_qqhz" tween="true" startValue="0.7" endValue="1" duration="8"/>
     <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"/>

+ 72 - 0
FGUIProject/assets/EnduringGiftBox/EnduringGiftBoxUIbackups.xml

@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<component size="1080,1118">
+  <displayList>
+    <image id="n0_qqhz" name="n0" src="qqhze" fileName="images/diban.png" xy="23,260" group="n7_qqhz"/>
+    <graph id="n30_qqhz" name="holderPaoMax" xy="4,59" size="401,298" group="n7_qqhz"/>
+    <image id="n1_qqhz" name="n1" src="qqhza" fileName="images/kaikou.png" xy="37,61" group="n7_qqhz"/>
+    <image id="n3_qqhz" name="n3" src="qqhz4" fileName="images/tape.png" xy="-1,576" group="n7_qqhz"/>
+    <image id="n6_qqhz" name="n6" src="qqhzb" fileName="images/heart.png" xy="208,56" group="n7_qqhz" rotation="-0.5"/>
+    <graph id="n31_qqhz" name="holderPaoMin" xy="528,260" size="353,221" group="n7_qqhz"/>
+    <image id="n5_qqhz" name="n5" src="qqhz5" fileName="images/small_paper.png" xy="261,404" group="n7_qqhz"/>
+    <image id="n2_qqhz" name="n2" src="qqhz6" fileName="images/paper.png" xy="30,365" group="n7_qqhz"/>
+    <graph id="n29_qqhz" name="holderBaby" xy="23,-28" size="467,503" group="n7_qqhz"/>
+    <graph id="n33_qqhz" name="holderFg" xy="454,283" size="295,196" group="n7_qqhz"/>
+    <group id="n7_qqhz" name="n7" xy="-1,-28" size="1080,1105"/>
+    <image id="n27_qqhz" name="n27" src="qqhzq" fileName="images/zsx_flower1.png" xy="224,300" group="n17_qqhz"/>
+    <text id="n9_qqhz" name="txtNeed" xy="481,163" size="444,47" group="n17_qqhz" fontSize="32" color="#915e15" align="center" autoSize="none" text="是否花费20粉钻购买60体力?"/>
+    <text id="n34_qqhz" name="txtNum" xy="481,208" pivot="0.5,0" size="444,115" group="n17_qqhz" fontSize="32" color="#915e15" align="center" autoSize="none" text="体力每5分钟恢复1点&#xA;(今日剩余购买次数:8/8)"/>
+    <component id="n12_qqhz" name="btnCancel" src="qqhzs" fileName="components/BtnCancel.xml" xy="362,326" group="n17_qqhz"/>
+    <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="除了上述购买体力的途径,我们还提供了更多的优惠礼包选择"/>
+    <component id="n24_qqhz" name="curSupply" src="qqhz11" fileName="components/ComCurSupply.xml" xy="69,475" group="n26_qqhz"/>
+    <component id="n25_qqhz" name="weekSupply" src="qqhz11" fileName="components/ComCurSupply.xml" xy="69,709" group="n26_qqhz"/>
+    <group id="n26_qqhz" name="n26" xy="69,163" size="954,777"/>
+    <image id="n28_qqhz" name="btnBack" src="qqhz2" fileName="images/back.png" xy="497,1064"/>
+  </displayList>
+  <transition name="t1">
+    <item time="0" type="Alpha" target="n0_qqhz" tween="true" startValue="0" endValue="1" duration="15"/>
+    <item time="0" type="Alpha" target="n12_qqhz" value="0"/>
+    <item time="0" type="Alpha" target="n14_qqhz" value="0"/>
+    <item time="0" type="Alpha" target="n15_qqhz" value="0"/>
+    <item time="0" type="Alpha" target="n1_qqhz" value="0"/>
+    <item time="0" type="Alpha" target="n24_qqhz" value="0"/>
+    <item time="0" type="Alpha" target="n25_qqhz" value="0"/>
+    <item time="0" type="Alpha" target="n27_qqhz" value="0"/>
+    <item time="0" type="Alpha" target="n28_qqhz" value="0"/>
+    <item time="0" type="Alpha" target="n29_qqhz" value="0"/>
+    <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="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="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="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"/>
+    <item time="12" type="Alpha" target="n6_qqhz" tween="true" startValue="0.6" endValue="1" duration="9"/>
+    <item time="12" type="XY" target="n29_qqhz" tween="true" startValue="36,-5" endValue="23,-28" duration="12"/>
+    <item time="13" type="Alpha" target="n5_qqhz" tween="true" startValue="0.5" endValue="1" duration="8"/>
+    <item time="14" type="Alpha" target="n33_qqhz" tween="true" startValue="1" endValue="0.2" duration="11"/>
+    <item time="14" type="Alpha" target="n9_qqhz" tween="true" startValue="0.7" endValue="1" duration="8"/>
+    <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="n28_qqhz" value="0.75"/>
+    <item time="17" type="Alpha" target="n24_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="19" type="Alpha" target="n3_qqhz" tween="true" startValue="0.7" endValue="1" duration="6"/>
+    <item time="20" type="Alpha" target="n25_qqhz" tween="true" startValue="0.7" endValue="1" duration="8"/>
+    <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"/>
+    <item time="68" type="Visible" target="n31_qqhz" value="false"/>
+  </transition>
+</component>

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

@@ -10,7 +10,7 @@
     <component id="n28_qqhz" name="comLeftGiftBox" src="qqhz1q" fileName="components/ComLeftGiftBox.xml" xy="25,22"/>
     <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="txtWeekPromptTag" src="qqhz1p" fileName="images/lm_tb_tishi.png" xy="530,48"/>
+    <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">
       <item/>
     </list>

+ 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="购买即得"/>
-    <image id="n2_qqhz" name="n2" src="qqhz10" fileName="images/lm_tb.png" xy="56,27" group="n4_qqhz"/>
+    <loader id="n5_qqhz" name="loaIcon" xy="56,27" size="33,31" group="n4_qqhz"/>
     <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>

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

@@ -2,9 +2,9 @@
 <component size="204,188">
   <displayList>
     <image id="n0_qqhz" name="n0" src="qqhzf" fileName="images/cz_lbicon_db.png" xy="10,0" group="n7_qqhz"/>
-    <image id="n1_qqhz" name="n1" src="qqhz1n" fileName="images/hlhdjficon.png" xy="47,42" size="120,104" group="n7_qqhz"/>
+    <loader id="n9_qqhz" name="loaIcon" xy="47,42" size="120,104" group="n7_qqhz"/>
     <component id="n6_qqhz" name="comDiscount" src="qqhz1o" fileName="components/ComDiscount.xml" xy="0,2" group="n7_qqhz"/>
-    <component id="n8_qqhz" name="n8" src="qqhz1r" fileName="components/ComGouMaiGetText.xml" xy="10,127" group="n7_qqhz"/>
+    <component id="n8_qqhz" name="comGouMaiGetText" src="qqhz1r" fileName="components/ComGouMaiGetText.xml" xy="10,127" group="n7_qqhz"/>
     <group id="n7_qqhz" name="n7" xy="0,0" size="204,186"/>
   </displayList>
 </component>

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

@@ -33,7 +33,7 @@
     <component id="qqhzy" name="BtnBuy.xml" path="/components/" exported="true"/>
     <component id="qqhzz" name="BtnBuyWeek.xml" path="/components/" exported="true"/>
     <image id="qqhz10" name="lm_tb.png" path="/images/"/>
-    <component id="qqhz11" name="ComCurSupply.xml" path="/components/" exported="true"/>
+    <component id="qqhz11" name="ComCurSupplyItem.xml" path="/components/" exported="true"/>
     <image id="qqhz1a" name="wpk_db_2.png" path="/images/"/>
     <image id="qqhz1b" name="wpk_sz_db2.png" path="/images/"/>
     <image id="qqhz1c" name="txz_tb_ylq.png" path="/images/"/>
@@ -45,6 +45,7 @@
     <image id="qqhz1p" name="lm_tb_tishi.png" path="/images/" exported="true"/>
     <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="/"/>
   </resources>
   <publish name="" path="../GameClient/Assets/ResIn/UI/EnduringGiftBox" packageCount="2" genCode="true" extractAlpha="true"/>
 </packageDescription>

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Constant/ConstStoreSubId.cs

@@ -14,6 +14,7 @@ namespace GFGGame
         public const int STORE_EXCHANGE_LEAGUE = 1;//雅集商城
         public const int STORE_ARENA_ITEM = 0;//竞技场
         public const int FU_ZHUANG_DIAN = 0;//服装店
-
+        public const int ENDURING_GIFT_BOX_POWER = 0;//常驻礼包-体力
+        public const int ENDURING_GIFT_BOX_GOLD = 1;//常驻礼包-金币
     }
 }

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

@@ -9,7 +9,7 @@ namespace GFGGame
         public const int STORE_ARENA = 5;//商城-竞技场
 
         public const int FU_ZHUANG_DIAN = 101;//服装店
-
-
+        
+        public const int ENDURING_GIFT_BOX = 105;//常驻礼包
     }
 }

+ 3 - 32
GameClient/Assets/Game/HotUpdate/Data/EnduringGiftBoxDataManager.cs

@@ -8,25 +8,12 @@ namespace GFGGame
 {
     public class EnduringGiftBoxDataManager
     {
-        //礼包配置id,状态:0未购买,1未领取,2已领取
+        //礼包配置id,状态:根据常量 EnduringGiftBoxBuyStatus
         public static Dictionary<int, int> GiftBoxStateDic = new Dictionary<int, int>();
-
-        //礼包配置id,剩余购买次数
-        public static Dictionary<int, int> GiftBoxResidueNumDic = new Dictionary<int, int>();
-
-        //当天体力剩余购买次数
-        public static int PowerResidueNum = 0;
-
-        //当天金币剩余购买次数
-        public static int GoldResidueNum = 0;
-
-
+        
         public static void InitData()
         {
-            GiftBoxResidueNumDic.Clear();
-            GiftBoxResidueNumDic.Clear();
-            PowerResidueNum = 0;
-            GoldResidueNum = 0;
+            GiftBoxStateDic.Clear();
         }
 
         public static void UpdateGiftBoxState(int giftCfgId, int state)
@@ -38,21 +25,5 @@ namespace GFGGame
         {
             GiftBoxStateDic[giftCfgId] = num;
         }
-
-        public static void UpdatePowerResidueNum(int num)
-        {
-            PowerResidueNum = num;
-        }
-
-        public static void UpdateGoldResidueNum(int num)
-        {
-            GoldResidueNum = num;
-        }
-
-        public static void UpdateGiftBoxStateAndResidueNum(int giftCfgId, int state, int num)
-        {
-            GiftBoxStateDic[giftCfgId] = state;
-            GiftBoxStateDic[giftCfgId] = num;
-        }
     }
 }

+ 10 - 10
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComCurSupply.cs → GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComCurSupplyItem.cs

@@ -4,7 +4,7 @@ using FairyGUI;
 
 namespace UI.EnduringGiftBox
 {
-    public partial class UI_ComCurSupply
+    public partial class UI_ComCurSupplyItem
     {
         public GComponent target;
         public GTextField m_txtLrc;
@@ -14,15 +14,15 @@ namespace UI.EnduringGiftBox
         public UI_ComLeftGiftBox m_comLeftGiftBox;
         public GTextField m_txtTitle;
         public GTextField m_txtWeekPrompt;
-        public GImage m_txtWeekPromptTag;
+        public GImage m_icoWeekPromptTag;
         public const string URL = "ui://bdi1qe15qqhz11";
         public const string PACKAGE_NAME = "EnduringGiftBox";
-        public const string RES_NAME = "ComCurSupply";
-        private static UI_ComCurSupply _proxy;
+        public const string RES_NAME = "ComCurSupplyItem";
+        private static UI_ComCurSupplyItem _proxy;
 
-        public static UI_ComCurSupply Create(GObject gObject = null)
+        public static UI_ComCurSupplyItem Create(GObject gObject = null)
         {
-            var ui = new UI_ComCurSupply();
+            var ui = new UI_ComCurSupplyItem();
             if(gObject == null)
             	ui.target =  (GComponent)UIPackage.CreateObject(PACKAGE_NAME, RES_NAME);
             else
@@ -31,11 +31,11 @@ namespace UI.EnduringGiftBox
             return ui;
         }
 
-        public static UI_ComCurSupply Proxy(GObject gObject = null)
+        public static UI_ComCurSupplyItem Proxy(GObject gObject = null)
         {
             if(_proxy == null)
             {
-                _proxy = new UI_ComCurSupply();
+                _proxy = new UI_ComCurSupplyItem();
             }
             var ui = _proxy;
             if(gObject == null)
@@ -69,7 +69,7 @@ namespace UI.EnduringGiftBox
             m_comLeftGiftBox = (UI_ComLeftGiftBox)UI_ComLeftGiftBox.Create(comp.GetChild("comLeftGiftBox"));
             m_txtTitle = (GTextField)comp.GetChild("txtTitle");
             m_txtWeekPrompt = (GTextField)comp.GetChild("txtWeekPrompt");
-            m_txtWeekPromptTag = (GImage)comp.GetChild("txtWeekPromptTag");
+            m_icoWeekPromptTag = (GImage)comp.GetChild("icoWeekPromptTag");
         }
         public void Dispose(bool disposeTarget = false)
         {
@@ -83,7 +83,7 @@ namespace UI.EnduringGiftBox
             m_comLeftGiftBox = null;
             m_txtTitle = null;
             m_txtWeekPrompt = null;
-            m_txtWeekPromptTag = null;
+            m_icoWeekPromptTag = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 1 - 1
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComCurSupply.cs.meta → GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComCurSupplyItem.cs.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: e850835055d519b48b4422721ad1ea0b
+guid: 092a2512d4c0ea84ca20a4a5ebd2a3e8
 MonoImporter:
   externalObjects: {}
   serializedVersion: 2

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

@@ -7,6 +7,7 @@ namespace UI.EnduringGiftBox
     public partial class UI_ComGouMaiGetText
     {
         public GComponent target;
+        public GLoader m_loaIcon;
         public GTextField m_txtGetGold;
         public const string URL = "ui://bdi1qe15qqhz1r";
         public const string PACKAGE_NAME = "EnduringGiftBox";
@@ -55,10 +56,12 @@ namespace UI.EnduringGiftBox
 
         private void Init(GComponent comp)
         {
+            m_loaIcon = (GLoader)comp.GetChild("loaIcon");
             m_txtGetGold = (GTextField)comp.GetChild("txtGetGold");
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_loaIcon = null;
             m_txtGetGold = null;
             if(disposeTarget && target != null)
             {

+ 7 - 0
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_ComLeftGiftBox.cs

@@ -7,7 +7,9 @@ namespace UI.EnduringGiftBox
     public partial class UI_ComLeftGiftBox
     {
         public GComponent target;
+        public GLoader m_loaIcon;
         public UI_ComDiscount m_comDiscount;
+        public UI_ComGouMaiGetText m_comGouMaiGetText;
         public const string URL = "ui://bdi1qe15qqhz1q";
         public const string PACKAGE_NAME = "EnduringGiftBox";
         public const string RES_NAME = "ComLeftGiftBox";
@@ -55,12 +57,17 @@ namespace UI.EnduringGiftBox
 
         private void Init(GComponent comp)
         {
+            m_loaIcon = (GLoader)comp.GetChild("loaIcon");
             m_comDiscount = (UI_ComDiscount)UI_ComDiscount.Create(comp.GetChild("comDiscount"));
+            m_comGouMaiGetText = (UI_ComGouMaiGetText)UI_ComGouMaiGetText.Create(comp.GetChild("comGouMaiGetText"));
         }
         public void Dispose(bool disposeTarget = false)
         {
+            m_loaIcon = null;
             m_comDiscount.Dispose();
             m_comDiscount = null;
+            m_comGouMaiGetText.Dispose();
+            m_comGouMaiGetText = null;
             if(disposeTarget && target != null)
             {
                 target.RemoveFromParent();

+ 12 - 14
GameClient/Assets/Game/HotUpdate/FairyGUI/GenCode/EnduringGiftBox/UI_EnduringGiftBoxUI.cs

@@ -11,12 +11,12 @@ namespace UI.EnduringGiftBox
         public GGraph m_holderPaoMin;
         public GGraph m_holderBaby;
         public GGraph m_holderFg;
-        public GTextField m_txtPrompt;
+        public GTextField m_txtNeed;
+        public GTextField m_txtNum;
         public GButton m_btnCancel;
-        public GButton m_btnSub;
+        public GButton m_btnSure;
         public GTextField m_txtPromptExt;
-        public UI_ComCurSupply m_curSupply;
-        public UI_ComCurSupply m_weekSupply;
+        public GList m_list;
         public GImage m_btnBack;
         public Transition m_t1;
         public const string URL = "ui://bdi1qe15qqhz1";
@@ -70,12 +70,12 @@ namespace UI.EnduringGiftBox
             m_holderPaoMin = (GGraph)comp.GetChild("holderPaoMin");
             m_holderBaby = (GGraph)comp.GetChild("holderBaby");
             m_holderFg = (GGraph)comp.GetChild("holderFg");
-            m_txtPrompt = (GTextField)comp.GetChild("txtPrompt");
+            m_txtNeed = (GTextField)comp.GetChild("txtNeed");
+            m_txtNum = (GTextField)comp.GetChild("txtNum");
             m_btnCancel = (GButton)comp.GetChild("btnCancel");
-            m_btnSub = (GButton)comp.GetChild("btnSub");
+            m_btnSure = (GButton)comp.GetChild("btnSure");
             m_txtPromptExt = (GTextField)comp.GetChild("txtPromptExt");
-            m_curSupply = (UI_ComCurSupply)UI_ComCurSupply.Create(comp.GetChild("curSupply"));
-            m_weekSupply = (UI_ComCurSupply)UI_ComCurSupply.Create(comp.GetChild("weekSupply"));
+            m_list = (GList)comp.GetChild("list");
             m_btnBack = (GImage)comp.GetChild("btnBack");
             m_t1 = comp.GetTransition("t1");
         }
@@ -85,14 +85,12 @@ namespace UI.EnduringGiftBox
             m_holderPaoMin = null;
             m_holderBaby = null;
             m_holderFg = null;
-            m_txtPrompt = null;
+            m_txtNeed = null;
+            m_txtNum = null;
             m_btnCancel = null;
-            m_btnSub = null;
+            m_btnSure = null;
             m_txtPromptExt = null;
-            m_curSupply.Dispose();
-            m_curSupply = null;
-            m_weekSupply.Dispose();
-            m_weekSupply = null;
+            m_list = null;
             m_btnBack = null;
             m_t1 = null;
             if(disposeTarget && target != null)

+ 153 - 19
GameClient/Assets/Game/HotUpdate/Views/EnduringGiftBox/EnduringGiftBoxView.cs

@@ -1,8 +1,7 @@
 using System;
 using System.Collections.Generic;
-using ET;
+using System.Linq;
 using FairyGUI;
-using UI.CommonGame;
 using UI.EnduringGiftBox;
 using UnityEngine;
 
@@ -12,59 +11,194 @@ namespace GFGGame
     {
         private UI_EnduringGiftBoxUI _ui;
 
+        private int _itemId; //道具id,该页面目前只给:体力,金币使用
+        private int _count; //本次购买次数
+        private int _buyTimes = 0; //已购次数
+
+        private Action _onSuccess;
+        private int _maxTimes = 0;
+        private string _message = "";
+        private List<ShopCfg> _shopCfgList = new List<ShopCfg>();
+
         public override void Dispose()
         {
-            base.Dispose();
-            
             if (_ui != null)
             {
                 _ui.Dispose();
                 _ui = null;
             }
+
+            BuyConfirmController.Dispose();
+            base.Dispose();
         }
 
         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; //先这样写,后面再改
+
+            _ui.m_btnSure.onClick.Add(OnClickBtnSure);
+            _ui.m_btnCancel.onClick.Add(OnClickBtnCancel);
         }
 
-        protected override void AddEventListener()
+        public void SetParams(int itemId, int count, Action onSuccess, string message = "")
         {
-            base.AddEventListener();
+            _itemId = itemId;
+            _count = count;
+
+            _onSuccess = onSuccess;
+            _message = message;
         }
 
         protected override void OnShown()
         {
             base.OnShown();
-
             UpdateView();
         }
 
-        protected override void OnHide()
+        private void UpdateView()
         {
+            //--------老逻辑
+            _buyTimes = ItemDataManager.GetItemExchangeTimes(_itemId);
+
+            ItemExchangeCfgArray.Instance.GetMoneyIdAndNum(_itemId, _buyTimes, _count, out int costId, out int coustNum,
+                out int buyNum);
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_itemId);
+            ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(costId);
+            _ui.m_txtNeed.text = string.Format("是否花费{0}{1} 购买{2}{3}", coustNum, costCfg.name, buyNum, itemCfg.name);
 
-            base.OnHide();
+            _ui.m_txtNum.text = "";
+            _maxTimes = ItemExchangeCfgArray.Instance.GetCfg(_itemId).maxLimit;
+            if (_maxTimes != 0)
+            {
+                _ui.m_txtNum.text = string.Format("今日剩余购买次数{0}/{1}", _maxTimes - _buyTimes, _maxTimes);
+            }
+
+            if (_message != "")
+            {
+                _ui.m_txtNum.text = _message;
+            }
+
+            //----新加逻辑
+            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();
+            }
+            else
+            {
+                //金币礼包
+                _shopCfgList = ShopCfgArray.Instance
+                    .GetCfgsBymenu1Andmenu2(ConstStoreTabId.ENDURING_GIFT_BOX, ConstStoreSubId.ENDURING_GIFT_BOX_GOLD)
+                    .OrderBy(a => a.refreshType).ToList();
+            }
+
+            _ui.m_txtPromptExt.text = string.Format("除了上述购买{0}的途径,我们还提供了更多的优惠礼包选择", itemCfg.name);
+            _ui.m_list.itemRenderer = ListItemRender;
         }
 
-        protected override void RemoveEventListener()
+
+        private void ListItemRender(int index, GObject obj)
         {
-            base.RemoveEventListener();
+            ShopCfg shopCfg = _shopCfgList[index];
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(shopCfg.itemId); //购买的物品-礼包
+            UI_ComCurSupplyItem item = UI_ComCurSupplyItem.Proxy(obj);
+            item.target.data = shopCfg;
+
+            //返利包
+            item.m_txtTitle.text = itemCfg.name;
+            item.m_txtWeekPrompt.visible = false;
+            item.m_icoWeekPromptTag.visible = false;
+            if (itemCfg.param2Arr[0] != 0)
+            {
+                item.m_txtWeekPrompt.visible = true;
+                item.m_icoWeekPromptTag.visible = true;
+                item.m_txtWeekPrompt.text = string.Format("连续{0}天每日获得", itemCfg.param2Arr[0]);
+            }
+
+            var remainBuyNum = shopCfg.maxBuyNum - ShopDataManager.Instance.GetGoodsBuyNumById(shopCfg.id);
+            item.m_comLeftGiftBox.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
+            if (shopCfg.refreshType == RefreshType.DAY) //也可以换成人民币来做条件
+            {
+                //日刷
+                item.m_comLeftGiftBox.m_comDiscount.target.visible = true;
+                item.m_comLeftGiftBox.m_comDiscount.m_txtDiscountNum.text = "1.5折"; //之后再计算赋值
+                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);
+            }
+            else
+            {
+                //周刷
+                item.m_comLeftGiftBox.m_comDiscount.target.visible = false;
+                item.m_comLeftGiftBox.m_comGouMaiGetText.target.visible = true;
+                var itemArr = itemCfg.itemsArr[0];
+                ItemCfg getItemCfg = ItemCfgArray.Instance.GetCfg(itemArr[0]); //及时获得的物品,读取第一个显示ICON
+                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}天", "");//剩余天数,应该是存储在数值组件上的,下周一过来再找找 然后赋值吧
+                //领取按钮的渲染,后端加个组件来记录着领取状态
+            }
         }
 
-        private void UpdateView()
+        private async void OnClickBtnSure()
         {
-            
+            if (_maxTimes > 0 && (_buyTimes + _count) > _maxTimes)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("购买次数不足");
+                return;
+            }
+
+            ItemExchangeCfgArray.Instance.GetMoneyIdAndNum(_itemId, _buyTimes, _count, out int costId, out int coustNum,
+                out int buyNum);
 
+            Debug.Log(costId + "数量:" + ItemDataManager.GetItemNum(costId));
+            if (ItemDataManager.GetItemNum(costId) < coustNum)
+            {
+                ItemCfg costCfg = ItemCfgArray.Instance.GetCfg(costId);
+                if (_itemId == ConstItemID.DIAMOND_PURPLE)
+                {
+                    PromptController.Instance.ShowFloatTextPrompt(string.Format("{0}不足,请前往商城选购", costCfg.name));
+                }
+                else
+                {
+                    AlertUI.Show(costCfg.name + "不足,是否前往购买?").SetLeftButton(true).SetRightButton(true, "确认",
+                        (AlertWindow.AlertCallback)((object data) =>
+                        {
+                            long costNeedCount = coustNum - ItemDataManager.GetItemNum(costId);
+                            BuyItemConteoller.Show(costId, costNeedCount, ConstBuyType.TYPE_ITEM, null, true, true,
+                                GameConst.MAX_COUNT_TO_BUY_DIAMOND_RED);
+                        }));
+                    OnClickBtnCancel();
+                }
+
+                return;
+            }
+
+            bool result = await ItemExchangeSProxy.ItemExchange(_itemId, _count);
+
+            if (result)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("购买成功", MessageType.SUCCESS);
+                if (_onSuccess != null)
+                {
+                    _onSuccess();
+                }
+            }
+
+            this.Hide();
+        }
+
+        private void OnClickBtnCancel()
+        {
+            this.Hide();
         }
-        
-        
-        
     }
 }

二進制
GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_atlas0!a.png


二進制
GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_atlas0.png


二進制
GameClient/Assets/ResIn/UI/EnduringGiftBox/EnduringGiftBox_fui.bytes