feat: 裁剪组件

This commit is contained in:
2026-04-21 16:13:55 +08:00
parent 429c7db195
commit ec632554e2
3 changed files with 178 additions and 93 deletions

View File

@@ -224,7 +224,6 @@
fixedBox
isProduct
:info="false"
:autoCropWidth="90"
v-bind="$attrs"
:type="cropType"
/>
@@ -405,15 +404,17 @@ const handleClickCrop = (data, type) => {
const titleList = {
sketch: "Crop Sketch",
mainProductImage: "Crop Main Product Image",
cover: "Crop Cover"
cover: "Crop Cover",
apparel: "Crop Apparel Sketch"
}
const ratio = type === "apparel" ? [4, 5] : [9, 16]
cropType.value = type
imageClipDialogRef.value.open(
data,
(file) => {
selectList.value[currentIndex.value].sketch = URL.createObjectURL(file)
},
{ ratio: [9, 16], isPreview: true, title: titleList[type], isProduct: true }
{ ratio, isPreview: true, title: titleList[type], isProduct: true }
)
}