瀏覽代碼

fix: 修正折扣价格显示格式,保留两位小数

ylong 6 天之前
父節點
當前提交
615baf530e
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      pages-sell/pages/search-result.vue

+ 1 - 1
pages-sell/pages/search-result.vue

@@ -196,7 +196,7 @@ export default {
                 this.$u.api.getSearchRecommendAjax(this.keyword).then(res => {
                     if (res.code == 200) {
                         res.data.discountDesc = res.data.productPrice ? ((res.data.productPrice / res.data.price) * 10).toFixed(2) + '折' : '';
-                        res.data.discountPrice = res.data.productPrice ? res.data.price - res.data.productPrice : '';
+                        res.data.discountPrice = res.data.productPrice ? (res.data.price - res.data.productPrice).toFixed(2) : '';
                         this.hotBook = res.data;
                     }
                 });