Forráskód Böngészése

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

ylong 6 napja
szülő
commit
615baf530e
1 módosított fájl, 1 hozzáadás és 1 törlés
  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;
                     }
                 });