Selaa lähdekoodia

退货登记图片处理

zengjun 1 päivä sitten
vanhempi
commit
ff70c6c0ba
1 muutettua tiedostoa jossa 4 lisäystä ja 3 poistoa
  1. 4 3
      src/views/returned/register/index.vue

+ 4 - 3
src/views/returned/register/index.vue

@@ -298,7 +298,8 @@ const beforeReadImage = async (
     if (isHeicFile) {
       try {
         const convertedFile = await convertHeicHeifToWebp(f)
-        normalizedFiles.push(convertedFile)
+        const image = await smartCompressImage(convertedFile)
+        normalizedFiles.push(image)
       } catch (error) {
         console.error('HEIC/HEIF 转换失败:', error)
         showFailToast('HEIC/HEIF 转换失败,请使用 JPG/PNG/WEBP 格式')
@@ -306,8 +307,8 @@ const beforeReadImage = async (
       }
       continue
     }
-
-    normalizedFiles.push(f)
+    const image = await smartCompressImage(f)
+    normalizedFiles.push(image)
   }
 
   // 返回原始 File 数组 给 van-uploader 进行默认处理,