PartnerPartnerBookGroupListItemCtrl.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 PartnerPartnerBookGroupListItemCtrl
  16. : UIController<PartnerPartnerBookGroupListItemVM>
  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. VM.PanelEvent.Add(OnClick);
  29. }
  30. private void RemoveUIListenres() {
  31. VM.PanelEvent.Remove(OnClick);
  32. }
  33. private void OnClick()
  34. {
  35. Context.UI.OpenAsync(UIKeys.PartnerPartnerBookDetailPanel, _collectId);
  36. }
  37. #endregion
  38. private int _collectId;
  39. public void OnRefresh(int index, collectTable table)
  40. {
  41. _collectId = table.Id;
  42. VM.NameLabel.text = table.Name;
  43. VM.List.BindDatas(table.Param);
  44. }
  45. }
  46. }