fix: 修复历史记录页面参数传递和清理未使用代码
- 统一结果页面参数格式,使用images参数传递图片数组 - 移除未使用的clearHistory函数,简化代码结构 - 保持与其他页面的参数传递格式一致
This commit is contained in:
parent
ed15d2d44b
commit
0ebe5f9cc2
|
|
@ -42,7 +42,7 @@ export default function History() {
|
|||
if (record.status === 'completed' && record.outputResult) {
|
||||
// 跳转到结果页面查看
|
||||
navigateTo({
|
||||
url: `/pages/result/index?resultUrl=${encodeURIComponent(record.outputResult)}`
|
||||
url: `/pages/result/index?images=${encodeURIComponent(JSON.stringify([record.outputResult!]))}`
|
||||
})
|
||||
} else if (record.status === 'failed') {
|
||||
// 显示错误信息
|
||||
|
|
@ -60,29 +60,6 @@ export default function History() {
|
|||
}
|
||||
}
|
||||
|
||||
const clearHistory = () => {
|
||||
Taro.showModal({
|
||||
title: '确认清空',
|
||||
content: '是否清空所有历史记录?',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
try {
|
||||
await dispatch(clearRecords())
|
||||
Taro.showToast({
|
||||
title: '清空成功',
|
||||
icon: 'success'
|
||||
})
|
||||
} catch (error) {
|
||||
Taro.showToast({
|
||||
title: '清空失败',
|
||||
icon: 'error'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getStatusText = (status: string) => {
|
||||
switch (status) {
|
||||
case 'generating': return '生成中'
|
||||
|
|
|
|||
Loading…
Reference in New Issue