Commit 7b744980 by wangonghui

CBA添加查看信息

parent 6d9fc263
......@@ -238,7 +238,7 @@ namespace VIZ.TVP.CBA.Module
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
playerSeasonData = JsonConvert.DeserializeObject<PlayerSeasonData>(result);
playerSeasonData = JsonConvert.DeserializeObject<PlayerSeasonData>(result,settings);
Log.Info(result);
});
......@@ -281,8 +281,7 @@ namespace VIZ.TVP.CBA.Module
string result = JsonHelper.Post(PlayerSeasonDataPath,dict,newKey);
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
playerSeasonData = JsonConvert.DeserializeObject<PlayerSeasonData>(result);
playerSeasonData = JsonConvert.DeserializeObject<PlayerSeasonData>(result,settings);
Log.Info(result);
});
......
......@@ -7,41 +7,41 @@ using VIZ.Package.Domain;
namespace VIZ.TVP.CBA.Module.HeaderPage
{
//public class HeaderPagePlugin : IPluginLifeCycle
//{
public class HeaderPagePlugin : IPluginLifeCycle
{
// /// <summary>
// /// 插件ID
// /// </summary>
// /// <remarks>
// /// 插件ID不能包含点号
// /// </remarks>
// public const string PLUGIN_ID = "DateHeaderView";
/// <summary>
/// 插件ID
/// </summary>
/// <remarks>
/// 插件ID不能包含点号
/// </remarks>
public const string PLUGIN_ID = "DateHeaderView";
// /// <summary>
// /// 插件显示名称
// /// </summary>
// public const string PLUGIN_NAME = "赛程";
// public void Dispose()
// {
/// <summary>
/// 插件显示名称
/// </summary>
public const string PLUGIN_NAME = "CBA赛事";
public void Dispose()
{
// }
}
// public void Initialize()
// {
public void Initialize()
{
// }
}
// public PluginInfo Register()
// {
// PluginInfo info = new PluginInfo();
// info.Group = PluginConstant.GroupName;
// info.ID = PLUGIN_ID;
// info.Name = PLUGIN_NAME;
// info.PluginType = PluginType.Module;
// info.ViewType = typeof(DateHeaderView);
// ////info.SettingViewType = typeof(DayMatchUI)
// return info;
// }
//}
public PluginInfo Register()
{
PluginInfo info = new PluginInfo();
info.Group = PluginConstant.GroupName;
info.ID = PLUGIN_ID;
info.Name = PLUGIN_NAME;
info.PluginType = PluginType.Module;
info.ViewType = typeof(DateHeaderView);
////info.SettingViewType = typeof(DayMatchUI)
return info;
}
}
}
......@@ -128,7 +128,7 @@ namespace VIZ.TVP.CBA.Module
MatchItems = new ObservableCollection<string>();
string date = Convert.ToDateTime(matchDate).ToString("yyyy-MM-dd");
var dayschedules = await JsonModel.TomorrowMatch_Path(date);
var dayschedules = await JsonModel.PostTomorrowMatch_Path(date);
if (dayschedules == null) return;
matchData.AddRange(dayschedules.dayschedule);
......@@ -206,19 +206,47 @@ namespace VIZ.TVP.CBA.Module
return;
}
onAirDataModel = JsonModel.OnAirData_Path(selectMatchData.ScheduleID);
onAirDataModel = JsonModel.PostOnAirData_Path(selectMatchData.ScheduleID);
SetTeamStatsData();
TeamHName = value.HomeTeamName;
TeamAName = value.VisitingTeamName;
TeamStatsViewModel teamStatsViewModel = TeamStatsViewModel.CreateInstance;
#region 球员统计信息
TeamStatsViewModel teamStatsViewModel = TeamStatsViewModel.CreateInstance;
Log.Error("DateHeaderViewModel_CreateTeamStatsViewModel");
teamStatsViewModel.ScheduleID = selectMatchData.ScheduleID;
teamStatsViewModel.Matchtypeid = selectMatchData.ScheduleTypeID;
//teamStatsViewModel.SetTeamData();
Log.Error(string.Format("DateHeader_ScheduleId:{0}",selectMatchData.ScheduleID));
Log.Error(string.Format("DateHeader_ScheduleTypeId:{0}", selectMatchData.ScheduleTypeID));
teamStatsViewModel.SetTeamData();
#endregion
#region 单个球员信息
SinglePlayerViewModel singlePlayerViewModel = SinglePlayerViewModel.CreateInstance;
singlePlayerViewModel.ScheduleID = selectMatchData.ScheduleID;
singlePlayerViewModel.Matchtypeid = selectMatchData.ScheduleTypeID;
singlePlayerViewModel.SetSingleData();
#endregion
#region 球员对比信息
PlayerCompareViewModel playerCompareViewModel = PlayerCompareViewModel.CreateInstance;
playerCompareViewModel.ScheduleID = selectMatchData.ScheduleID;
playerCompareViewModel.Matchtypeid = selectMatchData.ScheduleTypeID;
playerCompareViewModel.SetCompareData();
#endregion
}
}
......@@ -240,7 +268,6 @@ namespace VIZ.TVP.CBA.Module
#endregion
#region 球队积分排行榜
......@@ -260,7 +287,7 @@ namespace VIZ.TVP.CBA.Module
private void BtmCommand()
{
var teamStands = JsonModel.TeamScoreData_Path();
var teamStands = JsonModel.PostTeamScoreData_Path();
if (teamStands == null) return;
TeamRanksModel = new ObservableCollection<Teamrank>();
int i = 1;
......@@ -288,8 +315,6 @@ namespace VIZ.TVP.CBA.Module
#endregion
#region 球队数据
......@@ -371,7 +396,6 @@ namespace VIZ.TVP.CBA.Module
#endregion
#region 球员数据
/// <summary>
......@@ -515,9 +539,5 @@ namespace VIZ.TVP.CBA.Module
#endregion
}
}
......@@ -29,11 +29,11 @@
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="0"/>
<RowDefinition Height="200"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" VerticalAlignment="Center">
<!--<WrapPanel Grid.Row="0" VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
......@@ -59,7 +59,7 @@
</dxe:ComboBoxEdit>
<TextBox Grid.Column="4" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding MatchStatus,Mode=TwoWay}" Width="80"/>
</Grid>
</WrapPanel>
</WrapPanel>-->
<WrapPanel Grid.Row="1" Height="190" Width="650" HorizontalAlignment="Left" VerticalAlignment="Center" >
<Grid >
......
......@@ -87,7 +87,7 @@ namespace VIZ.TVP.CBA.Module
matchDate = DateTime.Today.ToShortDateString();
GetSchedule();
GetSeasonData();
// GetSeasonData();
}
......@@ -500,7 +500,7 @@ namespace VIZ.TVP.CBA.Module
GetSchedule();
GetSeasonData();
//GetSeasonData();
}
}
......@@ -917,6 +917,7 @@ namespace VIZ.TVP.CBA.Module
MatchItems.Add(dayschedule.time + dayschedule.HomeTeamName
+ "VS" + dayschedule.VisitingTeamName);
GetSeasonData();
}
}
......@@ -992,12 +993,14 @@ namespace VIZ.TVP.CBA.Module
private void SetCompareData()
public void SetCompareData()
{
if (SelectMatchItems == null) return;
ScheduleID = SetMatchDict[SelectMatchItems];
//if (SelectMatchItems == null) return;
//ScheduleID = SetMatchDict[SelectMatchItems];
GetSeasonData();
onAirDataModel = JsonModel.PostOnAirData_Path(ScheduleID);
if (onAirDataModel == null) return;
if (onAirDataModel != null)
{
......
......@@ -17,7 +17,7 @@ namespace VIZ.TVP.CBA.Module
public string PointsAverage { get; set; }//场均得分
public string ReboundsAverage { get; set; }//场均篮板
public string AssistsAverage { get; set; }//场均助攻
public float FieldGoalsPercentageAverage { get; set; }//投篮命中率
public float FieldGoalsPercentageAverage { get; set; }//投篮命中率
public string StealsAverage { get; set; }//抢断
public string BlockedAverage { get; set; }//盖帽
public string MinutesAverage { get; set; }//上场时间
......
......@@ -25,13 +25,13 @@
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="0"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" VerticalAlignment="Center">
<!--<WrapPanel Grid.Row="0" VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
......@@ -63,7 +63,7 @@
</Grid>
</WrapPanel>
</WrapPanel>-->
<WrapPanel Grid.Row="1" VerticalAlignment="Center" >
<Grid>
<Grid.ColumnDefinitions>
......
......@@ -49,7 +49,7 @@ namespace VIZ.TVP.CBA.Module
MVPCommand = new VCommand(mvpCommand);
matchDate = DateTime.Today.ToShortDateString();
GetSchedule();
GetSeasonData();
singlePlayerData = new ObservableCollection<SinglePlayerModel>();
......@@ -179,7 +179,7 @@ namespace VIZ.TVP.CBA.Module
matchDate = value;
this.RaisePropertyChanged(nameof(MatchDate));
GetSchedule();
GetSeasonData();
//GetSeasonData();
}
}
......@@ -913,10 +913,12 @@ namespace VIZ.TVP.CBA.Module
/// <summary>
/// 设置单个球员相关的信息
/// </summary>
private void SetSingleData()
public void SetSingleData()
{
if (SelectMatchItems == null) return;
ScheduleID = SetMatchDict[SelectMatchItems];
//if (SelectMatchItems == null) return;
//ScheduleID = SetMatchDict[SelectMatchItems];
GetSeasonData();
onAirDataModel = JsonModel.PostOnAirData_Path(ScheduleID);
if (onAirDataModel == null) return;
if (onAirDataModel != null)
......@@ -1028,6 +1030,8 @@ namespace VIZ.TVP.CBA.Module
MatchItems.Add(dayschedule.time + dayschedule.HomeTeamName
+ "VS" + dayschedule.VisitingTeamName);
GetSeasonData();
}
}
catch(Exception ex)
......
......@@ -25,14 +25,14 @@
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="0"/>
<RowDefinition Height="40"/>
<RowDefinition Height="40"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" VerticalAlignment="Center">
<!--<WrapPanel Grid.Row="0" VerticalAlignment="Center">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="80"/>
......@@ -59,7 +59,7 @@
<TextBox Grid.Column="4" FontSize="16" HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding MatchStatus,Mode=TwoWay}" Width="80"/>
</Grid>
</WrapPanel>
</WrapPanel>-->
<WrapPanel Grid.Row="1" VerticalAlignment="Center" >
......
......@@ -21,10 +21,13 @@ namespace VIZ.TVP.CBA.Module
{
get
{
if (null == _createInstance)
{
Log.Error("CreateInstance");
_createInstance = new TeamStatsViewModel();
}
Log.Error("CreatedInstance");
return _createInstance;
}
}
......@@ -529,10 +532,12 @@ namespace VIZ.TVP.CBA.Module
private async void SetTeamData()
public async void SetTeamData()
{
if (SelectMatchItems == null) return;
ScheduleID = SetMatchDict[SelectMatchItems];
//if (SelectMatchItems == null) return;
//ScheduleID = SetMatchDict[SelectMatchItems];
Log.Error(string.Format("teamStatsViewModel:{0}",ScheduleID));
onAirDataModel = JsonModel.PostOnAirData_Path(ScheduleID);
if (onAirDataModel == null) return;
......@@ -560,8 +565,12 @@ namespace VIZ.TVP.CBA.Module
HomeTeam = onAirDataModel.liveTeamInfo.HomeTeamCNAlias;
Log.Error(HomeTeam);
AwayTeam = onAirDataModel.liveTeamInfo.VisitingTeamCNAlias;
Log.Error(AwayTeam);
TeamSeasonData = await JsonModel.PostTeamSeasonData_Path(Matchtypeid);
SetTeamSeasonDictionary();
......@@ -601,7 +610,11 @@ namespace VIZ.TVP.CBA.Module
CompareItemToNumber.Add("篮下投篮命中率", (teamSeasonData.FieldGoalsAtRimPercentageAverage * 100).ToString("F1") + "%");
CompareItemToNumber.Add("中距离投篮命中率", (teamSeasonData.FieldGoalsMidRangePercentageAverage * 100).ToString("F1") + "%");
CNAliasVisitSportsDictionary.Add(teamSeasonData.TeamCNAlias, CompareItemToNumber);
if(!CNAliasVisitSportsDictionary.ContainsKey(teamSeasonData.TeamCNAlias))
{
CNAliasVisitSportsDictionary.Add(teamSeasonData.TeamCNAlias, CompareItemToNumber);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment