zhaoyang %!s(int64=2) %!d(string=hai) anos
pai
achega
4926d7df82

+ 2 - 2
FGUIProject/assets/Store/GiftBagStoreUI.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="1080,1920">
+<component size="1080,1920" opaque="false">
   <displayList>
-    <list id="n0_l500" name="list" xy="22,495" size="1036,1362" layout="flow_hz" overflow="scroll" colGap="30" defaultItem="ui://p9mtgheol500tbe" align="center" vAlign="middle" autoClearItems="true">
+    <list id="n0_l500" name="list" xy="74,495" size="932,1362" layout="flow_hz" overflow="scroll" colGap="30" defaultItem="ui://p9mtgheol500tbe" autoClearItems="true">
       <relation target="" sidePair="bottomext-bottom"/>
       <item/>
       <item/>

+ 3 - 3
FGUIProject/assets/Store/components/ListGiftItem.xml

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="460,270">
-  <controller name="c1" alias="礼包购买状态" pages="0,,1," selected="1">
+<component size="460,270" overflow="hidden">
+  <controller name="c1" alias="礼包购买状态" pages="0,,1," selected="0">
     <remark page="0" value="可购买"/>
     <remark page="1" value="已售罄"/>
   </controller>
@@ -29,7 +29,7 @@
       <gearDisplay controller="c1" pages="1"/>
       <gearDisplay2 controller="c2" pages="1" condition="0"/>
     </text>
-    <image id="n45_t8xr" name="n45" src="10not1u" fileName="images/sc_kuangand.png" xy="-7,-29">
+    <image id="n45_t8xr" name="n45" src="10not1u" fileName="images/sc_kuangand.png" xy="-7,-61" size="474,379">
       <gearDisplay controller="c1" pages="1"/>
       <gearDisplay2 controller="c2" pages="0" condition="1"/>
     </image>

+ 4 - 2
FGUIProject/assets/Store/components/ListShopItem.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<component size="290,455">
+<component size="290,455" overflow="hidden">
   <controller name="c1" alias="礼包购买状态" pages="0,,1," selected="0">
     <remark page="0" value="可购买"/>
     <remark page="1" value="已售罄"/>
@@ -26,10 +26,12 @@
       <gearDisplay controller="c2" pages="0"/>
     </text>
     <text id="n57_l500" name="n57" xy="93,157" size="112,49" fontSize="36" color="#a59f8f" align="center" text="已售罄">
-      <gearDisplay controller="c2" pages="1"/>
+      <gearDisplay controller="c1" pages="1"/>
+      <gearDisplay2 controller="c2" pages="1" condition="0"/>
     </text>
     <image id="n45_t8xr" name="n45" src="10not1u" fileName="images/sc_kuangand.png" xy="0,-72" size="291,600">
       <gearDisplay controller="c1" pages="1"/>
+      <gearDisplay2 controller="c2" pages="0" condition="1"/>
     </image>
     <component id="n53_l500" name="btnBuy" src="l500tbb" fileName="components/Button5.xml" xy="71,390"/>
     <image id="n55_l500" name="n55" src="fqortau" fileName="imagesNew/sc_xian.png" xy="27,119" size="236,4"/>

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

