/// <summary> /// 处理页签数据 /// </summary> /// <param name="tabDatas"></param> private void SetTabsData(object tabDatas) { if (tabDatas == null) { return; } _tabDatas.Clear(); Dictionary <string, object> param = (Dictionary <string, object>)tabDatas; int index = 0; foreach (KeyValuePair <string, object> keyPair in param) { RankTabData data = new RankTabData(keyPair.Key, keyPair.Value); data.Index = index++; _tabDatas.Add(data); } }
/// <summary> /// 生成式(后台配置)排行请求 /// </summary> /// <param name="tableView"></param> public void OnTabClickWithData(YxTabItem tableView) { if (tableView.GetToggle().value) { if (tableView.name.Equals(_curTabData.Index.ToString())) { return; } else { object data = tableView.GetData <TabData>().Data; _curTabData = data as RankTabData; RankTypes = _curTabData.Key; } base.OnTableClick(tableView); RequestWithParm(UpdateView); } }
protected virtual void DealData(object data) { _data = new RankData(data); if (_curTabData == null) { if (_data.TabDatas != null && _data.TabDatas.Count > 0) { RankTypes = _data.SelectTab; RankTabData selectTab = _data.TabDatas.Find(item => item.Key.Equals(RankTypes)); if (selectTab != null) { _curTabData = selectTab; } else { YxDebug.LogError("没有选中的页签"); } } } }