Преглед изворни кода

fix(skill): 报告内嵌状态补全厨房walls与柜体实际高度,页面重算口径与首页到手价一致

Hermes Agent пре 2 недеља
родитељ
комит
04be2581a7
1 измењених фајлова са 2 додато и 1 уклоњено
  1. 2 1
      skill/src/report.js

+ 2 - 1
skill/src/report.js

@@ -199,7 +199,8 @@ input[type=range]{width:100%}
 
 <script>
 ${engine}
-window.__Q__ = ${JSON.stringify({ cabinets: (quote.rooms || []).map((r, i) => ({ id: r.id, type: r.type.split(/\d$/)[0] || r.type, width: (quote.rooms || [])[i]?.kb ? undefined : parseFloat(String(r.dims || '0×0').split('×')[0]), height: 2.6, rawName: r.type })), config: quote.config, salesNote: salesNote })};
+// 内嵌初始状态:厨房必须带上 walls(计费墙长),否则页面重算会退化成 U 型口径(与首页到手价不一致)
+window.__Q__ = ${JSON.stringify({ cabinets: (quote.rooms || []).map((r) => { const walls = (r.kb && Array.isArray(r.kb.walls)) ? r.kb.walls : undefined; const dm = String(r.dims || '').split('×'); const w = walls ? undefined : (parseFloat(dm[0]) || undefined); const h = parseFloat(dm[1]) || 2.6; return { id: r.id, type: String(r.type || '').replace(/\d$/, ''), rawName: r.type, width: w, height: h, walls: walls }; }), config: quote.config, salesNote: salesNote })};
 console.log('fpc engine ready');
 </script>
 <script>