perf(miniprogram): 全面性能优化 — 分包加载 + 请求缓存 + 渲染优化
分包加载(主包从 517KB 降至 275KB,-47%): - 将 27 个页面拆入 6 个分包(health/doctor/mall/profile/content/device) - vendors.js 从 192KB 降至 36KB(-81%) - echarts 514KB 仅在访问健康趋势页时按需加载 请求层优化: - GET 请求增加 in-flight 去重 + 60s TTL 响应缓存 - 新建 points store 集中管理积分/签到状态(消除 5 处重复调用) - health store todaySummary 增加 60s TTL - mutation 后自动失效缓存(health input/daily-monitoring) - logout 时清空请求缓存 渲染优化: - 7 个组件添加 React.memo(EcCanvas/TrendChart/Loading/EmptyState 等) - 修复 TrendChart setChartReady 导致的双重渲染 - 静态数组(quickServices/quickActions/trendLinks)提取到模块级 - restoreAuth 从页面级提升到 App 级别 - 文章列表图片添加 lazyLoad 构建优化: - prod 配置添加 terser(drop_console + drop_debugger) - crypto-js 从全量引入改为按需引入(AES + Utf8)
This commit is contained in:
@@ -3,44 +3,50 @@ export default defineAppConfig({
|
||||
'pages/index/index',
|
||||
'pages/login/index',
|
||||
'pages/health/index',
|
||||
'pages/health/input/index',
|
||||
'pages/health/trend/index',
|
||||
'pages/health/daily-monitoring/index',
|
||||
'pages/consultation/index',
|
||||
'pages/consultation/detail/index',
|
||||
'pages/mall/index',
|
||||
'pages/profile/index',
|
||||
'pages/appointment/index',
|
||||
'pages/appointment/create/index',
|
||||
'pages/appointment/detail/index',
|
||||
'pages/article/index',
|
||||
'pages/article/detail/index',
|
||||
'pages/report/detail/index',
|
||||
'pages/ai-report/list/index',
|
||||
'pages/ai-report/detail/index',
|
||||
'pages/followup/detail/index',
|
||||
'pages/consultation/index',
|
||||
'pages/consultation/detail/index',
|
||||
'pages/mall/index',
|
||||
'pages/mall/exchange/index',
|
||||
'pages/mall/orders/index',
|
||||
'pages/mall/detail/index',
|
||||
'pages/profile/index',
|
||||
'pages/profile/family/index',
|
||||
'pages/profile/family-add/index',
|
||||
'pages/profile/reports/index',
|
||||
'pages/profile/followups/index',
|
||||
'pages/profile/medication/index',
|
||||
'pages/profile/settings/index',
|
||||
'pages/legal/user-agreement',
|
||||
'pages/legal/privacy-policy',
|
||||
'pages/doctor/index',
|
||||
'pages/doctor/patients/index',
|
||||
'pages/doctor/patients/detail/index',
|
||||
'pages/doctor/consultation/index',
|
||||
'pages/doctor/consultation/detail/index',
|
||||
'pages/doctor/followup/index',
|
||||
'pages/doctor/followup/detail/index',
|
||||
'pages/doctor/report/index',
|
||||
'pages/doctor/report/detail/index',
|
||||
'pages/events/index',
|
||||
'pages/device-sync/index',
|
||||
],
|
||||
subPackages: [
|
||||
{
|
||||
root: 'pages/health',
|
||||
pages: ['trend/index', 'input/index', 'daily-monitoring/index'],
|
||||
},
|
||||
{
|
||||
root: 'pages/doctor',
|
||||
pages: [
|
||||
'index', 'patients/index', 'patients/detail/index',
|
||||
'consultation/index', 'consultation/detail/index',
|
||||
'followup/index', 'followup/detail/index',
|
||||
'report/index', 'report/detail/index',
|
||||
],
|
||||
},
|
||||
{
|
||||
root: 'pages/mall',
|
||||
pages: ['exchange/index', 'orders/index', 'detail/index'],
|
||||
},
|
||||
{
|
||||
root: 'pages/profile',
|
||||
pages: [
|
||||
'family/index', 'family-add/index', 'reports/index',
|
||||
'followups/index', 'medication/index', 'settings/index',
|
||||
],
|
||||
},
|
||||
{
|
||||
root: 'pages',
|
||||
pages: [
|
||||
'article/detail/index', 'ai-report/list/index',
|
||||
'ai-report/detail/index', 'report/detail/index',
|
||||
'followup/detail/index', 'events/index', 'device-sync/index',
|
||||
],
|
||||
},
|
||||
],
|
||||
tabBar: {
|
||||
color: '#A8A29E',
|
||||
|
||||
Reference in New Issue
Block a user