Переглянути джерело

修改格式转换逻辑,个人中心转换失败原因

liyangbin 2 роки тому
батько
коміт
6cb4683c88
2 змінених файлів з 20 додано та 8 видалено
  1. 19 7
      pages/converter.vue
  2. 1 1
      pages/members/me/expenses.vue

+ 19 - 7
pages/converter.vue

@@ -77,7 +77,7 @@
                             <tr v-for="(item, index) in fileList" id="preview-1668340925733-0" :key="index" class="file-preview-frame explorer-frame  kv-preview-thumb w-100px h-38px hover:bg-[#f5f5f5]" data-fileindex="0" data-template="pdf" :title="item.name">
                               <td class="file-details-cell">{{ index+1 }}</td>
                               <td class="file-details-cell !text-left">
-                                <div class="explorer-caption max-w-260px truncate block text-[#777]" title="test.pdf">{{ item.name }}</div>
+                                <div class="explorer-caption max-w-260px truncate block text-[#777]" :title="item.name">{{ item.name }}</div>
                               </td>
                               <td class="file-details-cell text-[#999]">{{ getfilesize(item.size) }}</td>
                               <td class="file-details-cell points">{{ userInfo?.subscriberType === 1 ? 0 : item.price }}</td>
@@ -96,7 +96,7 @@
                               <!-- <td v-else class="file-details-cell state text-14px text-red-500">转换失败<img src="/converter/menu_ic_pdfconvert.png" @click="rechangeFile" /></td> -->
                               <td class="file-actions-cell w-50px p-0">
                                 <div class="file-actions text-center">
-                                  <div class="file-footer-buttons" @click="deleteFile(index)" v-if="changeFileFlag">
+                                  <div class="file-footer-buttons" @click="deleteFile(index,item)" v-if="changeFileFlag">
                                       <button type="button" class="kv-file-remove btn btn-xs btn-default bg-inherit !border-none pr-7px py-1px pl-5px text-12px leading-normal rounded-3px" title="删除文件"><i class="pdf-removeicon"></i></button>
                                   </div>
                                 </div>
@@ -479,6 +479,8 @@ export default {
               array = event
             }
             const defaultPrice = await this.getFilePrice("pdf", "docx");
+            // console.log("上传文件1:展示的文件",this.fileList)
+            // console.log("上传文件1:上传后台的文件:",this.uniqFileArr)
             for (let i = 0; i < array.length; i++) {
                 const fileObj = {
                     name: array[i].name,
@@ -513,7 +515,8 @@ export default {
               }
             }
             this.uniqFileArr=newArr
-            // console.log(this.uniqFileArr)
+            // console.log("上传文件2:展示的文件",this.fileList)
+            // console.log("上传文件2:上传后台的文件:",this.uniqFileArr)
 
             
             if(event.target){
@@ -558,9 +561,17 @@ export default {
             }
         },
         // 删除文件
-        deleteFile(index) {
-            this.fileList.splice(index, 1);
-            this.uniqFileArr.splice(index - this.changeSucesssNumTotal, 1);
+        deleteFile(index, item) {
+          // console.log(item)
+          // console.log("上传文件4:上传后台的文件:",this.uniqFileArr,this.fileList[index])
+          for(let i=0;i<this.uniqFileArr.length;i++){
+            if(item.name === this.uniqFileArr[i].name){
+              this.uniqFileArr.splice(i,1)
+            }
+          }
+          this.fileList.splice(index, 1);
+            // console.log("上传文件3:展示的文件",index,this.fileList,this.changeSucesssNumTotal)
+            // console.log("上传文件3:上传后台的文件:",this.uniqFileArr)
             this.changeSucesssFileList = [];
             localStorage.removeItem("file");
             this.fileList.forEach(item => {
@@ -773,11 +784,12 @@ export default {
                         for (let i = 0; i < failedFileNameArr.length; i++) {
                             this.uniqFileArr.forEach(item => {
                                 if (item.name === failedFileNameArr[i]) {
-                                    result.push(item);
+                                    result.unshift(item);
                                 }
                             });
                         }
                         this.uniqFileArr = result;
+                        // console.log("上传文件5:上传后台的文件:",this.uniqFileArr)
                         this.getUserInfo()
                         this.uploadNum = 0;
                         this.changeFileFlag = true;

+ 1 - 1
pages/members/me/expenses.vue

@@ -49,7 +49,7 @@
                   {{'转换时间: ' +scope.row.createdAt}}
                   <br/>
                   <div v-if="scope.row.failReason">
-                    失败原因: 未知错误,如重试失败请进官方客服QQ群:188917181获得即时帮助。
+                    {{scope.row.failReason}}
                   </div>
                 </div>
                 <span v-html="scope.row.status" class="cursor-default"></span>