diff --git a/HyPlayer/Pages/BasePage.xaml b/HyPlayer/Pages/BasePage.xaml index 8a42a798..92f4b043 100644 --- a/HyPlayer/Pages/BasePage.xaml +++ b/HyPlayer/Pages/BasePage.xaml @@ -2,45 +2,43 @@ x:Class="HyPlayer.Pages.BasePage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" + xmlns:controls1="using:Microsoft.UI.Xaml.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:hyPlayer="using:HyPlayer" - xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:media="using:Windows.UI.Xaml.Media" - xmlns:controls1="using:Microsoft.UI.Xaml.Controls" mc:Ignorable="d"> + Loaded="NavMain_Loaded" + SelectionChanged="NavMain_OnSelectionChanged"> - - + + + Width="20" + Margin="5,0,0,0" /> - + - - - - + + + + + Text="登录到网易云音乐" /> + KeyDown="TextBoxAccount_OnKeyDown" + PlaceholderText="手机 / 邮箱" /> + KeyDown="TextBoxPassword_OnKeyDown" + PlaceholderText="密码" /> - + Style="{StaticResource AccentButtonStyle}" /> + 登录代表你同意相关条款 diff --git a/HyPlayer/Pages/BasePage.xaml.cs b/HyPlayer/Pages/BasePage.xaml.cs index 93b5c2ec..9c3c42be 100644 --- a/HyPlayer/Pages/BasePage.xaml.cs +++ b/HyPlayer/Pages/BasePage.xaml.cs @@ -82,10 +82,8 @@ private async void LoadLoginData() PersonPictureUser.ProfilePicture = new BitmapImage(new Uri(json["profile"]["avatarUrl"].ToString())); } - } catch (Exception) { } - } private async void ButtonLogin_OnClick(object sender, RoutedEventArgs e) @@ -96,7 +94,6 @@ private async void ButtonLogin_OnClick(object sender, RoutedEventArgs e) JObject json; try { - var queries = new Dictionary(); var account = TextBoxAccount.Text; var isPhone = Regex.Match(account, "^[0-9]+$").Success; @@ -167,14 +164,15 @@ private async void NavMain_OnSelectionChanged(NavigationView sender, NavigationV case "PageMe": Common.BaseFrame.Navigate(typeof(Pages.Me), null, new EntranceNavigationTransitionInfo()); break; + case "PageHome": Common.BaseFrame.Navigate(typeof(Pages.Home), null, new EntranceNavigationTransitionInfo()); break; + case "PageSearch": Common.BaseFrame.Navigate(typeof(Search), null, new EntranceNavigationTransitionInfo()); break; } - } private void OnNavigateBack(NavigationView sender, NavigationViewBackRequestedEventArgs args) @@ -198,5 +196,11 @@ private void TextBoxPassword_OnKeyDown(object sender, KeyRoutedEventArgs e) ButtonLogin_OnClick(null, null); } } + + private void NavMain_Loaded(object sender, RoutedEventArgs e) + { + NavMain.SelectedItem = NavMain.MenuItems[0]; + Common.BaseFrame.Navigate(typeof(Home)); + } } -} +} \ No newline at end of file