import { View, Text, Image } from '@tarojs/components' import './index.scss' interface ListItemProps { title: string dateTime: string location: string distance: string registeredCount: number maxCount: number skillLevel: string matchType: string images: string[] } const ListItem: React.FC = ({ title, dateTime, location, distance, registeredCount, maxCount, skillLevel, matchType, images }) => { // 根据图片数量决定展示样式 const renderImages = () => { if (images.length === 0) return null if (images.length === 1) { return ( ) } if (images.length === 2) { return ( ) } // 3张或更多图片 return ( ) } return ( {/* 左侧内容区域 */} {/* 标题 */} {title} {/* 时间信息 */} {dateTime} {/* 地点和距离 */} {location}・{distance} {/* 底部信息行:头像组、报名人数、技能等级、比赛类型 */} {Array.from({ length: Math.min(registeredCount, 3) }).map((_, index) => ( ))} 报名人数 {registeredCount}/{maxCount} {skillLevel} {matchType} {/* 右侧图片区域 */} {renderImages()} ) } export default ListItem