refactor(mp): 迁移剩余 8 特殊页面到统一组件库

- 首页/健康/我的/商城/消息 TabBar 页面使用 PageShell 替代手写容器
- 登录/法律条款/关怀模式设置页使用 PageShell 替代手写容器
- 各页面卡片统一使用 ContentCard 组件
- 清理页面 SCSS 中的 min-height/background/padding 样板代码
- 66 个小程序页面全部完成统一组件迁移
This commit is contained in:
iven
2026-05-16 01:55:28 +08:00
parent c6bffd4019
commit 184bd0ea03
17 changed files with 109 additions and 179 deletions

View File

@@ -2,8 +2,6 @@
@import '../../styles/mixins.scss';
.mall-page {
min-height: 100vh;
background: $bg;
padding-bottom: calc(120px + env(safe-area-inset-bottom));
}
@@ -121,10 +119,7 @@
}
.product-card {
background: $card;
border-radius: $r;
overflow: hidden;
box-shadow: $shadow-sm;
&:active {
opacity: 0.7;

View File

@@ -10,6 +10,8 @@ import Loading from '../../components/Loading';
import ErrorState from '../../components/ErrorState';
import EmptyState from '../../components/EmptyState';
import { useElderClass } from '../../hooks/useElderClass';
import PageShell from '@/components/ui/PageShell';
import ContentCard from '@/components/ui/ContentCard';
import './index.scss';
const PRODUCT_TYPE_TABS = [
@@ -137,7 +139,7 @@ export default function Mall() {
if (noProfile) {
return (
<View className={`mall-page ${modeClass}`}>
<PageShell padding="md" safeBottom={false} scroll={false} className={`mall-page ${modeClass}`}>
<EmptyState
icon='档'
text='请先完善个人档案'
@@ -145,12 +147,12 @@ export default function Mall() {
actionText='去建档'
onAction={() => Taro.navigateTo({ url: '/pages/pkg-profile/family-add/index' })}
/>
</View>
</PageShell>
);
}
return (
<View className={`mall-page ${modeClass}`}>
<PageShell padding="none" safeBottom={false} scroll={false} className={`mall-page ${modeClass}`}>
{/* 积分余额卡片 */}
<View className='mall-header'>
<View className='points-card'>
@@ -197,7 +199,7 @@ export default function Mall() {
) : (
<View className='product-grid'>
{products.map((item) => (
<View className='product-card' key={item.id} onClick={() => handleProductClick(item)}>
<ContentCard key={item.id} onPress={() => handleProductClick(item)} activeFeedback="opacity" padding="none">
<View className={`product-image ${TYPE_BG[item.product_type] || ''}`}>
<Text className='product-image-char'>
{item.product_type === 'physical' ? '物' : item.product_type === 'service' ? '券' : '权'}
@@ -217,7 +219,7 @@ export default function Mall() {
) : null}
</View>
</View>
</View>
</ContentCard>
))}
{loading && <Loading />}
{!loading && products.length >= total && total > 0 && (
@@ -225,6 +227,6 @@ export default function Mall() {
)}
</View>
)}
</View>
</PageShell>
);
}