Przeglądaj źródła

feat(web):小红书卡片展示完整帖(图片画廊 + 正文)

详情页小红书分区:多图时渲染九宫格画廊(帖子全部图片)+ 正文摘要 + 「N 图」标注,
不再只显示一张封面。重建 dist。

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
SamLee 3 tygodni temu
rodzic
commit
497aa0a519

Plik diff jest za duży
+ 0 - 0
acquisition/web/app/dist/assets/index-Cz-31bz9.css


Plik diff jest za duży
+ 1 - 1
acquisition/web/app/dist/assets/index-VG3HLxO6.js


+ 2 - 2
acquisition/web/app/dist/index.html

@@ -4,8 +4,8 @@
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>创作知识 · 找帖子</title>
-    <script type="module" crossorigin src="/app/assets/index-BMwDeUUY.js"></script>
-    <link rel="stylesheet" crossorigin href="/app/assets/index-D2V3VNBc.css">
+    <script type="module" crossorigin src="/app/assets/index-VG3HLxO6.js"></script>
+    <link rel="stylesheet" crossorigin href="/app/assets/index-Cz-31bz9.css">
   </head>
   <body>
     <div id="root"></div>

+ 6 - 1
acquisition/web/app/src/pages/QueryDetail.jsx

@@ -44,13 +44,18 @@ export default function QueryDetail({ query }) {
 }
 
 function Result({ r, cls }) {
+  const imgs = (r.extra?.images && r.extra.images.length ? r.extra.images : (r.cover ? [r.cover] : []))
   return (
     <div className={`lane ${cls}`}>
       {r.video
         ? <video className="sv" src={r.video} controls preload="metadata" poster={r.cover || undefined} />
-        : r.cover && <img className="cover" src={r.cover} alt="" />}
+        : imgs.length > 1
+          ? <div className="gallery">{imgs.map((u, i) => <img key={i} className="gimg" src={u} alt="" />)}</div>
+          : imgs[0] && <img className="cover" src={imgs[0]} alt="" />}
       <div className="t">{r.title || '(无标题)'}</div>
+      {r.extra?.body_text && <div className="bt">{r.extra.body_text}</div>}
       <div className="meta">
+        {imgs.length > 1 ? `${imgs.length} 图 · ` : ''}
         {r.extra?.nick ? `${r.extra.nick} · ` : ''}
         {r.url && <a href={r.url} target="_blank" rel="noreferrer">打开原帖 ↗</a>}
       </div>

+ 5 - 0
acquisition/web/app/src/styles.css

@@ -70,6 +70,11 @@ td.q { font-weight: 600; }
 .lane .pl.wx { color: #15a36a; }
 .lane video, .lane img.cover { width: 100%; max-height: 260px; object-fit: cover; border-radius: 8px; background: #000; display: block; }
 .lane .t { font-size: 12.5px; margin: 7px 0 3px; line-height: 1.45; }
+/* 小红书完整帖:图片画廊 + 正文(链接会被反爬封,整帖存本地) */
+.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
+.gallery .gimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: #f0f0f3; }
+.lane .bt { font-size: 11.5px; color: #555; line-height: 1.5; margin: 6px 0 4px; max-height: 78px;
+  overflow: hidden; white-space: pre-wrap; }
 .lane .meta { color: var(--muted); font-size: 11.5px; }
 .lane .fail { color: var(--bad); font-size: 12.5px; padding: 18px 4px; text-align: center; }
 

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików