From a8bd416407c58e31d031206764c5bcf493c520b5 Mon Sep 17 00:00:00 2001 From: Anran Zhang Date: Wed, 22 Sep 2021 12:43:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DPGC=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E9=80=9A=E8=BF=87=E5=B9=B4=E4=BB=BD=E7=B4=A2?= =?UTF-8?q?=E5=BC=95=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App/Pages/Overlay/PgcIndexPage.xaml | 1 + .../ViewModels.Uwp.UnitTests.csproj | 15 ++------------ .../ViewModels.Uwp/Pgc/PgcViewModelBase.cs | 20 +++++++++++++++++-- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/App/Pages/Overlay/PgcIndexPage.xaml b/src/App/Pages/Overlay/PgcIndexPage.xaml index 891d6af03..277b9fe87 100644 --- a/src/App/Pages/Overlay/PgcIndexPage.xaml +++ b/src/App/Pages/Overlay/PgcIndexPage.xaml @@ -115,6 +115,7 @@ ActionContent="{loc:LocaleLocator Name=Refresh}" Text="{x:Bind ViewModel.IndexErrorText, Mode=OneWay}" Visibility="{x:Bind ViewModel.IsIndexError, Mode=OneWay}" /> + diff --git a/src/ViewModels/ViewModels.Uwp.UnitTests/ViewModels.Uwp.UnitTests.csproj b/src/ViewModels/ViewModels.Uwp.UnitTests/ViewModels.Uwp.UnitTests.csproj index 984e0c18c..42645965f 100644 --- a/src/ViewModels/ViewModels.Uwp.UnitTests/ViewModels.Uwp.UnitTests.csproj +++ b/src/ViewModels/ViewModels.Uwp.UnitTests/ViewModels.Uwp.UnitTests.csproj @@ -41,22 +41,11 @@ - - 5.10.3 - 6.2.12 - - 16.7.1 - - - 2.4.1 - - - 2.4.1 - runtime; build; native; contentfiles; analyzers - all + + 3.9.22 diff --git a/src/ViewModels/ViewModels.Uwp/Pgc/PgcViewModelBase.cs b/src/ViewModels/ViewModels.Uwp/Pgc/PgcViewModelBase.cs index 0a76aeec5..bf5ed1b5b 100644 --- a/src/ViewModels/ViewModels.Uwp/Pgc/PgcViewModelBase.cs +++ b/src/ViewModels/ViewModels.Uwp/Pgc/PgcViewModelBase.cs @@ -105,6 +105,12 @@ public PgcViewModelBase(PgcType type) [Reactive] public bool IsIndexRequested { get; set; } + /// + /// 是否显示为空白. + /// + [Reactive] + public bool IsEmpty { get; set; } + /// /// 加载索引. /// @@ -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); } } @@ -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; } } }