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

处理产品详情页价格计算错误问题

yangc 8 роки тому
батько
коміт
b63ec662f2
1 змінених файлів з 2 додано та 2 видалено
  1. 2 2
      components/store/CommodityInfo.vue

+ 2 - 2
components/store/CommodityInfo.vue

@@ -215,8 +215,8 @@
         return this.$store.state.shop.storeInfo.component.data
       },
       calculate () {
-        this.fragment.total = this.fragment.price * this.fragment.num
-        return Math.ceil(this.fragment.total * Math.pow(10, 6)) / Math.pow(10, 6)
+        this.fragment.total = this.fragment.price * Math.pow(10, 6) * this.fragment.num
+        return Math.ceil(this.fragment.total) / Math.pow(10, 6)
       },
       user () {
         return this.$store.state.option.user