diff --git a/scripts/check-long-text-guide-detail-routes.mjs b/scripts/check-long-text-guide-detail-routes.mjs new file mode 100644 index 0000000..cd77377 --- /dev/null +++ b/scripts/check-long-text-guide-detail-routes.mjs @@ -0,0 +1,41 @@ +import assert from "node:assert/strict"; +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +import { + DETAIL_ROUTE_BY_TYPE, + getLongTextGuideDetailRoute, +} from "../src/pages/ChatModule/LongTextGuideCardPreview/detailRoutes.mjs"; + +const dirname = path.dirname(fileURLToPath(import.meta.url)); +const rootDir = path.resolve(dirname, ".."); + +const expectedRoutes = { + longTextCard: "/pages/ChatModule/LongTextGuideCardPreview/guide", + longTextCardSnap: "/pages/ChatModule/LongTextGuideCardPreview/poi", + longTextCardRoute: "/pages/ChatModule/LongTextGuideCardPreview/route", + longTextCardScenicSpot: "/pages/ChatModule/LongTextGuideCardPreview/photo", +}; + +assert.deepEqual(DETAIL_ROUTE_BY_TYPE, expectedRoutes); + +for (const [type, route] of Object.entries(expectedRoutes)) { + assert.equal(getLongTextGuideDetailRoute(type), route); + + const pageFile = path.join(rootDir, "src", `${route.replace(/^\//, "")}.vue`); + assert.ok(fs.existsSync(pageFile), `Missing page file for ${type}: ${pageFile}`); +} + +const pagesJson = JSON.parse( + fs.readFileSync(path.join(rootDir, "src/pages.json"), "utf8"), +); +const registeredPages = new Set(pagesJson.pages.map((item) => item.path)); + +for (const route of Object.values(expectedRoutes)) { + assert.ok( + registeredPages.has(route.replace(/^\//, "")), + `Route is not registered in src/pages.json: ${route}`, + ); +} + diff --git a/src/pages.json b/src/pages.json index 54d45b4..58b6d31 100644 --- a/src/pages.json +++ b/src/pages.json @@ -38,17 +38,41 @@ "navigationBarTextStyle": "black" } }, - { - "path": "pages/ChatMain/ChatLongAnswer/index", - "style": { - "navigationStyle": "custom" - } - }, - { - "path": "pages/ChatMain/NoticeMessage/detail", - "style": { - "navigationStyle": "custom" - } + { + "path": "pages/ChatMain/ChatLongAnswer/index", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/ChatModule/LongTextGuideCardPreview/guide", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/ChatModule/LongTextGuideCardPreview/poi", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/ChatModule/LongTextGuideCardPreview/route", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/ChatModule/LongTextGuideCardPreview/photo", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/ChatMain/NoticeMessage/detail", + "style": { + "navigationStyle": "custom" + } }, { "path": "pages/test/index", diff --git a/src/pages/ChatMain/ChatMainList/index.vue b/src/pages/ChatMain/ChatMainList/index.vue index 06f06c8..fa93094 100644 --- a/src/pages/ChatMain/ChatMainList/index.vue +++ b/src/pages/ChatMain/ChatMainList/index.vue @@ -73,11 +73,17 @@ (item.componentName && isLongTextCard(item.componentName)) " > - --> + + + - + /> - - { + return DETAIL_ROUTE_BY_TYPE[type] || ""; +}; + diff --git a/src/pages/ChatModule/LongTextGuideCardPreview/guide.vue b/src/pages/ChatModule/LongTextGuideCardPreview/guide.vue new file mode 100644 index 0000000..49d6240 --- /dev/null +++ b/src/pages/ChatModule/LongTextGuideCardPreview/guide.vue @@ -0,0 +1,129 @@ + + + + + + diff --git a/src/pages/ChatModule/LongTextGuideCardPreview/images/comp1.jpg b/src/pages/ChatModule/LongTextGuideCardPreview/images/comp1.jpg new file mode 100644 index 0000000..6b0697d Binary files /dev/null and b/src/pages/ChatModule/LongTextGuideCardPreview/images/comp1.jpg differ diff --git a/src/pages/ChatModule/LongTextGuideCardPreview/images/comp11.jpg b/src/pages/ChatModule/LongTextGuideCardPreview/images/comp11.jpg new file mode 100644 index 0000000..dc3579a Binary files /dev/null and b/src/pages/ChatModule/LongTextGuideCardPreview/images/comp11.jpg differ diff --git a/src/pages/ChatModule/LongTextGuideCardPreview/images/comp12.jpg b/src/pages/ChatModule/LongTextGuideCardPreview/images/comp12.jpg new file mode 100644 index 0000000..58cb39e Binary files /dev/null and b/src/pages/ChatModule/LongTextGuideCardPreview/images/comp12.jpg differ diff --git a/src/pages/ChatModule/LongTextGuideCardPreview/images/comp2.jpg b/src/pages/ChatModule/LongTextGuideCardPreview/images/comp2.jpg new file mode 100644 index 0000000..f596580 Binary files /dev/null and b/src/pages/ChatModule/LongTextGuideCardPreview/images/comp2.jpg differ diff --git a/src/pages/ChatModule/LongTextGuideCardPreview/images/comp4.jpg b/src/pages/ChatModule/LongTextGuideCardPreview/images/comp4.jpg new file mode 100644 index 0000000..fec7a5d Binary files /dev/null and b/src/pages/ChatModule/LongTextGuideCardPreview/images/comp4.jpg differ diff --git a/src/pages/ChatModule/LongTextGuideCardPreview/index.vue b/src/pages/ChatModule/LongTextGuideCardPreview/index.vue index 2c005bd..41171aa 100644 --- a/src/pages/ChatModule/LongTextGuideCardPreview/index.vue +++ b/src/pages/ChatModule/LongTextGuideCardPreview/index.vue @@ -25,11 +25,12 @@ diff --git a/src/pages/ChatModule/LongTextGuideCardPreview/photo.vue b/src/pages/ChatModule/LongTextGuideCardPreview/photo.vue new file mode 100644 index 0000000..5038b77 --- /dev/null +++ b/src/pages/ChatModule/LongTextGuideCardPreview/photo.vue @@ -0,0 +1,119 @@ + + + + + + diff --git a/src/pages/ChatModule/LongTextGuideCardPreview/poi.vue b/src/pages/ChatModule/LongTextGuideCardPreview/poi.vue new file mode 100644 index 0000000..17889d3 --- /dev/null +++ b/src/pages/ChatModule/LongTextGuideCardPreview/poi.vue @@ -0,0 +1,95 @@ + + + + + + diff --git a/src/pages/ChatModule/LongTextGuideCardPreview/route.vue b/src/pages/ChatModule/LongTextGuideCardPreview/route.vue new file mode 100644 index 0000000..77bb9b1 --- /dev/null +++ b/src/pages/ChatModule/LongTextGuideCardPreview/route.vue @@ -0,0 +1,150 @@ + + + + + + diff --git a/src/pages/ChatModule/LongTextGuideCardPreview/styles/detail.scss b/src/pages/ChatModule/LongTextGuideCardPreview/styles/detail.scss new file mode 100644 index 0000000..1764faa --- /dev/null +++ b/src/pages/ChatModule/LongTextGuideCardPreview/styles/detail.scss @@ -0,0 +1,530 @@ +.long-text-detail-page { + height: 100vh; + overflow: hidden; + background: #e5efe9; +} + +.long-text-detail-scroll { + flex: 1; + min-height: 0; +} + +.long-text-detail-content { + box-sizing: border-box; +} + +.long-text-detail-card { + overflow: hidden; +} + +.long-text-detail-header { + padding: 16px 18px 14px; + border-bottom: 1px solid rgba(15, 23, 42, 0.06); +} + +.long-text-detail-title { + color: #1e293b; + font-size: 18px; + font-weight: 900; + line-height: 26px; +} + +.long-text-detail-badge { + display: inline-flex; + width: fit-content; + min-height: 24px; + margin-top: 10px; + padding: 0 10px; + align-items: center; + border: 1px solid transparent; + border-radius: 999px; + font-size: 11px; + font-weight: 900; + line-height: 18px; +} + +.long-text-detail-badge.is-amber { + color: #d97706; + background: #fffbeb; + border-color: #fde68a; +} + +.long-text-detail-badge.is-emerald { + color: #047857; + background: #ecfdf5; + border-color: #a7f3d0; +} + +.long-text-detail-badge.is-violet { + color: #7c3aed; + background: #f5f3ff; + border-color: #ddd6fe; +} + +.long-text-detail-badge.is-blue { + color: #2563eb; + background: #eff6ff; + border-color: #bfdbfe; +} + +.long-text-detail-body { + padding: 18px 18px 4px; +} + +.detail-paragraph { + margin-bottom: 14px; + color: #475569; + font-size: 13px; + font-weight: 500; + line-height: 24px; +} + +.detail-highlight { + padding: 1px 5px; + border-radius: 4px; + color: #065f46; + background: #ecfdf5; + font-weight: 900; +} + +.detail-section-title { + margin: 18px 0 8px; + color: #1e293b; + font-size: 13px; + font-weight: 900; + line-height: 20px; +} + +.detail-main-image { + width: 100%; + height: 160px; + margin: 4px 0 16px; + border-radius: 14px; + background: #f1f5f9; +} + +.detail-tip-block { + margin: 4px 0 16px; + padding: 10px 14px; + border-left: 3px solid #34d399; + border-radius: 12px; + color: #065f46; + background: #f0fdf4; + font-size: 12px; + font-weight: 800; + line-height: 22px; +} + +.detail-tip-block.is-warn { + color: #92400e; + background: #fffbeb; + border-left-color: #fbbf24; +} + +.detail-action-zone { + margin-top: 4px; + padding-bottom: 20px; + border-top: 1px solid rgba(15, 23, 42, 0.06); +} + +.detail-action-label { + padding: 12px 18px 8px; + color: #94a3b8; + font-size: 10px; + font-weight: 900; + letter-spacing: 0.6px; + line-height: 16px; +} + +.detail-action-card { + margin: 0 16px 12px; + overflow: hidden; + border: 1px solid #f1f5f9; + border-radius: 16px; + background: #fff; +} + +.detail-action-card.is-raised { + border-radius: 24px; + box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04); +} + +.poi-mini-tag { + display: inline-flex; + width: fit-content; + margin: 14px 0 0 14px; + padding: 4px 10px; + align-items: center; + border-radius: 8px; + color: #059669; + background: rgba(255, 255, 255, 0.9); + box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08); + font-size: 10px; + font-weight: 900; +} + +.poi-mini-body { + padding: 10px 20px 16px; +} + +.poi-mini-title { + margin-bottom: 10px; + color: #1e293b; + font-size: 19px; + font-weight: 900; + line-height: 26px; +} + +.poi-mini-desc { + margin-bottom: 12px; + padding: 10px 12px; + border: 1px solid rgba(167, 243, 208, 0.5); + border-radius: 12px; + color: #065f46; + background: linear-gradient(to right, #ecfdf5, rgba(240, 253, 250, 0.5)); + font-size: 12px; + font-weight: 800; + line-height: 20px; +} + +.detail-solid-button { + width: 100%; + height: 42px; + padding: 0; + border: 0; + border-radius: 14px; + color: #fff; + background: #0f172a; + font-size: 13px; + font-weight: 900; + line-height: 42px; +} + +.detail-solid-button::after { + border: 0; +} + +.detail-product-scroll { + width: 100%; + white-space: nowrap; +} + +.detail-product-row { + display: flex; + gap: 10px; + padding: 0 16px 2px; +} + +.detail-product-card { + width: 220px; + flex-shrink: 0; + overflow: hidden; + border: 1px solid #f1f5f9; + border-radius: 20px; + background: #fff; + box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04); +} + +.detail-product-image { + width: 100%; + height: 110px; + background: #f1f5f9; +} + +.detail-product-body { + padding: 10px 12px 12px; +} + +.detail-product-tag { + display: inline-flex; + width: fit-content; + margin-bottom: 4px; + padding: 2px 6px; + border-radius: 6px; + color: #f43f5e; + background: #fef2f2; + font-size: 9px; + font-weight: 900; +} + +.detail-product-name { + overflow: hidden; + color: #1e293b; + font-size: 13px; + font-weight: 900; + line-height: 20px; + text-overflow: ellipsis; + white-space: nowrap; +} + +.detail-product-price { + margin: 4px 0 8px; + color: #f43f5e; + font-size: 20px; + font-weight: 900; + line-height: 26px; +} + +.detail-product-currency { + font-size: 12px; +} + +.detail-product-original { + margin-left: 4px; + color: #cbd5e1; + font-size: 11px; + font-weight: 700; + text-decoration: line-through; +} + +.detail-buy-button { + width: 100%; + height: 34px; + padding: 0; + border: 0; + border-radius: 12px; + color: #451a03; + background: #fbbf24; + font-size: 12px; + font-weight: 900; + line-height: 34px; +} + +.detail-buy-button::after { + border: 0; +} + +.detail-faq-wrap { + margin: 0 16px; +} + +.detail-faq-chip { + display: inline-flex; + margin: 0 6px 8px 0; + padding: 8px 13px; + border: 1px solid #e2e8f0; + border-radius: 20px; + color: #475569; + background: #fff; + font-size: 11.5px; + font-weight: 800; + line-height: 16px; +} + +.route-vs-wrap { + display: flex; + gap: 8px; + margin: 6px 0 16px; +} + +.route-vs-col { + flex: 1; + padding: 11px 12px; + border: 1px solid #e8edf2; + border-radius: 12px; + background: #f8fafc; +} + +.route-vs-head { + margin-bottom: 8px; + padding-bottom: 7px; + border-bottom: 1px dashed #d8e0e8; + color: #1e293b; + font-size: 12px; + font-weight: 900; + line-height: 18px; +} + +.route-vs-boat { + margin-bottom: 7px; + font-size: 13px; + font-weight: 900; + line-height: 18px; +} + +.route-vs-row { + margin-bottom: 5px; + color: #64748b; + font-size: 11px; + font-weight: 600; + line-height: 17px; +} + +.route-vs-bold { + color: #334155; + font-weight: 900; +} + +.route-step-card { + margin: 0 16px 12px; + padding: 14px 16px; + border: 1px solid rgba(15, 23, 42, 0.07); + border-radius: 16px; + background: #fff; +} + +.route-step-title { + margin-bottom: 12px; + color: #1e293b; + font-size: 13px; + font-weight: 900; + line-height: 20px; +} + +.route-step { + display: flex; + gap: 10px; + margin-bottom: 10px; +} + +.route-step:last-child { + margin-bottom: 0; +} + +.route-step-index { + width: 18px; + height: 18px; + flex-shrink: 0; + border-radius: 50%; + color: #fff; + background: #8b5cf6; + font-size: 10px; + font-weight: 900; + line-height: 18px; + text-align: center; +} + +.route-step-main { + flex: 1; +} + +.route-step-act { + color: #334155; + font-size: 12px; + font-weight: 800; + line-height: 18px; +} + +.route-step-meta { + margin-top: 1px; + color: #94a3b8; + font-size: 10.5px; + font-weight: 700; + line-height: 16px; +} + +.facility-row { + display: flex; + gap: 8px; + padding: 5px 0; + color: #475569; + font-size: 11.5px; + font-weight: 700; + line-height: 18px; +} + +.facility-label { + width: 52px; + flex-shrink: 0; + color: #7c3aed; + font-weight: 900; +} + +.photo-card { + position: relative; + margin: 0 16px 12px; + overflow: hidden; + border-radius: 16px; + background: #f8fafc; +} + +.photo-card-image { + width: 100%; + height: 200px; + background: #f1f5f9; +} + +.photo-card-caption { + position: absolute; + right: 0; + bottom: 0; + left: 0; + padding: 28px 14px 12px; + background: linear-gradient(to top, rgba(15, 23, 42, 0.58), rgba(15, 23, 42, 0)); +} + +.photo-card-title { + color: #fff; + font-size: 13px; + font-weight: 900; + line-height: 18px; +} + +.photo-card-subtitle { + margin-top: 2px; + color: rgba(255, 255, 255, 0.78); + font-size: 11px; + font-weight: 700; + line-height: 16px; +} + +.photo-card-expand { + position: absolute; + top: 10px; + right: 10px; + width: 30px; + height: 30px; + border-radius: 50%; + color: #fff; + background: rgba(15, 23, 42, 0.38); + font-size: 18px; + font-weight: 800; + line-height: 30px; + text-align: center; +} + +.aigc-image { + width: 100%; + height: 160px; + background: #f1f5f9; +} + +.aigc-cover { + position: relative; +} + +.aigc-badge { + position: absolute; + top: 10px; + left: 10px; + padding: 4px 10px; + border-radius: 10px; + color: #fff; + background: linear-gradient(135deg, #8b5cf6, #6366f1); + box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35); + font-size: 10px; + font-weight: 900; +} + +.aigc-body { + padding: 12px 14px 14px; +} + +.aigc-title { + color: #1e293b; + font-size: 15px; + font-weight: 900; + line-height: 22px; +} + +.aigc-desc { + margin: 5px 0 12px; + color: #64748b; + font-size: 11.5px; + font-weight: 700; + line-height: 18px; +} + +.aigc-button { + background: linear-gradient(135deg, #8b5cf6, #6366f1); +} diff --git a/src/pages/ChatModule/LongTextGuideCardPreview/styles/index.scss b/src/pages/ChatModule/LongTextGuideCardPreview/styles/index.scss index 42596a0..4842da1 100644 --- a/src/pages/ChatModule/LongTextGuideCardPreview/styles/index.scss +++ b/src/pages/ChatModule/LongTextGuideCardPreview/styles/index.scss @@ -39,6 +39,12 @@ border-color: #a7f3d0; } +.long-text-guide-card__badge.is-violet { + color: #7c3aed; + background: #f5f3ff; + border-color: #ddd6fe; +} + .long-text-guide-card__badge.is-blue { color: #2563eb; background: #eff6ff; diff --git a/src/pages/ChatModule/LongTextGuideCardPreview/长文本收纳组件_4类演示.html b/src/pages/ChatModule/LongTextGuideCardPreview/长文本收纳组件_4类演示.html new file mode 100644 index 0000000..40e64b6 --- /dev/null +++ b/src/pages/ChatModule/LongTextGuideCardPreview/长文本收纳组件_4类演示.html @@ -0,0 +1,651 @@ + + + + + +长文本收纳组件 · 4 类演示 + + + + +
+ + +
+
+
🐯
+ 小七 · 荔波小七孔 AI 伴游 +
+
+ 演示 + 长文本收纳组件 · 4 类 +
+

+ 点击卡片 = 折叠态展开为完整内容。
+ 展开后下半部分是「行动条」,挂载真实可点击的组件。 +

+
+ + +
+ + +
+ + +
+
+
+ 漂流攻略 + 长文本-攻略组件 +
+

下水之前,先听小七唠两句

+

+
+
+ 点击查看完整攻略 + +
+
+ + +
+
+
+ 景点故事 + 长文本-景点组件 +
+

小七孔古桥 · 走了三百年的石拱

+

+
+
+ 点击查看完整介绍 + +
+
+ + +
+
+
+ 路线指引 + 长文本-路线组件 +
+

漂完卧龙潭,顺道去鸳鸯湖

+

+
+
+ 点击查看完整路线 + +
+
+ + +
+
+
+ 拍照攻略 + 长文本-拍照组件 +
+

鸳鸯湖玻璃船,这样拍才不亏

+

+
+
+ 点击查看完整攻略 + +
+
+ +
+ + +
+
+
+
+ + +
+
+
+
+
+ +
+
+ + + + + +
+ + + +