You need to sign in or sign up before continuing.
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) { ...@@ -418,32 +418,32 @@ export async function mockProductListAPI(params) {
418 // 🔧 测试商品:第一页第一位固定为储蓄产品(form_sn:savings-product-30b41aae) 418 // 🔧 测试商品:第一页第一位固定为储蓄产品(form_sn:savings-product-30b41aae)
419 if (page === 0) { 419 if (page === 0) {
420 const testCategory = PRODUCT_CATEGORIES.find(c => parseInt(c.id) === 1) 420 const testCategory = PRODUCT_CATEGORIES.find(c => parseInt(c.id) === 1)
421 - const testProduct = { 421 + const testProduct1 = {
422 - id: 'savings-product-30b41aae', 422 + id: 'savings-2-148b3acd',
423 - product_name: '储蓄产品测试(form_sn:savings-product-30b41aae)', 423 + product_name: '测试计划书-智享未来2(form_sn:savings-2-148b3acd)',
424 - cover_image: 'https://picsum.photos/seed/savings-product-30b41aae/400/300', 424 + cover_image: 'https://picsum.photos/seed/savings-2-148b3acd/400/300',
425 recommend: 'hot', 425 recommend: 'hot',
426 - form_sn: 'savings-product-30b41aae', // ✅ 关键字段:对应真实 API 的 form_sn 426 + form_sn: 'savings-2-148b3acd', // ✅ 关键字段:对应真实 API 的 form_sn
427 created_time: new Date().toISOString(), 427 created_time: new Date().toISOString(),
428 categories: [testCategory], // ✅ 符合真实 API 结构:categories 是数组 428 categories: [testCategory], // ✅ 符合真实 API 结构:categories 是数组
429 tags: [{ id: '1', name: '热销', bg_color: '#FEE2E2', text_color: '#DC2626' }], 429 tags: [{ id: '1', name: '热销', bg_color: '#FEE2E2', text_color: '#DC2626' }],
430 // 测试标识(不影响业务逻辑) 430 // 测试标识(不影响业务逻辑)
431 _test: true, 431 _test: true,
432 - _test_note: 'form_sn:savings-product-30b41aae' 432 + _test_note: 'form_sn:savings-2-148b3acd'
433 } 433 }
434 434
435 // 检查分类和关键词过滤 435 // 检查分类和关键词过滤
436 let shouldInclude = true 436 let shouldInclude = true
437 - if (cid && !testProduct.categories.some(c => parseInt(c.id) === parseInt(cid))) { 437 + if (cid && !testProduct1.categories.some(c => parseInt(c.id) === parseInt(cid))) {
438 shouldInclude = false 438 shouldInclude = false
439 } 439 }
440 - if (keyword && !testProduct.product_name.includes(keyword)) { 440 + if (keyword && !testProduct1.product_name.includes(keyword)) {
441 shouldInclude = false 441 shouldInclude = false
442 } 442 }
443 443
444 if (shouldInclude) { 444 if (shouldInclude) {
445 - list.push(testProduct) 445 + list.push(testProduct1)
446 - console.log('[Mock] listAPI - 测试商品已置顶: form_sn=savings-product-30b41aae') 446 + console.log('[Mock] listAPI - 测试商品已置顶: form_sn=savings-2-148b3acd')
447 } 447 }
448 } 448 }
449 449
......