deploy: auto commit repo-root changes 2026-07-13 22:38:58

This commit is contained in:
hajimi
2026-07-13 22:38:58 +08:00
parent af8941e880
commit 33687e31b7
6 changed files with 86 additions and 50 deletions
@@ -184,7 +184,7 @@ class MatchOddsLists extends BaseAdminDataLists implements ListsExtendInterface
public static function formatSourceSite(string $sourceSite): string
{
$map = [
'hg' => '滚球',
'hg' => '皇冠',
'titan007' => '球探',
];
return $map[$sourceSite] ?? ($sourceSite !== '' ? strtoupper($sourceSite) : '未知平台');
@@ -866,7 +866,7 @@ class MatchController extends BaseApiController
private function getOddsPlatformNameMap(): array
{
return [
'hg' => '滚球',
'hg' => '皇冠',
'titan007' => '球探',
];
}
@@ -15,6 +15,11 @@
<text>赔率加载中...</text>
</view>
<view v-else-if="loadError" class="match-odds-detail__state">
<text>{{ loadError }}</text>
<u-button size="mini" type="primary" @click="retryFetch">重新加载</u-button>
</view>
<view v-else-if="platforms.length" class="match-odds-detail__list">
<view v-for="platform in platforms"
:key="`${platform.platform_key}-${platform.source_match_id || platform.update_time || 0}`"
@@ -79,7 +84,7 @@ const props = withDefaults(defineProps<{
const defaultPlatformOptions: PlatformOption[] = [
{ key: '', label: '全部平台' },
{ key: 'hg', label: '滚球' },
{ key: 'hg', label: '皇冠' },
{ key: 'titan007', label: '球探' },
]
@@ -88,8 +93,13 @@ const platformOptions = ref<PlatformOption[]>([...defaultPlatformOptions])
const sourceSite = ref('')
const loading = ref(false)
const loaded = ref(false)
const loadError = ref('')
const requestSeq = ref(0)
const normalizePlatformLabel = (key: string, label: string) => {
return key === 'hg' ? '皇冠' : label
}
const platforms = computed<WorldCupOddsPlatform[]>(() => {
const result: WorldCupOddsPlatform[] = []
const seen = new Set<string>()
@@ -99,7 +109,10 @@ const platforms = computed<WorldCupOddsPlatform[]>(() => {
const key = `${platform.platform_key}-${platform.source_match_id || ''}`
if (seen.has(key)) return
seen.add(key)
result.push(platform)
result.push({
...platform,
platform_name: normalizePlatformLabel(platform.platform_key, platform.platform_name),
})
})
})
return result
@@ -124,7 +137,7 @@ const mergePlatformOptions = (options: unknown) => {
options.forEach((item: any) => {
const key = String(item?.key || '').trim()
const label = String(item?.label || '').trim()
if (key && label) map.set(key, { key, label })
if (key && label) map.set(key, { key, label: normalizePlatformLabel(key, label) })
})
}
platformOptions.value = Array.from(map.values())
@@ -141,6 +154,7 @@ const fetchOdds = async (force = false) => {
const seq = requestSeq.value + 1
requestSeq.value = seq
loading.value = true
loadError.value = ''
try {
const data = await getMatchOdds({
home_team: props.homeTeam.trim(),
@@ -157,6 +171,8 @@ const fetchOdds = async (force = false) => {
if (seq !== requestSeq.value) return
console.error('获取比赛赔率失败', error)
oddsList.value = []
loaded.value = true
loadError.value = '赔率加载失败,请稍后重试'
} finally {
if (seq === requestSeq.value) loading.value = false
}
@@ -169,6 +185,11 @@ const switchPlatform = (platformKey: string) => {
void fetchOdds(true)
}
const retryFetch = () => {
loaded.value = false
void fetchOdds(true)
}
const formatUpdateTime = (timestamp?: number) => {
const value = Number(timestamp || 0)
if (!value) return ''
@@ -185,6 +206,7 @@ watch(
() => {
loaded.value = false
oddsList.value = []
loadError.value = ''
void fetchOdds(true)
},
)
+9 -9
View File
@@ -1,7 +1,7 @@
import { isDevMode } from "@/utils/env";
const envBaseUrl = import.meta.env.VITE_APP_BASE_URL || "";
const envBaseUrl = 'https://test-server.sbnews.net/'
let baseUrl = `${envBaseUrl}/`;
let baseUrl = `${envBaseUrl}/`
//#endif
/*
* `VITE_APP_BASE_URL``dev`
@@ -10,14 +10,14 @@ let baseUrl = `${envBaseUrl}/`;
*/
//#ifdef MP-WEIXIN
baseUrl = isDevMode() || envBaseUrl ? baseUrl : "[baseUrl]";
baseUrl = envBaseUrl
//#endif
const config = {
version: "1.9.0", //版本号
version: '1.9.0', //版本号
baseUrl, //请求接口域名
urlPrefix: "api", //请求默认前缀
timeout: 60 * 1000, //请求超时时长
};
urlPrefix: 'api', //请求默认前缀
timeout: 60 * 1000 //请求超时时长
}
export default config;
export default config
@@ -266,7 +266,7 @@ const oddsShowTypeOptions: { key: OddsShowType; label: string }[] = [
const defaultOddsPlatformOptions: OddsPlatformOption[] = [
{ key: '', label: '全部平台' },
{ key: 'hg', label: '滚球' },
{ key: 'hg', label: '皇冠' },
{ key: 'titan007', label: '球探' },
]
@@ -463,9 +463,10 @@ const fetchOdds = async (force = false) => {
)
platformOptions.forEach((item: any) => {
if (item?.key) {
platformMap.set(String(item.key), {
key: String(item.key),
label: String(item.label || item.key).trim(),
const key = String(item.key)
platformMap.set(key, {
key,
label: key === 'hg' ? '皇冠' : String(item.label || item.key).trim(),
})
}
})
@@ -694,11 +695,12 @@ onMounted(() => {
.content-tabs {
padding: 0 24rpx 14rpx;
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
display: flex;
gap: 12rpx;
&__item {
flex: 1;
min-width: 0;
height: 58rpx;
border-radius: 16rpx;
background: #f1f5ff;
+15 -3
View File
@@ -1,4 +1,4 @@
import { defineConfig } from 'vite'
import { defineConfig, loadEnv } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import tailwindcss from 'tailwindcss'
import autoprefixer from 'autoprefixer'
@@ -28,7 +28,10 @@ const suppressUniRouterSourcemapWarning = (msg: string) =>
msg.includes("didn't generate a sourcemap")
// https://vitejs.dev/config/
export default defineConfig({
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd(), '')
return {
plugins: [uni(), uniRouter(), weappTailwindcssDisabled ? undefined : vwt()],
customLogger: {
info(msg) { console.log(msg) },
@@ -59,6 +62,15 @@ export default defineConfig({
}
},
server: {
port: 5177
port: 5177,
proxy: isH5 && env.VITE_APP_BASE_URL
? {
'/api': {
target: env.VITE_APP_BASE_URL,
changeOrigin: true,
},
}
: undefined,
}
}
})