From ff62205720e2b2b56aced0a258477c47c45cfe18 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Wed, 31 Dec 2025 14:43:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(mock):=20=E5=B8=82=E5=9C=BA=E7=83=AD?= =?UTF-8?q?=E5=8A=9B=E5=9B=BE=E6=B7=BB=E5=8A=A0=E6=B6=A8=E5=81=9C/?= =?UTF-8?q?=E8=B7=8C=E5=81=9C=E8=82=A1=E7=A5=A8=E6=A8=A1=E6=8B=9F=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 8 只涨停股票(9.9%~10.05%) - 添加 2 只跌停股票(-9.9%~-10.05%) - 使用真实股票名称池增强模拟效果 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/mocks/handlers/market.js | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/mocks/handlers/market.js b/src/mocks/handlers/market.js index 2e0f9d64..b5a7ba0e 100644 --- a/src/mocks/handlers/market.js +++ b/src/mocks/handlers/market.js @@ -294,7 +294,41 @@ export const marketHandlers = [ let risingCount = 0; let fallingCount = 0; - // 先添加主要股票 + // 涨停股票名称池(模拟真实市场) + const limitUpNames = ['东方财富', '科大讯飞', '中科曙光', '寒武纪', '金山办公', '同花顺', '三六零', '紫光股份']; + const limitDownNames = ['某ST股A', '某ST股B']; + + // 先添加一些涨停股票(10%) + for (let i = 0; i < 8; i++) { + const changePercent = parseFloat((9.9 + Math.random() * 0.15).toFixed(2)); // 9.9% ~ 10.05%(涨停) + risingCount++; + heatmapData.push({ + stock_code: `00${3000 + i}`, + stock_name: limitUpNames[i] || `涨停股${i}`, + market_cap: parseFloat((Math.random() * 300 + 50).toFixed(2)), + change_percent: changePercent, + amount: parseFloat((Math.random() * 30 + 5).toFixed(2)), + industry: industries[Math.floor(Math.random() * industries.length)], + province: provinces[Math.floor(Math.random() * provinces.length)] + }); + } + + // 添加一些跌停股票(-10%) + for (let i = 0; i < 2; i++) { + const changePercent = parseFloat((-9.9 - Math.random() * 0.15).toFixed(2)); // -10.05% ~ -9.9%(跌停) + fallingCount++; + heatmapData.push({ + stock_code: `00${2000 + i}`, + stock_name: limitDownNames[i] || `跌停股${i}`, + market_cap: parseFloat((Math.random() * 50 + 10).toFixed(2)), + change_percent: changePercent, + amount: parseFloat((Math.random() * 5 + 0.5).toFixed(2)), + industry: industries[Math.floor(Math.random() * industries.length)], + province: provinces[Math.floor(Math.random() * provinces.length)] + }); + } + + // 添加主要股票 majorStocks.forEach(stock => { const changePercent = parseFloat((Math.random() * 12 - 4).toFixed(2)); // -4% ~ 8% const amount = parseFloat((Math.random() * 100 + 10).toFixed(2)); // 10-110亿