Browse Source

feat: restructure WeChat miniprogram with subPackages to fix error 80051 (source size 3172KB > 2MB)

- Split pages.json: 16 main pages + 16 subPackages (60 pages)
- Move non-TabBar pages to subPackages (teacher, guide, parent, child, tasks, wishes, rewards, games, assessment, growth, shop, vendor, stats, promotion, energy, membership)
- TabBar changed: [index/discover/shop/profile] -> [index/body/mind/profile]
- manifest.json: lazyCodeLoading, name/description update
- package-lock.json: rename zxyj -> cfc

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
User 4 months ago
parent
commit
c08388be56

+ 0 - 2
cfc-frontend/.env.production

@@ -1,2 +0,0 @@
-VUE_APP_API_BASE=https://api.xxx.com
-VUE_APP_DANSHOP_BASE=https://danshop.xxx.com

+ 0 - 2
cfc-frontend/.env.staging

@@ -1,2 +0,0 @@
-VUE_APP_API_BASE=https://staging-api.xxx.com
-VUE_APP_DANSHOP_BASE=https://staging-danshop.xxx.com

+ 4 - 3
cfc-frontend/manifest.json

@@ -1,7 +1,7 @@
 {
-    "name" : "知行益家",
+    "name" : "浠艾福",
     "appid" : "__UNI__DA59D6D",
-    "description" : "家庭教育任务管理小程序",
+    "description" : "关爱家庭成长小程序",
     "versionName" : "1.0.0",
     "versionCode" : "100",
     "transformPx" : false,
@@ -47,7 +47,8 @@
             "urlCheck" : false,
             "es6" : true,
             "postcss" : true,
-            "minified" : true
+            "minified" : true,
+            "lazyCodeLoading" : "requiredComponents"
         },
         "usingComponents" : true
     },

+ 2 - 2
cfc-frontend/package-lock.json

@@ -1,11 +1,11 @@
 {
-  "name": "zxyj-frontend",
+  "name": "cfc-frontend",
   "version": "1.0.0",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
-      "name": "zxyj-frontend",
+      "name": "cfc-frontend",
       "version": "1.0.0"
     }
   }

+ 461 - 405
cfc-frontend/pages.json

