deploy: auto commit repo-root changes 2026-07-10 01:01:12

This commit is contained in:
hajimi
2026-07-10 01:01:12 +08:00
parent 84a5fb43f5
commit 3b61f0ba38
82 changed files with 625 additions and 80 deletions
+52
View File
@@ -83,6 +83,48 @@ export interface WorldCupLiveCardItem {
[key: string]: any
}
export interface WorldCupOddsValue {
label: string
value: string
}
export interface WorldCupOddsMarket {
label: string
line?: string
values: WorldCupOddsValue[]
}
export interface WorldCupOddsPlatform {
platform_key: string
platform_name: string
show_type: string
show_type_text: string
odds_type?: string
source_match_id?: string
update_time?: number
markets: WorldCupOddsMarket[]
}
export interface WorldCupOddsMatchItem {
id?: number
match_id?: number
source_match_ids?: string[]
league_name?: string
match_time_text?: string
match_time?: number
home_team: string
home_icon?: string
home_score?: number
away_team: string
away_icon?: string
away_score?: number
status?: number
current_minute?: string
platforms: WorldCupOddsPlatform[]
update_time?: number
[key: string]: any
}
export function getMatchList(data?: Record<string, any>) {
return request.get({ url: '/match/lists', data: data }, { withToken: false })
}
@@ -122,3 +164,13 @@ export function getWorldCupSchedule() {
export function getWorldCupLiveCards() {
return request.get({ url: '/match/worldCupLiveCards' }, { withToken: false })
}
export function getWorldCupOdds(data?: {
show_type?: 'live' | 'today' | 'early'
source_site?: string
keyword?: string
include_special?: number
limit?: number
}) {
return request.get({ url: '/match/worldCupOdds', data }, { withToken: false })
}
+2 -2
View File
@@ -2,8 +2,8 @@
"name" : "世博头条",
"appid" : "__UNI__90671D8",
"description" : "世博头条AI分析平台",
"versionName" : "1.0.9",
"versionCode" : 109,
"versionName" : "1.0.10",
"versionCode" : 1010,
"transformPx" : false,
/* 5+App */
"app-plus" : {
@@ -126,6 +126,100 @@
</view>
</block>
<block v-else-if="activeTab === 'odds'">
<view class="worldcup-odds-filter">
<scroll-view scroll-x class="worldcup-odds-filter__tabs" show-scrollbar="false">
<view class="worldcup-odds-filter__tabs-inner">
<view v-for="item in oddsShowTypeOptions" :key="item.key" class="worldcup-odds-filter__tab"
:class="{ 'worldcup-odds-filter__tab--active': oddsShowType === item.key }"
@tap="switchOddsShowType(item.key)">
<text>{{ item.label }}</text>
</view>
</view>
</scroll-view>
<view class="worldcup-odds-filter__search">
<u-icon name="search" size="30" color="#94a3b8"></u-icon>
<input v-model="oddsSearchText" class="worldcup-odds-filter__input" confirm-type="search"
placeholder="搜索联赛/球队" placeholder-class="worldcup-odds-filter__placeholder"
@confirm="confirmOddsSearch" />
<view v-if="oddsSearchText || oddsKeyword" class="worldcup-odds-filter__clear"
@tap="clearOddsKeyword">
<u-icon name="close" size="24" color="#94a3b8"></u-icon>
</view>
<view class="worldcup-odds-filter__button" @tap="confirmOddsSearch">
<text>筛选</text>
</view>
</view>
<view class="worldcup-odds-filter__meta">
<text>{{ oddsFilterSummary }}</text>
</view>
</view>
<view v-if="oddsLoading" class="worldcup-loading">
<u-loading mode="circle" />
<text>加载中...</text>
</view>
<block v-else-if="oddsList.length">
<view v-for="match in oddsList" :key="oddsMatchKey(match)" class="worldcup-odds-card"
@tap="goOddsMatchDetail(match)">
<view class="worldcup-odds-card__head">
<text class="worldcup-odds-card__league">{{ match.league_name || '赛事赔率' }}</text>
<text class="worldcup-odds-card__time">{{ oddsTimeText(match) }}</text>
</view>
<view class="worldcup-odds-card__teams">
<view class="worldcup-odds-card__team">
<image v-if="match.home_icon" class="worldcup-odds-card__logo"
:src="match.home_icon" mode="aspectFit" />
<text class="worldcup-odds-card__team-name">{{ match.home_team }}</text>
</view>
<view class="worldcup-odds-card__vs">
<text>{{ oddsCenterText(match) }}</text>
</view>
<view class="worldcup-odds-card__team worldcup-odds-card__team--right">
<image v-if="match.away_icon" class="worldcup-odds-card__logo"
:src="match.away_icon" mode="aspectFit" />
<text class="worldcup-odds-card__team-name">{{ match.away_team }}</text>
</view>
</view>
<view class="worldcup-odds-platform" v-for="platform in match.platforms"
:key="`${oddsMatchKey(match)}-${platform.platform_key}-${platform.source_match_id}`">
<view class="worldcup-odds-platform__head">
<view class="worldcup-odds-platform__name">
<text>{{ platform.platform_name }}</text>
<text class="worldcup-odds-platform__tag">{{ platform.show_type_text }}</text>
</view>
<text class="worldcup-odds-platform__update">{{ formatOddsUpdateTime(platform.update_time)
}}</text>
</view>
<view class="worldcup-odds-market" v-for="market in platform.markets"
:key="`${platform.source_match_id}-${market.label}`">
<view class="worldcup-odds-market__title">
<text>{{ market.label }}</text>
<text v-if="market.line" class="worldcup-odds-market__line">{{ market.line }}</text>
</view>
<view class="worldcup-odds-market__values">
<view class="worldcup-odds-value" v-for="item in market.values"
:key="`${market.label}-${item.label}`">
<text class="worldcup-odds-value__label">{{ item.label }}</text>
<text class="worldcup-odds-value__number">{{ item.value }}</text>
</view>
</view>
</view>
</view>
</view>
</block>
<view v-else class="worldcup-empty">
<u-empty text="暂无赔率" mode="data" />
</view>
</block>
<view v-else-if="activeTab === 'rank'" class="worldcup-section">
<ranking-nav v-model="rankingMode" />
@@ -260,17 +354,20 @@ import TranslatedArticleCard from '@/components/translated-article-card/translat
import { getArticleCate, getArticleList } from '@/api/news'
import {
getWorldCupLiveCards,
getWorldCupOdds,
getWorldCupRankings,
getWorldCupSchedule,
getWorldCupStandings,
type WorldCupLiveCardItem,
type WorldCupOddsMatchItem,
} from '@/api/match'
import { getLocalMatchDate } from '@/utils/match-time'
type MainTab = 'live' | 'schedule' | 'rank' | 'bracket' | 'news'
type MainTab = 'live' | 'schedule' | 'odds' | 'rank' | 'bracket' | 'news'
type RankingMode = 'standings' | 'goals' | 'assists'
type ScheduleSort = 'time' | 'group'
type BracketTabKey = '1/16决赛' | '1/8决赛' | '1/4决赛' | '半决赛' | '决赛'
type OddsShowType = '' | 'live' | 'today' | 'early'
const props = withDefaults(defineProps<{
initialTab?: string
@@ -287,11 +384,19 @@ const emit = defineEmits<{
const tabs: { key: MainTab; label: string }[] = [
{ key: 'live', label: '直播' },
{ key: 'schedule', label: '比分和赛程' },
{ key: 'odds', label: '赔率' },
{ key: 'rank', label: '排名' },
{ key: 'bracket', label: '对阵图' },
{ key: 'news', label: '新闻' }
]
const oddsShowTypeOptions: { key: OddsShowType; label: string }[] = [
{ key: '', label: '全部盘口' },
{ key: 'live', label: '滚球盘' },
{ key: 'today', label: '今日盘' },
{ key: 'early', label: '早盘' }
]
const WORLD_CUP_MATCH_CONTEXT = { competition_id: 61, league_name: '世界杯' }
const bracketTabs: { key: BracketTabKey; label: string }[] = [
@@ -312,6 +417,13 @@ const hideLiveCardControlsOnAndroid = ref(false)
const useLiveCardPosterMode = ref(false)
const liveCards = ref<WorldCupLiveCardItem[]>([])
const liveCardsLoaded = ref(false)
const oddsList = ref<WorldCupOddsMatchItem[]>([])
const oddsLoading = ref(false)
const oddsLoaded = ref(false)
const oddsShowType = ref<OddsShowType>('')
const oddsKeyword = ref('')
const oddsSearchText = ref('')
const oddsRequestSeq = ref(0)
const scheduleData = ref<any>({
current_round_name: '',
@@ -377,6 +489,15 @@ const currentRankingList = computed(() => {
return rankingData.value.standings
})
const oddsFilterSummary = computed(() => {
const showTypeLabel = oddsShowTypeOptions.find((item) => item.key === oddsShowType.value)?.label || '全部盘口'
const keyword = oddsKeyword.value.trim()
const parts = [showTypeLabel]
if (keyword) parts.push(`"${keyword}"`)
parts.push(`${oddsList.value.length}`)
return parts.join(' · ')
})
const groupRankTeamMap = computed(() => {
const map = new Map<string, { name: string; logo: string }>()
; (standingData.value.groups || []).forEach((group: any) => {
@@ -618,6 +739,49 @@ const fetchSchedule = async () => {
}
}
const buildOddsRequestParams = () => {
const params: {
show_type?: 'live' | 'today' | 'early'
keyword?: string
include_special: number
limit: number
} = {
include_special: 0,
limit: 300
}
if (oddsShowType.value) {
params.show_type = oddsShowType.value
}
const keyword = oddsKeyword.value.trim()
if (keyword) {
params.keyword = keyword
}
return params
}
const fetchOdds = async (force = false) => {
if (!force && (oddsLoaded.value || oddsLoading.value)) return
const requestSeq = oddsRequestSeq.value + 1
oddsRequestSeq.value = requestSeq
oddsLoading.value = true
try {
const data = await getWorldCupOdds(buildOddsRequestParams())
if (requestSeq === oddsRequestSeq.value) {
oddsList.value = Array.isArray(data?.list) ? data.list : []
oddsLoaded.value = true
}
} finally {
if (requestSeq === oddsRequestSeq.value) {
oddsLoading.value = false
}
}
}
const refreshOdds = async () => {
oddsLoaded.value = false
await fetchOdds(true)
}
const fetchStandings = async () => {
standingData.value = await getWorldCupStandings() || { stage_name: '', groups: [] }
}
@@ -661,6 +825,8 @@ const ensureTabData = async (tab: MainTab) => {
await fetchWorldCupLiveCards()
} else if (tab === 'schedule') {
await fetchSchedule()
} else if (tab === 'odds') {
await fetchOdds()
} else if (tab === 'rank') {
if (rankingMode.value === 'standings') {
await fetchStandings()
@@ -678,6 +844,26 @@ const switchTab = (tab: MainTab) => {
activeTab.value = tab
}
const switchOddsShowType = (showType: OddsShowType) => {
if (oddsShowType.value === showType) return
oddsShowType.value = showType
void refreshOdds()
}
const confirmOddsSearch = () => {
const keyword = oddsSearchText.value.trim()
if (oddsKeyword.value === keyword && oddsLoaded.value) return
oddsKeyword.value = keyword
void refreshOdds()
}
const clearOddsKeyword = () => {
if (!oddsSearchText.value && !oddsKeyword.value) return
oddsSearchText.value = ''
oddsKeyword.value = ''
void refreshOdds()
}
const switchBracketTab = (tab: BracketTabKey) => {
activeBracketTab.value = tab
}
@@ -696,6 +882,11 @@ const goMatchDetail = (match: any) => {
uni.navigateTo({ url: `/pages/match_detail/match_detail?id=${id}` })
}
const goOddsMatchDetail = (match: WorldCupOddsMatchItem) => {
if (!match?.id) return
goMatchDetail(match)
}
const openWorldCupLiveWebview = (url: string) => {
uni.navigateTo({ url: `/pages/webview/webview?url=${encodeURIComponent(url)}` })
}
@@ -813,6 +1004,35 @@ const matchMetaText = (match: any, index: number) => {
return parts.join(' · ') || '世界杯'
}
const oddsMatchKey = (match: WorldCupOddsMatchItem) => {
const sourceId = match.source_match_ids?.[0] || ''
return `${match.home_team}-${match.away_team}-${match.match_time_text || match.match_time || sourceId}`
}
const oddsCenterText = (match: WorldCupOddsMatchItem) => {
if (match.status === 1) return match.current_minute || '进行中'
if (match.status === 2) return `${match.home_score || 0}-${match.away_score || 0}`
return 'VS'
}
const oddsTimeText = (match: WorldCupOddsMatchItem) => {
if (match.match_time) {
return formatMatchTime(match.match_time)
}
return match.match_time_text || '--'
}
const formatOddsUpdateTime = (timestamp?: number) => {
const value = Number(timestamp || 0)
if (!value) return ''
const date = new Date(value * 1000)
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hour = String(date.getHours()).padStart(2, '0')
const minute = String(date.getMinutes()).padStart(2, '0')
return `${month}-${day} ${hour}:${minute}`
}
const initViewState = async () => {
initLayout()
@@ -822,6 +1042,8 @@ const initViewState = async () => {
activeTab.value = 'live'
} else if (legacyTab === 'schedule') {
activeTab.value = 'schedule'
} else if (legacyTab === 'odds') {
activeTab.value = 'odds'
} else if (legacyTab === 'rank' || legacyTab === 'standings') {
activeTab.value = 'rank'
rankingMode.value = 'standings'
@@ -842,6 +1064,9 @@ const initViewState = async () => {
if (activeTab.value === 'rank' && rankingMode.value !== 'standings') {
await fetchRanking(rankingMode.value)
}
if (activeTab.value === 'odds') {
await fetchOdds()
}
if (activeTab.value === 'news') {
await fetchNews()
}
@@ -1351,6 +1576,274 @@ onMounted(() => {
text-align: center;
}
.worldcup-odds-filter {
padding: 10rpx 0 8rpx;
}
.worldcup-odds-filter__tabs {
white-space: nowrap;
font-size: 0;
line-height: 0;
}
.worldcup-odds-filter__tabs-inner {
display: inline-flex;
align-items: center;
gap: 10rpx;
padding-right: 6rpx;
vertical-align: top;
}
.worldcup-odds-filter__tab {
height: 56rpx;
padding: 0 22rpx;
border-radius: 14rpx;
background: #f1f5f9;
color: #475569;
font-size: 24rpx;
font-weight: 700;
line-height: 56rpx;
white-space: nowrap;
}
.worldcup-odds-filter__tab--active {
background: #1d4ed8;
color: #ffffff;
}
.worldcup-odds-filter__search {
height: 72rpx;
margin-top: 14rpx;
padding: 0 10rpx 0 18rpx;
border: 1rpx solid #e2e8f0;
border-radius: 16rpx;
background: #ffffff;
display: flex;
align-items: center;
gap: 10rpx;
box-shadow: 0 8rpx 22rpx rgba(15, 23, 42, 0.04);
}
.worldcup-odds-filter__input {
flex: 1;
min-width: 0;
height: 70rpx;
color: #111827;
font-size: 26rpx;
line-height: 70rpx;
}
.worldcup-odds-filter__placeholder {
color: #94a3b8;
font-size: 26rpx;
}
.worldcup-odds-filter__clear {
width: 44rpx;
height: 44rpx;
border-radius: 14rpx;
background: #f1f5f9;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.worldcup-odds-filter__button {
width: 92rpx;
height: 52rpx;
border-radius: 14rpx;
background: #0f172a;
color: #ffffff;
font-size: 24rpx;
font-weight: 700;
line-height: 52rpx;
text-align: center;
flex-shrink: 0;
}
.worldcup-odds-filter__meta {
margin-top: 10rpx;
color: #64748b;
font-size: 22rpx;
line-height: 1.4;
}
.worldcup-odds-card {
margin: 12rpx 0;
padding: 18rpx 16rpx;
border-radius: 18rpx;
background: #fff;
box-shadow: 0 8rpx 24rpx rgba(15, 23, 42, 0.06);
}
.worldcup-odds-card__head,
.worldcup-odds-platform__head,
.worldcup-odds-platform__name,
.worldcup-odds-card__teams,
.worldcup-odds-card__team {
display: flex;
align-items: center;
min-width: 0;
}
.worldcup-odds-card__head,
.worldcup-odds-platform__head {
justify-content: space-between;
gap: 12rpx;
}
.worldcup-odds-card__league {
flex: 1;
min-width: 0;
color: #64748b;
font-size: 22rpx;
line-height: 1.35;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.worldcup-odds-card__time,
.worldcup-odds-platform__update {
flex-shrink: 0;
color: #94a3b8;
font-size: 20rpx;
line-height: 1.3;
}
.worldcup-odds-card__teams {
justify-content: space-between;
gap: 12rpx;
padding: 16rpx 0 12rpx;
}
.worldcup-odds-card__team {
flex: 1;
gap: 8rpx;
&--right {
justify-content: flex-end;
}
}
.worldcup-odds-card__logo {
width: 42rpx;
height: 42rpx;
flex-shrink: 0;
}
.worldcup-odds-card__team-name {
min-width: 0;
color: #111827;
font-size: 28rpx;
font-weight: 700;
line-height: 1.3;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.worldcup-odds-card__vs {
width: 104rpx;
flex-shrink: 0;
text-align: center;
color: #2563eb;
font-size: 28rpx;
font-weight: 800;
line-height: 1.2;
}
.worldcup-odds-platform {
padding: 14rpx 0 0;
border-top: 1rpx solid #eef2f7;
& + & {
margin-top: 14rpx;
}
}
.worldcup-odds-platform__name {
gap: 8rpx;
color: #0f172a;
font-size: 24rpx;
font-weight: 700;
}
.worldcup-odds-platform__tag {
height: 32rpx;
line-height: 32rpx;
padding: 0 10rpx;
border-radius: 999rpx;
background: #eaf1ff;
color: #2563eb;
font-size: 20rpx;
font-weight: 600;
}
.worldcup-odds-market {
display: grid;
grid-template-columns: 104rpx minmax(0, 1fr);
align-items: stretch;
gap: 10rpx;
margin-top: 10rpx;
}
.worldcup-odds-market__title {
display: flex;
flex-direction: column;
justify-content: center;
gap: 4rpx;
min-width: 0;
color: #475569;
font-size: 22rpx;
line-height: 1.25;
}
.worldcup-odds-market__line {
color: #0f172a;
font-size: 24rpx;
font-weight: 700;
}
.worldcup-odds-market__values {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 8rpx;
min-width: 0;
}
.worldcup-odds-value {
min-width: 0;
padding: 10rpx 8rpx;
border-radius: 12rpx;
background: #f8fafc;
text-align: center;
}
.worldcup-odds-value__label,
.worldcup-odds-value__number {
display: block;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.worldcup-odds-value__label {
color: #64748b;
font-size: 20rpx;
line-height: 1.2;
}
.worldcup-odds-value__number {
margin-top: 4rpx;
color: #dc2626;
font-size: 26rpx;
font-weight: 800;
line-height: 1.2;
}
.bracket-round-nav {
margin-bottom: 10rpx;
white-space: nowrap;