fix: 以图搜图查看详情优先用 spec_model 跳转物料页面自动搜索
This commit is contained in:
@ -203,14 +203,13 @@ const handleUse = (item: ImageSearchItem) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleView = (item: ImageSearchItem) => {
|
const handleView = (item: ImageSearchItem) => {
|
||||||
// 从 business_data 获取跳转 URL
|
const biz = item.business_data
|
||||||
const url = item.business_data?.url
|
if (biz?.spec_model) {
|
||||||
if (url) {
|
router.push({ path: '/material/index', query: { keyword: biz.spec_model } })
|
||||||
router.push(url)
|
} else if (biz?.url) {
|
||||||
|
router.push(biz.url)
|
||||||
} else {
|
} else {
|
||||||
// 兜底:使用 product_name 作为 keyword 搜索
|
ElMessage.warning('无法定位目标页面')
|
||||||
ElMessage.info(`未找到详情页链接,已将 "${item.product_name}" 作为关键词搜索`)
|
|
||||||
emit('view', item)
|
|
||||||
}
|
}
|
||||||
handleClose()
|
handleClose()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user