PartnerEpiBookPanelCtrl.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 PartnerEpiBookPanelCtrl : UIController<PartnerEpiBookPanelVM>
  16. {
  17. protected override void OnEnable(object intent)
  18. {
  19. AddUIListenres();
  20. UpView();
  21. }
  22. protected override void OnDisable()
  23. {
  24. RemoveUIListenres();
  25. }
  26. #region UI事件
  27. private void AddUIListenres()
  28. {
  29. VM.TotalAddBtn.onClick.Add(OnClickTotalAddBtn);
  30. }
  31. private void RemoveUIListenres()
  32. {
  33. VM.TotalAddBtn.onClick.Remove(OnClickTotalAddBtn);
  34. }
  35. private void OnClickTotalAddBtn()
  36. {
  37. Context.UI.OpenAsync(UIKeys.PartnerBookAddDetailPanel, 2);
  38. }
  39. #endregion
  40. #region 属性
  41. private bool _initView = false;
  42. #endregion
  43. #region 页面
  44. private void InitView()
  45. {
  46. if (_initView)
  47. return;
  48. VM.List.ListType = EGListType.Virtual;
  49. }
  50. private void UpView()
  51. {
  52. UpdateList();
  53. }
  54. private void UpdateList()
  55. {
  56. var list = collectTableRepo.GetAllEpiCollectList();
  57. VM.List.BindDatas(list);
  58. }
  59. #endregion
  60. }
  61. }