|
@@ -30,14 +30,15 @@ namespace FL.FGUI
|
|
|
{
|
|
|
protected override void OnEnable(object intent)
|
|
|
{
|
|
|
- AddUIListenres();
|
|
|
+ AddUIListenres();
|
|
|
+ InitView();
|
|
|
+ VM.OpenSelect.selectedIndex = 1;
|
|
|
+ ShowUI();
|
|
|
}
|
|
|
|
|
|
protected override void OnDisable()
|
|
|
{
|
|
|
RemoveUIListenres();
|
|
|
- InitView();
|
|
|
- ShowUI();
|
|
|
}
|
|
|
|
|
|
#region UI事件
|
|
@@ -55,7 +56,9 @@ namespace FL.FGUI
|
|
|
|
|
|
private void OnClickOnStrongBtn(EventContext context) { }
|
|
|
|
|
|
- private void OnClickSortBtn(EventContext context) { }
|
|
|
+ private void OnClickSortBtn(EventContext context) {
|
|
|
+ VM.OpenSelect.selectedIndex = VM.OpenSelect.selectedIndex > 0 ? 0 : 1;
|
|
|
+ }
|
|
|
|
|
|
#endregion
|
|
|
private List<PartnerSbBagListParam> _dataList = new List<PartnerSbBagListParam>();
|
|
@@ -67,65 +70,70 @@ namespace FL.FGUI
|
|
|
return;
|
|
|
_init = true;
|
|
|
VM.List.ListType = EGListType.Virtual;
|
|
|
- VM.List.itemProvider = (index) =>
|
|
|
- {
|
|
|
- var data = _dataList[index];
|
|
|
- if (data.Type == 0)
|
|
|
- {
|
|
|
- return "ui://Partner/SbBagListTitleItem";
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return "ui://Partner/SbBagListLineItem";
|
|
|
- }
|
|
|
- };
|
|
|
+ //VM.List.itemProvider = (index) =>
|
|
|
+ //{
|
|
|
+ // var data = _dataList[index];
|
|
|
+ // if (data.Type == 0)
|
|
|
+ // {
|
|
|
+ // return "ui://Partner/SbBagListTitleItem";
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // return "ui://Partner/SbBagListLineItem";
|
|
|
+ // }
|
|
|
+ //};
|
|
|
}
|
|
|
|
|
|
private void ShowUI()
|
|
|
{
|
|
|
var allSbList = PartnerTableRepo.GetAll();
|
|
|
- var haveList = new List<int>();
|
|
|
- var noHaveList = new List<int>();
|
|
|
- foreach (var sb in allSbList)
|
|
|
- {
|
|
|
- var attr = PartnersData.Instance.GetPartnerAttrByTableId(sb.Id);
|
|
|
- if (attr != null)
|
|
|
- {
|
|
|
- haveList.Add(sb.Id);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- noHaveList.Add(sb.Id);
|
|
|
- }
|
|
|
- }
|
|
|
- _dataList.Clear();
|
|
|
- _dataList.Add(new PartnerSbBagListParam() { Type = 0, Title = StringDefine.Have });
|
|
|
- var list = new List<int>();
|
|
|
- foreach (var have in haveList)
|
|
|
- {
|
|
|
- list.Add(have);
|
|
|
- if (list.Count >= 5)
|
|
|
- {
|
|
|
- _dataList.Add(new PartnerSbBagListParam() { Type = 1, SbList = list });
|
|
|
- list = new List<int>();
|
|
|
- }
|
|
|
- }
|
|
|
- if (list.Count > 0)
|
|
|
- {
|
|
|
- _dataList.Add(new PartnerSbBagListParam() { Type = 1, SbList = list });
|
|
|
- list = new List<int>();
|
|
|
- }
|
|
|
- _dataList.Add(new PartnerSbBagListParam() { Type = 0, Title = StringDefine.NoHave });
|
|
|
- foreach (var noHave in noHaveList)
|
|
|
+ //var haveList = new List<int>();
|
|
|
+ //var noHaveList = new List<int>();
|
|
|
+ //foreach (var sb in allSbList)
|
|
|
+ //{
|
|
|
+ // var attr = PartnersData.Instance.GetPartnerAttrByTableId(sb.Id);
|
|
|
+ // if (attr != null)
|
|
|
+ // {
|
|
|
+ // haveList.Add(sb.Id);
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // noHaveList.Add(sb.Id);
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ //_dataList.Clear();
|
|
|
+ //_dataList.Add(new PartnerSbBagListParam() { Type = 0, Title = StringDefine.Have });
|
|
|
+ //var list = new List<int>();
|
|
|
+ //foreach (var have in haveList)
|
|
|
+ //{
|
|
|
+ // list.Add(have);
|
|
|
+ // if (list.Count >= 5)
|
|
|
+ // {
|
|
|
+ // _dataList.Add(new PartnerSbBagListParam() { Type = 1, SbList = list });
|
|
|
+ // list = new List<int>();
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ //if (list.Count > 0)
|
|
|
+ //{
|
|
|
+ // _dataList.Add(new PartnerSbBagListParam() { Type = 1, SbList = list });
|
|
|
+ // list = new List<int>();
|
|
|
+ //}
|
|
|
+ //_dataList.Add(new PartnerSbBagListParam() { Type = 0, Title = StringDefine.NoHave });
|
|
|
+ //foreach (var noHave in noHaveList)
|
|
|
+ //{
|
|
|
+ // list.Add(noHave);
|
|
|
+ // if (list.Count >= 5)
|
|
|
+ // {
|
|
|
+ // _dataList.Add(new PartnerSbBagListParam() { Type = 1, SbList = list });
|
|
|
+ // list = new List<int>();
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+ var dataList = new List<int>();
|
|
|
+ foreach (var item in allSbList)
|
|
|
{
|
|
|
- list.Add(noHave);
|
|
|
- if (list.Count >= 5)
|
|
|
- {
|
|
|
- _dataList.Add(new PartnerSbBagListParam() { Type = 1, SbList = list });
|
|
|
- list = new List<int>();
|
|
|
- }
|
|
|
+ dataList.Add(item.Id);
|
|
|
}
|
|
|
- VM.List.BindDatas(_dataList);
|
|
|
+ VM.List.BindDatas(dataList);
|
|
|
}
|
|
|
}
|
|
|
}
|