Skip to content

Commit

Permalink
用户空间中支持一键打开全部投稿视频
Browse files Browse the repository at this point in the history
  • Loading branch information
ywmoyue committed May 18, 2024
1 parent 0c2df76 commit febe5f9
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/BiliLite.UWP/Models/Common/Video/VideoPlaylist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ public class VideoPlaylist
public int Index { get; set; }

public List<VideoPlaylistItem> Playlist { get; set; }

public string Title { get; set; }
}
}
4 changes: 3 additions & 1 deletion src/BiliLite.UWP/Pages/User/FavoriteDetailPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class FavoriteDetailArgs
public sealed partial class FavoriteDetailPage : BasePage, IRefreshablePage
{
FavoriteDetailVM favoriteDetailVM;

public FavoriteDetailPage()
{
this.InitializeComponent();
Expand Down Expand Up @@ -191,7 +192,8 @@ private async void PlayAll_Click(object sender, RoutedEventArgs e)
parameters = new VideoPlaylist()
{
Index = 0,
Playlist = items
Playlist = items,
Title = $"收藏夹:{favoriteDetailVM.FavoriteInfo.title}"
}
});
}
Expand Down
3 changes: 2 additions & 1 deletion src/BiliLite.UWP/Pages/User/WatchlaterPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ private void Video_ItemClick(object sender, ItemClickEventArgs e)
parameters = new VideoPlaylist()
{
Index = watchLaterVM.Videos.IndexOf(data),
Playlist = items
Playlist = items,
Title = $"稍后再看"
}
});
}
Expand Down
8 changes: 7 additions & 1 deletion src/BiliLite.UWP/Pages/UserInfoPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@
OneRowModeEnabled="False">
<toolkit:AdaptiveGridView.Header>
<Grid Margin="4 8">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal">
<ComboBox DisplayMemberPath="Name" ItemsSource="{x:Bind Path=m_userSubmitVideoViewModel.Tlist,Mode=OneWay}" SelectionChanged="ComboBox_SelectionChanged" SelectedItem="{x:Bind Path=m_userSubmitVideoViewModel.SelectTid,Mode=TwoWay}">

Expand All @@ -235,7 +240,8 @@
<ComboBoxItem>最多播放</ComboBoxItem>
</ComboBox>
</StackPanel>
<AutoSuggestBox Text="{x:Bind Path=m_userSubmitVideoViewModel.Keyword,Mode=TwoWay}" x:Name="searchVideo" QuerySubmitted="searchVideo_QuerySubmitted" QueryIcon="Find" PlaceholderText="搜索视频" Width="160" HorizontalAlignment="Right"></AutoSuggestBox>
<Button Grid.Column="1" Margin="0 0 8 0" x:Name="BtnPlayAll" Tapped="BtnPlayAll_OnTapped">全部播放</Button>
<AutoSuggestBox Grid.Column="2" Text="{x:Bind Path=m_userSubmitVideoViewModel.Keyword,Mode=TwoWay}" x:Name="searchVideo" QuerySubmitted="searchVideo_QuerySubmitted" QueryIcon="Find" PlaceholderText="搜索视频" Width="160" HorizontalAlignment="Right"></AutoSuggestBox>
</Grid>
</toolkit:AdaptiveGridView.Header>
<toolkit:AdaptiveGridView.ItemContainerStyle>
Expand Down
33 changes: 33 additions & 0 deletions src/BiliLite.UWP/Pages/UserInfoPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
using BiliLite.Services;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Navigation;
using BiliLite.Models.Common.User;
using BiliLite.ViewModels.User;
using BiliLite.ViewModels.UserDynamic;
using Microsoft.Extensions.DependencyInjection;
using BiliLite.Models.Common.Video;
using BiliLite.Modules;
using System.Collections.Generic;

// https://go.microsoft.com/fwlink/?LinkId=234238 上介绍了“空白页”项模板

Expand Down Expand Up @@ -411,5 +415,34 @@ public async Task Refresh()
{
throw new System.NotImplementedException();
}

private void BtnPlayAll_OnTapped(object sender, TappedRoutedEventArgs e)
{
var items = new List<VideoPlaylistItem>();
foreach (var item in m_userSubmitVideoViewModel.SubmitVideoItems)
{
items.Add(new VideoPlaylistItem()
{
Cover = item.Pic,
Author = item.Author,
Id = item.Aid,
Title = item.Title
});

}

MessageCenter.NavigateToPage(this, new NavigationInfo()
{
icon = Symbol.Play,
page = typeof(VideoDetailPage),
title = "视频播放",
parameters = new VideoPlaylist()
{
Index = 0,
Playlist = items,
Title = $"{m_viewModel.UserInfo.Name}:全部视频",
}
});
}
}
}
7 changes: 4 additions & 3 deletions src/BiliLite.UWP/Pages/VideoDetailPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -347,10 +347,11 @@
RightTapped="txtDesc_RightTapped"
Holding="txtDesc_Holding" Tapped="txtDesc_Tapped"
IsTextSelectionEnabled="False"
TextTrimming="CharacterEllipsis"
TextTrimming="CharacterEllipsis"
TextWrapping="Wrap" Foreground="Gray"
Text="{x:Bind Path=m_viewModel.VideoInfo.Desc,Mode=OneWay}"></TextBlock>
<ContentControl x:Name="contentDesc" Foreground="Gray" ></ContentControl>
Text="{x:Bind Path=m_viewModel.VideoInfo.Desc,Mode=OneWay}">
</TextBlock>
<ContentControl x:Name="contentDesc" Foreground="Gray" ></ContentControl>
</StackPanel>
<toolkit:AdaptiveGridView
Visibility="{x:Bind Path=m_viewModel.VideoInfo.ShowPages,Mode=OneWay}"
Expand Down
2 changes: 1 addition & 1 deletion src/BiliLite.UWP/Pages/VideoDetailPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected async override void OnNavigatedTo(NavigationEventArgs e)
videoSections.Add(new VideoListSection()
{
Selected = true,
Title = "播放列表",
Title = videoPlaylist.Title,
Items = new List<VideoListItem>(),
});
foreach (var videoPlaylistItem in videoPlaylist.Playlist)
Expand Down

0 comments on commit febe5f9

Please sign in to comment.