Revert "11"
Revert submission 1443
Reason for revert: <合并错误>
Reverted changes: /q/submissionid:1443
Change-Id: Ifc281ddf07de4b2686e270d68d1a5144e8d1aac4
diff --git a/Merge/front/src/components/PostDetailJWLLL.jsx b/Merge/front/src/components/PostDetailJWLLL.jsx
index 01f64b5..d598a72 100644
--- a/Merge/front/src/components/PostDetailJWLLL.jsx
+++ b/Merge/front/src/components/PostDetailJWLLL.jsx
@@ -5,7 +5,6 @@
import { getUserInfo } from '../utils/auth'
import FollowButton from './FollowButton'
import postsAPI from '../api/posts_api'
-import MediaPreview from './MediaPreview'
import '../style/PostDetail.css'
import dayjs from 'dayjs'
@@ -315,24 +314,11 @@
</div>
)}
- {/* 帖子媒体(支持多图/多视频) */}
+ {/* 帖子图片(支持多图) */}
{Array.isArray(post.media_urls) && post.media_urls.length > 0 && (
- <div className="post-media" style={{display:'flex',gap:8,marginBottom:16,flexWrap:'wrap'}}>
+ <div className="post-images" style={{display:'flex',gap:8,marginBottom:16}}>
{post.media_urls.map((url, idx) => (
- <MediaPreview
- key={idx}
- url={url}
- alt={`媒体${idx+1}`}
- onClick={(mediaUrl) => {
- // 对于图片,显示预览
- if (!mediaUrl.toLowerCase().includes('video') && !mediaUrl.includes('.mp4') && !mediaUrl.includes('.webm')) {
- setPreviewImg(mediaUrl)
- }
- }}
- style={{ cursor: 'pointer' }}
- maxWidth={320}
- maxHeight={320}
- />
+ <img key={idx} src={url} alt={`图片${idx+1}`} style={{maxWidth:220,maxHeight:220,borderRadius:8,objectFit:'cover',cursor:'pointer'}} onClick={() => setPreviewImg(url)} />
))}
</div>
)}