@@ -1,415 +1,471 @@
-{
-  "pages": [
-    {
-      "path": "pages/login/login",
-      "style": {
-        "navigationBarTitleText": "登录",
-        "navigationStyle": "custom"
-      }
-    },
-    {
-      "path": "pages/user-edit/user-edit",
-      "style": {
-        "navigationBarTitleText": "完善信息"
-      }
-    },
-    {
-      "path": "pages/index/index",
-      "style": {
-        "navigationBarTitleText": "首页"
-      }
-    },
-    {
-      "path": "pages/index/child-index",
-      "style": {
-        "navigationBarTitleText": "首页"
-      }
-    },
-    {
-      "path": "pages/child/tasks",
-      "style": {
-        "navigationBarTitleText": "孩子任务"
-      }
-    },
-    {
-      "path": "pages/child/rewards",
-      "style": {
-        "navigationBarTitleText": "孩子心愿单"
-      }
-    },
-    {
-      "path": "pages/index/parent-index",
-      "style": {
-        "navigationBarTitleText": "首页"
-      }
-    },
-    {
-      "path": "pages/tasks/tasks",
-      "style": {
-        "navigationBarTitleText": "任务列表"
-      }
-    },
-    {
-      "path": "pages/rewards/rewards",
-      "style": {
-        "navigationBarTitleText": "心愿单"
-      }
-    },
-    {
-      "path": "pages/profile/profile",
-      "style": {
-        "navigationBarTitleText": "我的"
-      }
-    },
-    {
-      "path": "pages/teacher/index",
-      "style": {
-        "navigationBarTitleText": "成长规划师中心"
-      }
-    },
-    {
-      "path": "pages/teacher/families",
-      "style": {
-        "navigationBarTitleText": "我的家庭"
-      }
-    },
-    {
-      "path": "pages/teacher/team",
-      "style": {
-        "navigationBarTitleText": "我的团队"
-      }
-    },
-    {
-      "path": "pages/teacher/messages",
-      "style": {
-        "navigationBarTitleText": "消息中心"
-      }
-    },
-    {
-      "path": "pages/teacher/orders",
-      "style": {
-        "navigationBarTitleText": "订单与佣金"
-      }
-    },
-    {
-      "path": "pages/teacher/chat",
+{
+  "pages": [
+    // ===== 主包:入口页 + TabBar 页 + 必须在主包的页面 =====
+    {
+      "path": "pages/discover/index",
+      "style": {
+        "navigationBarTitleText": "发现"
+      }
+    },
+    {
+      "path": "pages/login/login",
+      "style": {
+        "navigationBarTitleText": "登录",
+        "navigationStyle": "custom"
+      }
+    },
+    {
+      "path": "pages/user-edit/user-edit",
+      "style": {
+        "navigationBarTitleText": "完善信息"
+      }
+    },
+    // ===== TabBar 页面(必须在主包)=====
+    {
+      "path": "pages/index/index",
+      "style": {
+        "navigationBarTitleText": "首页"
+      }
+    },
+    {
+      "path": "pages/index/child-index",
+      "style": {
+        "navigationBarTitleText": "首页"
+      }
+    },
+    {
+      "path": "pages/index/parent-index",
+      "style": {
+        "navigationBarTitleText": "首页"
+      }
+    },
+    {
+      "path": "pages/body/index",
+      "style": {
+        "navigationBarTitleText": "身体"
+      }
+    },
+    {
+      "path": "pages/mind/index",
+      "style": {
+        "navigationBarTitleText": "心智"
+      }
+    },
+    {
+      "path": "pages/mind/articles",
       "style": {
-        "navigationBarTitleText": "聊天"
+        "navigationBarTitleText": "心智成长"
       }
     },
     {
-      "path": "pages/teacher/teacher-profile",
+      "path": "pages/mind/article-detail",
+      "style": {
+        "navigationBarTitleText": "文章详情"
+      }
+    },
+    {
+      "path": "pages/profile/profile",
       "style": {
         "navigationBarTitleText": "我的"
       }
     },
     {
-      "path": "pages/membership/index",
-      "style": {
-        "navigationBarTitleText": "会员服务"
-      }
-    },
-    {
-      "path": "pages/profile/create-child",
-      "style": {
-        "navigationBarTitleText": "添加孩子"
-      }
-    },
-      {
-        "path": "pages/profile/children",
-        "style": {
-          "navigationBarTitleText": "孩子管理"
-        }
-      },
-      {
-        "path": "pages/profile/edit-child",
-        "style": {
-          "navigationBarTitleText": "编辑孩子"
-        }
-      },
-      {
-        "path": "pages/profile/family-members",
-        "style": {
-          "navigationBarTitleText": "家庭成员"
-        }
-      },
-    {
-      "path": "pages/tasks/create-task",
-      "style": {
-        "navigationBarTitleText": "添加任务"
-      }
-    },
-    {
-      "path": "pages/tasks/review",
-      "style": {
-        "navigationBarTitleText": "审核任务"
-      }
-    },
-    {
-      "path": "pages/guide/packages/index",
-      "style": {
-        "navigationBarTitleText": "我的套餐"
-      }
-    },
-    {
-      "path": "pages/guide/packages/create",
-      "style": {
-        "navigationBarTitleText": "创建套餐"
-      }
-    },
-    {
-      "path": "pages/guide/packages/detail",
-      "style": {
-        "navigationBarTitleText": "套餐详情"
-      }
-    },
-    {
-      "path": "pages/parent/market/index",
-      "style": {
-        "navigationBarTitleText": "套餐市场"
-      }
-    },
-    {
-      "path": "pages/parent/market/detail",
-      "style": {
-        "navigationBarTitleText": "套餐详情"
-      }
-    },
-    {
-      "path": "pages/parent/plans/index",
-      "style": {
-        "navigationBarTitleText": "我的计划"
-      }
-    },
-    {
-      "path": "pages/parent/plans/detail",
-      "style": {
-        "navigationBarTitleText": "计划详情"
-      }
-    },
-    {
-      "path": "pages/guide/bind/invite",
-      "style": {
-        "navigationBarTitleText": "绑定成长规划师"
-      }
-    },
-    {
-      "path": "pages/guide/packages/share",
-      "style": {
-        "navigationBarTitleText": "分享套餐"
-      }
-    },
-    {
-      "path": "pages/games/list",
-      "style": {
-        "navigationBarTitleText": "小游戏"
-      }
-    },
-    {
-      "path": "pages/games/schulte",
-      "style": {
-        "navigationBarTitleText": "舒尔特方格"
-      }
-    },
-    {
-      "path": "pages/games/1a2b",
-      "style": {
-        "navigationBarTitleText": "猜数字"
-      }
-    },
-{
-"path": "pages/games/sudoku",
-"style": {
-"navigationBarTitleText": "数独"
-}
-},
-{
-"path": "pages/wishes/index",
-"style": {
-"navigationBarTitleText": "我的心愿"
-}
-},
-{
-"path": "pages/wishes/create",
-"style": {
-"navigationBarTitleText": "添加心愿"
-}
-},
-{
-"path": "pages/wishes/detail",
-"style": {
-"navigationBarTitleText": "心愿详情"
-}
-},
-{
-  "path": "pages/parent/wishes/index",
-  "style": {
-    "navigationBarTitleText": "心愿管理"
-  }
-},
-    {
-      "path": "pages/parent/child-detail",
-      "style": {
-        "navigationBarTitleText": "孩子详情"
-      }
-    },
-    {
-      "path": "pages/parent/invite/index",
-      "style": {
-        "navigationBarTitleText": "邀请加入"
-      }
-    },
-    {
-      "path": "pages/guide/register/index",
-      "style": {
-        "navigationBarTitleText": "成为成长规划师"
-      }
-    },
-    {
-      "path": "pages/guide/invite/share",
-      "style": {
-        "navigationBarTitleText": "邀请分享"
-      }
-    },
-    {
-      "path": "pages/assessment/apply",
-      "style": {
-        "navigationBarTitleText": "申请测评"
-      }
-    },
-    {
-      "path": "pages/assessment/results",
-      "style": {
-        "navigationBarTitleText": "测评报告"
-      }
-    },
-    {
-      "path": "pages/assessment/purchase",
-      "style": {
-        "navigationBarTitleText": "购买测评"
-      }
-    },
-    {
-      "path": "pages/guide/hierarchy/index",
-      "style": {
-        "navigationBarTitleText": "下级成长规划师"
-      }
-    },
-    {
-      "path": "pages/growth/index",
-      "style": {
-        "navigationBarTitleText": "成长档案"
-      }
-    },
-    {
-      "path": "pages/growth/create",
-      "style": {
-        "navigationBarTitleText": "创建成长档案"
-      }
-    },
-    {
-      "path": "pages/growth/detail",
-      "style": {
-        "navigationBarTitleText": "档案详情"
-      }
-    },
-    {
-      "path": "pages/growth/assessment-result",
-      "style": {
-        "navigationBarTitleText": "测评报告"
-      }
-    },
-    {
-      "path": "pages/stats/completion-rate",
-      "style": {
-        "navigationBarTitleText": "任务完成率",
-        "navigationStyle": "custom"
-      }
-    },
-    // ===== 汐福俱乐部 Phase 0 =====
-    {
-      "path": "pages/discover/index",
-      "style": {
-        "navigationBarTitleText": "发现"
-      }
-    },
-    {
-      "path": "pages/shop/index",
-      "style": {
-        "navigationBarTitleText": "商城"
-      }
-    },
-    {
-      "path": "pages/vendor/apply",
-      "style": {
-        "navigationBarTitleText": "服务商入驻"
-      }
-    },
-    {
-      "path": "pages/vendor/center",
-      "style": {
-        "navigationBarTitleText": "服务商中心"
-      }
-    },
-    {
-      "path": "pages/discover/product-detail/product-detail",
-      "style": {
-        "navigationBarTitleText": "商品详情"
-      }
-    },
-    {
-      "path": "pages/shop/order-list/order-list",
-      "style": {
-        "navigationBarTitleText": "我的订单"
-      }
-    },
-    {
-      "path": "pages/shop/order-detail/order-detail",
-      "style": {
-        "navigationBarTitleText": "订单详情"
-      }
-    },
-    {
-      "path": "pages/vendor/products/products",
-      "style": {
-        "navigationBarTitleText": "商品管理"
-      }
-    },
-    {
-      "path": "pages/vendor/orders/orders",
-      "style": {
-        "navigationBarTitleText": "订单管理"
-      }
-    }
+      "path": "pages/profile/create-child",
+      "style": {
+        "navigationBarTitleText": "添加孩子"
+      }
+    },
+    {
+      "path": "pages/profile/children",
+      "style": {
+        "navigationBarTitleText": "孩子管理"
+      }
+    },
+    {
+      "path": "pages/profile/edit-child",
+      "style": {
+        "navigationBarTitleText": "编辑孩子"
+      }
+    },
+    {
+      "path": "pages/profile/family-members",
+      "style": {
+        "navigationBarTitleText": "家庭成员"
+      }
+    },
+    {
+      "path": "pages/discover/product-detail/product-detail",
+      "style": {
+        "navigationBarTitleText": "商品详情"
+      }
+    }
+  ],
+  "subPackages": [
+    // ===== 成长规划师 =====
+    {
+      "root": "pages/teacher",
+      "pages": [
+        {
+          "path": "index",
+          "style": { "navigationBarTitleText": "成长规划师中心" }
+        },
+        {
+          "path": "families",
+          "style": { "navigationBarTitleText": "我的家庭" }
+        },
+        {
+          "path": "team",
+          "style": { "navigationBarTitleText": "我的团队" }
+        },
+        {
+          "path": "messages",
+          "style": { "navigationBarTitleText": "消息中心" }
+        },
+        {
+          "path": "orders",
+          "style": { "navigationBarTitleText": "订单与佣金" }
+        },
+        {
+          "path": "chat",
+          "style": { "navigationBarTitleText": "聊天" }
+        },
+        {
+          "path": "teacher-profile",
+          "style": { "navigationBarTitleText": "我的" }
+        }
+      ]
+    },
+    // ===== 规划师入驻/套餐 =====
+    {
+      "root": "pages/guide",
+      "pages": [
+        {
+          "path": "packages/index",
+          "style": { "navigationBarTitleText": "我的套餐" }
+        },
+        {
+          "path": "packages/create",
+          "style": { "navigationBarTitleText": "创建套餐" }
+        },
+        {
+          "path": "packages/detail",
+          "style": { "navigationBarTitleText": "套餐详情" }
+        },
+        {
+          "path": "packages/share",
+          "style": { "navigationBarTitleText": "分享套餐" }
+        },
+        {
+          "path": "bind/invite",
+          "style": { "navigationBarTitleText": "绑定成长规划师" }
+        },
+        {
+          "path": "register/index",
+          "style": { "navigationBarTitleText": "成为成长规划师" }
+        },
+        {
+          "path": "invite/share",
+          "style": { "navigationBarTitleText": "邀请分享" }
+        },
+        {
+          "path": "hierarchy/index",
+          "style": { "navigationBarTitleText": "下级成长规划师" }
+        }
+      ]
+    },
+    // ===== 家长专属 =====
+    {
+      "root": "pages/parent",
+      "pages": [
+        {
+          "path": "market/index",
+          "style": { "navigationBarTitleText": "套餐市场" }
+        },
+        {
+          "path": "market/detail",
+          "style": { "navigationBarTitleText": "套餐详情" }
+        },
+        {
+          "path": "plans/index",
+          "style": { "navigationBarTitleText": "我的计划" }
+        },
+        {
+          "path": "plans/detail",
+          "style": { "navigationBarTitleText": "计划详情" }
+        },
+        {
+          "path": "wishes/index",
+          "style": { "navigationBarTitleText": "心愿管理" }
+        },
+        {
+          "path": "child-detail",
+          "style": { "navigationBarTitleText": "孩子详情" }
+        },
+        {
+          "path": "invite/index",
+          "style": { "navigationBarTitleText": "邀请加入" }
+        }
+      ]
+    },
+    // ===== 孩子端 =====
+    {
+      "root": "pages/child",
+      "pages": [
+        {
+          "path": "tasks",
+          "style": { "navigationBarTitleText": "孩子任务" }
+        },
+        {
+          "path": "rewards",
+          "style": { "navigationBarTitleText": "孩子心愿单" }
+        }
+      ]
+    },
+    // ===== 任务管理 =====
+    {
+      "root": "pages/tasks",
+      "pages": [
+        {
+          "path": "tasks",
+          "style": { "navigationBarTitleText": "任务列表" }
+        },
+        {
+          "path": "create-task",
+          "style": { "navigationBarTitleText": "添加任务" }
+        },
+        {
+          "path": "review",
+          "style": { "navigationBarTitleText": "审核任务" }
+        }
+      ]
+    },
+    // ===== 心愿单 =====
+    {
+      "root": "pages/wishes",
+      "pages": [
+        {
+          "path": "index",
+          "style": { "navigationBarTitleText": "我的心愿" }
+        },
+        {
+          "path": "create",
+          "style": { "navigationBarTitleText": "添加心愿" }
+        },
+        {
+          "path": "detail",
+          "style": { "navigationBarTitleText": "心愿详情" }
+        }
+      ]
+    },
+    // ===== 奖励/勋章 =====
+    {
+      "root": "pages/rewards",
+      "pages": [
+        {
+          "path": "rewards",
+          "style": { "navigationBarTitleText": "心愿单" }
+        },
+        {
+          "path": "badge",
+          "style": { "navigationBarTitleText": "勋章墙" }
+        }
+      ]
+    },
+    // ===== 小游戏 =====
+    {
+      "root": "pages/games",
+      "pages": [
+        {
+          "path": "list",
+          "style": { "navigationBarTitleText": "小游戏" }
+        },
+        {
+          "path": "schulte",
+          "style": { "navigationBarTitleText": "舒尔特方格" }
+        },
+        {
+          "path": "1a2b",
+          "style": { "navigationBarTitleText": "猜数字" }
+        },
+        {
+          "path": "sudoku",
+          "style": { "navigationBarTitleText": "数独" }
+        },
+        {
+          "path": "records",
+          "style": { "navigationBarTitleText": "训练记录" }
+        },
+        {
+          "path": "stats",
+          "style": { "navigationBarTitleText": "训练统计" }
+        }
+      ]
+    },
+    // ===== 测评 =====
+    {
+      "root": "pages/assessment",
+      "pages": [
+        {
+          "path": "apply",
+          "style": { "navigationBarTitleText": "申请测评" }
+        },
+        {
+          "path": "results",
+          "style": { "navigationBarTitleText": "测评报告" }
+        },
+        {
+          "path": "purchase",
+          "style": { "navigationBarTitleText": "购买测评" }
+        }
+      ]
+    },
+    // ===== 成长档案 =====
+    {
+      "root": "pages/growth",
+      "pages": [
+        {
+          "path": "index",
+          "style": { "navigationBarTitleText": "成长档案" }
+        },
+        {
+          "path": "create",
+          "style": { "navigationBarTitleText": "创建成长档案" }
+        },
+        {
+          "path": "detail",
+          "style": { "navigationBarTitleText": "档案详情" }
+        },
+        {
+          "path": "assessment-result",
+          "style": { "navigationBarTitleText": "测评报告" }
+        }
+      ]
+    },
+    // ===== 商城 =====
+    {
+      "root": "pages/shop",
+      "pages": [
+        {
+          "path": "index",
+          "style": { "navigationBarTitleText": "行动" }
+        },
+        {
+          "path": "order-list/order-list",
+          "style": { "navigationBarTitleText": "我的订单" }
+        },
+        {
+          "path": "order-detail/order-detail",
+          "style": { "navigationBarTitleText": "订单详情" }
+        }
+      ]
+    },
+    // ===== 服务商入驻 =====
+    {
+      "root": "pages/vendor",
+      "pages": [
+        {
+          "path": "apply",
+          "style": { "navigationBarTitleText": "服务商入驻" }
+        },
+        {
+          "path": "center",
+          "style": { "navigationBarTitleText": "服务商中心" }
+        },
+        {
+          "path": "products/products",
+          "style": { "navigationBarTitleText": "商品管理" }
+        },
+        {
+          "path": "orders/orders",
+          "style": { "navigationBarTitleText": "订单管理" }
+        }
+      ]
+    },
+    // ===== 数据统计 =====
+    {
+      "root": "pages/stats",
+      "pages": [
+        {
+          "path": "completion-rate",
+          "style": { "navigationBarTitleText": "任务完成率", "navigationStyle": "custom" }
+        },
+        {
+          "path": "index",
+          "style": { "navigationBarTitleText": "数据统计" }
+        }
+      ]
+    },
+    // ===== 推广中心 =====
+    {
+      "root": "pages/promotion",
+      "pages": [
+        {
+          "path": "index",
+          "style": { "navigationBarTitleText": "推广中心" }
+        },
+        {
+          "path": "commission",
+          "style": { "navigationBarTitleText": "佣金明细" }
+        },
+        {
+          "path": "withdraw",
+          "style": { "navigationBarTitleText": "提现" }
+        },
+        {
+          "path": "invite",
+          "style": { "navigationBarTitleText": "邀请好友" }
+        }
+      ]
+    },
+    // ===== 五维能量 =====
+    {
+      "root": "pages/energy",
+      "pages": [
+        {
+          "path": "detail",
+          "style": { "navigationBarTitleText": "维度能量详情" }
+        }
+      ]
+    },
+    // ===== 会员服务 =====
+    {
+      "root": "pages/membership",
+      "pages": [
+        {
+          "path": "index",
+          "style": { "navigationBarTitleText": "会员服务" }
+        }
+      ]
+    }
   ],
-  "globalStyle": {
-    "navigationBarTextStyle": "black",
-    "navigationBarTitleText": "知行益家",
-    "navigationBarBackgroundColor": "#FFFFFF",
-    "backgroundColor": "#F8F8F8"
-  },
-"tabBar": {
-    "color": "#7A7E83",
-    "selectedColor": "#F97316",
-    "borderStyle": "black",
-    "backgroundColor": "#FFFFFF",
-    "list": [
-      {
-        "pagePath": "pages/index/index",
-        "text": "首页"
-      },
-      {
-        "pagePath": "pages/discover/index",
-        "text": "发现"
-      },
-      {
-        "pagePath": "pages/shop/index",
-        "text": "商城"
-      },
-      {
-        "pagePath": "pages/profile/profile",
-        "text": "我的"
-      }
-    ]
-  }
-}
+  "globalStyle": {
+    "navigationBarTextStyle": "black",
+    "navigationBarTitleText": "知行益家",
+    "navigationBarBackgroundColor": "#FFFFFF",
+    "backgroundColor": "#F8F8F8"
+  },
+  "tabBar": {
+    "color": "#7A7E83",
+    "selectedColor": "#F97316",
+    "borderStyle": "black",
+    "backgroundColor": "#FFFFFF",
+    "list": [
+      {
+        "pagePath": "pages/index/index",
+        "text": "首页"
+      },
+      {
+        "pagePath": "pages/body/index",
+        "text": "身体"
+      },
+      {
+        "pagePath": "pages/mind/index",
+        "text": "心智"
+      },
+      {
+        "pagePath": "pages/profile/profile",
+        "text": "我的"
+      }
+    ]
+  }
+}