92 lines
2.1 KiB
C#
92 lines
2.1 KiB
C#
using GCGame.Table;
|
|
using Module.Log;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class FlashSalePaging : MarketingUIBaseCS
|
|
{
|
|
public static FlashSalePaging _instance;
|
|
public static FlashSalePaging Instance
|
|
{
|
|
get
|
|
{
|
|
if (_instance != null)
|
|
{
|
|
return _instance;
|
|
}
|
|
|
|
LogModule.ErrorLog("Can't get instances");
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public int M__ActID = 554;
|
|
|
|
private void Awake()
|
|
{
|
|
if (_instance == null)
|
|
{
|
|
_instance = this;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
public List<Text> _DescList; //页面描述
|
|
|
|
public UIContainerBase _SubTagContainer;
|
|
|
|
|
|
void OnEnable()
|
|
{
|
|
if (_ActID < 0)
|
|
{
|
|
ReqActList(M__ActID);
|
|
}
|
|
else
|
|
{
|
|
ReqActList(_ActID);
|
|
}
|
|
|
|
}
|
|
|
|
public void ReqActList(int _actID)
|
|
{
|
|
MarketingActAwardPageReq packet = new MarketingActAwardPageReq();
|
|
packet.actID = _actID;
|
|
packet.updateOrInit = 1;
|
|
packet.SendMsg();
|
|
}
|
|
|
|
protected override void MarketingActPageAwardRetDelInner(object packet)
|
|
{
|
|
MarketingActPacketPageRet info = packet as MarketingActPacketPageRet;
|
|
if (info != null)
|
|
{
|
|
ShowInfo(info);
|
|
}
|
|
}
|
|
|
|
private void ShowInfo(MarketingActPacketPageRet info)
|
|
{
|
|
for (int index = 0; index < _DescList.Count; index++)
|
|
{
|
|
_DescList[index].gameObject.SetActive(index < info.pageDescList.Count);
|
|
}
|
|
for (int index = 0; index < _DescList.Count && index < info.pageDescList.Count; index++)
|
|
{
|
|
_DescList[index].text = StrDictionary.GetServerDictionaryFormatString(info.pageDescList[index]);
|
|
}
|
|
_SubTagContainer.InitContentItem(info.subTags[0].awardTags);
|
|
}
|
|
|
|
private void OnDisable()
|
|
{
|
|
if (MarketingActsRoot.Instance() != null)
|
|
MarketingActsRoot.Instance().ClearShowingWin(_ActID);
|
|
}
|
|
}
|