|
|
|
@ -249,7 +249,7 @@ |
|
|
|
<view class="delete-all-container"> |
|
|
|
<image |
|
|
|
class="delete-icon" |
|
|
|
src="/static/icons/Group_48095481.svg" |
|
|
|
src="/static/icons/Group_48095481.svg" @click="clearAllHistory" |
|
|
|
></image> |
|
|
|
<text class="delete-all" @click="clearAllHistory">删除全部</text> |
|
|
|
</view> |
|
|
|
@ -595,8 +595,21 @@ const groupedHistory = computed(() => { |
|
|
|
}); |
|
|
|
|
|
|
|
const clearAllHistory = () => { |
|
|
|
searchHistory.value = []; |
|
|
|
// uni.setStorageSync("search_history", []); |
|
|
|
uni.showModal({ |
|
|
|
title: '确认删除', |
|
|
|
content: '确定要删除全部历史记录吗?该操作不可撤销。', |
|
|
|
confirmText: '删除', |
|
|
|
cancelText: '取消', |
|
|
|
success: (res) => { |
|
|
|
if (res.confirm) { |
|
|
|
// 当前历史面板依赖 historyList,而非 searchHistory |
|
|
|
historyList.value = []; |
|
|
|
// 同步清空本地旧缓存(如果曾使用) |
|
|
|
// uni.setStorageSync("search_history", []); |
|
|
|
uni.showToast({ title: '历史已清空', icon: 'none' }); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}; |
|
|
|
|
|
|
|
// 发送消息 |
|
|
|
@ -669,7 +682,7 @@ const simulateBotResponse = async (userMessage) => { |
|
|
|
|
|
|
|
// 更新机器人的消息内容 |
|
|
|
const errorMessage = res.message || "请求失败,请稍后重试"; |
|
|
|
let responseText = `我已经收到您的消息: "${userMessage}"。错误信息: "${errorMessage}"`; |
|
|
|
let responseText = `我已经收到您的消息: "${userMessage}"。"${errorMessage}"`; |
|
|
|
|
|
|
|
// 开始打字机效果显示错误信息 |
|
|
|
let index = 0; |
|
|
|
@ -1190,7 +1203,7 @@ async function itemClick(item) { |
|
|
|
|
|
|
|
.welcome-section { |
|
|
|
/* 灰色卡片(recommend-card)之后展示背景图 */ |
|
|
|
margin-top: 10rpx; |
|
|
|
margin-top: 2rem; |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
|