feat: 将detail迁移至mod_user目录

This commit is contained in:
2025-09-11 23:04:05 +08:00
parent 57ef695e8b
commit 30d97739ae
7 changed files with 376 additions and 314 deletions

View File

@@ -17,19 +17,24 @@ const ListCard: React.FC<ListCardProps> = ({
play_type,
image_list = [],
court_type,
key
key,
}) => {
const renderItemImage = (src: string) => {
return <Image src={src} className="image" mode="aspectFill"
lazyLoad
defaultSource='https://images.unsplash.com/photo-1554068865-24cecd4e34b8?w=200&h=200&fit=crop&crop=center'
/>;
return (
<Image
src={src}
className="image"
mode="aspectFill"
lazyLoad
defaultSource="https://images.unsplash.com/photo-1554068865-24cecd4e34b8?w=200&h=200&fit=crop&crop=center"
/>
);
};
const handleViewDetail = () => {
console.log('id', id)
console.log("id", id);
Taro.navigateTo({
url: `/pages/detail/index?id=${id || 1}&from=list&autoShare=0`,
url: `/mod_user/detail/index?id=${id || 1}&from=list`,
});
};
@@ -40,7 +45,9 @@ const ListCard: React.FC<ListCardProps> = ({
if (image_list?.length === 1) {
return (
<View className="single-image">
<View className="image-container">{renderItemImage(image_list?.[0])}</View>
<View className="image-container">
{renderItemImage(image_list?.[0])}
</View>
</View>
);
}
@@ -48,8 +55,12 @@ const ListCard: React.FC<ListCardProps> = ({
if (image_list?.length === 2) {
return (
<View className="double-image">
<View className="image-container">{renderItemImage(image_list?.[0])}</View>
<View className="image-container">{renderItemImage(image_list?.[1])}</View>
<View className="image-container">
{renderItemImage(image_list?.[0])}
</View>
<View className="image-container">
{renderItemImage(image_list?.[1])}
</View>
</View>
);
}
@@ -57,9 +68,15 @@ const ListCard: React.FC<ListCardProps> = ({
// 3张或更多图片
return (
<View className="triple-image">
<View className="image-container">{renderItemImage(image_list?.[0])}</View>
<View className="image-container">{renderItemImage(image_list?.[1])}</View>
<View className="image-container">{renderItemImage(image_list?.[2])}</View>
<View className="image-container">
{renderItemImage(image_list?.[0])}
</View>
<View className="image-container">
{renderItemImage(image_list?.[1])}
</View>
<View className="image-container">
{renderItemImage(image_list?.[2])}
</View>
</View>
);
};
@@ -69,14 +86,16 @@ const ListCard: React.FC<ListCardProps> = ({
{/* 左侧内容区域 */}
<View className="content">
{/* 标题 */}
{title && <View className="titleWrapper">
<Text className="title">{title}</Text>
<Image
src={img.ICON_LIST_RIGHT_ARROW}
className="title-right-arrow"
mode="aspectFit"
/>
</View>}
{title && (
<View className="titleWrapper">
<Text className="title">{title}</Text>
<Image
src={img.ICON_LIST_RIGHT_ARROW}
className="title-right-arrow"
mode="aspectFit"
/>
</View>
)}
{/* 时间信息 */}
<View className="date-time">
@@ -86,8 +105,11 @@ const ListCard: React.FC<ListCardProps> = ({
{/* 地点,室内外,距离 */}
<View className="location">
{location &&
<Text className="location-text location-position">{location}</Text>}
{location && (
<Text className="location-text location-position">
{location}
</Text>
)}
<Text className="location-text location-time-distance">
{court_type && `${court_type}`}
{distance_km && `${distance_km}km`}
@@ -98,17 +120,15 @@ const ListCard: React.FC<ListCardProps> = ({
<View className="bottom-info">
<View className="left-section">
<View className="avatar-group">
{Array.from({ length: 3 }).map(
(_, index) => (
<View key={index} className="avatar">
<Image
className="avatar-image"
src="https://images.unsplash.com/photo-1554068865-24cecd4e34b8?w=200&h=200&fit=crop&crop=center"
mode="aspectFill"
/>
</View>
)
)}
{Array.from({ length: 3 }).map((_, index) => (
<View key={index} className="avatar">
<Image
className="avatar-image"
src="https://images.unsplash.com/photo-1554068865-24cecd4e34b8?w=200&h=200&fit=crop&crop=center"
mode="aspectFill"
/>
</View>
))}
</View>
</View>
@@ -120,11 +140,15 @@ const ListCard: React.FC<ListCardProps> = ({
</Text>
</View>
<View className="tag">
<Text className="tag-text">{skill_level_min} {skill_level_max}</Text>
<Text className="tag-text">
{skill_level_min} {skill_level_max}
</Text>
</View>
{play_type && <View className="tag">
<Text className="tag-text">{play_type}</Text>
</View>}
{play_type && (
<View className="tag">
<Text className="tag-text">{play_type}</Text>
</View>
)}
</View>
</View>
</View>
@@ -135,13 +159,19 @@ const ListCard: React.FC<ListCardProps> = ({
{/* 畅打球局 */}
<View className="smoothPlayingGame">
<View className="smoothWrapper">
<Image src={img.ICON_LIST_PLAYING_GAME} className="iconListPlayingGame" />
<Image
src={img.ICON_LIST_PLAYING_GAME}
className="iconListPlayingGame"
/>
<Text className="smoothTitle"></Text>
</View>
<View className="line" />
<View>:</View>
<View className="localAreaWrapper">
<Image className="localArea" src="https://images.unsplash.com/photo-1554068865-24cecd4e34b8?w=200&h=200&fit=crop&crop=center" />
<Image
className="localArea"
src="https://images.unsplash.com/photo-1554068865-24cecd4e34b8?w=200&h=200&fit=crop&crop=center"
/>
<Text className="localAreaText"></Text>
</View>
</View>