This commit is contained in:
Lightczx
2023-10-20 11:44:42 +08:00
committed by DismissedLight
parent 91f6665849
commit ba7ba3af44
3 changed files with 35 additions and 20 deletions

View File

@@ -195,7 +195,24 @@
Value="{Binding LastPurplePull}"/>
</Grid>
</StackPanel>
<MenuFlyoutSeparator Margin="-12,0"/>
<Grid Margin="-12,-2" ColumnSpacing="8">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<MenuFlyoutSeparator Grid.Column="0"/>
<TextBlock
Grid.Column="1"
Margin="0,0,0,0"
HorizontalAlignment="Center"
Opacity="0.6"
Style="{StaticResource CaptionTextBlockStyle}"
Text="{Binding TimeSpanFormatted}"/>
<MenuFlyoutSeparator Grid.Column="2"/>
</Grid>
<shvcont:StatisticsSegmented
x:Name="StatisticsSegmented"
Margin="0,12,0,0"
@@ -209,15 +226,20 @@
<cwcont:Case Value="{shcm:Int32 Value=0}">
<StackPanel Spacing="2">
<Grid>
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Text="{shcm:ResourceString Name=ViewControlStatisticsCardOrangeAveragePullText}"/>
<TextBlock
HorizontalAlignment="Left"
Style="{StaticResource BodyTextBlockStyle}"
Text="{shcm:ResourceString Name=ViewControlStatisticsCardOrangeAveragePullText}"/>
<TextBlock
HorizontalAlignment="Right"
Style="{StaticResource BodyTextBlockStyle}"
Text="{Binding AverageOrangePullFormatted}"/>
</Grid>
<Grid>
<!-- 高度占位符 -->
<TextBlock/>
<TextBlock
HorizontalAlignment="Left"
Style="{StaticResource BodyTextBlockStyle}"
Text="{shcm:ResourceString Name=ViewControlStatisticsCardUpAveragePullText}"
Visibility="{x:Bind ShowUpPull, Converter={StaticResource BoolToVisibilityConverter}}"/>
@@ -237,12 +259,14 @@
Style="{StaticResource BodyTextBlockStyle}"
Text="{Binding MinOrangePullFormatted}"/>
</Grid>
<Grid/>
</StackPanel>
</cwcont:Case>
<cwcont:Case Value="{shcm:Int32 Value=1}">
<StackPanel Spacing="2">
<Grid>
<TextBlock
HorizontalAlignment="Left"
Foreground="{StaticResource OrangeColorBrush}"
Style="{StaticResource BodyTextBlockStyle}"
Text="{shcm:ResourceString Name=ViewControlStatisticsCardOrangeText}"/>
@@ -255,6 +279,7 @@
</Grid>
<Grid>
<TextBlock
HorizontalAlignment="Left"
Foreground="{StaticResource PurpleColorBrush}"
Style="{StaticResource BodyTextBlockStyle}"
Text="{shcm:ResourceString Name=ViewControlStatisticsCardPurpleText}"/>
@@ -267,6 +292,7 @@
</Grid>
<Grid>
<TextBlock
HorizontalAlignment="Left"
Foreground="{StaticResource BlueColorBrush}"
Style="{StaticResource BodyTextBlockStyle}"
Text="{shcm:ResourceString Name=ViewControlStatisticsCardBlueText}"/>

View File

@@ -19,20 +19,9 @@ internal abstract class Wish
/// </summary>
public int TotalCount { get; set; }
/// <summary>
/// 统计开始时间
/// </summary>
public string FromFormatted
public string TimeSpanFormatted
{
get => $"{From:yyyy.MM.dd}";
}
/// <summary>
/// 统计开始时间
/// </summary>
public string ToFormatted
{
get => $"{To:yyyy.MM.dd}";
get => $"{From:yyyy.MM.dd} - {To:yyyy.MM.dd}";
}
/// <summary>

View File

@@ -53,11 +53,11 @@ internal class MiHoYoJSInterface
private CoreWebView2 coreWebView2;
public MiHoYoJSInterface(CoreWebView2 webView, UserAndUid userAndUid)
public MiHoYoJSInterface(CoreWebView2 coreWebView2, UserAndUid userAndUid)
{
// 由于Webview2 的作用域特殊性,我们在此处直接使用根服务
serviceProvider = Ioc.Default;
this.coreWebView2 = webView;
this.coreWebView2 = coreWebView2;
this.userAndUid = userAndUid;
taskContext = serviceProvider.GetRequiredService<ITaskContext>();
@@ -67,9 +67,9 @@ internal class MiHoYoJSInterface
domContentLoadedEventHandler = OnDOMContentLoaded;
navigationStartingEventHandler = OnNavigationStarting;
webView.WebMessageReceived += webMessageReceivedEventHandler;
webView.DOMContentLoaded += domContentLoadedEventHandler;
webView.NavigationStarting += navigationStartingEventHandler;
coreWebView2.WebMessageReceived += webMessageReceivedEventHandler;
coreWebView2.DOMContentLoaded += domContentLoadedEventHandler;
coreWebView2.NavigationStarting += navigationStartingEventHandler;
}
public event Action? ClosePageRequested;