diff --git a/public/family.png b/public/family.png new file mode 100644 index 0000000..11f4964 Binary files /dev/null and b/public/family.png differ diff --git a/public/heart.png b/public/heart.png new file mode 100644 index 0000000..d737597 Binary files /dev/null and b/public/heart.png differ diff --git a/public/note.png b/public/note.png new file mode 100644 index 0000000..52debdf Binary files /dev/null and b/public/note.png differ diff --git a/public/security.png b/public/security.png new file mode 100644 index 0000000..8a26d33 Binary files /dev/null and b/public/security.png differ diff --git a/public/thumbsup.png b/public/thumbsup.png new file mode 100644 index 0000000..37cb343 Binary files /dev/null and b/public/thumbsup.png differ diff --git a/src/assets/sass/card.css b/src/assets/sass/card.css index 372f569..343c09d 100644 --- a/src/assets/sass/card.css +++ b/src/assets/sass/card.css @@ -1,18 +1,22 @@ .card { + margin: 10px 0; display: flex; align-items: center; - justify-content: center; - gap: 10px; + justify-content: flex-start; + gap: 5%; + flex-shrink: 0; } .card > div { + line-height: 0; + /* height: fit-content; */ border-radius: 10px; overflow: hidden; } .card > div > img { - width: 80px; - height: 80px; + width: 70px; + height: auto; } .card > section > :nth-child(1) { @@ -27,5 +31,22 @@ .card > section > :nth-child(2) > div { background-color: #0065ff; - padding: 5px; + padding: 1px 4px; + border-radius: 3px; +} + +/* 选择遇到的第一个 div */ +.render-container > div:nth-of-type(1) > img { + width: 100%; + background-color: red; +} + +.render-container > div { + display: flex; + align-items: center; + justify-content: start; + gap: 5px; +} +.render-container > div > img { + width: 20px; } diff --git a/src/main.js b/src/main.js index 4096e83..62d16cd 100644 --- a/src/main.js +++ b/src/main.js @@ -1,4 +1,5 @@ import Vue from 'vue' +import "./assets/sass/card.css" import App from './App.vue' import Router from './router' import Store from './store' diff --git a/src/router/generatedRouter/index.js b/src/router/generatedRouter/index.js index c1d956f..6b66ca5 100644 --- a/src/router/generatedRouter/index.js +++ b/src/router/generatedRouter/index.js @@ -51,7 +51,7 @@ export default [ name: 'productRecommend', component: () => import('@/views/AI-new/views/productRecommend/index.vue'), meta: { - title: '产品推荐助手', + title: '产品推荐助手-保障型', }, }, ] diff --git a/src/views/AI-new/components/chat-new.vue b/src/views/AI-new/components/chat-new.vue index 7bf1851..ca6e770 100644 --- a/src/views/AI-new/components/chat-new.vue +++ b/src/views/AI-new/components/chat-new.vue @@ -14,7 +14,7 @@
+ @keyup.enter="beforeSend" />
@@ -25,11 +25,11 @@
- +
- @@ -39,24 +39,13 @@ --> - - - - - @@ -517,7 +550,7 @@ $primary-trans-color: rgba(135, 162, 208, 0.5); } input { - width: 110%; + width: 100%; padding: 10px; border: none; background: #fff; diff --git a/src/views/AI-new/components/message.vue b/src/views/AI-new/components/message.vue index 2b6d59d..6a5d6f3 100644 --- a/src/views/AI-new/components/message.vue +++ b/src/views/AI-new/components/message.vue @@ -21,7 +21,7 @@

-

+

@@ -79,25 +79,33 @@ export default { }, methods: { render(message) { - // this.filterVisible(message); - - // console.log(md.render(message.text)); return md.render(this.filterVisible(message)) }, setProductName(e) { this.$emit('setProductName', e) }, filterVisible(message) { + // 捕获 不包含 < 的后置标签 ( .*>) + let _text = message.text.replace(/(?/g, '') + // 把 未闭合的标签替换成空白 + _text = _text.replace(/<\/\w*$/g, '') + return _text if (!message.text.startsWith('<')) { return message.text } // 只把 text 标签内容渲染 - const match = /([^<]*)(?:<\/text>)?/.exec(message.text) - return match ? match[1] : '' + let match = /([^<]*)(?:<\/text>)?/.exec(message.text) + let text = match ? match[1] : '' + // 捕获 不包含 < 的后置标签 ( .*>) + text = text.replace(/(?/g, '') + // 把 未闭合的标签替换成空白 + text = text.replace(/<\/\w*$/g, '') + console.log(text); + + return text }, showThink(message) { this.$set(message, 'showThink', !message.showThink) - console.log(message.showThink) }, // 处理点赞和踩的逻辑 @@ -113,6 +121,9 @@ export default { this.$emit('update-message', { ...message }) }, }, + mounted() { + window.md = md + } } diff --git a/src/views/AI-new/index.vue b/src/views/AI-new/index.vue index 4f6fc76..abf4fbf 100644 --- a/src/views/AI-new/index.vue +++ b/src/views/AI-new/index.vue @@ -31,7 +31,7 @@ + :autoScrollEnabled.sync="autoScrollEnabled" @getIsThink="getIsThink" action="normal_chat">
diff --git a/src/views/AI-new/views/productKnowledge/index.vue b/src/views/AI-new/views/productKnowledge/index.vue index b46f64d..0e1b0a2 100644 --- a/src/views/AI-new/views/productKnowledge/index.vue +++ b/src/views/AI-new/views/productKnowledge/index.vue @@ -21,13 +21,13 @@ + :autoScrollEnabled.sync="autoScrollEnabled" @getIsThink="getIsThink" action="chat"/>