PressMatchScheduleCard
Introduction
A schedule card component for displaying esports match information, supporting multiple match states and team types. The component is designed based on real data structures and supports special states like bye, pending, and forfeit, with flexible customization capabilities.
Import
Code Examples
Basic Usage
Different State Examples
Custom Badge Text
Support customizing badge text to adapt to different business scenarios.
API
Props
| Property | Description | Type | Default |
| battle-data | Battle data based on real data structure | BattleData | - |
| round-info | Round information | RoundInfo | - |
| custom-class | Custom class name | string | '' |
| show-manage-button | Whether to show manage button | boolean | false |
| my-team-id | Current user's team ID for showing "me" badge | string | - |
| left-team-quit | Left team forfeit flag | boolean | false |
| right-team-quit | Right team forfeit flag | boolean | false |
| bye-avatar | Avatar URL for bye state | string | '' |
| pending-avatar | Avatar URL for pending state | string | '' |
BattleData Structure
RoundInfo Structure
Events
| Event | Description | Parameters |
| team-click | Team click event | (side: 'left' \| 'right', team: TeamData) |
| manage-click | Manage button click event | () |
Slots
| Slot | Description | Parameters |
| manage-btn | Custom manage button | - |
Team State Description
Team Types
- normal: Normal team, displays real team information
- bye: Bye, displays "轮空" text and custom avatar
- pending: Pending, displays "待定" text and custom avatar
- forfeit: Forfeit, displays forfeit state
Badge Labels
- "我" Badge: Displayed when team ID matches
myTeamId, orange background - "弃" Badge: Controlled by
leftTeamQuit or rightTeamQuit, red background
Match States
- Finished (
realStatus: 100): Shows final score, identifies winner - Live (
realStatus: 50): Shows real-time score and live icon - Waiting for Admin (
realStatus: 0): Shows manage button - Scheduled (
realStatus: 10): Shows start time
Theme Customization
The component provides the following CSS variables for custom styling. Please refer to the ConfigProvider component for usage.
Style Variables
| Name | Default Value | Description |
| --pmsc-round-mb | .4rem | Round info bottom margin |
| --pmsc-team-item-mb | $spacing-sm | Team avatar bottom margin |
| --pmsc-center-gap | $spacing-sm | Center area gap |
| --pmsc-status-gap | $spacing-xs | Status text gap |
| --pmsc-avatar-border-width | 1px | Avatar border width |
| --pmsc-avatar-padding | 1px | Avatar padding |
| --pmsc-score-gap | .36rem | Score gap |
| --pmsc-badge-padding-lr | $spacing-sm | Badge left/right padding |
| --pmsc-round-padding-lr | $spacing-lg | Round info left/right padding |
| --pmsc-card-content-padding-lr | $spacing-xl | Card content left/right padding |
| --pmsc-card-min-height | 3.4rem | Card minimum height |
| --pmsc-avatar-size | 1.44rem | Team avatar size |
| --pmsc-badge-size | .36rem | Badge size |
| --pmsc-card-border-width | .08rem | Card border width |
| --pmsc-round-height | .48rem | Round info height |
| --pmsc-team-width | 1.68rem | Team width |
| --pmsc-score-height | .64rem | Score height |
| --pmsc-card-bg | $color-surface-default | Card background |
| --pmsc-avatar-border-color | $color-divider-light | Avatar border color |
| --pmsc-round-color | $color-text-primary | Round info text color |
| --pmsc-team-name-color | $color-text-primary | Team name text color |
| --pmsc-status-default-color | $color-text-invert-default | Default status text color |
| --pmsc-status-live-color | $color-text-brand | Live status text color |
| --pmsc-badge-quit-bg | #3e4c5a | Forfeit badge background |
| --pmsc-badge-me-bg | $color-surface-brand | Me badge background |
| --pmsc-badge-text-color | $color-text-invert-light | Badge text color |
| --pmsc-card-border-color | $color-surface-brand-light2 | Card border color |
| --pmsc-round-bg | $color-surface-brand-light2 | Round info background |
| --pmsc-score-text-color | $color-text-primary | Score text color |
| --pmsc-round-font-size | $font-size-md | Round info font size |
| --pmsc-team-name-font-size | $font-size-sm | Team name font size |
| --pmsc-status-font-size | $font-size-sm | Status text font size |
| --pmsc-badge-font-size | $font-size-xs | Badge font size |
| --pmsc-score-font-size | .8rem | Score font size |
| --pmsc-score-font-family | 'PingFang' | Score font family |
| --pmsc-avatar-border-radius | $border-radius-circle | Avatar border radius |
| --pmsc-badge-border-radius | $border-radius-999 | Badge border radius |
| --pmsc-card-border-radius | $border-radius-sm | Card border radius |
| --pmsc-round-clip-path | polygon(0 0, 100% 0, 90% 100%, 10% 100%) | Round info clip path |
| --pmsc-badge-offset-bottom | -.12rem | Badge bottom offset |
Notes
- Data Structure: Component data must use the
BattleData interface based on real data structure - Team Type Detection: Component automatically determines team type based on
teamname field (bye, pending, etc.) - Match Status: Match status is automatically calculated and displayed based on
realStatus field - Forfeit Control: Forfeit state is controlled by
leftTeamQuit and rightTeamQuit props, not dependent on data fields - Avatar Customization: Avatars for bye and pending states can be customized via
byeAvatar and pendingAvatar props - WeChat Mini Program: Supports WeChat Mini Program virtual host configuration with Press-UI integration
- Event Handling: All interactive events are emitted outward, maintaining component purity
Design Principles
- Data-Driven: Designed based on real business data structure, ensuring seamless integration with backend data
- State Separation: Business logic states (like forfeit) are controlled via props, not coupled to data structure
- Extensibility: Provides slots and CSS variables support to meet different business scenario customization needs
- Consistency: Follows project coding standards, using unified naming conventions and style variable systems