forked from gxwebsoft/mp-10550
feat(shop): 调整商品详情页分享图片比例
- 修改分享图片URL,添加OSS处理参数- 设置图片尺寸为500x40,裁剪模式填充 - 保持图片宽高比为5:4 - 当图片不存在时返回undefined
This commit is contained in:
@@ -189,7 +189,7 @@ const GoodsDetail = () => {
|
||||
return {
|
||||
title: goods?.name || '精选商品',
|
||||
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) {
|
||||
console.log('分享成功', res);
|
||||
Taro.showToast({
|
||||
|
||||
Reference in New Issue
Block a user