/// #pkgName FGUI包名
/// #panelName UIPanel名字
/// #UIName = $"{#pkgName}{#panelName}" UIKey名字
/// 该脚本由模板创建
/// created by cb 2024
using FairyGUI;
using FL.Data;
using XGame.Database;
using XGame.Framework.UI;
namespace FL.FGUI
{
///
/// UI逻辑处理类
///
///
public partial class PartnerEpiMainPanelCtrl : UIController
{
private bool _initialized = false;
protected override void OnEnable(object intent)
{
AddUIListenres();
InitList();
EpigraphService.Instance.RequestEpiInto();
UpView();
}
protected override void OnDisable()
{
RemoveUIListenres();
}
#region UI事件
private void AddUIListenres()
{
VM.OneUpBtn.onClick.Add(OnClickOneUpBtn);
VM.OneStrongBtn.onClick.Add(OnClickOneStrongBtn);
EventSingle.Instance.AddListener(EventDefine.EpigraphHaveInfoUpdate, OnUpView);
}
private void RemoveUIListenres()
{
VM.OneUpBtn.onClick.Remove(OnClickOneUpBtn);
VM.OneStrongBtn.onClick.Remove(OnClickOneStrongBtn);
EventSingle.Instance.RemoveListener(EventDefine.EpigraphHaveInfoUpdate, OnUpView);
}
private void OnClickOneUpBtn(EventContext context) { }
private void OnClickOneStrongBtn(EventContext context) { }
#endregion
private void InitList()
{
if (_initialized)
return;
VM.UpList.ListType = EGListType.None;
VM.BagList.ListType = EGListType.Virtual;
_initialized = true;
}
private void OnUpView(int eventId, object args)
{
UpView();
}
private void UpView()
{
UpList();
UpPlan();
}
private void UpPlan()
{
//VM.SchemeLabel.text =
}
private void UpList()
{
var list = EpigraphTableRepo.GetAll();
VM.BagList.BindDatas(list);
}
}
}