123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- /// #pkgName FGUI包名
- /// #panelName UIPanel名字
- /// #UIName = $"{#pkgName}{#panelName}" UIKey名字
- /// 该脚本由模板创建
- /// created by cb 2024
- using System.Collections.Generic;
- using FairyGUI;
- using FL.Data;
- using XGame.Framework.UI;
- namespace FL.FGUI
- {
- /// <summary>
- /// UI逻辑处理类
- /// </summary>
- /// <typeparam name=""></typeparam>
- public partial class PartnerSbReplacePanelCtrl : UIController<PartnerSbReplacePanelVM>
- {
- protected override void OnEnable(object intent)
- {
- _pos = (int)intent;
- _id = PartnersData.Instance.UpSbMap.GetValueOrDefault(_pos, 0);
- AddUIListenres();
- InitView();
- ShowUI();
- }
- protected override void OnDisable()
- {
- RemoveUIListenres();
- }
- #region UI事件
- private void AddUIListenres()
- {
- EventSingle.Instance.AddListener(EventDefine.PartnerUpSelect, OnSelectUpSb);
- }
- private void RemoveUIListenres()
- {
- EventSingle.Instance.RemoveListener(EventDefine.PartnerUpSelect, OnSelectUpSb);
- }
- private void OnSelectUpSb(int eventId, object args)
- {
- var id = (int)args;
- PartnersService.Instance.RequestPartnerUpNew(_pos, id);
- Context.ClosePanel();
- }
- #endregion
- private int _id;
- private int _pos;
- private bool _initView;
- private void InitView()
- {
- if (_initView)
- return;
- _initView = true;
- VM.List.ListType = EGListType.Virtual;
- }
- private void ShowUI()
- {
- VM.DetailNested.VM.SpGroup.visible = false;
- VM.DetailNested.Ctrl.ShowUI(_id);
- var list = PartnersData.Instance.PartnerList;
- var dataList = new List<int>();
- foreach (var item in list)
- {
- if (item.Status > 0) continue;
- dataList.Add(item.TableId);
- }
- VM.List.BindDatas(dataList);
- }
- }
- }
|