Explorar el Código

退货图片上传大小限制为15MB

zengjun hace 6 meses
padre
commit
3d8a526ec2
Se han modificado 1 ficheros con 8 adiciones y 1 borrados
  1. 8 1
      src/views/returned/register/index.vue

+ 8 - 1
src/views/returned/register/index.vue

@@ -23,6 +23,8 @@
         <p style="margin: 3px;font-size: 14px">
           工作台:<span style="color: #333333">{{ workbench.workStation}}</span>
         </p>
+        <p style="margin: 3px;font-size: 14px">支持png/jpeg/jpg/webp</p>
+
         <van-button size="mini" type="primary" plain icon="replay" @click.stop="getWorkbench"></van-button>
       </div>
       <div class="scan-returned-content">
@@ -104,12 +106,17 @@ function getWorkbench(){
 const beforeReadImage = (file) => {
   const files = Array.isArray(file) ? file : [file]
   for (const f of files) {
+    if (file.name.toLowerCase().endsWith('.heic') ||
+      file.name.toLowerCase().endsWith('.heif')) {
+      showFailToast('不支持的图片格式')
+      return false
+    }
     const isImage = /^image\//.test(f.type)
     if (!isImage) {
       showFailToast('仅支持图片文件')
       return false
     }
-    if (f.size > 10 * 1024 * 1024) {
+    if (f.size > 15 * 1024 * 1024) {
       showFailToast('图片大小不能超过10MB')
       return false
     }