PartnerSbUpLineListItemCtrl.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /// #pkgName FGUI包名
  2. /// #panelName UIPanel名字
  3. /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
  4. /// 该脚本由模板创建
  5. /// created by cb 2024
  6. using FairyGUI;
  7. using FL.Data;
  8. using XGame;
  9. using XGame.Database;
  10. using XGame.Framework.UI;
  11. namespace FL.FGUI
  12. {
  13. /// <summary>
  14. /// UI逻辑处理类
  15. /// </summary>
  16. /// <typeparam name=""></typeparam>
  17. public partial class PartnerSbUpLineListItemCtrl : UIController<PartnerSbUpLineListItemVM>
  18. {
  19. protected override void OnEnable(object intent)
  20. {
  21. AddUIListenres();
  22. }
  23. protected override void OnDisable()
  24. {
  25. RemoveUIListenres();
  26. }
  27. #region UI事件
  28. private void AddUIListenres()
  29. {
  30. VM.UpBtn.onClick.Add(OnClickUpBtn);
  31. }
  32. private void RemoveUIListenres()
  33. {
  34. VM.UpBtn.onClick.Remove(OnClickUpBtn);
  35. }
  36. private void OnClickUpBtn(EventContext context)
  37. {
  38. EventSingle.Instance.Notify(EventDefine.PartnerUpSelect, _id);
  39. }
  40. #endregion
  41. private int _id;
  42. public void OnRefresh(int index, int id)
  43. {
  44. _id = id;
  45. VM.DetailNested.VM.SpGroup.visible = false;
  46. VM.DetailNested.Ctrl.ShowUI(id);
  47. }
  48. }
  49. }