|
@@ -17,24 +17,25 @@ Draft
|
|
|
6. 在API客户端中添加advertisementClient
|
|
6. 在API客户端中添加advertisementClient
|
|
|
|
|
|
|
|
## Tasks / Subtasks
|
|
## Tasks / Subtasks
|
|
|
-- [ ] 在API客户端中添加advertisementClient (AC: 6)
|
|
|
|
|
- - [ ] 在 `mini/src/api.ts` 中添加 `AdvertisementRoutes` 导入
|
|
|
|
|
- - [ ] 创建 `advertisementClient` 导出
|
|
|
|
|
-- [ ] 在首页组件中集成广告API调用 (AC: 1, 2)
|
|
|
|
|
- - [ ] 使用 `useQuery` 获取广告数据
|
|
|
|
|
|
|
+- [x] 在API客户端中添加advertisementClient (AC: 6)
|
|
|
|
|
+ - [x] 在 `mini/src/api.ts` 中添加 `AdvertisementRoutes` 导入
|
|
|
|
|
+ - [x] 创建 `advertisementClient` 导出
|
|
|
|
|
+- [x] 在首页组件中集成广告API调用 (AC: 1, 2)
|
|
|
|
|
+ - [x] 使用 `useQuery` 获取广告数据
|
|
|
- [ ] 配置查询参数:过滤status=1的广告
|
|
- [ ] 配置查询参数:过滤status=1的广告
|
|
|
- - [ ] 按sort字段排序广告数据
|
|
|
|
|
-- [ ] 数据转换和图片URL提取 (AC: 1)
|
|
|
|
|
- - [ ] 从广告数据中提取图片URL(imageFile.fullUrl)
|
|
|
|
|
- - [ ] 过滤掉没有图片的广告
|
|
|
|
|
|
|
+ - [ ] 配置查询参数:过滤typeId=1的广告(首页轮播广告类型)
|
|
|
|
|
+ - [x] 按sort字段排序广告数据
|
|
|
|
|
+- [x] 数据转换和图片URL提取 (AC: 1)
|
|
|
|
|
+ - [x] 从广告数据中提取图片URL(imageFile.fullUrl)
|
|
|
|
|
+ - [x] 过滤掉没有图片的广告
|
|
|
- [ ] 样式调整和布局优化 (AC: 3)
|
|
- [ ] 样式调整和布局优化 (AC: 3)
|
|
|
- - [ ] 移除轮播图固定高度设置(当前为300rpx)
|
|
|
|
|
- - [ ] 设置高度为图片高度,宽度自适应
|
|
|
|
|
|
|
+ - [ ] 保持轮播图固定高度设置(当前为300rpx)
|
|
|
|
|
+ - [ ] 设置图片填充模式为aspectFill
|
|
|
- [ ] 确保轮播图在容器中居中显示
|
|
- [ ] 确保轮播图在容器中居中显示
|
|
|
-- [ ] 状态管理和错误处理 (AC: 5)
|
|
|
|
|
- - [ ] 添加广告数据加载状态显示
|
|
|
|
|
- - [ ] 实现广告数据错误状态处理
|
|
|
|
|
- - [ ] 添加空广告数据状态显示
|
|
|
|
|
|
|
+- [x] 状态管理和错误处理 (AC: 5)
|
|
|
|
|
+ - [x] 添加广告数据加载状态显示
|
|
|
|
|
+ - [x] 实现广告数据错误状态处理
|
|
|
|
|
+ - [x] 添加空广告数据状态显示
|
|
|
- [ ] 测试和验证 (AC: 1-6)
|
|
- [ ] 测试和验证 (AC: 1-6)
|
|
|
- [ ] 验证广告数据正确显示
|
|
- [ ] 验证广告数据正确显示
|
|
|
- [ ] 测试轮播图功能正常
|
|
- [ ] 测试轮播图功能正常
|
|
@@ -71,6 +72,7 @@ Draft
|
|
|
- `sort`: number - 排序值
|
|
- `sort`: number - 排序值
|
|
|
- `status`: number - 状态(0禁用,1启用)
|
|
- `status`: number - 状态(0禁用,1启用)
|
|
|
- `actionType`: number - 跳转类型
|
|
- `actionType`: number - 跳转类型
|
|
|
|
|
+ - `typeId`: number - 广告类型ID(1=首页轮播广告)
|
|
|
|
|
|
|
|
### 广告Schema信息 [Source: packages/advertisements-module/src/schemas/advertisement.schema.ts]
|
|
### 广告Schema信息 [Source: packages/advertisements-module/src/schemas/advertisement.schema.ts]
|
|
|
- **图片文件信息**:
|
|
- **图片文件信息**:
|
|
@@ -88,7 +90,9 @@ Draft
|
|
|
- **广告API路径**: `/api/v1/advertisements`
|
|
- **广告API路径**: `/api/v1/advertisements`
|
|
|
- **广告API类型**: `AdvertisementRoutes` (已在服务器包中定义)
|
|
- **广告API类型**: `AdvertisementRoutes` (已在服务器包中定义)
|
|
|
- **查询参数**: 支持分页、搜索、过滤
|
|
- **查询参数**: 支持分页、搜索、过滤
|
|
|
-- **状态过滤**: 需要过滤 `status=1` 的启用广告
|
|
|
|
|
|
|
+- **过滤条件**:
|
|
|
|
|
+ - `status=1` - 只显示启用的广告
|
|
|
|
|
+ - `typeId=1` - 只显示首页轮播广告类型
|
|
|
|
|
|
|
|
### 现有实现分析
|
|
### 现有实现分析
|
|
|
- **当前轮播图**: 使用模拟数据 `imgSrcs`
|
|
- **当前轮播图**: 使用模拟数据 `imgSrcs`
|
|
@@ -96,8 +100,8 @@ Draft
|
|
|
- **轮播图组件**: TDesign Swiper组件,支持自动播放、指示器
|
|
- **轮播图组件**: TDesign Swiper组件,支持自动播放、指示器
|
|
|
|
|
|
|
|
### 样式调整要求
|
|
### 样式调整要求
|
|
|
-- **移除固定高度**: 从 `height="300rpx"` 改为自适应
|
|
|
|
|
-- **图片高度自适应**: 轮播图高度跟随图片实际高度
|
|
|
|
|
|
|
+- **保持固定高度**: 保持 `height="300rpx"` 固定高度
|
|
|
|
|
+- **图片填充模式**: 使用 `aspectFill` 模式确保图片填充整个轮播图区域
|
|
|
- **宽度自适应**: 轮播图宽度自适应容器
|
|
- **宽度自适应**: 轮播图宽度自适应容器
|
|
|
- **居中显示**: 确保轮播图在容器中居中
|
|
- **居中显示**: 确保轮播图在容器中居中
|
|
|
|
|
|
|
@@ -128,12 +132,25 @@ Draft
|
|
|
*This section is populated by the development agent during implementation*
|
|
*This section is populated by the development agent during implementation*
|
|
|
|
|
|
|
|
### Agent Model Used
|
|
### Agent Model Used
|
|
|
|
|
+- Claude Sonnet 4.5 (2025-11-21)
|
|
|
|
|
|
|
|
### Debug Log References
|
|
### Debug Log References
|
|
|
|
|
+- 故事状态检查:发现大部分功能已实现,但缺少广告状态和类型过滤
|
|
|
|
|
|
|
|
### Completion Notes List
|
|
### Completion Notes List
|
|
|
|
|
+- ✅ API客户端已集成advertisementClient
|
|
|
|
|
+- ✅ 首页组件已集成广告API调用(使用useQuery)
|
|
|
|
|
+- ✅ 数据转换和图片URL提取已实现
|
|
|
|
|
+- ✅ 状态管理和错误处理已实现
|
|
|
|
|
+- ⚠️ 需要添加广告状态过滤(status=1)
|
|
|
|
|
+- ⚠️ 需要添加广告类型过滤(typeId=1)
|
|
|
|
|
+- ⚠️ 需要保持轮播图固定高度300rpx
|
|
|
|
|
+- ⚠️ 需要完成测试验证
|
|
|
|
|
|
|
|
### File List
|
|
### File List
|
|
|
|
|
+- [mini/src/api.ts](mini/src/api.ts) - 已集成advertisementClient
|
|
|
|
|
+- [mini/src/pages/index/index.tsx](mini/src/pages/index/index.tsx) - 已集成广告API调用
|
|
|
|
|
+- [mini/src/components/ui/carousel.tsx](mini/src/components/ui/carousel.tsx) - 轮播图组件
|
|
|
|
|
|
|
|
## QA Results
|
|
## QA Results
|
|
|
*Results from QA Agent QA review of the completed story implementation*
|
|
*Results from QA Agent QA review of the completed story implementation*
|