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
|
public static function formatSourceSite(string $sourceSite): string
|
||||||
{
|
{
|
||||||
$map = [
|
$map = [
|
||||||
'hg' => '滚球',
|
'hg' => '皇冠',
|
||||||
'titan007' => '球探',
|
'titan007' => '球探',
|
||||||
];
|
];
|
||||||
return $map[$sourceSite] ?? ($sourceSite !== '' ? strtoupper($sourceSite) : '未知平台');
|
return $map[$sourceSite] ?? ($sourceSite !== '' ? strtoupper($sourceSite) : '未知平台');
|
||||||
|
|||||||
@@ -866,7 +866,7 @@ class MatchController extends BaseApiController
|
|||||||
private function getOddsPlatformNameMap(): array
|
private function getOddsPlatformNameMap(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'hg' => '滚球',
|
'hg' => '皇冠',
|
||||||
'titan007' => '球探',
|
'titan007' => '球探',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,11 @@
|
|||||||
<text>赔率加载中...</text>
|
<text>赔率加载中...</text>
|
||||||
</view>
|
</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-else-if="platforms.length" class="match-odds-detail__list">
|
||||||
<view v-for="platform in platforms"
|
<view v-for="platform in platforms"
|
||||||
:key="`${platform.platform_key}-${platform.source_match_id || platform.update_time || 0}`"
|
:key="`${platform.platform_key}-${platform.source_match_id || platform.update_time || 0}`"
|
||||||
@@ -79,7 +84,7 @@ const props = withDefaults(defineProps<{
|
|||||||
|
|
||||||
const defaultPlatformOptions: PlatformOption[] = [
|
const defaultPlatformOptions: PlatformOption[] = [
|
||||||
{ key: '', label: '全部平台' },
|
{ key: '', label: '全部平台' },
|
||||||
{ key: 'hg', label: '滚球' },
|
{ key: 'hg', label: '皇冠' },
|
||||||
{ key: 'titan007', label: '球探' },
|
{ key: 'titan007', label: '球探' },
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -88,8 +93,13 @@ const platformOptions = ref<PlatformOption[]>([...defaultPlatformOptions])
|
|||||||
const sourceSite = ref('')
|
const sourceSite = ref('')
|
||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const loaded = ref(false)
|
const loaded = ref(false)
|
||||||
|
const loadError = ref('')
|
||||||
const requestSeq = ref(0)
|
const requestSeq = ref(0)
|
||||||
|
|
||||||
|
const normalizePlatformLabel = (key: string, label: string) => {
|
||||||
|
return key === 'hg' ? '皇冠' : label
|
||||||
|
}
|
||||||
|
|
||||||
const platforms = computed<WorldCupOddsPlatform[]>(() => {
|
const platforms = computed<WorldCupOddsPlatform[]>(() => {
|
||||||
const result: WorldCupOddsPlatform[] = []
|
const result: WorldCupOddsPlatform[] = []
|
||||||
const seen = new Set<string>()
|
const seen = new Set<string>()
|
||||||
@@ -99,7 +109,10 @@ const platforms = computed<WorldCupOddsPlatform[]>(() => {
|
|||||||
const key = `${platform.platform_key}-${platform.source_match_id || ''}`
|
const key = `${platform.platform_key}-${platform.source_match_id || ''}`
|
||||||
if (seen.has(key)) return
|
if (seen.has(key)) return
|
||||||
seen.add(key)
|
seen.add(key)
|
||||||
result.push(platform)
|
result.push({
|
||||||
|
...platform,
|
||||||
|
platform_name: normalizePlatformLabel(platform.platform_key, platform.platform_name),
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
return result
|
return result
|
||||||
@@ -124,7 +137,7 @@ const mergePlatformOptions = (options: unknown) => {
|
|||||||
options.forEach((item: any) => {
|
options.forEach((item: any) => {
|
||||||
const key = String(item?.key || '').trim()
|
const key = String(item?.key || '').trim()
|
||||||
const label = String(item?.label || '').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())
|
platformOptions.value = Array.from(map.values())
|
||||||
@@ -141,6 +154,7 @@ const fetchOdds = async (force = false) => {
|
|||||||
const seq = requestSeq.value + 1
|
const seq = requestSeq.value + 1
|
||||||
requestSeq.value = seq
|
requestSeq.value = seq
|
||||||
loading.value = true
|
loading.value = true
|
||||||
|
loadError.value = ''
|
||||||
try {
|
try {
|
||||||
const data = await getMatchOdds({
|
const data = await getMatchOdds({
|
||||||
home_team: props.homeTeam.trim(),
|
home_team: props.homeTeam.trim(),
|
||||||
@@ -157,6 +171,8 @@ const fetchOdds = async (force = false) => {
|
|||||||
if (seq !== requestSeq.value) return
|
if (seq !== requestSeq.value) return
|
||||||
console.error('获取比赛赔率失败', error)
|
console.error('获取比赛赔率失败', error)
|
||||||
oddsList.value = []
|
oddsList.value = []
|
||||||
|
loaded.value = true
|
||||||
|
loadError.value = '赔率加载失败,请稍后重试'
|
||||||
} finally {
|
} finally {
|
||||||
if (seq === requestSeq.value) loading.value = false
|
if (seq === requestSeq.value) loading.value = false
|
||||||
}
|
}
|
||||||
@@ -169,6 +185,11 @@ const switchPlatform = (platformKey: string) => {
|
|||||||
void fetchOdds(true)
|
void fetchOdds(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const retryFetch = () => {
|
||||||
|
loaded.value = false
|
||||||
|
void fetchOdds(true)
|
||||||
|
}
|
||||||
|
|
||||||
const formatUpdateTime = (timestamp?: number) => {
|
const formatUpdateTime = (timestamp?: number) => {
|
||||||
const value = Number(timestamp || 0)
|
const value = Number(timestamp || 0)
|
||||||
if (!value) return ''
|
if (!value) return ''
|
||||||
@@ -185,6 +206,7 @@ watch(
|
|||||||
() => {
|
() => {
|
||||||
loaded.value = false
|
loaded.value = false
|
||||||
oddsList.value = []
|
oddsList.value = []
|
||||||
|
loadError.value = ''
|
||||||
void fetchOdds(true)
|
void fetchOdds(true)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { isDevMode } from "@/utils/env";
|
const envBaseUrl = 'https://test-server.sbnews.net/'
|
||||||
const envBaseUrl = import.meta.env.VITE_APP_BASE_URL || "";
|
|
||||||
|
|
||||||
let baseUrl = `${envBaseUrl}/`;
|
let baseUrl = `${envBaseUrl}/`
|
||||||
|
//#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 微信小程序在`VITE_APP_BASE_URL`存在或`dev`模式下
|
* 微信小程序在`VITE_APP_BASE_URL`存在或`dev`模式下
|
||||||
@@ -10,14 +10,14 @@ let baseUrl = `${envBaseUrl}/`;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
//#ifdef MP-WEIXIN
|
//#ifdef MP-WEIXIN
|
||||||
baseUrl = isDevMode() || envBaseUrl ? baseUrl : "[baseUrl]";
|
baseUrl = envBaseUrl
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
version: "1.9.0", //版本号
|
version: '1.9.0', //版本号
|
||||||
baseUrl, //请求接口域名
|
baseUrl, //请求接口域名
|
||||||
urlPrefix: "api", //请求默认前缀
|
urlPrefix: 'api', //请求默认前缀
|
||||||
timeout: 60 * 1000, //请求超时时长
|
timeout: 60 * 1000 //请求超时时长
|
||||||
};
|
}
|
||||||
|
|
||||||
export default config;
|
export default config
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ const oddsShowTypeOptions: { key: OddsShowType; label: string }[] = [
|
|||||||
|
|
||||||
const defaultOddsPlatformOptions: OddsPlatformOption[] = [
|
const defaultOddsPlatformOptions: OddsPlatformOption[] = [
|
||||||
{ key: '', label: '全部平台' },
|
{ key: '', label: '全部平台' },
|
||||||
{ key: 'hg', label: '滚球' },
|
{ key: 'hg', label: '皇冠' },
|
||||||
{ key: 'titan007', label: '球探' },
|
{ key: 'titan007', label: '球探' },
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -463,9 +463,10 @@ const fetchOdds = async (force = false) => {
|
|||||||
)
|
)
|
||||||
platformOptions.forEach((item: any) => {
|
platformOptions.forEach((item: any) => {
|
||||||
if (item?.key) {
|
if (item?.key) {
|
||||||
platformMap.set(String(item.key), {
|
const key = String(item.key)
|
||||||
key: String(item.key),
|
platformMap.set(key, {
|
||||||
label: String(item.label || item.key).trim(),
|
key,
|
||||||
|
label: key === 'hg' ? '皇冠' : String(item.label || item.key).trim(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -694,11 +695,12 @@ onMounted(() => {
|
|||||||
|
|
||||||
.content-tabs {
|
.content-tabs {
|
||||||
padding: 0 24rpx 14rpx;
|
padding: 0 24rpx 14rpx;
|
||||||
display: grid;
|
display: flex;
|
||||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
||||||
gap: 12rpx;
|
gap: 12rpx;
|
||||||
|
|
||||||
&__item {
|
&__item {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
height: 58rpx;
|
height: 58rpx;
|
||||||
border-radius: 16rpx;
|
border-radius: 16rpx;
|
||||||
background: #f1f5ff;
|
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 uni from '@dcloudio/vite-plugin-uni'
|
||||||
import tailwindcss from 'tailwindcss'
|
import tailwindcss from 'tailwindcss'
|
||||||
import autoprefixer from 'autoprefixer'
|
import autoprefixer from 'autoprefixer'
|
||||||
@@ -28,37 +28,49 @@ const suppressUniRouterSourcemapWarning = (msg: string) =>
|
|||||||
msg.includes("didn't generate a sourcemap")
|
msg.includes("didn't generate a sourcemap")
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig(({ mode }) => {
|
||||||
plugins: [uni(), uniRouter(), weappTailwindcssDisabled ? undefined : vwt()],
|
const env = loadEnv(mode, process.cwd(), '')
|
||||||
customLogger: {
|
|
||||||
info(msg) { console.log(msg) },
|
return {
|
||||||
warn(msg) { if (suppressUniRouterSourcemapWarning(msg)) return; console.warn(msg) },
|
plugins: [uni(), uniRouter(), weappTailwindcssDisabled ? undefined : vwt()],
|
||||||
error(msg) { console.error(msg) },
|
customLogger: {
|
||||||
warnOnce(msg) { if (suppressUniRouterSourcemapWarning(msg)) return; console.warn(msg) },
|
info(msg) { console.log(msg) },
|
||||||
infoOnce(msg) { console.log(msg) },
|
warn(msg) { if (suppressUniRouterSourcemapWarning(msg)) return; console.warn(msg) },
|
||||||
clearScreen() { },
|
error(msg) { console.error(msg) },
|
||||||
hasWarned: false,
|
warnOnce(msg) { if (suppressUniRouterSourcemapWarning(msg)) return; console.warn(msg) },
|
||||||
hasErrorLogged: false,
|
infoOnce(msg) { console.log(msg) },
|
||||||
},
|
clearScreen() { },
|
||||||
build: {
|
hasWarned: false,
|
||||||
rollupOptions: {
|
hasErrorLogged: false,
|
||||||
onwarn(warning, warn) {
|
},
|
||||||
if (
|
build: {
|
||||||
warning.message?.includes('plugin (unplugin-uni-router) was used to transform files') &&
|
rollupOptions: {
|
||||||
warning.message?.includes("didn't generate a sourcemap")
|
onwarn(warning, warn) {
|
||||||
) {
|
if (
|
||||||
return
|
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