Explorar el Código

docs(poster): 活动海报模板迁移号修正为 381 并同步实现描述

- 迁移378→381:远端 rebase 期间 378/379/380 已被 member_indicator_current/
  report_member_permissions/FAMILY会员道具映射占用,顺延为 381
- schema.sql 注释、PROJECT-OVERVIEW、spec 文档统一为 381
- spec 小程序端/验收/兼容性描述改为与最终实现一致:无模板时隐藏选择行
  (对齐 4cdc515d7 移除硬编码模板行的决策),接口失败仅不阻塞海报生成
Sisyphus hace 1 semana
padre
commit
fa633257ca

+ 1 - 1
cfc-backend/src/main/resources/schema.sql

@@ -5362,7 +5362,7 @@ CREATE TABLE IF NOT EXISTS notification_templates (
   UNIQUE KEY uk_type (type)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='通知模板(改版v1 W3)';
 
--- 活动海报模板(迁移378,Web 管理端定义 → 小程序端海报模板选择)
+-- 活动海报模板(迁移381,Web 管理端定义 → 小程序端海报模板选择)
 CREATE TABLE IF NOT EXISTS activity_poster_templates (
   id BIGINT AUTO_INCREMENT PRIMARY KEY,
   name VARCHAR(50) NOT NULL COMMENT '模板名称(管理端展示,如 暖橙渐变)',

+ 1 - 1
docs/superpowers/PROJECT-OVERVIEW.md

@@ -389,7 +389,7 @@
 | `2026-09-22-guide-popup-config-design.md` | ✅ 已实施(4表/guide_popup+step+trigger+log,9接口,ConfigurableGuide.vue组件+管理端2页;旧 sys_config 方案保留并行) | 弹窗引导页配置化管理设计 |
 | `2026-10-10-address-contact-backfill-realname-design.md` | 🟡 设计稿(后端统一回填方案:`RealNameBackfillService` 独立组件 + `UserAddressService.create/update` + `ConsigneeService.save` 两入口回填,realName 为空才回填,幂等) | 地址联系人回填真实姓名设计 |
 | `2026-10-16-comprehensive-health-survey-design.md` | 🟢 已实现(8 模块 step 式综合调研:basic/status/diet/disease/bowel/sleep/med/allergy,URL `modules=` 逗号分隔子集;ComprehensiveSurvey.vue 组件(1108 行)+ health-survey.vue 独立页 + pages.json 注册 + index-home/health-main 两处入口改跳;方案制定页 Step2 同步替换,memberFormMap 快照经 currentMemberForm 合并视图传 form prop;合并式增量保存 + 主动清空检测(diseasesCleared/medsCleared 下发 '[]'、lifestyle 模块感知 null 清除);过敏源双写两表;饮食结构 3 项补采;lifestyle 新 key currentStatus/exerciseFrequency/exerciseDuration;旧 wizard 集群 6 文件标记 DEPRECATED 零引用;实现提交 b5578f5d2/d6e1cb864/98450cd73,零后端改动零 DDL) | 综合健康调研 — 身体状态+饮食偏好合并 |
-| `2026-10-17-activity-poster-template-design.md` | ✅ 已实现(迁移380 `activity_poster_templates` 表 + 种子3套默认模板;后端4接口 `/api/admin/poster-template/*`(admin/operator 权限)+ `/api/poster-template/list`;cfc-web `PosterTemplateManage.vue` 管理页 + 路由 `poster-template-manage`(perm `activity:poster_template`)+ 活动管理菜单;小程序 `ContentSharePoster` 新增 `templates` prop 动态模板 + `activity-detail` 拉取降级内置三套;后端 `mvn clean compile` 通过) | Web 管理端定义活动海报模板 |
+| `2026-10-17-activity-poster-template-design.md` | ✅ 已实现(迁移381 `activity_poster_templates` 表 + 种子3套默认模板;后端4接口 `/api/admin/poster-template/*`(admin/operator 权限)+ `/api/poster-template/list`;cfc-web `PosterTemplateManage.vue` 管理页 + 路由 `poster-template-manage`(perm `activity:poster_template`)+ 活动管理菜单;小程序 `ContentSharePoster` 新增 `templates` prop 动态模板 + `activity-detail` 拉取(失败不阻塞);后端 `mvn clean compile` 通过) | Web 管理端定义活动海报模板 |
 
 ### 实施计划(plans/)
 

+ 8 - 8
docs/superpowers/specs/2026-10-17-activity-poster-template-design.md

@@ -1,7 +1,7 @@
 # Web 管理端定义活动海报模板
 
 **日期**: 2026-10-17
-**状态**: 已实现(迁移378)
+**状态**: 已实现(迁移381)
 **关联**: 活动海报生成(`cfc-frontend/components/ContentSharePoster.vue`)、活动分享注册链路(`2026-10-07-activity-share-referral-design.md`)
 
 ---
@@ -18,7 +18,7 @@
 
 ## 方案设计
 
-### 数据模型:`activity_poster_templates`(迁移378)
+### 数据模型:`activity_poster_templates`(迁移381)
 
 | 字段 | 说明 |
 |------|------|
@@ -50,8 +50,8 @@
 
 ### 小程序端(cfc-frontend)
 
-- `ContentSharePoster.vue` 新增 `templates` prop:有模板时渲染管理端模板列表(默认选第一个,emit 同步 template/bgColor),模板 `qrSize` 优先于 `qrSizeOverride`;无模板时保持原三套内置模板不变
-- `activity-detail.vue` `generatePoster()` 并行拉取 `/api/poster-template/list`(失败降级为内置模板,不阻塞海报生成)
+- `ContentSharePoster.vue` 新增 `templates` prop:配置了模板时渲染管理端模板列表(默认选第一个,emit 同步 template/bgColor),模板 `qrSize` 优先于 `qrSizeOverride`;**未配置任何模板时隐藏模板/背景色选择行**(与 `4cdc515d7` 移除硬编码选择行的决策保持一致,海报仍按默认 gradient 引擎绘制)
+- `activity-detail.vue` `generatePoster()` 拉取 `/api/poster-template/list`(接口失败时 `posterTemplates=[]`,不阻塞海报生成)
 - `utils/api.js` 新增 `getPosterTemplates()`
 
 ---
@@ -61,10 +61,10 @@
 - [x] 管理端可对模板增删改查,配色带可视化色块预览
 - [x] 小程序端海报弹窗展示管理端配置的模板列表,点选实时重绘
 - [x] 管理端停用模板后小程序不再展示该模板
-- [x] 管理端无任何模板时(如全删),小程序自动降级为内置三套,海报功能不白屏
-- [x] `mvn clean compile` 通过;两个 .vue 文件 script 语法校验通过
+- [x] 管理端无任何模板时(如全删),小程序隐藏选择行、按默认引擎出图,海报功能不白屏
+- [x] `mvn clean compile` 通过;改动 .vue 文件 script 语法校验通过
 
 ## 兼容性说明
 
-- 商品/文章/个人中心海报未传 `templates`,走原有内置模板逻辑,零影响
-- 迁移378 幂等(CREATE TABLE IF NOT EXISTS + INSERT IGNORE 按名称去重),重复执行无副作用
+- 商品/文章/个人中心海报未传 `templates`(`serverTemplates` 为空),不渲染选择行,零影响
+- 迁移381 幂等(CREATE TABLE IF NOT EXISTS + INSERT IGNORE 按名称去重),重复执行无副作用