xtraderClient/docs/views/EventMarkets.md

24 lines
977 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# EventMarkets.vue
**路径**`src/views/EventMarkets.vue`
**路由**`/event/:id/markets`name: `event-markets`
## 功能用途
事件下的市场列表页,展示某个 Event 的多个 Market如 NFL 多支队伍),支持选择并跳转交易详情。
- **多市场折线图**:按市场数量依次调用 `getPmPriceHistoryPublic`,每个市场使用 `clobTokenIds[0]`YES token作为 `market` 参数,展示多条分时曲线
- **时间范围**1H / 6H / 1D / 1W / 1M / ALL与 TradeDetail 一致
## 使用方式
- 从首页或详情进入,路由 `/event/123/markets`
- 路由参数 `id` 为 Event ID
- 分时图数据来源:`src/api/priceHistory.ts``getPmPriceHistoryPublic``priceHistoryToChartData`
## 扩展方式
- 增加市场筛选、排序
- 与 TradeDetail 联动,支持从市场列表直接进入指定 market 的交易
- 可抽取 `getTimeRangeMs``filterChartDataByRange` 为共享 util与 TradeDetail 复用