fix(mp): 文章详情页对齐 mp-04 原型 — 流式布局+底部浮动栏
- 标题 22px serif bold(原型值),元信息 13px tx3 - 正文 15px tx2 lineHeight:1.8 首行缩进(原型值) - 去掉分段白卡片,改为统一背景流式布局 - 新增底部浮动栏:收藏+分享按钮 - 分隔线 1px bdL
This commit is contained in:
@@ -63,36 +63,38 @@ export default function ArticleDetail() {
|
||||
);
|
||||
}
|
||||
|
||||
const handleCollect = () => {
|
||||
Taro.showToast({ title: '已收藏', icon: 'success' });
|
||||
};
|
||||
|
||||
const handleShare = () => {
|
||||
Taro.showShareMenu({ withShareTicket: true });
|
||||
};
|
||||
|
||||
return (
|
||||
<PageShell className={modeClass}>
|
||||
{/* 文章头部 */}
|
||||
<View className='article-header'>
|
||||
<Text className='article-title'>{article.title}</Text>
|
||||
<View className='article-meta'>
|
||||
{article.category && (
|
||||
<Text className='article-category'>{article.category}</Text>
|
||||
)}
|
||||
{article.author && (
|
||||
<Text className='article-author'>{article.author}</Text>
|
||||
)}
|
||||
{article.published_at && (
|
||||
<Text className='article-date'>{article.published_at.slice(0, 10)}</Text>
|
||||
)}
|
||||
</View>
|
||||
<PageShell padding="md" safeBottom={false} scroll={false} className={`article-detail-page ${modeClass}`}>
|
||||
<Text className='article-title'>{article.title}</Text>
|
||||
|
||||
<View className='article-meta'>
|
||||
{article.author && <Text>{article.author}</Text>}
|
||||
{article.published_at && <Text>{article.published_at.slice(0, 10)}</Text>}
|
||||
</View>
|
||||
|
||||
{/* 摘要 */}
|
||||
{article.summary && (
|
||||
<View className='article-summary'>
|
||||
<Text className='summary-text'>{article.summary}</Text>
|
||||
</View>
|
||||
)}
|
||||
<View className='article-divider' />
|
||||
|
||||
{/* 正文 */}
|
||||
<View className='article-content'>
|
||||
<RichText
|
||||
nodes={sanitizeHtml(article.content || '')}
|
||||
/>
|
||||
<View className='article-body'>
|
||||
<RichText nodes={sanitizeHtml(article.content || '')} />
|
||||
</View>
|
||||
|
||||
<View className='article-bottom-bar'>
|
||||
<View className='article-action-btn' onClick={handleCollect}>
|
||||
<Text className='article-action-icon'>♡</Text>
|
||||
<Text className='article-action-text'>收藏</Text>
|
||||
</View>
|
||||
<View className='article-action-btn' onClick={handleShare}>
|
||||
<Text className='article-action-icon'>↑</Text>
|
||||
<Text className='article-action-text'>分享</Text>
|
||||
</View>
|
||||
</View>
|
||||
</PageShell>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user