deploy: auto commit repo-root changes 2026-07-11 12:03:08

This commit is contained in:
hajimi
2026-07-11 12:03:08 +08:00
parent 3a5d571e53
commit 42d243971e
3 changed files with 94 additions and 19 deletions
@@ -123,6 +123,19 @@
<block v-else>
<view class="match-odds-filter">
<scroll-view scroll-x
class="match-odds-filter__tabs match-odds-filter__platforms"
show-scrollbar="false">
<view class="match-odds-filter__tabs-inner">
<view v-for="item in oddsPlatformOptions" :key="item.key"
class="match-odds-filter__tab"
:class="{ 'match-odds-filter__tab--active': oddsSourceSite === item.key }"
@tap="switchOddsSourceSite(item.key)">
<text>{{ item.label }}</text>
</view>
</view>
</scroll-view>
<scroll-view scroll-x class="match-odds-filter__tabs" show-scrollbar="false">
<view class="match-odds-filter__tabs-inner">
<view v-for="item in oddsShowTypeOptions" :key="item.key" class="match-odds-filter__tab"
@@ -232,6 +245,7 @@ import {
type MatchCenterTab = 'schedule' | 'live' | 'odds'
type OddsShowType = '' | 'live' | 'today' | 'early'
type OddsPlatformOption = { key: string; label: string }
const contentTabs: { key: MatchCenterTab; label: string }[] = [
{ key: 'schedule', label: '赛程' },
@@ -246,6 +260,12 @@ const oddsShowTypeOptions: { key: OddsShowType; label: string }[] = [
{ key: 'early', label: '早盘' },
]
const defaultOddsPlatformOptions: OddsPlatformOption[] = [
{ key: '', label: '全部平台' },
{ key: 'hg', label: '滚球' },
{ key: 'titan007', label: '球探' },
]
const activeTab = ref<MatchCenterTab>('schedule')
const sportTabs = ref<any[]>([])
const currentSport = ref(0)
@@ -269,6 +289,8 @@ const useLiveCardPosterMode = ref(false)
const oddsList = ref<MatchOddsMatchItem[]>([])
const oddsLoading = ref(false)
const oddsLoaded = ref(false)
const oddsPlatformOptions = ref<OddsPlatformOption[]>([...defaultOddsPlatformOptions])
const oddsSourceSite = ref('')
const oddsShowType = ref<OddsShowType>('')
const oddsKeyword = ref('')
const oddsSearchText = ref('')
@@ -313,9 +335,12 @@ const matchGroups = computed(() => {
})
const oddsFilterSummary = computed(() => {
const platformLabel = oddsPlatformOptions.value.find(
(item) => item.key === oddsSourceSite.value,
)?.label || '全部平台'
const showTypeLabel = oddsShowTypeOptions.find((item) => item.key === oddsShowType.value)?.label || '全部盘口'
const keyword = oddsKeyword.value.trim()
const parts = [showTypeLabel]
const parts = [platformLabel, showTypeLabel]
if (keyword) parts.push(`"${keyword}"`)
parts.push(`${oddsList.value.length}`)
return parts.join(' · ')
@@ -397,7 +422,10 @@ const fetchLiveCards = async (force = false) => {
const buildOddsRequestParams = () => {
const params: {
sport_type?: number
league_name?: string
show_type?: 'live' | 'today' | 'early'
source_site?: string
keyword?: string
include_special: number
limit: number
@@ -405,7 +433,10 @@ const buildOddsRequestParams = () => {
include_special: 0,
limit: 300,
}
if (currentSport.value > 0) params.sport_type = currentSport.value
if (currentLeague.value) params.league_name = currentLeague.value
if (oddsShowType.value) params.show_type = oddsShowType.value
if (oddsSourceSite.value) params.source_site = oddsSourceSite.value
const keyword = oddsKeyword.value.trim()
if (keyword) params.keyword = keyword
return params
@@ -420,6 +451,21 @@ const fetchOdds = async (force = false) => {
const data = await getMatchOdds(buildOddsRequestParams())
if (requestSeq === oddsRequestSeq.value) {
oddsList.value = Array.isArray(data?.list) ? data.list : []
const platformOptions = Array.isArray(data?.platform_options)
? data.platform_options
: []
const platformMap = new Map(
defaultOddsPlatformOptions.map((item) => [item.key, item]),
)
platformOptions.forEach((item: any) => {
if (item?.key) {
platformMap.set(String(item.key), {
key: String(item.key),
label: String(item.label || item.key).trim(),
})
}
})
oddsPlatformOptions.value = Array.from(platformMap.values())
oddsLoaded.value = true
}
} catch (error) {
@@ -495,6 +541,13 @@ const switchOddsShowType = (showType: OddsShowType) => {
void fetchOdds(true)
}
const switchOddsSourceSite = (sourceSite: string) => {
if (oddsSourceSite.value === sourceSite) return
oddsSourceSite.value = sourceSite
oddsLoaded.value = false
void fetchOdds(true)
}
const confirmOddsSearch = () => {
const keyword = oddsSearchText.value.trim()
if (oddsKeyword.value === keyword && oddsLoaded.value) return
@@ -1005,6 +1058,10 @@ onMounted(() => {
white-space: nowrap;
}
.match-odds-filter__platforms {
margin-bottom: 12rpx;
}
.match-odds-filter__tabs-inner {
display: inline-flex;
align-items: center;