123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- /// #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
- {
- /// <summary>
- /// UI逻辑处理类
- /// </summary>
- /// <typeparam name=""></typeparam>
- public partial class PartnerEpiMainPanelCtrl : UIController<PartnerEpiMainPanelVM>
- {
- 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);
- }
- }
- }
|