فهرست منبع

vip会员界面增加列表虚化效果

huangxiaoyue 1 سال پیش
والد
کامیت
2608d3f91b

+ 15 - 7
GameClient/Assets/Game/HotUpdate/Views/Store/StoreChargeAddUpView.cs

@@ -120,6 +120,7 @@ namespace GFGGame
             if (item.m_listGiftBag.data == null)
             {
                 item.m_listGiftBag.itemRenderer = ListRewardItemRender;
+                item.m_listGiftBag.onClickItem.Add(OnListItemClick);
             }
             item.m_listGiftBag.data = lastVipCfg.bonusOnceArr;
             item.m_listGiftBag.numItems = lastVipCfg.bonusOnceArr.Length;
@@ -162,14 +163,14 @@ namespace GFGGame
         private void ListRewardItemRender(int index, GObject obj)
         {
             int[][] rewards = (int[][])obj.parent.data;
-
-            if (obj.data == null)
-            {
-                obj.data = new ItemView(obj as GComponent);
-            }
+            UI_ComItem item = UI_ComItem.Proxy(obj);
             ItemData itemData = ItemUtil.createItemData(rewards[index]);
-            (obj.data as ItemView).SetData(itemData);
-            (obj.data as ItemView).ChangeTxtCountStyle();
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemData.id);
+            item.m_txtCount.text = itemData.num.ToString();
+            item.target.data = itemCfg;
+            item.m_QualityType.selectedIndex = itemData.rarity - 1;
+            item.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
+            UI_ComItem.ProxyEnd();
         }
 
         private void OnBtnShowClick(EventContext context)
@@ -267,5 +268,12 @@ namespace GFGGame
             RedDotController.Instance.SetComRedDot(_ui.m_btnRight, rightRed);
 
         }
+
+        private void OnListItemClick(EventContext context)
+        {
+            GComponent comItem = (context.data as GComponent);
+            ItemCfg itemCfg = comItem.data as ItemCfg;
+            GoodsItemTipsController.ShowItemTips(itemCfg.id);
+        }
     }
 }

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

@@ -40,7 +40,7 @@ namespace GFGGame
         {
             base.OnShown();
             _vipLv = (int)this.viewData;
-            VipCfg vipCfg = VipCfgArray.Instance.dataArray[_vipLv + 1];
+            VipCfg vipCfg = VipCfgArray.Instance.dataArray[_vipLv];
             _ui.m_txtWeekGiftBag.SetVar("value", vipCfg.id.ToString()).FlushVars();
             _ui.m_listWeekGiftBag.data = vipCfg.bonusWeekArr;
             _ui.m_listWeekGiftBag.numItems = vipCfg.bonusWeekArr.Length;

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