@@ -3,8 +3,8 @@ namespace GFGGame
     public class ConstStoreTabId
     {
         public const int STORE_CHARGE = 1;//商城-充值
-        public const int STORE_GIFT_BAG = 2;//商城-礼包
-        public const int STORE_MONTH_CARD = 3;//商城-月卡
+        public const int STORE_MONTH_CARD = 2;//商城-月卡
+        public const int STORE_GIFT_BAG = 3;//商城-礼包
         public const int STORE_EXCHANGE = 4;//商城-兑换
         public const int STORE_ARENA = 5;//商城-竞技场
 

+ 28 - 20
GameClient/Assets/Game/HotUpdate/Data/ShopDataManager.cs

@@ -162,23 +162,24 @@ namespace GFGGame
 
         public List<GiftBagCfg> GetGiftBagCfgs()
         {
-            List<GiftBagCfg> giftBagCfgs = new List<GiftBagCfg>();
+            // List<GiftBagCfg> giftBagCfgs = new List<GiftBagCfg>();
 
-            List<GiftBagCfg> noneGiftBagCfgs = GetNoneGiftCfg();
-            giftBagCfgs = giftBagCfgs.Concat(noneGiftBagCfgs).ToList<GiftBagCfg>();
+            // List<GiftBagCfg> noneGiftBagCfgs = GetNoneGiftCfg();
+            // giftBagCfgs = giftBagCfgs.Concat(noneGiftBagCfgs).ToList<GiftBagCfg>();
 
-            GiftBagCfg StoryLvGiftCfg = GetStoryLvGiftCfg();
-            if (StoryLvGiftCfg != null) giftBagCfgs.Add(StoryLvGiftCfg);
-            GiftBagCfg RoleLvGiftCfg = GetRoleLvGiftCfg();
-            if (RoleLvGiftCfg != null) giftBagCfgs.Add(RoleLvGiftCfg);
-            giftBagCfgs = RemoveNotOpenCfg(giftBagCfgs);
-            SortGiftBagCfgs(giftBagCfgs);
-            return giftBagCfgs;
+            // GiftBagCfg StoryLvGiftCfg = GetStoryLvGiftCfg();
+            // if (StoryLvGiftCfg != null) giftBagCfgs.Add(StoryLvGiftCfg);
+            // GiftBagCfg RoleLvGiftCfg = GetRoleLvGiftCfg();
+            // if (RoleLvGiftCfg != null) giftBagCfgs.Add(RoleLvGiftCfg);
+            // giftBagCfgs = RemoveNotOpenCfg(giftBagCfgs);
+            // SortGiftBagCfgs(giftBagCfgs);
+            // return giftBagCfgs;
+            return null;
         }
 
-        private List<GiftBagCfg> SortGiftBagCfgs(List<GiftBagCfg> giftBagCfgs)
+        public List<ShopCfg> SortGiftBagCfgs(List<ShopCfg> shopCfgs)
         {
-            giftBagCfgs.Sort((GiftBagCfg a, GiftBagCfg b) =>
+            shopCfgs.Sort((ShopCfg a, ShopCfg b) =>
             {
 
                 //未售罄的>未解锁>已售罄的
@@ -205,16 +206,23 @@ namespace GFGGame
 
 
 
-                int descA = a.desc == "" ? 0 : int.Parse(a.desc);
-                int descB = b.desc == "" ? 0 : int.Parse(b.desc);
-                if (descA != descB) return descA - descB;
+                int disCountA = GetShopGoodsDiscount(a.id);
+                int disCountB = GetShopGoodsDiscount(b.id);
+                if (disCountA != disCountB) return disCountA - disCountB;
 
                 if (a.price != b.price) return a.price - b.price;
 
 
                 return 0;
             });
-            return giftBagCfgs;
+            return shopCfgs;
+        }
+        //获取商品折扣百分比
+        public int GetShopGoodsDiscount(int goodsId)
+        {
+            ShopCfg shopCfg = ShopCfgArray.Instance.GetCfg(goodsId);
+            if (shopCfg.price == 0) return 0;
+            return (int)(((double)shopCfg.originalPrice / (double)shopCfg.price) * 100);
         }
         private List<GiftBagCfg> RemoveNotOpenCfg(List<GiftBagCfg> giftBagCfgs)
         {
@@ -311,14 +319,14 @@ namespace GFGGame
             }
         }
         /// <summary>
-        /// 根据礼包id获取下架时间
+        /// 根据商品id获取下架时间
         /// </summary>
-        /// <param name="giftId"></param>
+        /// <param name="goodsId"></param>
         /// <returns></returns>
-        public string GetEndTime(int giftId)
+        public string GetEndTime(int goodsId)
         {
             long endTime = 0;
-            GiftBagCfg cfg = GiftBagCfgArray.Instance.GetCfg(giftId);
+            ShopCfg cfg = ShopCfgArray.Instance.GetCfg(goodsId);
             if (cfg.endTime == "") return "";
 
             endTime = TimeUtil.DateTimeToTimestamp(cfg.endTime);

+ 2 - 2
GameClient/Assets/Game/HotUpdate/Data/ShopViewManager.cs

@@ -55,12 +55,12 @@ namespace GFGGame
             item.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
 
             item.m_grpDiscount.visible = shopCfg.price < shopCfg.originalPrice;
-            item.m_txtDesc.text = ((double)(shopCfg.originalPrice / shopCfg.price) * 100).ToString();
+            item.m_txtDesc.text = shopCfg.price <= 0 ? "" : ShopDataManager.Instance.GetShopGoodsDiscount(shopCfg.id).ToString();
 
             item.m_txtEndTime.SetVar("value", ShopDataManager.Instance.GetEndTime(shopCfg.id)).FlushVars();
             item.m_txtEndTime.visible = shopCfg.endTime != "";
 
-            item.m_c2.selectedIndex = ShopDataManager.Instance.GetShopGoodsStateById(shopCfg.id) ? 0 : 1;
+            item.m_c2.selectedIndex = ShopDataManager.Instance.GetShopGoodsStateById(shopCfg.id) ? 1 : 0;
             if (shopCfg.lockType == LockType.STORY_LV)
             {
                 StoryLevelCfg storyLevelCfg = StoryLevelCfgArray.Instance.GetCfg(shopCfg.storyLevelId);

+ 1 - 0
GameClient/Assets/Game/HotUpdate/Views/Store/GiftBagStoreView.cs

@@ -42,6 +42,7 @@ namespace GFGGame
             base.OnShown();
             int menu2 = (int)this.viewData;
             _shopCfgs = ShopCfgArray.Instance.GetCfgsBymenu1Andmenu2(ConstStoreTabId.STORE_GIFT_BAG, menu2);
+            _shopCfgs = ShopDataManager.Instance.SortGiftBagCfgs(_shopCfgs);
             _ui.m_list.numItems = _shopCfgs.Count;
         }
 

+ 2 - 1
GameClient/Assets/Game/HotUpdate/Views/Store/StoreView.cs

@@ -152,6 +152,7 @@ namespace GFGGame
             GObject obj = context.data as GObject;
             int index = (int)obj.data;
             if (index < 0) return;
+            OnListSubTabChange(index);
         }
         private void OnListSubTabChange(int index)
         {
@@ -167,7 +168,7 @@ namespace GFGGame
             ViewManager.Hide(_curViewName);
             if (!string.IsNullOrEmpty(viewName) && viewName != "“”")
             {
-                ViewManager.Show("GFGGame." + viewName, tabCfg.subTabArr[index][1]);
+                ViewManager.Show("GFGGame." + viewName, int.Parse(tabCfg.subTabArr[index][1]));
             }
             _curSubTabIndex = index;
             _curViewName = "GFGGame." + viewName;

BIN=BIN
GameClient/Assets/ResIn/Config/excelConfig.sqlite.bytes


BIN=BIN
GameClient/Assets/ResIn/UI/Store/Store_fui.bytes