Browse Source

修改计数器

yangc 7 years ago
parent
commit
70bad00e76

+ 3 - 3
components/home/displayCard.vue

@@ -138,7 +138,7 @@
             }
             }
           }
           }
         }
         }
-        return num
+        return num || 0
       },
       },
       formatDouble (num) {
       formatDouble (num) {
         if (num) {
         if (num) {
@@ -154,8 +154,8 @@
             num += ''
             num += ''
           }
           }
         }
         }
-        return num
-      },
+        return num || 0
+      }
     },
     },
     computed: {
     computed: {
       counter () {
       counter () {

+ 1 - 1
components/mobile/common/StatisticsMobile.vue

@@ -109,7 +109,7 @@
         }
         }
       },
       },
       formatNumber (num, type) {
       formatNumber (num, type) {
-        if (num === '' || !num) return false
+        if (num === '' || !num) return 0
         if (num.toString().indexOf('E') !== -1) {
         if (num.toString().indexOf('E') !== -1) {
           let arr = num.toString().split('E')
           let arr = num.toString().split('E')
           num = arr[0] * Math.pow(10, arr[1])
           num = arr[0] * Math.pow(10, arr[1])