diff --git a/src/components/business/PostCard.tsx b/src/components/business/PostCard.tsx index c992e42..fb5fabd 100644 --- a/src/components/business/PostCard.tsx +++ b/src/components/business/PostCard.tsx @@ -362,6 +362,20 @@ const PostCard: React.FC = ({ const gridUsernameFontSize = isDesktop ? 14 : 12; const gridLikeFontSize = isDesktop ? 14 : 12; + const handleContainerPress = () => { + onPress(); + }; + + const handleImagePress = (e: any) => { + e.stopPropagation(); + onImagePress?.(post.images || [], 0); + }; + + const handleUserPress = (e: any) => { + e.stopPropagation(); + onUserPress(); + }; + return ( = ({ !hasImage && styles.gridContainerNoImage, isDesktop && styles.gridContainerDesktop ]} - onPress={onPress} + onPress={handleContainerPress} activeOpacity={0.9} > {/* 封面图 - 只有有图片时才渲染,无图时不显示占位区域 */} {hasImage && ( onImagePress?.(post.images || [], 0)} + onPress={handleImagePress} > = ({ {/* 底部信息 */} - + = ({ return 3; }, [isWideScreen, isDesktop, isTablet]); + const handleContainerPress = () => { + onPress(); + }; + + const handleUserPress = (e: any) => { + e.stopPropagation(); + onUserPress(); + }; + + const handleLikePress = (e: any) => { + e.stopPropagation(); + onLike(); + }; + + const handleCommentPress = (e: any) => { + e.stopPropagation(); + onComment(); + }; + + const handleSharePress = (e: any) => { + e.stopPropagation(); + onShare(); + }; + + const handleBookmarkPress = (e: any) => { + e.stopPropagation(); + onBookmark(); + }; + + const handleDeletePress = (e: any) => { + e.stopPropagation(); + handleDelete(); + }; + return ( = ({ } : {}) } ]} - onPress={onPress} + onPress={handleContainerPress} activeOpacity={0.9} > {/* 用户信息 */} - + = ({ - + = ({ {isPostAuthor && onDelete && ( = ({ - + = ({ - + = ({ - + = ({ /> - + { .runOnJS(true) .activeOffsetX([-15, 15]) .failOffsetY([-20, 20]) + .shouldCancelWhenOutside(true) .onEnd((event) => { const now = Date.now(); if (now - lastSwipeAtRef.current < SWIPE_COOLDOWN_MS) {