This commit is contained in:
hailin 2025-04-09 00:28:28 +08:00
parent a78875ea4b
commit 9158edaa45
1 changed files with 49 additions and 6 deletions

View File

@ -41,7 +41,11 @@ export const Card: React.FC<ArticleData> = (articleData) => {
className="cursor-pointer rounded border border-[#243c5a] overflow-hidden"
>
<figure
{/* <figure
style={{ width: '100%', minHeight: "246px", position: 'relative' }}
>
<img src={
@ -53,9 +57,6 @@ export const Card: React.FC<ArticleData> = (articleData) => {
} alt={articleData.main_title} style={{ width: '100%', marginBottom: '8px' }} />
{/* 只在 model_parameter 无效时显示感叹号 */}
{(!articleData.model_parameter) && (
<div style={{
position: 'absolute',
@ -71,16 +72,58 @@ export const Card: React.FC<ArticleData> = (articleData) => {
justifyContent: 'center',
fontWeight: 'bold',
fontSize: '16px',
zIndex: 2, // 保证盖在图片上面
zIndex: 2,
}}>
!
</div>
)}
</figure> */}
<figure style={{ width: '100%', minHeight: "246px", position: 'relative', overflow: 'hidden' }}>
<div style={{ position: 'relative', width: '100%', height: '100%' }}>
<img
src={(
articleData.image_url.includes("http")
? articleData.image_url
: process.env.NEXT_PUBLIC_CLIENT_IMAGE_URL + articleData.image_url
) || defaultImage}
alt={articleData.main_title}
style={{
width: '100%',
height: '100%',
objectFit: 'cover',
display: 'block'
}}
/>
{/* 🔥 只有当 model_parameter 没有值时显示叹号 */}
{(!articleData.model_parameter) && (
<div style={{
position: 'absolute',
bottom: '8px',
right: '8px',
width: '24px',
height: '24px',
backgroundColor: 'red',
borderRadius: '50%',
color: 'white',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
fontWeight: 'bold',
fontSize: '16px',
zIndex: 2,
}}>
!
</div>
)}
</div>
</figure>
<div className='px-2 lg:px-6' style={{ height: '214px' }} >
<h3
className='text-left font-bold text-[#333333] text-[1.125rem] leading-[1.5rem]'