feat(shop): 列表商品图片改用 OSS 压缩函数
- src/views/shop/shopGoodsBrowse/index.vue 中引入 getCompressedImageUrl - 商品图片 :src 改为使用 getCompressedImageUrl(record.goodsImage) - 统一默认宽度 240px,质量 90,自动补全 OSS 域名 - 跳过已含 x-oss-process 的 URL 保持预览行为不变
This commit is contained in:
@@ -106,3 +106,10 @@
|
||||
- `confirmSubscribe` 无需改动(用 `currentProduct.productId`,已自动是 65)。
|
||||
- `getProductDetail(65)` 返回的 product 含 name/priceType/price,前端参考价 `monthPrice = price/100`、`yearPrice = monthPrice*10` 仍适用。
|
||||
- vue-tsc 验证 dashboard 零 error TS(总错误 1778 不变)。
|
||||
|
||||
## shopGoodsBrowse 列表商品图片改用 OSS 压缩函数
|
||||
|
||||
- 文件:`src/views/shop/shopGoodsBrowse/index.vue`
|
||||
- 引入 `getCompressedImageUrl`(来自 `src/utils/image.ts`),将商品图片 `:src="record.goodsImage"` 改为 `:src="getCompressedImageUrl(record.goodsImage)"`。
|
||||
- 与 `shopGoods`、`shopOrder`、`dashboard` 等页面保持一致:默认宽度 240px、质量 90、自动补全 OSS 域名、跳过已含 `x-oss-process` 的 URL。
|
||||
- 预览行为未改(仍走 a-image 默认 src 预览)。
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<template v-if="column.key === 'goodsImage'">
|
||||
<a-image
|
||||
v-if="record.goodsImage"
|
||||
:src="record.goodsImage"
|
||||
:src="getCompressedImageUrl(record.goodsImage)"
|
||||
:width="50"
|
||||
:height="50"
|
||||
style="border-radius: 4px; object-fit: cover"
|
||||
@@ -57,6 +57,7 @@
|
||||
import { message } from 'ant-design-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import { getCompressedImageUrl } from '@/utils/image';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
|
||||
Reference in New Issue
Block a user