From 9d4aeafed06a1c4f01ee0ce9891590b18ecfa08d Mon Sep 17 00:00:00 2001 From: huangzhe Date: Mon, 4 Aug 2025 09:36:42 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"feat:=20=E6=B7=BB=E5=8A=A0=20card=20?= =?UTF-8?q?=E5=AE=B9=E5=99=A8=E6=94=AF=E6=8C=81"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a9d74932d3158eab9bc453c766d70476c6b25964. --- package.json | 1 - src/views/AI-new/components/card/index.vue | 43 --------------- .../components/js/markdown-it-container.js | 46 ---------------- src/views/AI-new/index.vue | 6 +-- .../AI-new/views/productKnowledge/index.vue | 53 ++++++++++++------- 5 files changed, 36 insertions(+), 113 deletions(-) delete mode 100644 src/views/AI-new/components/card/index.vue delete mode 100644 src/views/AI-new/components/js/markdown-it-container.js diff --git a/package.json b/package.json index 094bd01..4d83119 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ }, "dependencies": { "@better-scroll/core": "^2.5.1", - "@gerhobbelt/markdown-it-container": "^3.0.0-10", "@isaacs/cliui": "^8.0.2", "axios": "^0.19.0", "core-js": "^3.43.0", diff --git a/src/views/AI-new/components/card/index.vue b/src/views/AI-new/components/card/index.vue deleted file mode 100644 index fd6213c..0000000 --- a/src/views/AI-new/components/card/index.vue +++ /dev/null @@ -1,43 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/AI-new/components/js/markdown-it-container.js b/src/views/AI-new/components/js/markdown-it-container.js deleted file mode 100644 index 7aca602..0000000 --- a/src/views/AI-new/components/js/markdown-it-container.js +++ /dev/null @@ -1,46 +0,0 @@ -import container from "@gerhobbelt/markdown-it-container" -import Vue from "vue"; -import KnowledgeCard from "../card/index.vue" - -export function markdownContainer(markdownIt) { - console.log(markdownIt); - console.log(container); - - container(markdownIt, "card", { - validate: function (params) { - console.log(params.trim(), "title line"); - return "card" - // return params.trim().match(/^card\b/); - }, - render: function (tokens, idx) { - // console.log(`tokens, idx`, tokens, idx); - return tokens[idx].content - }, - content: function (tokens, idx, options, env, self) { - - - console.log(`args`, tokens, idx, options, env, self); - // return [...args] - console.log(`tokens[idx]`, tokens[idx]); - - const { markup } = tokens[idx] - console.log(`markup`, markup); - setTimeout(() => { - const dom = document.getElementById("cardTest"); - // if (dom) return - const vm = new Vue({ - el: "#cardTest", - render: h => h(KnowledgeCard, { - props: { - content: tokens[idx] - } - }) - }) - // console.log(`vue instance`, vm); - }) - - // return tokens[idx] - return "
" - } - }) -} diff --git a/src/views/AI-new/index.vue b/src/views/AI-new/index.vue index f67239d..34172a2 100644 --- a/src/views/AI-new/index.vue +++ b/src/views/AI-new/index.vue @@ -84,11 +84,11 @@ export default { // 可以调用接口展示 名字 或者存在session里 let sesstions = JSON.parse(sessionStorage.getItem('results')).productResults - // console.log(sesstions) + console.log(sesstions) let text = sesstions.map((item) => { return item.productName + '
' }) - // console.log(text) + console.log(text) let other = '对比产品
' + text.join('') this.messages.push({ @@ -103,7 +103,7 @@ export default { this.isThink = e }, getHotProducts(e) { - // console.log(e) + console.log(e) this.hotList = e }, diff --git a/src/views/AI-new/views/productKnowledge/index.vue b/src/views/AI-new/views/productKnowledge/index.vue index 56e7de5..3797a51 100644 --- a/src/views/AI-new/views/productKnowledge/index.vue +++ b/src/views/AI-new/views/productKnowledge/index.vue @@ -1,15 +1,26 @@ @@ -70,11 +90,11 @@ export default { // 可以调用接口展示 名字 或者存在session里 let sesstions = JSON.parse(sessionStorage.getItem('results')).productResults - // console.log(sesstions) + console.log(sesstions) let text = sesstions.map(item => { return item.productName + '
' }) - // console.log(text) + console.log(text) let other = '对比产品
' + text.join('') this.messages.push({ @@ -89,7 +109,7 @@ export default { this.isThink = e }, getHotProducts(e) { - // console.log(e) + console.log(e) this.hotList = e }, @@ -122,14 +142,7 @@ export default { initBotMessage() { this.messages.splice(0, this.messages.length, { type: 'bot', - text: `这里是产品知识小助手,请告诉我您想要了解哪个产品?也可以输入以下信息,我帮您进行精准查询:\n\n1.投保规则\n\n2.保障责任\n\n3.增值服务\n\n您可以直接向我提问~ \n\n` - /* ::: card - { - "img": "/family.png", - "title": "标题", - "tags": ["标签1", "标签2", "标签3"] - } - ::: */ + text: `这里是产品知识小助手,请告诉我您想要了解哪个产品?也可以输入以下信息,我帮您进行精准查询:\n\n1.投保规则\n\n2.保障责任\n\n3.增值服务\n\n您可以直接向我提问~` }) } },