PartnerPartnerBookPanelCtrl.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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()
  37. {
  38. Context.UI.OpenAsync(UIKeys.PartnerBookAddDetailPanel, 2);
  39. }
  40. #endregion
  41. #region 属性
  42. private bool _initView = false;
  43. #endregion
  44. #region 页面
  45. private void InitView()
  46. {
  47. if (_initView)
  48. return;
  49. VM.List.ListType = EGListType.Virtual;
  50. }
  51. private void UpView()
  52. {
  53. UpdateList();
  54. }
  55. private void UpdateList()
  56. {
  57. var list = collectTableRepo.GetAllPartnerCollectList();
  58. VM.List.BindDatas(list);
  59. }
  60. #endregion
  61. }
  62. }