From 2cd5f6103f5b5b4465b8c898f5debb12b2d2bce2 Mon Sep 17 00:00:00 2001 From: ZhangYong Date: Fri, 31 Oct 2025 10:29:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=80=89=E8=82=A1=E7=AD=96=E7=95=A5?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E6=A8=A1=E5=9D=97=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/deepExploration/deepExploration.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/deepExploration/deepExploration.vue b/pages/deepExploration/deepExploration.vue index f523971..b29b807 100644 --- a/pages/deepExploration/deepExploration.vue +++ b/pages/deepExploration/deepExploration.vue @@ -46,7 +46,7 @@ - + @@ -75,7 +75,7 @@ - + From 5a2e264d51c8bf6257590c25c2956b7e0c4d3094 Mon Sep 17 00:00:00 2001 From: lihui Date: Fri, 31 Oct 2025 10:30:50 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix=EF=BC=9A=E7=99=BB=E5=BD=95=E4=B9=9F?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E7=82=B9=E5=87=BB=E5=88=86=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/member.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/home/member.vue b/pages/home/member.vue index 988b972..3c02820 100644 --- a/pages/home/member.vue +++ b/pages/home/member.vue @@ -129,8 +129,8 @@ const goToAbout = () => { } const goToShare = () => { - console.log('用户信息==========',userInfoRes.value.data) - if (!userInfoRes.value.data) { + console.log('用户信息==========',userStore.userInfo.isVisitor) + if (userStore.userInfo.isVisitor) { uni.showToast({ title: '请先登录', icon: 'none' From 7266de1d810bfc9ffa32b027c92720292f3bee8c Mon Sep 17 00:00:00 2001 From: wangyi <3432649580@qq.com> Date: Fri, 31 Oct 2025 10:36:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?deepmate=E6=B7=BB=E5=8A=A0=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E8=AE=B0=E5=BD=95=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/deepMate/deepMate.js | 13 ++++++++++ pages/deepMate/deepMate.vue | 61 ++++++++++++++++++++++++++++----------------- 2 files changed, 51 insertions(+), 23 deletions(-) diff --git a/api/deepMate/deepMate.js b/api/deepMate/deepMate.js index 9416772..7b67999 100644 --- a/api/deepMate/deepMate.js +++ b/api/deepMate/deepMate.js @@ -54,6 +54,19 @@ export const postHistory = (data) => { /** + * 删除历史记录 + */ + +export const postDeleteHistory = (data) => { + return http({ + method: 'POST', + url: '/api/deepMate/deleteRecord', + data + }) +} + + +/** * 历史记录详情 */ diff --git a/pages/deepMate/deepMate.vue b/pages/deepMate/deepMate.vue index 657f181..74b2536 100644 --- a/pages/deepMate/deepMate.vue +++ b/pages/deepMate/deepMate.vue @@ -250,7 +250,8 @@ 删除全部 @@ -312,6 +313,7 @@ import { postIntent, postHistory, postHistoryDetail, + postDeleteHistory, } from "../../api/deepMate/deepMate"; import { useUserStore } from "../../stores/modules/userInfo"; @@ -597,22 +599,36 @@ const groupedHistory = computed(() => { const clearAllHistory = () => { uni.showModal({ - title: '确认删除', - content: '确定要删除全部历史记录吗?该操作不可撤销。', - confirmText: '删除', - cancelText: '取消', + title: "确认删除", + content: "确定要删除全部历史记录吗?该操作不可撤销。", + confirmText: "删除", + cancelText: "取消", success: (res) => { if (res.confirm) { - // 当前历史面板依赖 historyList,而非 searchHistory - historyList.value = []; - // 同步清空本地旧缓存(如果曾使用) - // uni.setStorageSync("search_history", []); - uni.showToast({ title: '历史已清空', icon: 'none' }); + deleteHistory(); } - } - }) + }, + }); }; +// 删除历史记录 +async function deleteHistory(historyId) { + // 当前历史面板依赖 historyList,而非 searchHistory + // 同步清空本地旧缓存(如果曾使用) + const res = await postDeleteHistory({ + model: 5, + }); + if (res.code === 200) { + historyList.value = []; + + // uni.setStorageSync("search_history", []); + uni.showToast({ title: "历史已清空", icon: "none" }); + } + else { + uni.showToast({ title: res.message, icon: "none" }); + } +} + // 发送消息 const sendMessage = () => { if (inputMessage.value.trim() === "" || isSending.value) return; @@ -694,18 +710,18 @@ const simulateBotResponse = async (userMessage) => { let ch = responseText.charAt(index); let charsToAdd = ch; let newIndex = index + 1; - + // 检查是否遇到HTML标签开始 - if (ch === '<') { + if (ch === "<") { // 寻找标签结束位置 - let tagEndIndex = responseText.indexOf('>', index); + let tagEndIndex = responseText.indexOf(">", index); if (tagEndIndex !== -1) { // 完整获取标签内容 charsToAdd = responseText.substring(index, tagEndIndex + 1); newIndex = tagEndIndex + 1; } } - + const current = messages.value[botIndex]; // 通过数组替换触发渲染,避免部分平台对子项属性变更不响应 messages.value.splice(botIndex, 1, { @@ -720,10 +736,10 @@ const simulateBotResponse = async (userMessage) => { const baseDelay = 5; // 普通字符基础延迟(毫秒) const slowPunct = /[。!?!?;;]/; // 句号、感叹号、分号等较长停顿 const midPunct = /[,、,::]/; // 逗号、顿号、冒号等中等停顿 - + // 如果是标签,使用更短的延迟或者立即显示 let delay; - if (charsToAdd.startsWith('<')) { + if (charsToAdd.startsWith("<")) { delay = 1; // 标签快速显示 } else { delay = slowPunct.test(ch) @@ -826,11 +842,11 @@ const simulateBotResponse = async (userMessage) => { let charsToAdd = ch; let newIndex = index + 1; let delay = baseDelay; - + // 检查是否遇到HTML标签开始 - if (ch === '<') { + if (ch === "<") { // 寻找标签结束位置 - let tagEndIndex = responseText.indexOf('>', index); + let tagEndIndex = responseText.indexOf(">", index); if (tagEndIndex !== -1) { // 完整获取标签内容 charsToAdd = responseText.substring(index, tagEndIndex + 1); @@ -838,7 +854,7 @@ const simulateBotResponse = async (userMessage) => { delay = 1; // 标签快速显示 } } - + const current = messages.value[botIndex]; // 通过数组替换触发渲染,避免部分平台对子项属性变更不响应 messages.value.splice(botIndex, 1, { @@ -1841,7 +1857,6 @@ async function itemClick(item) { to { transform: scaleY(1); } - } .thinking-item {