Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
修复PGC内容不能通过年份索引的问题 (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
Richasy authored Sep 22, 2021
1 parent e395a9c commit 5f3d023
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/App/Pages/Overlay/PgcIndexPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
ActionContent="{loc:LocaleLocator Name=Refresh}"
Text="{x:Bind ViewModel.IndexErrorText, Mode=OneWay}"
Visibility="{x:Bind ViewModel.IsIndexError, Mode=OneWay}" />
<controls:ErrorPanel Text="{loc:LocaleLocator Name=NoSpecificData}" Visibility="{x:Bind ViewModel.IsEmpty, Mode=OneWay}" />
</Grid>
</Grid>
</Page>
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,11 @@
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="FluentAssertions">
<Version>5.10.3</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.12</Version>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.SDK">
<Version>16.7.1</Version>
</PackageReference>
<PackageReference Include="xunit">
<Version>2.4.1</Version>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio">
<Version>2.4.1</Version>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
<PackageReference Include="SpecFlow">
<Version>3.9.22</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
20 changes: 18 additions & 2 deletions src/ViewModels/ViewModels.Uwp/Pgc/PgcViewModelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ public PgcViewModelBase(PgcType type)
[Reactive]
public bool IsIndexRequested { get; set; }

/// <summary>
/// 是否显示为空白.
/// </summary>
[Reactive]
public bool IsEmpty { get; set; }

/// <summary>
/// 加载索引.
/// </summary>
Expand Down Expand Up @@ -192,7 +198,13 @@ private async Task RequestIndexRequestAsync()
{
if (condition.SelectedItem != null)
{
queryPrameters.Add(condition.Id, condition.SelectedItem.Id);
var id = condition.SelectedItem.Id;
if (condition.Id == "year")
{
id = Uri.EscapeDataString(condition.SelectedItem.Id);
}

queryPrameters.Add(condition.Id, id);
}
}

Expand All @@ -203,10 +215,14 @@ private void OnPgcIndexResultIteration(object sender, PgcIndexResultIterationEve
{
if (e.Type == Type)
{
e.List.ForEach(p => ItemCollection.Add(new SeasonViewModel(p)));
if (e.List != null)
{
e.List.ForEach(p => ItemCollection.Add(new SeasonViewModel(p)));
}

_isIndexLoadCompleted = !e.HasNext || e.TotalCount <= ItemCollection.Count;
_indexPageNumber = e.NextPageNumber;
IsEmpty = ItemCollection.Count == 0;
}
}
}
Expand Down

0 comments on commit 5f3d023

Please sign in to comment.