Skip to content

Commit

Permalink
add dailynote refresh time hint
Browse files Browse the repository at this point in the history
  • Loading branch information
Lightczx committed Aug 24, 2023
1 parent 5a952d8 commit b3de8b1
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 13 deletions.
3 changes: 3 additions & 0 deletions src/Snap.Hutao/Snap.Hutao/Model/Entity/DailyNoteEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ internal sealed class DailyNoteEntry : ObservableObject, IMappingFrom<DailyNoteE
/// </summary>
public DateTimeOffset RefreshTime { get; set; }

[NotMapped]
public string RefreshTimeFormatted { get => SH.ModelEntityDailyNoteRefreshTimeFormat.Format(RefreshTime); }

/// <summary>
/// 树脂提醒阈值
/// </summary>
Expand Down
18 changes: 18 additions & 0 deletions src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/Snap.Hutao/Snap.Hutao/Resource/Localization/SH.resx
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@
<data name="ModelBindingUserInitializationFailed" xml:space="preserve">
<value>网络异常</value>
</data>
<data name="ModelEntityDailyNoteRefreshTimeFormat" xml:space="preserve">
<value>刷新于 {0:yyyy/MM/dd HH:mm:ss}</value>
</data>
<data name="ModelEntitySpiralAbyssScheduleFormat" xml:space="preserve">
<value>第 {0} 期</value>
</data>
Expand Down Expand Up @@ -2033,6 +2036,9 @@
<data name="WebDailyNoteHomeCoinRecoveryFormat" xml:space="preserve">
<value>预计 {0} {1:HH:mm} 达到存储上限</value>
</data>
<data name="WebDailyNoteHomeLocked" xml:space="preserve">
<value>尚未解锁洞天</value>
</data>
<data name="WebDailyNoteRecoveryTimeDay0" xml:space="preserve">
<value>今天</value>
</data>
Expand Down
46 changes: 34 additions & 12 deletions src/Snap.Hutao/Snap.Hutao/View/Card/DailyNoteCard.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,38 @@
Visibility="{Binding IsInitialized, Converter={StaticResource BoolToVisibilityConverter}}">
<FlipView.ItemTemplate>
<DataTemplate>
<Grid Margin="12" ColumnSpacing="6">
<Grid
Margin="12"
ColumnSpacing="6"
RowSpacing="6">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>

<Grid Grid.Column="0" RowSpacing="6">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock
Grid.Row="0"
HorizontalAlignment="Center"
Text="{Binding Uid}"/>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<TextBlock
Grid.Row="0"
HorizontalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{Binding Uid}"/>
<TextBlock
Grid.Row="0"
Grid.Column="1"
Grid.ColumnSpan="2"
HorizontalAlignment="Center"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{Binding RefreshTimeFormatted}"/>

<Grid
Grid.Row="1"
Grid.Column="0"
RowSpacing="6">

<Grid Grid.Row="1" Style="{StaticResource BorderGridStyle}">
<StackPanel VerticalAlignment="Center">
<shci:CachedImage shvh:FrameworkElementHelper.SquareLength="64" Source="{StaticResource UI_ItemIcon_210}"/>
Expand All @@ -65,7 +81,10 @@
</Grid>
</Grid>

<Grid Grid.Column="1" RowSpacing="6">
<Grid
Grid.Row="1"
Grid.Column="1"
RowSpacing="6">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
Expand Down Expand Up @@ -108,7 +127,10 @@
</Grid>

</Grid>
<Grid Grid.Column="2" RowSpacing="6">
<Grid
Grid.Row="1"
Grid.Column="2"
RowSpacing="6">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
Expand Down
7 changes: 7 additions & 0 deletions src/Snap.Hutao/Snap.Hutao/View/Page/DailyNotePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>

<Grid.Resources>
Expand Down Expand Up @@ -453,6 +454,12 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock
Grid.Row="4"
Margin="0,6,0,0"
Opacity="0.7"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{Binding RefreshTimeFormatted}"/>
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public string ResinDiscountFormatted
[JsonIgnore]
public string HomeCoinFormatted
{
get => $"{CurrentHomeCoin}/{MaxHomeCoin}";
get => MaxHomeCoin == 0 ? SH.WebDailyNoteHomeLocked : $"{CurrentHomeCoin}/{MaxHomeCoin}";
}

/// <summary>
Expand Down

0 comments on commit b3de8b1

Please sign in to comment.