瀏覽代碼

fix(frontend): 商城首页/搜索页商品价格显示放大100倍(漏除100)

asus 1 月之前
父節點
當前提交
4115d76b21
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      cfc-frontend/pages/shop/index/index.vue
  2. 1 1
      cfc-frontend/pages/shop/search/search.vue

+ 1 - 1
cfc-frontend/pages/shop/index/index.vue

@@ -284,7 +284,7 @@ export default {
     },
     formatPriceWithSymbol(price) {
       if (price === null || price === undefined) return ''
-      return '¥' + parseFloat(price).toFixed(2)
+      return '¥' + (Number(price) / 100).toFixed(2)
     },
     getImageUrl: function(path) {
       return config.API_BASE_URL + path

+ 1 - 1
cfc-frontend/pages/shop/search/search.vue

@@ -151,7 +151,7 @@ export default {
     },
     formatPriceWithSymbol(price) {
       if (price === null || price === undefined) return ''
-      return '¥' + parseFloat(price).toFixed(2)
+      return '¥' + (Number(price) / 100).toFixed(2)
     }
   }
 }