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

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

asus 1 місяць тому
батько
коміт
4115d76b21

+ 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)
     }
   }
 }