|
|
@ -250,7 +250,8 @@ |
|
|
<view class="delete-all-container"> |
|
|
<view class="delete-all-container"> |
|
|
<image |
|
|
<image |
|
|
class="delete-icon" |
|
|
class="delete-icon" |
|
|
src="/static/icons/Group_48095481.svg" @click="clearAllHistory" |
|
|
|
|
|
|
|
|
src="/static/icons/Group_48095481.svg" |
|
|
|
|
|
@click="clearAllHistory" |
|
|
></image> |
|
|
></image> |
|
|
<text class="delete-all" @click="clearAllHistory">删除全部</text> |
|
|
<text class="delete-all" @click="clearAllHistory">删除全部</text> |
|
|
</view> |
|
|
</view> |
|
|
@ -312,6 +313,7 @@ import { |
|
|
postIntent, |
|
|
postIntent, |
|
|
postHistory, |
|
|
postHistory, |
|
|
postHistoryDetail, |
|
|
postHistoryDetail, |
|
|
|
|
|
postDeleteHistory, |
|
|
} from "../../api/deepMate/deepMate"; |
|
|
} from "../../api/deepMate/deepMate"; |
|
|
|
|
|
|
|
|
import { useUserStore } from "../../stores/modules/userInfo"; |
|
|
import { useUserStore } from "../../stores/modules/userInfo"; |
|
|
@ -597,21 +599,35 @@ const groupedHistory = computed(() => { |
|
|
|
|
|
|
|
|
const clearAllHistory = () => { |
|
|
const clearAllHistory = () => { |
|
|
uni.showModal({ |
|
|
uni.showModal({ |
|
|
title: '确认删除', |
|
|
|
|
|
content: '确定要删除全部历史记录吗?该操作不可撤销。', |
|
|
|
|
|
confirmText: '删除', |
|
|
|
|
|
cancelText: '取消', |
|
|
|
|
|
|
|
|
title: "确认删除", |
|
|
|
|
|
content: "确定要删除全部历史记录吗?该操作不可撤销。", |
|
|
|
|
|
confirmText: "删除", |
|
|
|
|
|
cancelText: "取消", |
|
|
success: (res) => { |
|
|
success: (res) => { |
|
|
if (res.confirm) { |
|
|
if (res.confirm) { |
|
|
|
|
|
deleteHistory(); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// 删除历史记录 |
|
|
|
|
|
async function deleteHistory(historyId) { |
|
|
// 当前历史面板依赖 historyList,而非 searchHistory |
|
|
// 当前历史面板依赖 historyList,而非 searchHistory |
|
|
historyList.value = []; |
|
|
|
|
|
// 同步清空本地旧缓存(如果曾使用) |
|
|
// 同步清空本地旧缓存(如果曾使用) |
|
|
|
|
|
const res = await postDeleteHistory({ |
|
|
|
|
|
model: 5, |
|
|
|
|
|
}); |
|
|
|
|
|
if (res.code === 200) { |
|
|
|
|
|
historyList.value = []; |
|
|
|
|
|
|
|
|
// uni.setStorageSync("search_history", []); |
|
|
// uni.setStorageSync("search_history", []); |
|
|
uni.showToast({ title: '历史已清空', icon: 'none' }); |
|
|
|
|
|
|
|
|
uni.showToast({ title: "历史已清空", icon: "none" }); |
|
|
} |
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
uni.showToast({ title: res.message, icon: "none" }); |
|
|
} |
|
|
} |
|
|
}) |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 发送消息 |
|
|
// 发送消息 |
|
|
const sendMessage = () => { |
|
|
const sendMessage = () => { |
|
|
@ -696,9 +712,9 @@ const simulateBotResponse = async (userMessage) => { |
|
|
let newIndex = index + 1; |
|
|
let newIndex = index + 1; |
|
|
|
|
|
|
|
|
// 检查是否遇到HTML标签开始 |
|
|
// 检查是否遇到HTML标签开始 |
|
|
if (ch === '<') { |
|
|
|
|
|
|
|
|
if (ch === "<") { |
|
|
// 寻找标签结束位置 |
|
|
// 寻找标签结束位置 |
|
|
let tagEndIndex = responseText.indexOf('>', index); |
|
|
|
|
|
|
|
|
let tagEndIndex = responseText.indexOf(">", index); |
|
|
if (tagEndIndex !== -1) { |
|
|
if (tagEndIndex !== -1) { |
|
|
// 完整获取标签内容 |
|
|
// 完整获取标签内容 |
|
|
charsToAdd = responseText.substring(index, tagEndIndex + 1); |
|
|
charsToAdd = responseText.substring(index, tagEndIndex + 1); |
|
|
@ -723,7 +739,7 @@ const simulateBotResponse = async (userMessage) => { |
|
|
|
|
|
|
|
|
// 如果是标签,使用更短的延迟或者立即显示 |
|
|
// 如果是标签,使用更短的延迟或者立即显示 |
|
|
let delay; |
|
|
let delay; |
|
|
if (charsToAdd.startsWith('<')) { |
|
|
|
|
|
|
|
|
if (charsToAdd.startsWith("<")) { |
|
|
delay = 1; // 标签快速显示 |
|
|
delay = 1; // 标签快速显示 |
|
|
} else { |
|
|
} else { |
|
|
delay = slowPunct.test(ch) |
|
|
delay = slowPunct.test(ch) |
|
|
@ -828,9 +844,9 @@ const simulateBotResponse = async (userMessage) => { |
|
|
let delay = baseDelay; |
|
|
let delay = baseDelay; |
|
|
|
|
|
|
|
|
// 检查是否遇到HTML标签开始 |
|
|
// 检查是否遇到HTML标签开始 |
|
|
if (ch === '<') { |
|
|
|
|
|
|
|
|
if (ch === "<") { |
|
|
// 寻找标签结束位置 |
|
|
// 寻找标签结束位置 |
|
|
let tagEndIndex = responseText.indexOf('>', index); |
|
|
|
|
|
|
|
|
let tagEndIndex = responseText.indexOf(">", index); |
|
|
if (tagEndIndex !== -1) { |
|
|
if (tagEndIndex !== -1) { |
|
|
// 完整获取标签内容 |
|
|
// 完整获取标签内容 |
|
|
charsToAdd = responseText.substring(index, tagEndIndex + 1); |
|
|
charsToAdd = responseText.substring(index, tagEndIndex + 1); |
|
|
@ -1841,7 +1857,6 @@ async function itemClick(item) { |
|
|
to { |
|
|
to { |
|
|
transform: scaleY(1); |
|
|
transform: scaleY(1); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.thinking-item { |
|
|
.thinking-item { |
|
|
|