48 lines
1.4 KiB
C#
48 lines
1.4 KiB
C#
|
using UnityEngine;
|
|||
|
using System.Collections;
|
|||
|
using UnityEngine.UI;
|
|||
|
using GCGame.Table;
|
|||
|
|
|||
|
public class RedPacketItem : UIItemBase{
|
|||
|
|
|||
|
public Text _DayDesc;
|
|||
|
public Text _StateDesc;
|
|||
|
public Image _MoneyIcon;
|
|||
|
public Text _MoneyNum;
|
|||
|
|
|||
|
protected MarketingRedPacketTag _ItemParam;
|
|||
|
public override void Show(Hashtable hash)
|
|||
|
{
|
|||
|
base.Show();
|
|||
|
_ItemParam = (MarketingRedPacketTag)hash["InitObj"];
|
|||
|
InitItem();
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
private int _ActId;
|
|||
|
private int _TagId;
|
|||
|
public void InitItem()
|
|||
|
{
|
|||
|
_DayDesc.text = StrDictionary.GetServerDictionaryFormatString(_ItemParam.dayDesc);
|
|||
|
_StateDesc.text = _ItemParam.state == 1 ? StrDictionary.GetClientDictionaryString("#{1230}") : StrDictionary.GetClientDictionaryString("#{1231}");
|
|||
|
|
|||
|
LoadAssetBundle.Instance.SetImageSprite(_MoneyIcon, PlayerData.MONEY.GetMoneySpriteStr((MONEYTYPE)_ItemParam.moneyType), delegate (bool bSucess, GameObject obj) {
|
|||
|
if(bSucess)
|
|||
|
{
|
|||
|
_MoneyIcon.SetNativeSize();
|
|||
|
}
|
|||
|
});
|
|||
|
_ActId = _ItemParam.actId;
|
|||
|
_TagId = _ItemParam.tagId;
|
|||
|
_MoneyNum.text = _ItemParam.moneyNum.ToString();
|
|||
|
}
|
|||
|
|
|||
|
public override void OnItemClick()
|
|||
|
{
|
|||
|
MarketingActAwardPageGetAward req = new MarketingActAwardPageGetAward();
|
|||
|
req.actID = _ActId;
|
|||
|
req.tagID = _TagId;
|
|||
|
req.SendMsg();
|
|||
|
}
|
|||
|
}
|