ソースを参照

feat: mark half-time odds history games

flyzto 11 時間 前
コミット
1881ff543c
1 ファイル変更21 行追加1 行削除
  1. 21 1
      web/apps/web-antd/src/views/match/odds-curve/index.vue

+ 21 - 1
web/apps/web-antd/src/views/match/odds-curve/index.vue

@@ -142,6 +142,10 @@ const historyTitle = computed(() => {
   return `${source.teamHomeName ?? ''} vs ${source.teamAwayName ?? ''}`;
 });
 
+const isHalfEvent = (eventId?: number) => {
+  return typeof eventId === 'number' && eventId < 0;
+};
+
 const marketOptions = computed(() => {
   const available = new Set(availableMarketKeys.value);
   return MARKET_GROUPS.map((group) => ({
@@ -383,7 +387,10 @@ onMounted(() => {
             @click="selectGame(game.eventId)"
           >
             <span class="league">{{ game.leagueName }}</span>
-            <span class="teams">{{ game.teamHomeName }} vs {{ game.teamAwayName }}</span>
+            <span class="teams">
+              {{ game.teamHomeName }} vs {{ game.teamAwayName }}
+              <span v-if="isHalfEvent(game.eventId)" class="period-tag">上半场</span>
+            </span>
             <span class="meta">ID {{ game.eventId }} · {{ formatGameTime(game.startTime) }} · {{ game.marketCount }}盘</span>
           </button>
         </div>
@@ -397,6 +404,7 @@ onMounted(() => {
           <div class="curve-title">{{ historyTitle }}</div>
           <div class="curve-subtitle">
             <span>赛事ID:{{ selectedEventId ?? '-' }}</span>
+            <span v-if="isHalfEvent(selectedEventId)">比赛周期:上半场</span>
             <span>开赛:{{ formatTime(history?.startTime ?? selectedGame?.startTime) }}</span>
             <span>记录盘口:{{ availableMarketKeys.length }}</span>
           </div>
@@ -497,6 +505,18 @@ onMounted(() => {
   font-weight: 500;
 }
 
+.period-tag {
+  display: inline-flex;
+  align-items: center;
+  margin-left: 6px;
+  padding: 0 5px;
+  border: 1px solid hsl(var(--primary) / 0.3);
+  color: hsl(var(--primary));
+  font-size: 12px;
+  font-weight: 400;
+  line-height: 18px;
+}
+
 .curve-panel {
   display: flex;
   min-width: 0;