Эх сурвалжийг харах

首页计数器添加店铺字段

gaoxm 7 жил өмнө
parent
commit
7a23b48b09

+ 6 - 1
components/home/count/countItem.vue

@@ -1,7 +1,8 @@
 <template>
   <div class="count-item">
       <span>{{ nums }}</span>
-      <span v-text="isMore?'万':'个'" v-if="!isShow"></span>
+      <span v-text="isMore?'万':'个'" v-if="!isShow && index !==3"></span>
+      <span v-text="isMore?'万':'家'" v-if="!isShow && index ===3"></span>
       <span v-if="isShow">亿</span>
   </div>
 </template>
@@ -12,6 +13,10 @@
       value: {
         default: 0,
         type: Number
+      },
+      index: {
+        default: 0,
+        type: Number
       }
     },
     data () {

+ 3 - 3
components/home/count/displayCard.vue

@@ -10,7 +10,7 @@
          </ul>
          <ul class="list-unstyled">
            <li v-for="(c, index) in counts" :style="'top: -' + 30 * timerIndex + 'px'" :class="{'top': isTop}">
-             <count-item :value ="c"></count-item>
+             <count-item :value ="c" :index ="index"></count-item>
            </li>
          </ul>
        </div>
@@ -85,7 +85,7 @@
             }
             num += '<span style="color: #333">万</span>'
           } else {
-            if (type === 1 || type === 2) {
+            if (type === 1) {
               num += '<span style="color: #333">元</span>'
             } else {
               num += ''
@@ -127,7 +127,7 @@
         return this.$store.state.count.allCount.data
       },
       payMoneyLast () {
-        return this.allCount[0] ? this.formatNumber(this.allCount[0].count, 2) : 0
+        return this.allCount[0] ? this.formatNumber(this.allCount[0].count, 1) : 0
       },
       payMoney () {
         return this.allCount[1] ? this.formatNumber(this.allCount[1].count, 1) : 0

+ 2 - 0
components/mobile/common/StatisticsMobile.vue

@@ -66,6 +66,8 @@
         } else {
           if (type === 6 || type === 7) {
             num += '<span style="color: #333">元</span>'
+          } else if (type === 0 || type === 1 || type === 2) {
+            num += '<span style="color: #333">个</span>'
           } else {
             num += ''
           }