| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 | 
							- using FairyGUI;
 
- namespace GFGGame
 
- {
 
-     public class ItemView
 
-     {
 
-         private GComponent _obj;
 
-         private GLoader _loaIcon;
 
-         private GLoader _loaRarity;
 
-         private GTextField _txtName;
 
-         private GTextField _txtCount;
 
-         private GTextField _txtHasCount;
 
-         private GImage _imgGot;
 
-         private GImage _imgNotHas;
 
-         private GImage _imgHas;
 
-         private GImage _imgShouTong;
 
-         // private GGroup _grpCount;
 
-         private bool _showTips = true;
 
-         private ItemData _itemData;
 
-         public ItemView(GComponent obj)
 
-         {
 
-             _obj = obj;
 
-             _loaIcon = obj.GetChild("loaIcon") as GLoader;
 
-             _loaRarity = obj.GetChild("loaRarity") as GLoader;
 
-             _txtName = obj.GetChild("txtName") as GTextField;
 
-             _txtCount = obj.GetChild("txtCount") as GTextField;
 
-             _txtHasCount = obj.GetChild("txtHasCount") as GTextField;
 
-             _imgGot = obj.GetChild("imgGot") as GImage;
 
-             _imgNotHas = obj.GetChild("imgNotHas") as GImage;
 
-             _imgHas = obj.GetChild("imgHas") as GImage;
 
-             _imgShouTong = obj.GetChild("imgShowTong") as GImage;
 
-             // _grpCount = obj.GetChild("grpCount") as GGroup;
 
-             // AddClickListener();
 
-             _obj.onClick.Remove(AddClickListener);
 
-             _obj.onClick.Add(AddClickListener);
 
-         }
 
-         public void Dispose()
 
-         {
 
-             _obj.onClick.Remove(AddClickListener);
 
-             _obj.Dispose();
 
-         }
 
-         private void AddClickListener()
 
-         {
 
-             if (!ShowTips) return;
 
-             GoodsItemTipsController.ShowItemTips(_itemData.id);
 
-         }
 
-         public void SetData(ItemData itemData)
 
-         {
 
-             _itemData = itemData;
 
-             UpdateView();
 
-         }
 
-         private void UpdateView()
 
-         {
 
-             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_itemData.id);
 
-             _loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
 
-             RarityIconController.UpdateRarityIcon(_loaRarity, _itemData.id, false);
 
-             _imgGot.visible = false;
 
-             _imgNotHas.visible = false;
 
-             _imgHas.visible = false;
 
-             _imgShouTong.visible = false;
 
-             // _grpCount.visible = true;
 
-             _showTips = true;
 
-             _txtName.text = itemCfg.name;
 
-             _txtCount.SetVar("count", _itemData.num.ToString()).FlushVars();
 
-             _txtHasCount.SetVar("count", "" + ItemDataManager.GetItemNum(_itemData.id)).FlushVars();
 
-         }
 
-         public ItemData ItemData
 
-         {
 
-             get
 
-             {
 
-                 return _itemData;
 
-             }
 
-         }
 
-         /// <summary>
 
-         /// “已领取”显示状态
 
-         /// </summary>
 
-         /// <value></value>
 
-         public bool ImgGotVisible
 
-         {
 
-             get
 
-             {
 
-                 return _imgGot.visible;
 
-             }
 
-             set
 
-             {
 
-                 _imgGot.visible = value;
 
-             }
 
-         }
 
-         /// “已获得”显示状态
 
-         /// </summary>
 
-         /// <value></value>
 
-         public bool ImgHasVisible
 
-         {
 
-             get
 
-             {
 
-                 return _imgHas.visible;
 
-             }
 
-             set
 
-             {
 
-                 _imgHas.visible = value;
 
-             }
 
-         }
 
-         /// <summary>
 
-         /// “未获得”显示状态
 
-         /// </summary>
 
-         /// <value></value>
 
-         public bool ImgNotGotVisible
 
-         {
 
-             get
 
-             {
 
-                 return _imgNotHas.visible;
 
-             }
 
-             set
 
-             {
 
-                 _imgNotHas.visible = value;
 
-             }
 
-         }
 
-         /// <summary>
 
-         /// <summary>
 
-         /// "首通奖励"显示状态
 
-         /// </summary>
 
-         /// <value></value>
 
-         public bool ImgShouTongVisable
 
-         {
 
-             get
 
-             {
 
-                 return _imgShouTong.visible;
 
-             }
 
-             set
 
-             {
 
-                 _imgShouTong.visible = value;
 
-             }
 
-         }
 
-         /// <summary>
 
-         /// 显示拥有数量
 
-         /// </summary>
 
-         /// <value></value>
 
-         public bool ShowHasCount
 
-         {
 
-             get
 
-             {
 
-                 return _txtHasCount.visible;
 
-             }
 
-             set
 
-             {
 
-                 _txtHasCount.visible = value;
 
-             }
 
-         }
 
-         /// <summary>
 
-         /// 显示名字
 
-         /// </summary>
 
-         /// <value></value>
 
-         public bool ShowName
 
-         {
 
-             set
 
-             {
 
-                 _txtName.visible = value;
 
-             }
 
-         }
 
-         /// <summary>
 
-         /// 显示稀有度
 
-         /// </summary>
 
-         /// <value></value>
 
-         public bool ShowRarity
 
-         {
 
-             set
 
-             {
 
-                 _loaRarity.visible = value;
 
-             }
 
-         }
 
-         // /// <summary>
 
-         // /// 显示数量
 
-         // /// </summary>
 
-         // /// <value></value>
 
-         // public bool ShowCount
 
-         // {
 
-         //     set
 
-         //     {
 
-         //         _grpCount.visible = value;
 
-         //     }
 
-         // }
 
-         /// <summary>
 
-         /// 展示详情tips
 
-         /// </summary>
 
-         /// <value></value>
 
-         public bool ShowTips
 
-         {
 
-             get
 
-             {
 
-                 return _showTips;
 
-             }
 
-             set
 
-             {
 
-                 _showTips = value;
 
-             }
 
-         }
 
-     }
 
- }
 
 
  |