no message
This commit is contained in:
@@ -202,6 +202,7 @@ import PlayerRankingPanel from '../pages/worldcup/components/ranking/PlayerRanki
|
||||
import TranslatedArticleCard from '@/components/translated-article-card/translated-article-card.vue'
|
||||
import { getArticleCate, getArticleList } from '@/api/news'
|
||||
import { getWorldCupRankings, getWorldCupSchedule, getWorldCupStandings } from '@/api/match'
|
||||
import { getLocalMatchDate } from '@/utils/match-time'
|
||||
|
||||
type MainTab = 'schedule' | 'rank' | 'bracket' | 'news'
|
||||
type RankingMode = 'standings' | 'goals' | 'assists'
|
||||
@@ -227,6 +228,8 @@ const tabs: { key: MainTab; label: string }[] = [
|
||||
{ key: 'news', label: '新闻' }
|
||||
]
|
||||
|
||||
const WORLD_CUP_MATCH_CONTEXT = { competition_id: 61, league_name: '世界杯' }
|
||||
|
||||
const bracketTabs: { key: BracketTabKey; label: string }[] = [
|
||||
{ key: '1/16决赛', label: '32强' },
|
||||
{ key: '1/8决赛', label: '十六强' },
|
||||
@@ -531,9 +534,14 @@ const goMatchDetail = (match: any) => {
|
||||
uni.navigateTo({ url: `/pages/match_detail/match_detail?id=${id}` })
|
||||
}
|
||||
|
||||
const getWorldCupDisplayDate = (timestamp: number) => {
|
||||
return getLocalMatchDate(timestamp, WORLD_CUP_MATCH_CONTEXT)
|
||||
}
|
||||
|
||||
const formatDateKey = (timestamp: number) => {
|
||||
if (!timestamp) return '0'
|
||||
const d = new Date(timestamp * 1000)
|
||||
const d = getWorldCupDisplayDate(timestamp)
|
||||
if (!d) return '0'
|
||||
const y = d.getFullYear()
|
||||
const m = String(d.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(d.getDate()).padStart(2, '0')
|
||||
@@ -542,7 +550,8 @@ const formatDateKey = (timestamp: number) => {
|
||||
|
||||
const formatDateLabel = (timestamp: number) => {
|
||||
if (!timestamp) return '未分组'
|
||||
const d = new Date(timestamp * 1000)
|
||||
const d = getWorldCupDisplayDate(timestamp)
|
||||
if (!d) return '未分组'
|
||||
const weeks = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
|
||||
return `${d.getFullYear()}年${d.getMonth() + 1}月${d.getDate()}日 ${weeks[d.getDay()]}`
|
||||
}
|
||||
@@ -555,13 +564,15 @@ const normalizeGroupName = (value: string) => {
|
||||
|
||||
const formatMatchTime = (timestamp: number) => {
|
||||
if (!timestamp) return '--'
|
||||
const date = new Date(timestamp * 1000)
|
||||
const date = getWorldCupDisplayDate(timestamp)
|
||||
if (!date) return '--'
|
||||
return `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`
|
||||
}
|
||||
|
||||
const formatBracketDate = (timestamp: number) => {
|
||||
if (!timestamp) return '--'
|
||||
const date = new Date(timestamp * 1000)
|
||||
const date = getWorldCupDisplayDate(timestamp)
|
||||
if (!date) return '--'
|
||||
return `${date.getMonth() + 1}月${date.getDate()}日`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user