diff --git a/src/_locales/cmn-CN.yml b/src/_locales/cmn-CN.yml index 29ec705c..f12fa9e9 100644 --- a/src/_locales/cmn-CN.yml +++ b/src/_locales/cmn-CN.yml @@ -6,6 +6,7 @@ common: viewWithoutNum: 次 danmaku: '{count} 弹幕' danmakuWithoutNum: 弹幕 + anime_follow_count: '{count}人关注' year: 年前 month: 个月前 week: 个星期前 @@ -133,7 +134,7 @@ topbar: logo_dropdown: anime: 番剧 movies: 电影 - chinese_anime: 国创 + chinese_anime: 中国动画 tv_shows: 电视剧 variety_shows: 综艺 documentary_films: 纪录片 @@ -211,6 +212,11 @@ home: not_interested_in: 对哪方面不感兴趣? video_removed: 视频已移除 save_to_watch_later: 添加到稍后再看 +ranking: + all: 全部 + chinese_anime_related: 中国动画相关 + original_content: 原创内容 + debut_work: 新人作品 anime: total_episodes: 全 {ep} 话 update_to_n_episodes: 更新至 {ep} 话 diff --git a/src/_locales/cmn-TW.yml b/src/_locales/cmn-TW.yml index 7be4a126..2f95181f 100644 --- a/src/_locales/cmn-TW.yml +++ b/src/_locales/cmn-TW.yml @@ -6,6 +6,7 @@ common: viewWithoutNum: 次 danmaku: '{count} 彈幕' danmakuWithoutNum: 彈幕 + anime_follow_count: '{count}人追蹤' year: 年前 month: 個月前 week: 個禮拜前 @@ -210,6 +211,11 @@ dock: home: not_interested_in: 對哪方面不感興趣? video_removed: 影片已移除 +ranking: + all: 全部 + chinese_anime_related: 中國動畫相關 + original_content: 原創內容 + debut_work: 新人作品 anime: total_episodes: 全 {ep} 話 update_to_n_episodes: 更新至 {ep} 話 diff --git a/src/_locales/en.yml b/src/_locales/en.yml index cd626d91..49a8d939 100644 --- a/src/_locales/en.yml +++ b/src/_locales/en.yml @@ -6,6 +6,7 @@ common: viewWithoutNum: ' views' danmaku: no danmaku | {count} danmaku | {count} danmakus danmakuWithoutNum: ' danmakus' + anime_follow_count: no follow | {count} follow | {count} follows year: year ago | years ago month: month ago | months ago week: week ago | weeks ago @@ -211,6 +212,11 @@ dock: home: not_interested_in: Not interested in... video_removed: Video removed +ranking: + all: All + chinese_anime_related: Chinese Anime-related + original_content: Original Content + debut_work: Debut Work anime: total_episodes: EP {ep} update_to_n_episodes: Update to EP {ep} diff --git a/src/_locales/jyut.yml b/src/_locales/jyut.yml index 0dc91eed..657ccd5f 100644 --- a/src/_locales/jyut.yml +++ b/src/_locales/jyut.yml @@ -6,6 +6,7 @@ common: viewWithoutNum: 次 danmaku: '{count} 彈幕' danmakuWithoutNum: 彈幕 + anime_follow_count: '{count}人追緊' year: 年前 month: 個月前 week: 個禮拜前 @@ -210,6 +211,11 @@ dock: home: not_interested_in: 對邊方面冇癮? video_removed: 經已鏟咗條片 +ranking: + all: 全部 + chinese_anime_related: 中國動畫相關 + original_content: 原創內容 + debut_work: 新人作品 anime: total_episodes: 共 {ep} 集 update_to_n_episodes: 更新到 {ep} 集 diff --git a/src/background/messageListeners/ranking.ts b/src/background/messageListeners/ranking.ts index 2f1e9a5e..a17d68db 100644 --- a/src/background/messageListeners/ranking.ts +++ b/src/background/messageListeners/ranking.ts @@ -3,7 +3,7 @@ import browser from 'webextension-polyfill' function handleMessage(message: any) { // https://github.com/SocialSisterYi/bilibili-API-collect/blob/7873a79022a5606e2391d93b411a05576a0df111/docs/video_ranking/ranking.md#%E8%8E%B7%E5%8F%96%E5%88%86%E5%8C%BA%E8%A7%86%E9%A2%91%E6%8E%92%E8%A1%8C%E6%A6%9C%E5%88%97%E8%A1%A8 if (message.contentScriptQuery === 'getRankingVideos') { - const url = `https://api.bilibili.com/x/web-interface/ranking/v2?rid=${message.rid ?? 0}&type=all` + const url = `https://api.bilibili.com/x/web-interface/ranking/v2?rid=${message.rid ?? 0}&type=${message.type ?? 'all'}` return fetch(url) .then(response => response.json()) .then(data => data) diff --git a/src/components/LongCoverCard/LongCoverCard.vue b/src/components/LongCoverCard/LongCoverCard.vue index ba5ce697..4c3960ee 100644 --- a/src/components/LongCoverCard/LongCoverCard.vue +++ b/src/components/LongCoverCard/LongCoverCard.vue @@ -1,5 +1,6 @@ @@ -18,24 +21,23 @@ defineProps<{
-
+
@@ -121,8 +122,13 @@ defineProps<{
-
-

+

+

+

+ {{ $t('common.view', { count: numFormatter(view) }, view) }} + {{ $t('common.anime_follow_count', { count: numFormatter(follow) }, follow) }} +

+defineProps<{ + horizontal?: boolean +}>() + + diff --git a/src/contentScripts/views/Home/components/Ranking.vue b/src/contentScripts/views/Home/components/Ranking.vue index 5385f88f..1bc27f63 100644 --- a/src/contentScripts/views/Home/components/Ranking.vue +++ b/src/contentScripts/views/Home/components/Ranking.vue @@ -9,10 +9,10 @@ const handleBackToTop = inject('handleBackToTop') as (targetScrollTop: number) = const rankingTypes = computed((): RankingType[] => { return [ - { id: 1, name: 'All', rid: 0 }, + { id: 1, name: t('ranking.all'), rid: 0 }, { id: 2, name: t('topbar.logo_dropdown.anime'), seasonType: 1 }, { id: 3, name: t('topbar.logo_dropdown.chinese_anime'), seasonType: 4 }, - { id: 4, name: `${t('topbar.logo_dropdown.chinese_anime')} relative`, rid: 168 }, + { id: 4, name: t('ranking.chinese_anime_related'), rid: 168 }, { id: 5, name: t('topbar.logo_dropdown.documentary_films'), seasonType: 3 }, { id: 6, name: t('topbar.logo_dropdown.animations'), rid: 1 }, { id: 7, name: t('topbar.logo_dropdown.music'), rid: 3 }, @@ -32,19 +32,20 @@ const rankingTypes = computed((): RankingType[] => { { id: 21, name: t('topbar.logo_dropdown.movies'), seasonType: 2 }, { id: 22, name: t('topbar.logo_dropdown.tv_shows'), seasonType: 5 }, { id: 23, name: t('topbar.logo_dropdown.variety_shows'), seasonType: 7 }, - { id: 24, name: 'Original', rid: 0, type: 'origin' }, - { id: 25, name: 'Newest Uploader', rid: 0, type: 'rookie' }, + { id: 24, name: t('ranking.original_content'), rid: 0, type: 'origin' }, + { id: 25, name: t('ranking.debut_work'), rid: 0, type: 'rookie' }, ] }) const isLoading = ref(false) -const activatedRankingType = reactive({ ...rankingTypes.value[0] }) +const activatedRankingType = ref({ ...rankingTypes.value[0] }) const videoList = reactive([]) const PgcList = reactive([]) -watch(() => activatedRankingType.id, () => { +watch(() => activatedRankingType.value.id, () => { handleBackToTop(settings.value.useSearchPageModeOnHomePage ? 510 : 0) - if (activatedRankingType.seasonType) + + if ('seasonType' in activatedRankingType.value) getRankingPgc() else getRankingVideos() @@ -59,7 +60,8 @@ function getRankingVideos() { isLoading.value = true browser.runtime.sendMessage({ contentScriptQuery: 'getRankingVideos', - rid: activatedRankingType.rid, + rid: activatedRankingType.value.rid, + type: 'type' in activatedRankingType.value ? activatedRankingType.value.type : 'all', }).then((response) => { if (response.code === 0) { const { list } = response.data @@ -73,7 +75,7 @@ function getRankingPgc() { isLoading.value = true browser.runtime.sendMessage({ contentScriptQuery: 'getRankingPgc', - seasonType: activatedRankingType.seasonType, + seasonType: activatedRankingType.value.seasonType, }).then((response) => { if (response.code === 0) Object.assign(PgcList, response.result.list) @@ -92,7 +94,7 @@ function getRankingPgc() { block rounded="$bew-radius" cursor-pointer transition="all 300 ease-out" hover:scale-105 un-text="$bew-text-2 hover:$bew-text-1" :class="{ active: activatedRankingType.id === rankingType.id }" - @click="Object.assign(activatedRankingType, rankingType)" + @click="activatedRankingType = rankingType" >{{ rankingType.name }} @@ -100,7 +102,7 @@ function getRankingPgc() {
-