cuiyalong 4 жил өмнө
parent
commit
d6681d87c2

+ 4 - 4
jydocs-mobile/src/components/docs-card/Card.vue

@@ -129,10 +129,10 @@ export default class DocsCard extends Vue {
     }
   }
 
-  @include diy-icon('pdf', 24);
-  @include diy-icon('word', 24);
-  @include diy-icon('excel', 24);
-  @include diy-icon('ppt', 24);
+  @include diy-icon('pdf');
+  @include diy-icon('word');
+  @include diy-icon('excel');
+  @include diy-icon('ppt');
 
   .docs-header {
     .d-title {

+ 1 - 0
jydocs-mobile/src/components/docs-card/Price.vue

@@ -36,6 +36,7 @@ export default class Price extends Vue {
     color: #ff3a20;
     &.bought {
       color: $color_main;
+      font-size: 14px;
     }
   }
 }

+ 10 - 3
jydocs-mobile/src/utils/globalFunctions.ts

@@ -313,13 +313,14 @@ export function removeSpace (str: string) {
 }
 
 // 文件大小格式化
-export function formatSize (size: string | number, pointLength = 2, units = ['B', 'K', 'M', 'G', 'TB']) {
+export function formatSize (size: string | number, pointLength = 2) {
+  const units = ['B', 'K', 'M', 'G', 'TB']
   size = Number(size)
   let unit: string | undefined = ''
   while ((unit = units.shift()) && size > 1024) {
     size = size / 1024
   }
-  return (unit === 'B' ? size : size.toFixed(pointLength === undefined ? 2 : pointLength)) + (unit || '')
+  return (unit === 'B' ? size : size.toFixed(pointLength)) + (unit || '')
 }
 
 // 文件类型转换
@@ -330,7 +331,13 @@ export function docTypeConvert (docType = 'pdf') {
     xls: 'excel',
     xlsx: 'excel',
     ppt: 'ppt',
-    pdf: 'pdf'
+    pdf: 'pdf',
+    1: 'word', // doc
+    2: 'pdf',
+    3: 'excel', // xls
+    4: 'ppt',
+    5: 'txt',
+    6: '其他'
   }
   const type = typeMap[docType]
   return type || docType // map中不存在的,则返回原始类型

+ 1 - 1
jydocs-mobile/src/views/user/Library.vue

@@ -165,7 +165,7 @@ export default class UserLibrary extends Vue {
 
   calcSubInfoForLib (item: any) {
     const { UpdateAt, DocFileSize } = item
-    return [`${dateFormatter(UpdateAt * 1000, 'yyyy/MM/dd')}下载`, formatSize(DocFileSize, 2, ['k'])]
+    return [`${dateFormatter(UpdateAt * 1000, 'yyyy/MM/dd')}下载`, formatSize(DocFileSize)]
   }
 
   calcSubInfoForColl (item: any) {

+ 7 - 1
jydocs-pc/src/utils/globalFunctions.js

@@ -245,7 +245,13 @@ export function docTypeConvert (docType = 'pdf') {
     xls: 'excel',
     xlsx: 'excel',
     ppt: 'ppt',
-    pdf: 'pdf'
+    pdf: 'pdf',
+    1: 'word', // doc
+    2: 'pdf',
+    3: 'excel', // xls
+    4: 'ppt',
+    5: 'txt',
+    6: '其他'
   }
   const type = typeMap[docType]
   return type || docType // map中不存在的,则返回原始类型