hookehuyr

feat(mock): 添加 savings-2-148b3acd 测试商品到列表首位

- 商品 ID: savings-2-148b3acd
- 商品名称: 测试计划书-智享未来2
- 置于 plan-templates.js 中的配置
- 置于储蓄型产品分类

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
......@@ -418,32 +418,32 @@ export async function mockProductListAPI(params) {
// 🔧 测试商品:第一页第一位固定为储蓄产品(form_sn:savings-product-30b41aae)
if (page === 0) {
const testCategory = PRODUCT_CATEGORIES.find(c => parseInt(c.id) === 1)
const testProduct = {
id: 'savings-product-30b41aae',
product_name: '储蓄产品测试(form_sn:savings-product-30b41aae)',
cover_image: 'https://picsum.photos/seed/savings-product-30b41aae/400/300',
const testProduct1 = {
id: 'savings-2-148b3acd',
product_name: '测试计划书-智享未来2(form_sn:savings-2-148b3acd)',
cover_image: 'https://picsum.photos/seed/savings-2-148b3acd/400/300',
recommend: 'hot',
form_sn: 'savings-product-30b41aae', // ✅ 关键字段:对应真实 API 的 form_sn
form_sn: 'savings-2-148b3acd', // ✅ 关键字段:对应真实 API 的 form_sn
created_time: new Date().toISOString(),
categories: [testCategory], // ✅ 符合真实 API 结构:categories 是数组
tags: [{ id: '1', name: '热销', bg_color: '#FEE2E2', text_color: '#DC2626' }],
// 测试标识(不影响业务逻辑)
_test: true,
_test_note: 'form_sn:savings-product-30b41aae'
_test_note: 'form_sn:savings-2-148b3acd'
}
// 检查分类和关键词过滤
let shouldInclude = true
if (cid && !testProduct.categories.some(c => parseInt(c.id) === parseInt(cid))) {
if (cid && !testProduct1.categories.some(c => parseInt(c.id) === parseInt(cid))) {
shouldInclude = false
}
if (keyword && !testProduct.product_name.includes(keyword)) {
if (keyword && !testProduct1.product_name.includes(keyword)) {
shouldInclude = false
}
if (shouldInclude) {
list.push(testProduct)
console.log('[Mock] listAPI - 测试商品已置顶: form_sn=savings-product-30b41aae')
list.push(testProduct1)
console.log('[Mock] listAPI - 测试商品已置顶: form_sn=savings-2-148b3acd')
}
}
......