tangning 1 年間 前
コミット
1decd08ccb
4 ファイル変更14 行追加11 行削除
  1. 3 0
      src/assets/app.css
  2. 3 3
      src/i18n/lang/en-us.ts
  3. 1 1
      src/i18n/lang/zh-cn.ts
  4. 7 7
      src/views/feedback/mcSubmit.vue

+ 3 - 0
src/assets/app.css

@@ -64,5 +64,8 @@ p {
   left: 0px !important;
 }
 
+.van-uploader__preview-delete-icon{
+  position: absolute !important;
+}
 
 

+ 3 - 3
src/i18n/lang/en-us.ts

@@ -32,10 +32,10 @@ export const lang: langType = {
     title8: 'Product Rating',
     title9: 'Reason For Rating',
     Submit: 'Submit',
-    settext: 'Please enter ',
-    setselcet: 'Please select ',
+    settext: 'Enter ',
+    setselcet: 'Select ',
     success:
       'Thank you for your feedback. We attach great importance to your opinions and will deal with them as soon as possible after receiving them. Looking forward to providing you with an excellent product experience!',
-    fileTips: 'Please upload images or videos, supporting JPG and PNG formats, not exceeding 5MB; MP4 should not exceed 50MB;',
+    fileTips: 'Please upload pictures or videos. Recommend picture within 5MB, jpg/png format support. Recommend video within 50MB, mp4 format support',
   },
 };

+ 1 - 1
src/i18n/lang/zh-cn.ts

@@ -35,6 +35,6 @@ export const lang: langType = {
     settext: '请输入',
     setselcet: '请选择',
     success: '感谢反馈,我们非常重视您的意见,并将在收到反馈后第一时间处理。期待为您提供出色的产品体验!',
-    fileTips: '请上传图片或视频,支持jpg、png格式,不大于5MB;mp4不大于50MB;',
+    fileTips: '请上传图片或视频支持jpg、png格式,不大于5MB;mp4不大于50MB;',
   },
 };

+ 7 - 7
src/views/feedback/mcSubmit.vue

@@ -26,7 +26,6 @@
                   upload-icon="plus"
                   :before-read="beforeRead"
                   :after-read="clzpAfterRead"
-                  :before-upload="beforeUpload"
                   accept=".jpg,.png,.mp4"
                   :max-count="6"
                   v-model="formData.problemDescImgs"
@@ -222,6 +221,7 @@
   const areaList = ref({});
   const props = defineProps(['columns', 'addres']);
   const emit = defineEmits(['submit']);
+  import { showToast } from 'vant';
   const propsOptions = props.columns;
   const loading = ref(false);
   const setObjId = ref({
@@ -296,29 +296,29 @@
     console.log('beforeUpload', file);
     const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png';
     if (!isJpgOrPng) {
-      message.error('You can only upload JPG file!');
+      showToast('You can only upload JPG file!');
     }
     const isLt2M = file.size / 1024 / 1024 < 2;
     if (!isLt2M) {
-      message.error('Image must smaller than 2MB!');
+      showToast('Image must smaller than 2MB!');
     }
     return isJpgOrPng && isLt2M;
   }; //校验图片的格式
   function beforeRead(file) {
     const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'video/mp4';
     if (!isJpgOrPng) {
-      message.error(t('feedback.fileTips'));
+      showToast(t('feedback.fileTips'));
       return false;
     }
     const isLt2M = file.size / 1024 / 1024 < 2;
     const isLt50M = file.size / 1024 / 1024 < 50;
     if (!isLt2M && (file.type === 'image/jpeg' || file.type === 'image/png')) {
-      message.error(t('feedback.fileTips'));
+      showToast(t('feedback.fileTips'));
       return false;
     }
     if (!isLt50M && file.type === 'video/mp4') {
-      message.error(t('feedback.fileTips'));
-      return Upload.LIST_IGNORE;
+      showToast(t('feedback.fileTips'));
+      return false;
     }
     if (!/(jpg|jpeg|png|JPG|PNG|mp4)/i.test(file.type)) {
       showToast(t('feedback.upload'));