This commit is contained in:
Lightczx
2024-01-08 11:36:16 +08:00
parent 04df5a7bf1
commit e8a459cb41
6 changed files with 48 additions and 88 deletions

View File

@@ -1859,6 +1859,27 @@
<data name="ViewPageFeedBackBasicInformation" xml:space="preserve">
<value>基本信息</value>
</data>
<data name="ViewPageFeedbackCommonLinksHeader" xml:space="preserve">
<value>常用链接</value>
</data>
<data name="ViewPageFeedbackEngageWithUsDescription" xml:space="preserve">
<value>与我们密切联系</value>
</data>
<data name="ViewPageFeedbackFeatureGuideHeader" xml:space="preserve">
<value>功能指南</value>
</data>
<data name="ViewPageFeedbackGithubIssuesDescription" xml:space="preserve">
<value>我们总是优先处理 Github 上的问题</value>
</data>
<data name="ViewPageFeedbackRoadmapDescription" xml:space="preserve">
<value>开发路线规划</value>
</data>
<data name="ViewPageFeedbackServerStatusDescription" xml:space="preserve">
<value>胡桃服务可用性监控</value>
</data>
<data name="ViewPageFeedbackServerStatusHeader" xml:space="preserve">
<value>胡桃服务</value>
</data>
<data name="ViewPageGachaLogAggressiveRefresh" xml:space="preserve">
<value>全量刷新</value>
</data>

View File

@@ -1,46 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
using Snap.Hutao.View.Page;
namespace Snap.Hutao.Service.Navigation;
[Injection(InjectAs.Singleton, typeof(IDocumentationProvider))]
[ConstructorGenerated]
internal sealed partial class DocumentationProvider : IDocumentationProvider
{
private const string Home = "https://hut.ao";
private static readonly Dictionary<Type, string> TypeDocumentations = new()
{
[typeof(AnnouncementPage)] = "https://hut.ao/features/dashboard.html",
[typeof(LaunchGamePage)] = "https://hut.ao/features/game-launcher.html",
[typeof(GachaLogPage)] = "https://hut.ao/features/wish-export.html",
[typeof(AchievementPage)] = "https://hut.ao/features/achievements.html",
[typeof(DailyNotePage)] = "https://hut.ao/features/real-time-notes.html",
[typeof(AvatarPropertyPage)] = "https://hut.ao/features/character-data.html",
[typeof(SpiralAbyssRecordPage)] = "https://hut.ao/features/hutao-API.html",
[typeof(CultivationPage)] = "https://hut.ao/features/develop-plan.html",
[typeof(WikiAvatarPage)] = "https://hut.ao/features/character-wiki.html",
[typeof(WikiMonsterPage)] = "https://hut.ao/features/monster-wiki.html",
[typeof(WikiWeaponPage)] = "https://hut.ao/features/weapon-wiki.html",
[typeof(SettingPage)] = "https://hut.ao/features/hutao-settings.html",
[typeof(LoginHoyoverseUserPage)] = "https://hut.ao/features/mhy-account-switch.html",
[typeof(LoginMihoyoUserPage)] = "https://hut.ao/features/mhy-account-switch.html",
[typeof(TestPage)] = Home,
};
private readonly INavigationService navigationService;
public string GetDocumentation()
{
if (navigationService.Current is { } type)
{
return TypeDocumentations[type];
}
return Home;
}
}

View File

@@ -1,9 +0,0 @@
// Copyright (c) DGP Studio. All rights reserved.
// Licensed under the MIT license.
namespace Snap.Hutao.Service.Navigation;
internal interface IDocumentationProvider
{
string GetDocumentation();
}

View File

@@ -51,7 +51,33 @@
</cwc:SettingsExpander.Items>
</cwc:SettingsExpander>
<cwc:SettingsExpander
Header="功能指南"
Description="{shcm:ResourceString Name=ViewPageFeedbackEngageWithUsDescription}"
Header="{shcm:ResourceString Name=ViewPageFeedbackCommonLinksHeader}"
HeaderIcon="{shcm:FontIcon Glyph=&#xE71B;}"
IsExpanded="True">
<cwc:SettingsExpander.Items>
<cwc:SettingsCard
Command="{Binding NavigateToUriCommand}"
CommandParameter="https://github.com/DGP-Studio/Snap.Hutao/issues/new/choose"
Description="{shcm:ResourceString Name=ViewPageFeedbackGithubIssuesDescription}"
Header="Github Issues"
IsClickEnabled="True"/>
<cwc:SettingsCard
Command="{Binding NavigateToUriCommand}"
CommandParameter="https://github.com/orgs/DGP-Studio/projects/2"
Description="{shcm:ResourceString Name=ViewPageFeedbackRoadmapDescription}"
Header="Github Projects"
IsClickEnabled="True"/>
<cwc:SettingsCard
Command="{Binding NavigateToUriCommand}"
CommandParameter="https://status.hut.ao"
Description="{shcm:ResourceString Name=ViewPageFeedbackServerStatusDescription}"
Header="{shcm:ResourceString Name=ViewPageFeedbackServerStatusHeader}"
IsClickEnabled="True"/>
</cwc:SettingsExpander.Items>
</cwc:SettingsExpander>
<cwc:SettingsExpander
Header="{shcm:ResourceString Name=ViewPageFeedbackFeatureGuideHeader}"
HeaderIcon="{shcm:FontIcon Glyph=&#xF8A5;}"
IsExpanded="True">
<cwc:SettingsExpander.Items>

View File

@@ -61,31 +61,6 @@
</ResourceDictionary>
</StackPanel.Resources>
<Button
Margin="4,0"
Padding="6,6"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Command="{Binding OpenDocumentationCommand}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<BitmapIcon
Grid.Column="0"
Width="24"
Height="24"
ShowAsMonochrome="False"
UriSource="ms-appx:///Resource/Navigation/Documentation.png"/>
<TextBlock
Grid.Column="1"
Margin="13,0,0,0"
VerticalAlignment="Center"
Text="{shcm:ResourceString Name=ViewUserDocumentationHeader}"/>
</Grid>
</Button>
<Button MaxHeight="40" Margin="4,0">
<Button.Content>
<Grid>

View File

@@ -32,7 +32,6 @@ namespace Snap.Hutao.ViewModel.User;
internal sealed partial class UserViewModel : ObservableObject
{
private readonly IContentDialogFactory contentDialogFactory;
private readonly IDocumentationProvider documentationProvider;
private readonly INavigationService navigationService;
private readonly IServiceProvider serviceProvider;
private readonly IInfoBarService infoBarService;
@@ -280,10 +279,4 @@ internal sealed partial class UserViewModel : ObservableObject
FlyoutBase.ShowAttachedFlyout(appBarButton);
infoBarService.Warning(message);
}
[Command("OpenDocumentationCommand")]
private async Task OpenDocumentationAsync()
{
await Launcher.LaunchUriAsync(new(documentationProvider.GetDocumentation()));
}
}