deploy: auto commit repo-root changes 2026-07-13 22:38:58
This commit is contained in:
@@ -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)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -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;
|
||||
|
||||
+42
-30
@@ -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,37 +28,49 @@ const suppressUniRouterSourcemapWarning = (msg: string) =>
|
||||
msg.includes("didn't generate a sourcemap")
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [uni(), uniRouter(), weappTailwindcssDisabled ? undefined : vwt()],
|
||||
customLogger: {
|
||||
info(msg) { console.log(msg) },
|
||||
warn(msg) { if (suppressUniRouterSourcemapWarning(msg)) return; console.warn(msg) },
|
||||
error(msg) { console.error(msg) },
|
||||
warnOnce(msg) { if (suppressUniRouterSourcemapWarning(msg)) return; console.warn(msg) },
|
||||
infoOnce(msg) { console.log(msg) },
|
||||
clearScreen() { },
|
||||
hasWarned: false,
|
||||
hasErrorLogged: false,
|
||||
},
|
||||
build: {
|
||||
rollupOptions: {
|
||||
onwarn(warning, warn) {
|
||||
if (
|
||||
warning.message?.includes('plugin (unplugin-uni-router) was used to transform files') &&
|
||||
warning.message?.includes("didn't generate a sourcemap")
|
||||
) {
|
||||
return
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '')
|
||||
|
||||
return {
|
||||
plugins: [uni(), uniRouter(), weappTailwindcssDisabled ? undefined : vwt()],
|
||||
customLogger: {
|
||||
info(msg) { console.log(msg) },
|
||||
warn(msg) { if (suppressUniRouterSourcemapWarning(msg)) return; console.warn(msg) },
|
||||
error(msg) { console.error(msg) },
|
||||
warnOnce(msg) { if (suppressUniRouterSourcemapWarning(msg)) return; console.warn(msg) },
|
||||
infoOnce(msg) { console.log(msg) },
|
||||
clearScreen() { },
|
||||
hasWarned: false,
|
||||
hasErrorLogged: false,
|
||||
},
|
||||
build: {
|
||||
rollupOptions: {
|
||||
onwarn(warning, warn) {
|
||||
if (
|
||||
warning.message?.includes('plugin (unplugin-uni-router) was used to transform files') &&
|
||||
warning.message?.includes("didn't generate a sourcemap")
|
||||
) {
|
||||
return
|
||||
}
|
||||
warn(warning)
|
||||
}
|
||||
warn(warning)
|
||||
}
|
||||
},
|
||||
css: {
|
||||
postcss: {
|
||||
plugins: postcssPlugin
|
||||
}
|
||||
},
|
||||
server: {
|
||||
port: 5177,
|
||||
proxy: isH5 && env.VITE_APP_BASE_URL
|
||||
? {
|
||||
'/api': {
|
||||
target: env.VITE_APP_BASE_URL,
|
||||
changeOrigin: true,
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
}
|
||||
},
|
||||
css: {
|
||||
postcss: {
|
||||
plugins: postcssPlugin
|
||||
}
|
||||
},
|
||||
server: {
|
||||
port: 5177
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user