From 5619761be42f85622da102397c05243478d2c2a8 Mon Sep 17 00:00:00 2001 From: the1812 Date: Tue, 8 Apr 2025 09:00:01 +0800 Subject: [PATCH] Add match popup (#5055) --- .../style/custom-navbar/built-in-items.ts | 3 +- .../style/custom-navbar/match/MatchPopup.vue | 234 ++++++++++++++++++ .../style/custom-navbar/match/match.ts | 14 ++ .../style/custom-navbar/match/types.ts | 31 +++ .../simple-links/simple-links.ts | 5 - 5 files changed, 281 insertions(+), 6 deletions(-) create mode 100644 registry/lib/components/style/custom-navbar/match/MatchPopup.vue create mode 100644 registry/lib/components/style/custom-navbar/match/match.ts create mode 100644 registry/lib/components/style/custom-navbar/match/types.ts diff --git a/registry/lib/components/style/custom-navbar/built-in-items.ts b/registry/lib/components/style/custom-navbar/built-in-items.ts index c4bb44952..7cfd3c5ce 100644 --- a/registry/lib/components/style/custom-navbar/built-in-items.ts +++ b/registry/lib/components/style/custom-navbar/built-in-items.ts @@ -6,7 +6,8 @@ import { logo } from './logo/logo' import { home } from './home/home' import { games } from './games/games' import { blanks } from './flexible-blank/flexible-blank' -import { bangumi, music, shop, match, creations, lives } from './simple-links/simple-links' +import { bangumi, music, shop, creations, lives } from './simple-links/simple-links' +import { match } from './match/match' import { upload } from './upload/upload' import { search } from './search/search' import { feeds } from './feeds/feeds' diff --git a/registry/lib/components/style/custom-navbar/match/MatchPopup.vue b/registry/lib/components/style/custom-navbar/match/MatchPopup.vue new file mode 100644 index 000000000..6400b2107 --- /dev/null +++ b/registry/lib/components/style/custom-navbar/match/MatchPopup.vue @@ -0,0 +1,234 @@ + + + diff --git a/registry/lib/components/style/custom-navbar/match/match.ts b/registry/lib/components/style/custom-navbar/match/match.ts new file mode 100644 index 000000000..50cafcb65 --- /dev/null +++ b/registry/lib/components/style/custom-navbar/match/match.ts @@ -0,0 +1,14 @@ +import { CustomNavbarItemInit } from '../custom-navbar-item' + +export const match: CustomNavbarItemInit = { + name: 'match', + displayName: '赛事', + content: '赛事', + + touch: true, + href: 'https://www.bilibili.com/v/game/match/', + + boundingWidth: 650, + noPopupPadding: true, + popupContent: () => import('./MatchPopup.vue').then(m => m.default), +} diff --git a/registry/lib/components/style/custom-navbar/match/types.ts b/registry/lib/components/style/custom-navbar/match/types.ts new file mode 100644 index 000000000..36b9bfd3c --- /dev/null +++ b/registry/lib/components/style/custom-navbar/match/types.ts @@ -0,0 +1,31 @@ +export interface MatchInfo { + hot: MatchHotItem[] + banner: MatchBannerItem[] + preview: MatchPreviewItem[] +} + +export interface MatchHotItem { + index: number + cid: number + desc: string + status: number + name: string + jump_url: string +} + +export interface MatchBannerItem { + index: number + cover: string + jump_url: string +} + +export interface MatchPreviewItem { + index: number + cid: number + name: string + desc: string + fav_status: number + jump_url: string + // spell-checker: disable-next-line + stime: string +} diff --git a/registry/lib/components/style/custom-navbar/simple-links/simple-links.ts b/registry/lib/components/style/custom-navbar/simple-links/simple-links.ts index 7234221d6..18e0a1a58 100644 --- a/registry/lib/components/style/custom-navbar/simple-links/simple-links.ts +++ b/registry/lib/components/style/custom-navbar/simple-links/simple-links.ts @@ -32,11 +32,6 @@ export const shop = getSimpleLinkItem({ displayName: '会员购', href: 'https://show.bilibili.com', }) -export const match = getSimpleLinkItem({ - name: 'match', - displayName: '赛事', - href: 'https://www.bilibili.com/v/game/match/', -}) export const creations = getSimpleLinkItem({ name: 'creations', displayName: '创作中心',