100 lines
2.4 KiB
C#
100 lines
2.4 KiB
C#
|
using UnityEngine;
|
|||
|
using System.Collections;
|
|||
|
using System.Collections.Generic;
|
|||
|
using UnityEngine.UI;
|
|||
|
using GCGame.Table;
|
|||
|
|
|||
|
public class InvestMentPanelRoot : MonoBehaviour {
|
|||
|
public OperationActivityEnterfaceId _ActEnterFaceId;
|
|||
|
public int _ActID = 71; //对应活动ID
|
|||
|
private int _TagId = -1;
|
|||
|
public UIContainerBase _AwardContainer;
|
|||
|
|
|||
|
public List<Text> _DescLists;
|
|||
|
|
|||
|
public GameObject _EnabledBtn;
|
|||
|
public GameObject _EnableBtn;
|
|||
|
|
|||
|
private void OnEnable()
|
|||
|
{
|
|||
|
ReqActList();
|
|||
|
}
|
|||
|
|
|||
|
public void ReqActList()
|
|||
|
{
|
|||
|
MarketingActAwardPageReq packet = new MarketingActAwardPageReq();
|
|||
|
packet.actID = _ActID;
|
|||
|
packet.updateOrInit = 1;
|
|||
|
packet.SendMsg();
|
|||
|
}
|
|||
|
|
|||
|
public void OnDisable()
|
|||
|
{
|
|||
|
if (MarketingActsRoot.Instance())
|
|||
|
{
|
|||
|
MarketingActsRoot.Instance().ClearShowingWin((int)_ActEnterFaceId);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void MarketingActAwardPageRet(MarketingActAwardPageRet marketActsRet)
|
|||
|
{
|
|||
|
_TagId = marketActsRet.awardTags[0].tagID;
|
|||
|
_AwardContainer.InitContentItem(marketActsRet.awardTags);
|
|||
|
RefreshBtnState(marketActsRet.pagrState);
|
|||
|
SetDesc(marketActsRet.descList);
|
|||
|
}
|
|||
|
|
|||
|
public void RefreshBtnState(int btnState)
|
|||
|
{
|
|||
|
if(btnState == 1)
|
|||
|
{
|
|||
|
if(_EnabledBtn != null)
|
|||
|
{
|
|||
|
_EnabledBtn.SetActive(true);
|
|||
|
}
|
|||
|
|
|||
|
if(_EnableBtn != null)
|
|||
|
{
|
|||
|
_EnableBtn.SetActive(false);
|
|||
|
}
|
|||
|
}else
|
|||
|
{
|
|||
|
if (_EnabledBtn != null)
|
|||
|
{
|
|||
|
_EnabledBtn.SetActive(false);
|
|||
|
}
|
|||
|
|
|||
|
if (_EnableBtn != null)
|
|||
|
{
|
|||
|
_EnableBtn.SetActive(true);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void SetDesc(List<string> stringLists)
|
|||
|
{
|
|||
|
for(int index = 0; index < _DescLists.Count; index++)
|
|||
|
{
|
|||
|
_DescLists[index].gameObject.SetActive(index < stringLists.Count);
|
|||
|
}
|
|||
|
|
|||
|
for(int index = 0; index < _DescLists.Count && index < stringLists.Count; index++)
|
|||
|
{
|
|||
|
_DescLists[index].text = StrDictionary.GetServerDictionaryFormatString(stringLists[index]);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public void OnGetBtnClick()
|
|||
|
{
|
|||
|
MarketinfActPerchasePeq req = new MarketinfActPerchasePeq();
|
|||
|
req.actId = _ActID;
|
|||
|
req.tagId = _TagId;
|
|||
|
req.SendMsg();
|
|||
|
}
|
|||
|
|
|||
|
public void OnCloseBtnClick()
|
|||
|
{
|
|||
|
gameObject.SetActive(false);
|
|||
|
}
|
|||
|
}
|