77 lines
1.9 KiB
C#
77 lines
1.9 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using GCGame.Table;
|
|
|
|
// 开服活动 - 连充特惠
|
|
public class OpenServiceContinueRechargeCS : MarketingUIBaseCS {
|
|
|
|
public Image banner;
|
|
public Text[] descList;
|
|
public UIContainerBase tagContainer;
|
|
public Button rechargeBtn;
|
|
|
|
private void Awake()
|
|
{
|
|
rechargeBtn.onClick.AddListener(
|
|
() =>
|
|
{
|
|
YuanBaoShopLogic.OpenChargePage();
|
|
});
|
|
}
|
|
|
|
private void OnEnable()
|
|
{
|
|
InitBG();
|
|
AskInfo();
|
|
}
|
|
|
|
#region 消息发送/接收
|
|
|
|
private void AskInfo()
|
|
{
|
|
MarketingActAwardPageReq req = new MarketingActAwardPageReq();
|
|
req.actID = this._ActID;
|
|
req.updateOrInit = 1;
|
|
req.SendMsg();
|
|
}
|
|
|
|
protected override void MarketingActPageAwardRetDelInner(object packet)
|
|
{
|
|
MarketingActAwardPageRet p = packet as MarketingActAwardPageRet;
|
|
if (p == null)
|
|
return;
|
|
|
|
descList[2].text = StrDictionary.GetClientDictionaryString("#{61054}");
|
|
if(p.descList.Count < 2)
|
|
{
|
|
for(int i = 0; i < descList.Length; ++i)
|
|
{
|
|
descList[i].gameObject.SetActive(false);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
for(int i = 0; i < 2; ++i)
|
|
{
|
|
descList[i].gameObject.SetActive(true);
|
|
descList[i].text = StrDictionary.GetServerDictionaryFormatString(p.descList[i]);
|
|
}
|
|
}
|
|
|
|
tagContainer.InitContentItem(p.awardTags);
|
|
}
|
|
|
|
// 设置Banner图片
|
|
protected virtual void InitBG()
|
|
{
|
|
Tab_ActInfoClient tab = TableManager.GetActInfoClientByID(this._ActID, 0);
|
|
if (tab != null && !string.IsNullOrEmpty(tab.Icon))
|
|
{
|
|
LoadAssetBundle.Instance.SetImageSprite(banner, tab.Icon);
|
|
}
|
|
}
|
|
#endregion
|
|
}
|