PartnerEpiBookGroupListItemCtrl.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /// #pkgName FGUI包名
  2. /// #panelName UIPanel名字
  3. /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
  4. /// 该脚本由模板创建
  5. /// created by cb 2024
  6. using FairyGUI;
  7. using XGame.Database;
  8. using XGame.Framework.UI;
  9. namespace FL.FGUI
  10. {
  11. /// <summary>
  12. /// UI逻辑处理类
  13. /// </summary>
  14. /// <typeparam name=""></typeparam>
  15. public partial class PartnerEpiBookGroupListItemCtrl
  16. : UIController<PartnerEpiBookGroupListItemVM>
  17. {
  18. protected override void OnEnable(object intent)
  19. {
  20. AddUIListenres();
  21. }
  22. protected override void OnDisable()
  23. {
  24. RemoveUIListenres();
  25. }
  26. #region UI事件
  27. private void AddUIListenres()
  28. {
  29. VM.PanelEvent.Add(OnClick);
  30. }
  31. private void RemoveUIListenres()
  32. {
  33. VM.PanelEvent.Remove(OnClick);
  34. }
  35. private void OnClick()
  36. {
  37. Context.UI.OpenAsync(UIKeys.PartnerEpiBookDetailPanel, _id);
  38. }
  39. #endregion
  40. private int _id;
  41. public void OnRefresh(int index, collectTable table)
  42. {
  43. _id = table.Id;
  44. VM.NameLabel.text = table.Name;
  45. VM.List.BindDatas(table.Param);
  46. }
  47. }
  48. }