PartnerPartnerBookPanelCtrl.cs 1.5 KB

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