Commit 7b744980 by wangonghui

CBA添加查看信息

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