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

Commit

Permalink
#4 update to Alpha0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kitUIN committed Feb 26, 2022
1 parent 35f866c commit eec689e
Show file tree
Hide file tree
Showing 44 changed files with 973 additions and 274 deletions.
2 changes: 1 addition & 1 deletion App.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "pch.h"

#include "App.h"
#include "MainPage.h"
#include "Pages/MainPage.h"


using namespace winrt;
Expand Down
68 changes: 35 additions & 33 deletions ClassificationPage.cpp → Pages/ClassificationPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

using namespace winrt;
using namespace Windows::UI::Xaml;

//todo 分区封印
namespace winrt::bikabika::implementation
{
ClassificationPage::ClassificationPage()
Expand All @@ -26,40 +26,42 @@ namespace winrt::bikabika::implementation
Windows::Foundation::IAsyncAction ClassificationPage::ContentDialogShow(hstring const& mode, hstring const& message)
{
Windows::ApplicationModel::Resources::ResourceLoader resourceLoader{ Windows::ApplicationModel::Resources::ResourceLoader::GetForCurrentView() };
if (mode == L"Timeout") {
auto show{ PicErrorDialog().ShowAsync() };
}
else {
HttpContentDialog().Title(box_value(resourceLoader.GetString(L"FailHttpTitle")));
HttpContentDialog().CloseButtonText(resourceLoader.GetString(L"FailCloseButtonText"));
if (mode == L"Error")
{
HttpContentDialog().Content(box_value(message));
auto show{ co_await HttpContentDialog().ShowAsync() };
if (mode == L"Timeout") {
auto show{ PicErrorDialog().ShowAsync() };
}
else {
HttpContentDialog().Title(box_value(resourceLoader.GetString(L"FailHttpTitle")));
HttpContentDialog().CloseButtonText(resourceLoader.GetString(L"FailCloseButtonText"));
if (mode == L"Error")
{
HttpContentDialog().Content(box_value(message));

auto show{ co_await HttpContentDialog().ShowAsync() };

}
else if (mode == L"Unknown")
{
Windows::Data::Json::JsonObject resp = Windows::Data::Json::JsonObject::Parse(message);
HttpContentDialog().Content(box_value(to_hstring(resp.GetNamedNumber(L"code")) + L":" + resp.GetNamedString(L"message")));
auto show{ co_await HttpContentDialog().ShowAsync() };
}
else if (mode == L"Unknown")
{
Windows::Data::Json::JsonObject resp = Windows::Data::Json::JsonObject::Parse(message);
HttpContentDialog().Content(box_value(to_hstring(resp.GetNamedNumber(L"code")) + L":" + resp.GetNamedString(L"message")));
HttpContentDialog().IsTextScaleFactorEnabled(true);
auto show{ co_await HttpContentDialog().ShowAsync() };

}
else if (mode == L"1005")
{
HttpContentDialog().Content(box_value(resourceLoader.GetString(L"FailAuth")));
extern bool m_login;
m_login = false;
auto show{ co_await HttpContentDialog().ShowAsync() };
if (show == winrt::Windows::UI::Xaml::Controls::ContentDialogResult::None)
{
auto loginTeachingTip = Frame().Parent().as<Microsoft::UI::Xaml::Controls::NavigationView>().Parent().as<Windows::UI::Xaml::Controls::Grid>().Children().GetAt(3).as<Microsoft::UI::Xaml::Controls::TeachingTip>();
Windows::ApplicationModel::Resources::ResourceLoader resourceLoader{ Windows::ApplicationModel::Resources::ResourceLoader::GetForCurrentView() };
loginTeachingTip.Title(resourceLoader.GetString(L"LoginButton/Content"));
loginTeachingTip.IsOpen(true);
}
}
}
}
else if (mode == L"1005")
{
HttpContentDialog().Content(box_value(resourceLoader.GetString(L"FailAuth")));
HttpContentDialog().IsTextScaleFactorEnabled(true);
extern bool m_login;
m_login = false;
auto show{ co_await HttpContentDialog().ShowAsync() };
if (show == winrt::Windows::UI::Xaml::Controls::ContentDialogResult::None)
{
auto loginTeachingTip = Frame().Parent().as<Microsoft::UI::Xaml::Controls::NavigationView>().Parent().as<Windows::UI::Xaml::Controls::Grid>().Children().GetAt(3).as<Microsoft::UI::Xaml::Controls::TeachingTip>();
loginTeachingTip.Title(resourceLoader.GetString(L"LoginButton/Content"));
loginTeachingTip.IsOpen(true);
}
}
}
ErrorTip().IsOpen(true);
}
Windows::Foundation::IAsyncAction ClassificationPage::Init()
Expand Down
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions ClassificationPage.xaml → Pages/ClassificationPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
</DataTemplate>
</ContentDialog.TitleTemplate>
<StackPanel HorizontalAlignment="Center">
<TextBlock x:Uid="ErrorText1" HorizontalAlignment="Center" FontWeight="Bold"/>
<TextBlock x:Uid="ErrorText2" HorizontalAlignment="Center"/>
<TextBlock x:Uid="ErrorText3" HorizontalAlignment="Center" FontWeight="Bold"/>
<TextBlock x:Uid="ErrorText4" HorizontalAlignment="Center" FontWeight="Bold"/>
<TextBlock IsTextSelectionEnabled="True" x:Uid="ErrorText1" HorizontalAlignment="Center" FontWeight="Bold"/>
<TextBlock IsTextSelectionEnabled="True" x:Uid="ErrorText2" HorizontalAlignment="Center"/>
<TextBlock IsTextSelectionEnabled="True" HorizontalAlignment="Center" FontWeight="Bold"/>
<TextBlock IsTextSelectionEnabled="True" HorizontalAlignment="Center" FontWeight="Bold"/>
</StackPanel>
</ContentDialog >
<ContentDialog x:Name="HttpContentDialog" x:Uid="HttpContentDialog" Background="{StaticResource SystemAccentColorLight2}">
Expand Down
4 changes: 3 additions & 1 deletion ComicsPage.cpp → Pages/ComicsPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,28 @@ namespace winrt::bikabika::implementation
if (mode == L"Error")
{
HttpContentDialog().Content(box_value(message));

auto show{ co_await HttpContentDialog().ShowAsync() };

}
else if (mode == L"Unknown")
{
Windows::Data::Json::JsonObject resp = Windows::Data::Json::JsonObject::Parse(message);
HttpContentDialog().Content(box_value(to_hstring(resp.GetNamedNumber(L"code")) + L":" + resp.GetNamedString(L"message")));
HttpContentDialog().IsTextScaleFactorEnabled(true);
auto show{ co_await HttpContentDialog().ShowAsync() };

}
else if (mode == L"1005")
{
HttpContentDialog().Content(box_value(resourceLoader.GetString(L"FailAuth")));
HttpContentDialog().IsTextScaleFactorEnabled(true);
extern bool m_login;
m_login = false;
auto show{ co_await HttpContentDialog().ShowAsync() };
if (show == winrt::Windows::UI::Xaml::Controls::ContentDialogResult::None)
{
auto loginTeachingTip = Frame().Parent().as<Microsoft::UI::Xaml::Controls::NavigationView>().Parent().as<Windows::UI::Xaml::Controls::Grid>().Children().GetAt(3).as<Microsoft::UI::Xaml::Controls::TeachingTip>();
Windows::ApplicationModel::Resources::ResourceLoader resourceLoader{ Windows::ApplicationModel::Resources::ResourceLoader::GetForCurrentView() };
loginTeachingTip.Title(resourceLoader.GetString(L"LoginButton/Content"));
loginTeachingTip.IsOpen(true);
}
Expand Down
File renamed without changes.
File renamed without changes.
18 changes: 12 additions & 6 deletions ComicsPage.xaml → Pages/ComicsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,19 @@
</DataTemplate>
</ContentDialog.TitleTemplate>
<StackPanel HorizontalAlignment="Center">
<TextBlock x:Uid="ErrorText1" HorizontalAlignment="Center" FontWeight="Bold"/>
<TextBlock x:Uid="ErrorText2" HorizontalAlignment="Center"/>
<TextBlock x:Uid="ErrorText3" HorizontalAlignment="Center" FontWeight="Bold"/>
<TextBlock x:Uid="ErrorText4" HorizontalAlignment="Center" FontWeight="Bold"/>
<TextBlock IsTextSelectionEnabled="True" x:Uid="ErrorText1" HorizontalAlignment="Center" FontWeight="Bold"/>
<TextBlock IsTextSelectionEnabled="True" x:Uid="ErrorText2" HorizontalAlignment="Center"/>
<TextBlock IsTextSelectionEnabled="True" HorizontalAlignment="Center" FontWeight="Bold"/>
<TextBlock IsTextSelectionEnabled="True" HorizontalAlignment="Center" FontWeight="Bold"/>
</StackPanel>
</ContentDialog >
<ContentDialog x:Name="HttpContentDialog" Background="{StaticResource SystemAccentColorLight2}" />
<ContentDialog x:Name="HttpContentDialog" x:Uid="HttpContentDialog" Background="{StaticResource SystemAccentColorLight2}">
<ContentDialog.TitleTemplate>
<DataTemplate>
<Image Source="ms-appx:///Assets//Picacgs//icon_exclamation_error.png" Width="270" Height="270" HorizontalAlignment="Center"/>
</DataTemplate>
</ContentDialog.TitleTemplate>
</ContentDialog >
<ScrollViewer Margin="3,38,0,10">
<StackPanel >

Expand Down Expand Up @@ -148,7 +154,7 @@
<Border Height="40" CornerRadius="10" VerticalAlignment="Top" Background="{ThemeResource MyAcrylicBrushLight1}">
<Grid>
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Left" Margin="10,0,0,0">
<TextBlock Text="{x:Bind MyPageNumBox.Title,Mode=OneWay}" FontSize="25" Margin="10,0,0,3" FontWeight="ExtraBlack" VerticalAlignment="Center" Foreground="{ThemeResource SystemAccentColorDark3}"/>
<TextBlock IsTextSelectionEnabled="True" Text="{x:Bind MyPageNumBox.Title,Mode=OneWay}" FontSize="25" Margin="10,0,0,3" FontWeight="ExtraBlack" VerticalAlignment="Center" Foreground="{ThemeResource SystemAccentColorDark3}"/>


</StackPanel>
Expand Down
73 changes: 37 additions & 36 deletions Pages/HomePage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,43 +32,44 @@ namespace winrt::bikabika::implementation
loginData.Values().Insert(L"token", box_value(L"sadf"));*/

}
Windows::Foundation::IAsyncAction HomePage::ContentDialogShow(hstring const& mode, hstring const& message)
{
Windows::ApplicationModel::Resources::ResourceLoader resourceLoader{ Windows::ApplicationModel::Resources::ResourceLoader::GetForCurrentView() };
if (mode == L"Timeout") {
auto show{ PicErrorDialog().ShowAsync() };
}
else {
HttpContentDialog().Title(box_value(resourceLoader.GetString(L"FailHttpTitle")));
HttpContentDialog().CloseButtonText(resourceLoader.GetString(L"FailCloseButtonText"));
if (mode == L"Error")
{
HttpContentDialog().Content(box_value(message));
auto show{ co_await HttpContentDialog().ShowAsync() };
Windows::Foundation::IAsyncAction HomePage::ContentDialogShow(hstring const& mode, hstring const& message)
{
Windows::ApplicationModel::Resources::ResourceLoader resourceLoader{ Windows::ApplicationModel::Resources::ResourceLoader::GetForCurrentView() };
if (mode == L"Timeout") {
auto show{ PicErrorDialog().ShowAsync() };
}
else {
HttpContentDialog().Title(box_value(resourceLoader.GetString(L"FailHttpTitle")));
HttpContentDialog().CloseButtonText(resourceLoader.GetString(L"FailCloseButtonText"));
if (mode == L"Error")
{
HttpContentDialog().Content(box_value(message));

}
else if (mode == L"Unknown")
{
Windows::Data::Json::JsonObject resp = Windows::Data::Json::JsonObject::Parse(message);
HttpContentDialog().Content(box_value(to_hstring(resp.GetNamedNumber(L"code")) + L":" + resp.GetNamedString(L"message")));
auto show{ co_await HttpContentDialog().ShowAsync() };
auto show{ co_await HttpContentDialog().ShowAsync() };

}
else if (mode == L"1005")
{
HttpContentDialog().Content(box_value(resourceLoader.GetString(L"FailAuth")));
extern bool m_login;
m_login = false;
auto show{ co_await HttpContentDialog().ShowAsync() };
if (show == winrt::Windows::UI::Xaml::Controls::ContentDialogResult::None)
{
auto loginTeachingTip = Frame().Parent().as<Microsoft::UI::Xaml::Controls::NavigationView>().Parent().as<Windows::UI::Xaml::Controls::Grid>().Children().GetAt(3).as<Microsoft::UI::Xaml::Controls::TeachingTip>();
Windows::ApplicationModel::Resources::ResourceLoader resourceLoader{ Windows::ApplicationModel::Resources::ResourceLoader::GetForCurrentView() };
loginTeachingTip.Title(resourceLoader.GetString(L"LoginButton/Content"));
loginTeachingTip.IsOpen(true);
}
}
}
}
else if (mode == L"Unknown")
{
Windows::Data::Json::JsonObject resp = Windows::Data::Json::JsonObject::Parse(message);
HttpContentDialog().Content(box_value(to_hstring(resp.GetNamedNumber(L"code")) + L":" + resp.GetNamedString(L"message")));
HttpContentDialog().IsTextScaleFactorEnabled(true);
auto show{ co_await HttpContentDialog().ShowAsync() };

}
}
else if (mode == L"1005")
{
HttpContentDialog().Content(box_value(resourceLoader.GetString(L"FailAuth")));
HttpContentDialog().IsTextScaleFactorEnabled(true);
extern bool m_login;
m_login = false;
auto show{ co_await HttpContentDialog().ShowAsync() };
if (show == winrt::Windows::UI::Xaml::Controls::ContentDialogResult::None)
{
auto loginTeachingTip = Frame().Parent().as<Microsoft::UI::Xaml::Controls::NavigationView>().Parent().as<Windows::UI::Xaml::Controls::Grid>().Children().GetAt(3).as<Microsoft::UI::Xaml::Controls::TeachingTip>();
loginTeachingTip.Title(resourceLoader.GetString(L"LoginButton/Content"));
loginTeachingTip.IsOpen(true);
}
}
}
}
}
8 changes: 4 additions & 4 deletions Pages/HomePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
</DataTemplate>
</ContentDialog.TitleTemplate>
<StackPanel HorizontalAlignment="Center">
<TextBlock x:Uid="ErrorText1" HorizontalAlignment="Center" FontWeight="Bold"/>
<TextBlock x:Uid="ErrorText2" HorizontalAlignment="Center"/>
<TextBlock x:Uid="ErrorText3" HorizontalAlignment="Center" FontWeight="Bold"/>
<TextBlock x:Uid="ErrorText4" HorizontalAlignment="Center" FontWeight="Bold"/>
<TextBlock IsTextSelectionEnabled="True" x:Uid="ErrorText1" HorizontalAlignment="Center" FontWeight="Bold"/>
<TextBlock IsTextSelectionEnabled="True" x:Uid="ErrorText2" HorizontalAlignment="Center"/>
<TextBlock IsTextSelectionEnabled="True" HorizontalAlignment="Center" FontWeight="Bold"/>
<TextBlock IsTextSelectionEnabled="True" HorizontalAlignment="Center" FontWeight="Bold"/>
</StackPanel>
</ContentDialog >
<ContentDialog x:Name="HttpContentDialog" x:Uid="HttpContentDialog" Background="{StaticResource SystemAccentColorLight2}">
Expand Down
Loading

0 comments on commit eec689e

Please sign in to comment.