|
|
|
@ -237,7 +237,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> |
|
|
|
@ -571,8 +571,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' }); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}; |
|
|
|
|
|
|
|
// 发送消息 |
|
|
|
|