|
|
@ -86,8 +86,17 @@ function getShareImageUrl(goodsDetail) { |
|
|
const imageUrls = goodsDetail.imageUrls || []; |
|
|
const imageUrls = goodsDetail.imageUrls || []; |
|
|
|
|
|
|
|
|
if (imageUrls.length > 0) { |
|
|
if (imageUrls.length > 0) { |
|
|
// 返回第一张图片作为分享图片
|
|
|
// 过滤出图片类型
|
|
|
return imageUrls[0]; |
|
|
const imageOnly = imageUrls.filter(url => !isVideoUrl(url)); |
|
|
|
|
|
|
|
|
|
|
|
if (imageOnly.length > 0) { |
|
|
|
|
|
// 情况1: 有图片 → 使用第一张图片
|
|
|
|
|
|
return imageOnly[0]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 情况2: 全是视频 → 使用第一帧(暂无封面字段,返回默认图片)
|
|
|
|
|
|
// 注: 当前数据结构无poster字段,如需视频封面需后端添加
|
|
|
|
|
|
return '/images/你有好蛋.png'; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return '/images/你有好蛋.png'; |
|
|
return '/images/你有好蛋.png'; |
|
|
|