feat(admin,api,player): 优胜赛配置、赛事管理重构与玩家端投注体验优化
管理端拆分赛事/优胜赛 Tab,新增联赛优胜赔率面板(批量、排序、外侧删除);统一 list-chrome 工具栏对齐与列表页布局;Dashboard 失败重试、Users 操作下拉、小屏侧栏等体验修复。 API 扩展优胜赛与赛事目录接口,完善投注与钱包查询;玩家端重构赛事卡片、串关面板、注单/钱包页,新增注单详情、下注成功动画与下拉刷新。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { computed, ref, watch, onMounted, onUnmounted } from 'vue';
|
||||
import { teamFlagUrl } from '../../utils/teamFlag';
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -15,6 +15,9 @@ const flag = computed(
|
||||
() => props.logoUrl?.trim() || teamFlagUrl(props.teamCode, props.teamName),
|
||||
);
|
||||
const flagFailed = ref(false);
|
||||
const imgVisible = ref(false);
|
||||
const cardRef = ref<HTMLElement | null>(null);
|
||||
let observer: IntersectionObserver | null = null;
|
||||
|
||||
function onFlagError() {
|
||||
flagFailed.value = true;
|
||||
@@ -31,16 +34,34 @@ function formatOdds(odds: string) {
|
||||
const n = parseFloat(odds);
|
||||
return Number.isFinite(n) ? n.toFixed(2) : odds;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (!cardRef.value) return;
|
||||
observer = new IntersectionObserver(
|
||||
(entries) => {
|
||||
const entry = entries[0];
|
||||
if (entry.isIntersecting) {
|
||||
imgVisible.value = true;
|
||||
observer?.disconnect();
|
||||
}
|
||||
},
|
||||
{ rootMargin: '120px' }
|
||||
);
|
||||
observer.observe(cardRef.value);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
observer?.disconnect();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<button type="button" class="option-card" @click="emit('pick')">
|
||||
<button ref="cardRef" type="button" class="option-card" @click="emit('pick')">
|
||||
<img
|
||||
v-if="flag && !flagFailed"
|
||||
v-if="imgVisible && flag && !flagFailed"
|
||||
:src="flag"
|
||||
alt=""
|
||||
class="flag"
|
||||
loading="lazy"
|
||||
@error="onFlagError"
|
||||
/>
|
||||
<span v-else class="flag-placeholder" aria-hidden="true">⚽</span>
|
||||
|
||||
Reference in New Issue
Block a user