feat(shop): 调整商品详情页分享图片比例

- 修改分享图片URL,添加OSS处理参数- 设置图片尺寸为500x40,裁剪模式填充
- 保持图片宽高比为5:4
- 当图片不存在时返回undefined
This commit is contained in:
2025-10-11 20:20:14 +08:00
parent f808c22a22
commit 7db4da5081

View File

@@ -189,7 +189,7 @@ const GoodsDetail = () => {
return { return {
title: goods?.name || '精选商品', title: goods?.name || '精选商品',
path: `/shop/goodsDetail/index?id=${goodsId}`, path: `/shop/goodsDetail/index?id=${goodsId}`,
imageUrl: goods?.image, // 分享图片 imageUrl: goods?.image ? `${goods.image}?x-oss-process=image/resize,w_500,h_400,m_fill` : undefined, // 分享图片调整为5:4比例
success: function (res: any) { success: function (res: any) {
console.log('分享成功', res); console.log('分享成功', res);
Taro.showToast({ Taro.showToast({