feat(mp): design-handoff 产出的页面样式和组件优化
- 首页/商城/医生端/积分/家庭档案等页面 SCSS + TSX 更新 - TabFilter 组件样式优化 - points service 接口调整 - app.config 路由注册更新
This commit is contained in:
@@ -85,6 +85,15 @@ function GuestHome({ modeClass }: { modeClass: string }) {
|
||||
|
||||
const slides = banners.length > 0 ? banners : FALLBACK_SLIDES;
|
||||
|
||||
const ARTICLE_ICONS = ['♥', '◇', '✦'];
|
||||
const ARTICLE_COLORS = ['pri', 'acc', 'wrn'] as const;
|
||||
|
||||
const formatDate = (dateStr?: string) => {
|
||||
if (!dateStr) return '';
|
||||
const d = new Date(dateStr);
|
||||
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
||||
};
|
||||
|
||||
return (
|
||||
<PageShell padding="none" safeBottom={false} scroll={false} className={`guest-page ${modeClass}`}>
|
||||
<Swiper
|
||||
@@ -114,59 +123,71 @@ function GuestHome({ modeClass }: { modeClass: string }) {
|
||||
))}
|
||||
</Swiper>
|
||||
|
||||
{/* 健康资讯 */}
|
||||
<View className='guest-section'>
|
||||
<Text className='guest-section-title'>健康资讯</Text>
|
||||
<View className='guest-section-header'>
|
||||
<Text className='guest-section-title'>健康资讯</Text>
|
||||
<Text
|
||||
className='guest-section-more'
|
||||
onClick={() => Taro.switchTab({ url: '/pages/health/index' })}
|
||||
>
|
||||
查看全部 ›
|
||||
</Text>
|
||||
</View>
|
||||
|
||||
{articles.length > 0 ? (
|
||||
<View className='guest-articles'>
|
||||
{articles.map((article) => (
|
||||
<ContentCard
|
||||
{articles.map((article, i) => (
|
||||
<View
|
||||
key={article.id}
|
||||
onPress={() => safeNavigateTo(`/pages/article/detail/index?id=${article.id}`)}
|
||||
activeFeedback="opacity"
|
||||
padding="none"
|
||||
className={`guest-article-card guest-article-card--${ARTICLE_COLORS[i % 3]}`}
|
||||
onClick={() => safeNavigateTo(`/pages/article/detail/index?id=${article.id}`)}
|
||||
>
|
||||
{article.cover_image && (
|
||||
<Image className='guest-article-cover' src={article.cover_image} mode='aspectFill' lazyLoad />
|
||||
)}
|
||||
<View className='guest-article-icon'>
|
||||
<Text className='guest-article-icon-char'>{ARTICLE_ICONS[i % 3]}</Text>
|
||||
</View>
|
||||
<View className='guest-article-body'>
|
||||
<Text className='guest-article-title'>{article.title}</Text>
|
||||
<Text className='guest-article-summary'>
|
||||
{article.summary || '点击查看详情'}
|
||||
</Text>
|
||||
<Text className='guest-article-date'>{formatDate(article.published_at)}</Text>
|
||||
</View>
|
||||
</ContentCard>
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
) : (
|
||||
<View className='guest-articles'>
|
||||
<ContentCard padding="none">
|
||||
<View className='guest-article-card guest-article-card--pri'>
|
||||
<View className='guest-article-icon'><Text className='guest-article-icon-char'>♥</Text></View>
|
||||
<View className='guest-article-body'>
|
||||
<Text className='guest-article-title'>健康数据管理</Text>
|
||||
<Text className='guest-article-summary'>记录并追踪您的体征数据</Text>
|
||||
<Text className='guest-article-date'>记录并追踪您的体征数据</Text>
|
||||
</View>
|
||||
</ContentCard>
|
||||
<ContentCard padding="none">
|
||||
</View>
|
||||
<View className='guest-article-card guest-article-card--acc'>
|
||||
<View className='guest-article-icon'><Text className='guest-article-icon-char'>◇</Text></View>
|
||||
<View className='guest-article-body'>
|
||||
<Text className='guest-article-title'>智能预约排班</Text>
|
||||
<Text className='guest-article-summary'>在线预约透析和治疗</Text>
|
||||
<Text className='guest-article-title'>积分商城</Text>
|
||||
<Text className='guest-article-date'>签到赚积分,好礼兑不停</Text>
|
||||
</View>
|
||||
</ContentCard>
|
||||
<ContentCard padding="none">
|
||||
</View>
|
||||
<View className='guest-article-card guest-article-card--wrn'>
|
||||
<View className='guest-article-icon'><Text className='guest-article-icon-char'>✦</Text></View>
|
||||
<View className='guest-article-body'>
|
||||
<Text className='guest-article-title'>AI 健康分析</Text>
|
||||
<Text className='guest-article-summary'>个性化健康趋势解读</Text>
|
||||
<Text className='guest-article-title'>专业科普文章</Text>
|
||||
<Text className='guest-article-date'>权威健康知识推送</Text>
|
||||
</View>
|
||||
</ContentCard>
|
||||
</View>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
|
||||
<ContentCard variant="elevated">
|
||||
<Text className='guest-login-text'>登录后即可使用完整健康管理服务</Text>
|
||||
<View className='guest-login-btn' onClick={navigateToLogin}>
|
||||
<Text className='guest-login-btn-text'>立即登录</Text>
|
||||
{/* 底部注册引导 */}
|
||||
<View className='guest-cta-card'>
|
||||
<Text className='guest-cta-title'>加入我们</Text>
|
||||
<Text className='guest-cta-desc'>注册后即可使用签到、积分商城等全部功能</Text>
|
||||
<View className='guest-cta-btn' onClick={navigateToLogin}>
|
||||
<Text className='guest-cta-btn-text'>注册 / 登录</Text>
|
||||
</View>
|
||||
</ContentCard>
|
||||
</View>
|
||||
</PageShell>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user