1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- /// #pkgName FGUI包名
- /// #panelName UIPanel名字
- /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
- /// 该脚本由模板创建
- /// created by cb 2024
- using System.Collections.Generic;
- using FairyGUI;
- using FL.Data;
- using XGame.Framework.UI;
- namespace FL.FGUI
- {
- /// <summary>
- /// UI逻辑处理类
- /// </summary>
- /// <typeparam name=""></typeparam>
- public partial class PartnerMwUpPanelCtrl : UIController<PartnerMwUpPanelVM>
- {
- protected override void OnEnable(object intent)
- {
- AddUIListenres();
- _sbId = (int)intent;
- ShowUI();
- }
- protected override void OnDisable()
- {
- RemoveUIListenres();
- }
- #region UI事件
- private void AddUIListenres()
- {
- Context.AddListener(EventDefine.PartnerSbMwUpSelect, OnSelectUpMw);
- }
- private void RemoveUIListenres()
- {
- Context.RemoveListener(EventDefine.PartnerSbMwUpSelect, OnSelectUpMw);
- }
- private void OnSelectUpMw(int eventId, object args)
- {
- var id = (int)args;
- EpigraphService.Instance.RequestEpiInset(_sbId, id);
- Context.ClosePanel();
- }
- #endregion
- private bool _init = false;
- private int _sbId;
- public void Init()
- {
- if (_init)
- return;
- _init = true;
- VM.List.ListType = EGListType.Virtual;
- }
- public void ShowUI()
- {
- var list = EpigraphData.Instance.EpiList;
- var dataList = new List<int>();
- foreach (var item in list)
- {
- if (item.PartnerId > 0)
- continue;
- dataList.Add(item.TableId);
- }
- VM.List.BindDatas(dataList);
- }
- }
- }
|