forked from xiaoyaocz/biliuwp-lite
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 搜索页样式调整 * 整理搜索页代码 * 添加搜索页缓存 * 搜索页搜索框响应式处理 --------- Co-authored-by: ProJend <[email protected]>
- Loading branch information
Showing
32 changed files
with
2,002 additions
and
1,414 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
src/BiliLite.UWP/Controls/DataTemplateSelectors/SearchDataTemplateSelector.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using BiliLite.Models.Common; | ||
using BiliLite.ViewModels.Search; | ||
|
||
namespace BiliLite.Controls.DataTemplateSelectors | ||
{ | ||
public class SearchDataTemplateSelector : DataTemplateSelector | ||
{ | ||
public DataTemplate VideoTemplate { get; set; } | ||
public DataTemplate AnimeTemplate { get; set; } | ||
public DataTemplate TestTemplate { get; set; } | ||
public DataTemplate LiveRoomTemplate { get; set; } | ||
public DataTemplate UserTemplate { get; set; } | ||
public DataTemplate ArticTemplate { get; set; } | ||
public DataTemplate TopicTemplate { get; set; } | ||
protected override DataTemplate SelectTemplateCore(object item, DependencyObject container) | ||
{ | ||
var data = item as ISearchPivotViewModel; | ||
switch (data.SearchType) | ||
{ | ||
case SearchType.Video: | ||
return VideoTemplate; | ||
case SearchType.Anime: | ||
case SearchType.Movie: | ||
return AnimeTemplate; | ||
case SearchType.User: | ||
return UserTemplate; | ||
case SearchType.Live: | ||
return LiveRoomTemplate; | ||
case SearchType.Article: | ||
return ArticTemplate; | ||
case SearchType.Topic: | ||
return TopicTemplate; | ||
case SearchType.Anchor: | ||
return TestTemplate; | ||
default: | ||
return TestTemplate; | ||
} | ||
|
||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
namespace BiliLite.Models.Common.Search | ||
{ | ||
public class SearchAnimeItem | ||
{ | ||
public string type { get; set; } | ||
public string season_id { get; set; } | ||
public string media_id { get; set; } | ||
private string _title; | ||
|
||
public string title | ||
{ | ||
get { return _title; } | ||
set | ||
{ | ||
|
||
_title = System.Web.HttpUtility.HtmlDecode(value.Replace("<em class=\"keyword\">", "").Replace("</em>", "")); | ||
} | ||
} | ||
public string areas { get; set; } | ||
public string cv { get; set; } | ||
public string styles { get; set; } | ||
public string desc { get; set; } | ||
public long pubtime { get; set; } | ||
public string season_type_name { get; set; } | ||
|
||
private string _pic; | ||
public string cover | ||
{ | ||
get { return _pic; } | ||
set { _pic = value; } | ||
} | ||
|
||
public string angle_title { get; set; } | ||
public bool showBadge | ||
{ | ||
get | ||
{ | ||
return !string.IsNullOrEmpty(angle_title); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace BiliLite.Models.Common.Search | ||
{ | ||
public class SearchArea | ||
{ | ||
public SearchArea(string name, string area) | ||
{ | ||
this.name = name; | ||
this.area = area; | ||
} | ||
public string name { get; set; } | ||
public string area { get; set; } | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
src/BiliLite.UWP/Models/Common/Search/SearchArticleItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace BiliLite.Models.Common.Search | ||
{ | ||
public class SearchArticleItem | ||
{ | ||
|
||
public string mid { get; set; } | ||
|
||
private string _title; | ||
|
||
public string title | ||
{ | ||
get { return _title; } | ||
set | ||
{ | ||
_title = System.Web.HttpUtility.HtmlDecode(value.Replace("<em class=\"keyword\">", "").Replace("</em>", "")); | ||
} | ||
} | ||
public string category_name { get; set; } | ||
public string type { get; set; } | ||
public string desc { get; set; } | ||
public long like { get; set; } | ||
public long view { get; set; } | ||
public long reply { get; set; } | ||
public string id { get; set; } | ||
public List<string> image_urls { get; set; } | ||
public string cover | ||
{ | ||
get | ||
{ | ||
if (image_urls != null && image_urls.Count != 0) | ||
{ | ||
return "https:" + image_urls[0]; | ||
} | ||
return null; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace BiliLite.Models.Common.Search | ||
{ | ||
public class SearchFilterItem | ||
{ | ||
public SearchFilterItem(string name, string value) | ||
{ | ||
this.name = name; | ||
this.value = value; | ||
} | ||
public string name { get; set; } | ||
public string value { get; set; } | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
src/BiliLite.UWP/Models/Common/Search/SearchLiveRoomItem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
namespace BiliLite.Models.Common.Search | ||
{ | ||
public class SearchLiveRoomItem | ||
{ | ||
|
||
public string roomid { get; set; } | ||
|
||
private string _title; | ||
|
||
public string title | ||
{ | ||
get { return _title; } | ||
set | ||
{ | ||
|
||
_title = System.Web.HttpUtility.HtmlDecode(value.Replace("<em class=\"keyword\">", "").Replace("</em>", "")); | ||
} | ||
} | ||
public string uname { get; set; } | ||
public string tags { get; set; } | ||
public string cate_name { get; set; } | ||
public int online { get; set; } | ||
|
||
|
||
private string _user_cover; | ||
public string user_cover | ||
{ | ||
get { return _user_cover; } | ||
set { _user_cover = "https:" + value; } | ||
} | ||
private string _uface; | ||
public string uface | ||
{ | ||
get { return _uface; } | ||
set { _uface = "https:" + value; } | ||
} | ||
private string _cover; | ||
public string cover | ||
{ | ||
get { return _cover; } | ||
set { _cover = "https:" + value; } | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace BiliLite.Models.Common.Search | ||
{ | ||
public class SearchParameter | ||
{ | ||
public string Keyword { get; set; } | ||
|
||
public SearchType SearchType { get; set; } = SearchType.Video; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
namespace BiliLite.Models.Common.Search | ||
{ | ||
public class SearchTopicItem | ||
{ | ||
public string arcurl { get; set; } | ||
|
||
private string _title; | ||
|
||
public string title | ||
{ | ||
get { return _title; } | ||
set | ||
{ | ||
_title = System.Web.HttpUtility.HtmlDecode(value.Replace("<em class=\"keyword\">", "").Replace("</em>", "")); | ||
} | ||
} | ||
|
||
private string _description; | ||
|
||
public string description | ||
{ | ||
get { return _description; } | ||
set | ||
{ | ||
_description = value.Replace("<em class=\"keyword\">", "").Replace("</em>", ""); | ||
} | ||
} | ||
|
||
|
||
public long pubdate { get; set; } | ||
|
||
|
||
private string _pic; | ||
public string cover | ||
{ | ||
get { return _pic; } | ||
set { _pic = "https:" + value; } | ||
} | ||
|
||
|
||
} | ||
} |
Oops, something went wrong.